JBoss Tools SVN: r10852 - in trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common: model/ui/attribute/editor and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-15 09:53:29 -0400 (Wed, 15 Oct 2008)
New Revision: 10852
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/multipage/DefaultMultipageEditor.java
Log:
Selection improved
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2008-10-15 13:42:13 UTC (rev 10851)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/editor/ObjectMultiPageEditor.java 2008-10-15 13:53:29 UTC (rev 10852)
@@ -848,9 +848,15 @@
if(postponedTextSelection.selected != null) {
Display.getDefault().asyncExec(postponedTextSelection);
}
+ if(newPageIndex != getSourcePageIndex()) {
+ synchronizeSelectionWithText();
+ }
activateSite();
}
-
+
+ protected void synchronizeSelectionWithText() {
+ }
+
protected void updateSelectionProvider() {
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2008-10-15 13:42:13 UTC (rev 10851)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ComboBoxFieldEditor.java 2008-10-15 13:53:29 UTC (rev 10852)
@@ -270,6 +270,10 @@
PropertyChangeEvent event = new PropertyChangeEvent(this, IPropertyEditor.VALUE, oldValue, stringValue);
valueChangeListener.valueChange(event);
revalidateValue();
+ if(this.valueProvider == null) {
+ //disposed already
+ return;
+ }
this.valueProvider.addValueChangeListener(this);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java 2008-10-15 13:42:13 UTC (rev 10851)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/StringFieldEditor.java 2008-10-15 13:53:29 UTC (rev 10852)
@@ -70,7 +70,10 @@
protected boolean validate() {
boolean result = false;
if (emptyStringAllowed) result = true;
- if (textField == null) result = false;
+ if (textField == null) {
+ result = false;
+ return result;
+ }
String txt = textField.getText();
if (txt == null) {
result = false;
@@ -308,7 +311,11 @@
if (isValid != oldState)
fireStateChanged(IS_VALID, oldState, isValid);
-
+
+ if(textField == null) {
+ //disposed
+ return;
+ }
String newValue = textField.getText();
if (!newValue.equals(oldValue)) {
fireValueChanged(VALUE, oldValue, newValue);
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/multipage/DefaultMultipageEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/multipage/DefaultMultipageEditor.java 2008-10-15 13:42:13 UTC (rev 10851)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/editors/multipage/DefaultMultipageEditor.java 2008-10-15 13:53:29 UTC (rev 10852)
@@ -95,14 +95,17 @@
} else {
if (treeFormPage != null) {
selectionProvider.setHost(treeFormPage.getSelectionProvider());
- if(getTextSelectionProvider() == null) return;
- ISelection s = getTextSelectionProvider().getSelection();
- if(s == null || s.isEmpty() || !(s instanceof IStructuredSelection)) return;
- Object o = ((IStructuredSelection)s).getFirstElement();
- if(!(o instanceof XModelObject) || o == getModelObject()) return;
- treeFormPage.getSelectionProvider().setSelection(s);
}
}
}
+
+ protected void synchronizeSelectionWithText() {
+ if(getTextSelectionProvider() == null || treeFormPage == null) return;
+ ISelection s = getTextSelectionProvider().getSelection();
+ if(s == null || s.isEmpty() || !(s instanceof IStructuredSelection)) return;
+ Object o = ((IStructuredSelection)s).getFirstElement();
+ if(!(o instanceof XModelObject) || o == getModelObject()) return;
+ treeFormPage.getSelectionProvider().setSelection(s);
+ }
}
17 years, 2 months
JBoss Tools SVN: r10851 - in trunk/seam/plugins/org.jboss.tools.seam.pages.xml: src/org/jboss/tools/seam/pages/xml/model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-15 09:42:13 -0400 (Wed, 15 Oct 2008)
New Revision: 10851
Modified:
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesConstants.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesLoaderUtil.java
trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/DiagramAdopt.java
Log:
JBIDE-2855 pages.xml 2.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-10-15 13:41:35 UTC (rev 10850)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/resources/meta/seam-pages.meta 2008-10-15 13:42:13 UTC (rev 10851)
@@ -7,8 +7,10 @@
<MAPPING name="FileVersions">
<PAIR name="SeamPage_1.2" value="FileSeamPage12"/>
<PAIR name="SeamPage_2.0" value="FileSeamPage20"/>
+ <PAIR name="SeamPage_2.1" value="FileSeamPage21"/>
<PAIR name="SeamPages1.2" value="FileSeamPages12"/>
<PAIR name="SeamPages2.0" value="FileSeamPages20"/>
+ <PAIR name="SeamPages2.1" value="FileSeamPages21"/>
</MAPPING>
<MAPPING name="FilteredTreeConstraints">
<PAIR name="FileSystems$144" value="org.jboss.tools.seam.pages.xml.model.impl.SeamPagesFilteredTreeConstraint"/>
@@ -325,6 +327,151 @@
<XDependencies/>
</XModelEntity>
<XModelEntity
+ ImplementationLoadingClass="org.jboss.tools.seam.pages.xml.model.SeamPageFileLoader"
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.FileSeamPageImpl"
+ ObjectEditorClass="%XML%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
+ XMLSUBPATH="page" name="FileSeamPage21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamPageParam20"/>
+ <XChildEntity name="SeamPageHeader21"/>
+ <XChildEntity name="SeamPageRewrite21"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageEndConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageStartTask"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginTask"/>
+ <XChildEntity maxCount="1" name="SeamPageEndTask"/>
+ <XChildEntity maxCount="1" name="SeamPageCreateProcess"/>
+ <XChildEntity maxCount="1" name="SeamPageResumeProcess"/>
+ <XChildEntity name="SeamPageIn"/>
+ <XChildEntity maxCount="1" name="SeamPageRaiseEvent20"/>
+ <XChildEntity name="SeamPageAction21"/>
+ <XChildEntity name="SeamPageNavigation21"/>
+ <XChildEntity name="SeamPageNavigationRule21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.file" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="components" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME"/>
+ <XModelAttributeReference
+ attributes="action,view id,switch,no conversation view id,conversation required,login required,scheme,timeout,bundle,conversation"
+ entity="SeamPage12" name="page"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="concurrent request timeout" xmlname="concurrent-request-timeout"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="expires" xmlname="expires"/>
+ <XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute loader="ElementType" name="_lateload" visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="no" name="isIncorrect" visibility="false">
+ <Constraint loader="List">
+ <value name="yes"/>
+ <value name="no"/>
+ </Constraint>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://jboss.com/products/seam/pages" name="xmlns" xmlname="xmlns"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
+ name="xsi:schemaLocation" xmlname="xsi:schemaLocation"/>
+ <XModelAttribute name="encoding">
+ <Constraint loader="ListString">
+ <value name="ISO-8859-1"/>
+ <value name="UTF-8"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem BaseActionName="Open" HandlerClassName="%Open%"
+ ICON="action.empty" displayName="Open" kind="action" name="Open"/>
+ <XActionItem displayName="Open With" group="1" kind="list" name="OpenWith">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithExternalHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Open with External Program" kind="action" name="OpenWithSelected"/>
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Choose Program..." kind="action" name="OpenWithChoice">
+ <EntityData EntityName="OpenWithHelper">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="default"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.RenameFacesConfigHandler"
+ ICON="action.empty" PROPERTIES="validator.edit=true"
+ WizardClassName="%Default%" displayName="Rename..." kind="action" name="Rename">
+ <EntityData EntityName="FacesConfig">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.common.model.filesystems.impl.handlers.RenameEclipseFileHandler"
+ ICON="action.empty" displayName="Rename..." kind="action" name="RenameEclipse"/>
+ </XActionItem>
+ <XActionItem kind="list" name="SaveActions">
+ <XActionItem HIDE="always" HandlerClassName="%SaveFile%"
+ ICON="action.save" displayName="Save" kind="action" name="Save"/>
+ </XActionItem>
+ <XActionItemReference entity="SeamPage21" name="CreateActions" path="CreateActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.DeleteFacesConfigHandler"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem kind="list" name="DiscardActions">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.DiscardConfigHandler"
+ ICON="action.delete"
+ PROPERTIES="significanceMessageClass=org.jboss.tools.common.model.filesystems.impl.DiscardFileSignificanceMessage"
+ displayName="Discard Changes" kind="action" name="Discard"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity name="FileSeamPage21_EditorActionList">
+ <XChildrenEntities/>
+ <XEntityRenderer/>
+ <XModelAttributes/>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamPage21" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="SeamPage21" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPage21" name="VerifyActions" path="VerifyActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity
ImplementationLoadingClass="org.jboss.tools.seam.pages.xml.model.SeamPages12FileLoader"
ImplementingClass="org.jboss.tools.seam.pages.xml.model.FileSeamPagesImpl"
ObjectEditorClass="%XML%"
@@ -630,6 +777,156 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity
+ ImplementationLoadingClass="org.jboss.tools.seam.pages.xml.model.SeamPagesFileLoader"
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.FileSeamPagesImpl"
+ ObjectEditorClass="%XML%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
+ XMLSUBPATH="pages" name="FileSeamPages21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPageFolderConversation" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPageFolderPage21" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPageFolderException21" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPagesDiagram" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.file" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="pages configuration" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="name" xmlname="NAME"/>
+ <XModelAttribute default="xml" name="extension" xmlname="EXTENSION">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="no conversation view id,login view id"
+ entity="FileSeamPages12" name="page2"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="http port" xmlname="http-port"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="https port" xmlname="https-port"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute loader="ElementType" name="_lateload" visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="no" name="isIncorrect" visibility="false">
+ <Constraint loader="List">
+ <value name="yes"/>
+ <value name="no"/>
+ </Constraint>
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute name="incorrectBody" visibility="false"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://jboss.com/products/seam/pages" name="xmlns" xmlname="xmlns"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://www.w3.org/2001/XMLSchema-instance" name="xmlns:xsi" xmlname="xmlns:xsi"/>
+ <XModelAttribute PROPERTIES="save=always"
+ default="http://jboss.com/products/seam/pages http://jboss.com/products/seam/pages-2.1.xsd"
+ name="xsi:schemaLocation" xmlname="xsi:schemaLocation"/>
+ <XModelAttribute name="namespaceMapping"/>
+ <XModelAttribute name="encoding">
+ <Constraint loader="ListString">
+ <value name="ISO-8859-1"/>
+ <value name="UTF-8"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem BaseActionName="Open" HandlerClassName="%Open%"
+ ICON="action.empty" displayName="Open" kind="action" name="Open"/>
+ <XActionItem displayName="Open With" group="1" kind="list" name="OpenWith">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithExternalHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Open with External Program" kind="action" name="OpenWithSelected"/>
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.common.meta.action.impl.handlers.OpenWithChoiceHandler"
+ ICON="action.empty" PROPERTIES="extension=struts-config"
+ displayName="Choose Program..." kind="action" name="OpenWithChoice">
+ <EntityData EntityName="OpenWithHelper">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="default"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem kind="list" name="EditActions">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.RenameFacesConfigHandler"
+ ICON="action.empty" PROPERTIES="validator.edit=true"
+ WizardClassName="%Default%" displayName="Rename..." kind="action" name="Rename">
+ <EntityData EntityName="FacesConfig">
+ <AttributeData AttributeName="name"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.common.model.filesystems.impl.handlers.RenameEclipseFileHandler"
+ ICON="action.empty" displayName="Rename..." kind="action" name="RenameEclipse"/>
+ </XActionItem>
+ <XActionItem kind="list" name="SaveActions">
+ <XActionItem HIDE="always" HandlerClassName="%SaveFile%"
+ ICON="action.save" displayName="Save" kind="action" name="Save"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Redirect%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true;sourcepath=Pages;actionpath=CreateActions/AddPage"
+ WizardClassName="%Default%" displayName="Page..." kind="action" name="AddPage"/>
+ <XActionItem HandlerClassName="%Redirect%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true;sourcepath=Conversations;actionpath=CreateActions/AddConversation"
+ WizardClassName="%Default%" displayName="Conversation..."
+ kind="action" name="AddConversation"/>
+ <XActionItem HandlerClassName="%Redirect%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true;sourcepath=Exceptions;actionpath=CreateActions/AddException"
+ WizardClassName="%Default%" displayName="Exception..."
+ kind="action" name="AddException"/>
+ </XActionItem>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.DeleteFacesConfigHandler"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem kind="list" name="DiscardActions">
+ <XActionItem HIDE="always"
+ HandlerClassName="org.jboss.tools.jsf.model.handlers.DiscardConfigHandler"
+ ICON="action.delete"
+ PROPERTIES="significanceMessageClass=org.jboss.tools.common.model.filesystems.impl.DiscardFileSignificanceMessage"
+ displayName="Discard Changes" kind="action" name="Discard"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity name="FileSeamPages21_EditorActionList">
+ <XChildrenEntities/>
+ <XEntityRenderer/>
+ <XModelAttributes/>
+ <XActionItem kind="list">
+ <XActionItemReference entity="FileSeamPages21" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="FileSeamPages21" name="Properties" path="Properties"/>
+ <XActionItemReference entity="FileSeamPages21" name="VerifyActions" path="VerifyActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="page" name="SeamPage12">
@@ -905,6 +1202,139 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="page" name="SeamPage21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamPageParam20"/>
+ <XChildEntity name="SeamPageHeader21"/>
+ <XChildEntity name="SeamPageRewrite21"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageEndConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageStartTask"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginTask"/>
+ <XChildEntity maxCount="1" name="SeamPageEndTask"/>
+ <XChildEntity maxCount="1" name="SeamPageCreateProcess"/>
+ <XChildEntity maxCount="1" name="SeamPageResumeProcess"/>
+ <XChildEntity name="SeamPageIn"/>
+ <XChildEntity maxCount="1" name="SeamPageRaiseEvent20"/>
+ <XChildEntity name="SeamPageAction21"/>
+ <XChildEntity name="SeamPageNavigation21"/>
+ <XChildEntity name="SeamPageNavigationRule21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.page" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="page" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="action,view id,switch,no conversation view id,conversation required,login required,scheme,timeout,bundle,conversation,restrict,description"
+ entity="SeamPage12" name="page"/>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="concurrent request timeout" xmlname="concurrent-request-timeout"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="expires" xmlname="expires"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem displayName="New" group="1" kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddParam"
+ WizardClassName="%Default%" displayName="Param..." kind="action" name="AddParam">
+ <EntityData EntityName="SeamPageParam20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddParam"
+ WizardClassName="%Default%" displayName="Header..." kind="action" name="AddHeader">
+ <EntityData EntityName="SeamPageHeader21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddParam"
+ WizardClassName="%Default%" displayName="Rewrite..." kind="action" name="AddRewrite">
+ <EntityData EntityName="SeamPageRewrite21">
+ <AttributeData AttributeName="pattern"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddIn"
+ WizardClassName="%Default%" displayName="In..." kind="action" name="AddIn">
+ <EntityData EntityName="SeamPageIn">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="value"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddAction"
+ WizardClassName="%Default%" displayName="Action..." kind="action" name="AddAction">
+ <EntityData EntityName="SeamPageAction21">
+ <AttributeData AttributeName="execute"/>
+ <AttributeData AttributeName="if" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddNavigation"
+ WizardClassName="%Default%" displayName="Navigation..."
+ kind="action" name="AddNavigation">
+ <EntityData EntityName="SeamPageNavigation21">
+ <AttributeData AttributeName="from action" Mandatory="no"/>
+ <AttributeData AttributeName="evaluate" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddRuleHandler"
+ ICON="action.empty"
+ PROPERTIES="validator.add=true;entity=SeamPageNavigationRule21;renderEntity=SeamPageRender;redirectEntity=SeamPageRedirect21;key=SeamPage_AddRule"
+ WizardClassName="%Default%" displayName="Navigation Rule..."
+ kind="action" name="AddRule">
+ <EntityData EntityName="AddSeamPageRule">
+ <AttributeData AttributeName="kind" Mandatory="no"/>
+ <AttributeData AttributeName="view id"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.OpenPageHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open"
+ displayName="Open Page" kind="action" name="OpenPage"/>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.SelectOnDiagramHandler"
+ ICON="action.empty" displayName="Select on Diagram" kind="action" name="Select"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
XMLSUBPATH="action" name="SeamPageAction">
<XChildrenEntities/>
@@ -919,7 +1349,14 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="id=true;save=always;category=general"
name="execute" xmlname="execute"/>
- <XModelAttribute PROPERTIES="category=general" name="if" xmlname="if"/>
+ <XModelAttribute PROPERTIES="category=general" name="if" xmlname="if">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -948,6 +1385,43 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData"
+ XMLSUBPATH="action" name="SeamPageAction21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.action" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="action" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference attributes="execute,if"
+ entity="SeamPageAction" name="action"/>
+ <XModelAttribute PROPERTIES="category=general" name="on postback" xmlname="on-postback">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageAction" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageAction" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageAction" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageAction" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%SeamPageTask%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="begin-conversation" name="SeamPageBeginConversation">
@@ -1022,6 +1496,42 @@
</XModelEntity>
<XModelEntity ImplementingClass="%SeamPageTask%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="begin-conversation" name="SeamPageBeginConversation21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="begin-conversation" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" default="command" name="name" visibility="false"/>
+ <XModelAttributeReference
+ attributes="join,nested,pageflow,flush mode,if"
+ entity="SeamPageBeginConversation" name="bc"/>
+ <XModelAttribute PROPERTIES="category=general" name="conversation" xmlname="conversation"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageBeginConversation"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageBeginConversation"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageBeginConversation"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageBeginConversation"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%SeamPageTask%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="begin-task" name="SeamPageBeginTask">
<XChildrenEntities/>
<XEntityRenderer>
@@ -1219,6 +1729,48 @@
</XModelEntity>
<XModelEntity ImplementingClass="%SeamPageTask%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="end-conversation" name="SeamPageEndConversation21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.component" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="end conversation" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" default="command" name="name" visibility="false"/>
+ <XModelAttributeReference attributes="before redirect,if"
+ entity="SeamPageEndConversation" name="ec"/>
+ <XModelAttribute PROPERTIES="category=general" name="root" xmlname="before-redirect">
+ <Constraint loader="List">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageEndConversation"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageEndConversation"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageEndConversation"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageEndConversation"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%SeamPageTask%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="end-task" name="SeamPageEndTask">
<XChildrenEntities/>
<XEntityRenderer>
@@ -1370,6 +1922,68 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
+ XMLSUBPATH="exception" name="SeamPageException21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPageEndConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageHTTPError"/>
+ <XChildEntity maxCount="1" name="SeamPageRedirect21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.exception" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="exception" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general" name="class" xmlname="class">
+ <Constraint loader="QClassName"/>
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="log" xmlname="log">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="log level" xmlname="logLevel">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="info"/>
+ <value name="warn"/>
+ <value name="error"/>
+ <value name="fatal"/>
+ <value name="debug"/>
+ <value name="trace"/>
+ <value name="INFO"/>
+ <value name="WARN"/>
+ <value name="ERROR"/>
+ <value name="FATAL"/>
+ <value name="DEBUG"/>
+ <value name="TRACE"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageException12" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageException12"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageException12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageException12" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%Ordered%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData" name="SeamPageFolderConversation">
<XChildrenEntities>
@@ -1508,23 +2122,54 @@
</EntityData>
</XActionItem>
</XActionItem>
- <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
- <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
- ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
- <XActionItem BaseActionName="Copy" HandlerClassName="%CopyChildren%"
- ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
- <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
- ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="Properties" path="Properties"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Ordered%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData" name="SeamPageFolderException21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamPageException21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="default.folder" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="exception list" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="Exceptions" name="name" xmlname="NAME">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddExceptionHandler"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true;entity=SeamPageException21;childEntity=SeamPageRedirect21"
+ WizardClassName="%Default%"
+ displayName="Exception With Redirect..." kind="action" name="AddException">
+ <EntityData EntityName="AddSeamPageException">
+ <AttributeData AttributeName="class"/>
+ <AttributeData AttributeName="view id"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
- <XActionItem kind="list" name="DeleteActions">
- <XActionItem BaseActionName="Delete"
- HandlerClassName="%DeleteChildren%" ICON="action.delete"
- displayName="Delete" kind="action" name="Delete"/>
- </XActionItem>
- <XActionItem ICON="action.empty" kind="list" name="Properties">
- <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
- displayName="Properties..." kind="action" name="Properties"/>
- </XActionItem>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageFolderException12"
+ name="Properties" path="Properties"/>
</XActionItem>
<XDependencies/>
</XModelEntity>
@@ -1630,6 +2275,45 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Ordered%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData" name="SeamPageFolderPage21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamPage21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="default.folder" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="page list" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute default="Pages" name="name" xmlname="NAME">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%"
+ ICON="action.new.struts.webapp.res_ref"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Page..." kind="action" name="AddPage">
+ <EntityData EntityName="SeamPage21">
+ <AttributeData AttributeName="view id"/>
+ <AttributeData AttributeName="action" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItemReference entity="SeamPageFolderPage20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageFolderPage20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageFolderPage20" name="Properties" path="Properties"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageHTTPErrorImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
@@ -1691,6 +2375,36 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="header" name="SeamPageHeader21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.attribute" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="header" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general" name="value" xmlname="value"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageParam12" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="in" name="SeamPageIn">
<XChildrenEntities/>
<XEntityRenderer>
@@ -1938,6 +2652,69 @@
<XModelEntity
ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageNavigationImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
+ XMLSUBPATH="navigation" name="SeamPageNavigation21">
+ <XChildrenEntities>
+ <XChildEntity name="SeamPageRule21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.rule" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="navigation" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ name="from action" xmlname="from-action"/>
+ <XModelAttribute PROPERTIES="category=general" name="evaluate" xmlname="evaluate"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;generate=true" name="_id_" visibility="false"/>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.AddRuleHandler"
+ ICON="action.empty"
+ PROPERTIES="validator.add=true;entity=SeamPageRule21;renderEntity=SeamPageRender;redirectEntity=SeamPageRedirect21;key=SeamPage_AddRule"
+ WizardClassName="%Default%" displayName="Add Rule..." kind="action" name="AddRule">
+ <EntityData EntityName="AddSeamPageRule">
+ <AttributeData AttributeName="kind" Mandatory="no"/>
+ <AttributeData AttributeName="view id"/>
+ <AttributeData AttributeName="if outcome" Mandatory="no"/>
+ <AttributeData AttributeName="if" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageNavigationImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="navigation" name="SeamPageNavigationRule12">
<XChildrenEntities>
<XChildEntity maxCount="1" name="SeamPageBeginConversation"/>
@@ -2088,6 +2865,83 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageNavigationImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
+ XMLSUBPATH="navigation" name="SeamPageNavigationRule21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPageBeginConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageEndConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageStartTask"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginTask"/>
+ <XChildEntity maxCount="1" name="SeamPageEndTask"/>
+ <XChildEntity maxCount="1" name="SeamPageCreateProcess"/>
+ <XChildEntity maxCount="1" name="SeamPageResumeProcess"/>
+ <XChildEntity name="SeamPageOut"/>
+ <XChildEntity maxCount="1" name="SeamPageRaiseEvent20"/>
+ <XChildEntity maxCount="1" name="SeamPageRender"/>
+ <XChildEntity maxCount="1" name="SeamPageRedirect21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.rule" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="navigation" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ name="from action" xmlname="from-action"/>
+ <XModelAttribute PROPERTIES="category=general" name="evaluate" xmlname="evaluate"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;generate=true" name="_id_" visibility="false"/>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPageRule_AddOut"
+ WizardClassName="%Default%" displayName="Add Out..." kind="action" name="AddOut">
+ <EntityData EntityName="SeamPageOut">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="value"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.OpenPageHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open"
+ displayName="Open Page" kind="action" name="OpenPage"/>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.SelectOnDiagramHandler"
+ ICON="action.empty" displayName="Select on Diagram" kind="action" name="Select"/>
+ <XActionItem ICON="action.copy" displayName="Copy" kind="list" name="CopyActions">
+ <XActionItem BaseActionName="Copy" HandlerClassName="%Copy%"
+ ICON="action.copy" displayName="Copy" kind="action" name="Copy"/>
+ <XActionItem BaseActionName="Cut" HandlerClassName="%Cut%"
+ ICON="action.cut" displayName="Cut" kind="action" name="Cut"/>
+ <XActionItem BaseActionName="Paste" HandlerClassName="%Paste%"
+ ICON="action.paste" displayName="Paste" kind="action" name="Paste"/>
+ </XActionItem>
+ <XActionItem ICON="action.delete" displayName="Delete" kind="list" name="DeleteActions">
+ <XActionItem BaseActionName="Delete" HandlerClassName="%Delete%"
+ ICON="action.delete" displayName="Delete" kind="action" name="Delete"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" kind="list" name="Properties">
+ <XActionItem HandlerClassName="%Properties%" ICON="action.empty"
+ displayName="Properties..." kind="action" name="Properties"/>
+ </XActionItem>
+ <XActionItem displayName="move" kind="list" name="MoveActions">
+ <XActionItem HIDE="always" HandlerClassName="%Move%"
+ ICON="action.move" displayName="Move" kind="action" name="Move"/>
+ </XActionItem>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="out" name="SeamPageOut">
@@ -2462,6 +3316,80 @@
</XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageRedirectImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
+ XMLSUBPATH="redirect" name="SeamPageRedirect21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPageMessage"/>
+ <XChildEntity name="SeamPageParam20"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.redirect" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="redirect" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true" default="target" name="name" visibility="false"/>
+ <XModelAttribute PROPERTIES="category=general" name="view id" xmlname="view-id">
+ <Constraint loader="Tree">
+ <value name="JSFPageTree"/>
+ <value name="extensions=jsp,html,htm,xhtml,xml"/>
+ <value name="linkAction=OpenPage"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="url" xmlname="url">
+ <Constraint loader="Tree">
+ <value name="JSFPageTree"/>
+ <value name="extensions=jsp,html,htm,xhtml,xml"/>
+ <value name="linkAction=OpenPage"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Add Message..." kind="action" name="AddMessage">
+ <EntityData EntityName="SeamPageMessage">
+ <AttributeData AttributeName="message"/>
+ <AttributeData AttributeName="severity" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPage_AddParam"
+ WizardClassName="%Default%" displayName="Add Param..."
+ kind="action" name="AddParam">
+ <EntityData EntityName="SeamPageParam20">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="value" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.OpenPageHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open"
+ displayName="Open Page" kind="action" name="OpenPage"/>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.SelectOnDiagramHandler"
+ ICON="action.empty" displayName="Select on Diagram" kind="action" name="Select"/>
+ <XActionItemReference entity="SeamPageRedirect20" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageRedirect20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageRedirect20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageRedirect20" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageRedirectImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="render" name="SeamPageRender">
<XChildrenEntities>
@@ -2576,6 +3504,35 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
+ XMLSUBPATH="rewrite" name="SeamPageRewrite21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.attribute" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="header" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general;save=always"
+ name="pattern" xmlname="pattern"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageParam12" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageParam12" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity
ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageRuleImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
@@ -2727,6 +3684,66 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.seam.pages.xml.model.impl.SeamPageRuleImpl"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%EntityOrdered%"
+ XMLSUBPATH="rule" name="SeamPageRule21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPageBeginConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageEndConversation21"/>
+ <XChildEntity maxCount="1" name="SeamPageStartTask"/>
+ <XChildEntity maxCount="1" name="SeamPageBeginTask"/>
+ <XChildEntity maxCount="1" name="SeamPageEndTask"/>
+ <XChildEntity maxCount="1" name="SeamPageCreateProcess"/>
+ <XChildEntity maxCount="1" name="SeamPageResumeProcess"/>
+ <XChildEntity name="SeamPageOut"/>
+ <XChildEntity maxCount="1" name="SeamPageRaiseEvent20"/>
+ <XChildEntity maxCount="1" name="SeamPageRender"/>
+ <XChildEntity maxCount="1" name="SeamPageRedirect21"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam-pages.rule" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="rule" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ name="if outcome" xmlname="if-outcome"/>
+ <XModelAttribute PROPERTIES="category=general" name="if" xmlname="if"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true;key=SeamPageRule_AddOut"
+ WizardClassName="%Default%" displayName="Add Out..." kind="action" name="AddOut">
+ <EntityData EntityName="SeamPageOut">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="scope" Mandatory="no"/>
+ <AttributeData AttributeName="value"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItem HIDE="disabled"
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.OpenPageHandler"
+ ICON="action.empty" PROPERTIES="actionpath=Open"
+ displayName="Open Page" kind="action" name="OpenPage"/>
+ <XActionItem
+ HandlerClassName="org.jboss.tools.seam.pages.xml.model.handlers.SelectOnDiagramHandler"
+ ICON="action.empty" displayName="Select on Diagram" kind="action" name="Select"/>
+ <XActionItemReference entity="SeamPageRule20" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPageRule20" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPageRule20" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPageRule20" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XModelEntity ImplementingClass="%SeamPageTask%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.SeamXMLFormLayoutData;children=%Ordered%"
XMLSUBPATH="start-task" name="SeamPageStartTask">
@@ -3227,6 +4244,8 @@
<XChildEntity name="FileSeamPage12"/>
<XChildEntity name="FileSeamPages20"/>
<XChildEntity name="FileSeamPage20"/>
+ <XChildEntity name="FileSeamPage21"/>
+ <XChildEntity name="FileSeamPages21"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -3267,6 +4286,8 @@
<XChildEntity name="FileSeamPage12"/>
<XChildEntity name="FileSeamPages20"/>
<XChildEntity name="FileSeamPage20"/>
+ <XChildEntity name="FileSeamPage21"/>
+ <XChildEntity name="FileSeamPages21"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -3307,6 +4328,8 @@
<XChildEntity name="FileSeamPage12"/>
<XChildEntity name="FileSeamPages20"/>
<XChildEntity name="FileSeamPage20"/>
+ <XChildEntity name="FileSeamPage21"/>
+ <XChildEntity name="FileSeamPages21"/>
</XChildrenEntities>
<XActionItem kind="list"/>
</XEntityExtension>
@@ -3316,6 +4339,8 @@
<XChildEntity name="FileSeamPage12"/>
<XChildEntity name="FileSeamPages20"/>
<XChildEntity name="FileSeamPage20"/>
+ <XChildEntity name="FileSeamPage21"/>
+ <XChildEntity name="FileSeamPages21"/>
</XChildrenEntities>
<XActionItem kind="list"/>
</XEntityExtension>
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesConstants.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesConstants.java 2008-10-15 13:41:35 UTC (rev 10850)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesConstants.java 2008-10-15 13:42:13 UTC (rev 10851)
@@ -17,19 +17,22 @@
public String SUFF_12 = "12"; //$NON-NLS-1$
public String SUFF_20 = "20"; //$NON-NLS-1$
+ public String SUFF_21 = "21"; //$NON-NLS-1$
public String ENT_FILE_SEAM_PAGES = "FileSeamPages"; //$NON-NLS-1$
public String ENT_FILE_SEAM_PAGES_12 = ENT_FILE_SEAM_PAGES + SUFF_12;
- public String ENT_FILE_SEAM_PAGE = "FileSeamPage";
+ public String ENT_FILE_SEAM_PAGE = "FileSeamPage"; //$NON-NLS-1$
public String ENT_FILE_SEAM_PAGE_12 = ENT_FILE_SEAM_PAGE + SUFF_12;
public String ENT_FILE_SEAM_PAGES_20 = ENT_FILE_SEAM_PAGES + SUFF_20;
- public String ENT_FILE_SEAM_PAGE_20 = ENT_FILE_SEAM_PAGE + SUFF_20; //$NON-NLS-1$
+ public String ENT_FILE_SEAM_PAGE_20 = ENT_FILE_SEAM_PAGE + SUFF_20;
+ public String ENT_FILE_SEAM_PAGES_21 = ENT_FILE_SEAM_PAGES + SUFF_21;
+ public String ENT_FILE_SEAM_PAGE_21 = ENT_FILE_SEAM_PAGE + SUFF_21;
public String ENT_SEAM_PAGE = "SeamPage"; //$NON-NLS-1$
public String ENT_SEAM_PAGE_12 = ENT_SEAM_PAGE + SUFF_12;
public String ENT_SEAM_PAGE_20 = ENT_SEAM_PAGE + SUFF_20;
- public String ENT_NAVIGATION = "SeamPageNavigation";
- public String ENT_NAVIGATION_RULE = "SeamPageNavigationRule";
+ public String ENT_NAVIGATION = "SeamPageNavigation"; //$NON-NLS-1$
+ public String ENT_NAVIGATION_RULE = "SeamPageNavigationRule"; //$NON-NLS-1$
public String ENT_EXCEPTION = "SeamPageException";
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java 2008-10-15 13:41:35 UTC (rev 10850)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesEntityRecognizer.java 2008-10-15 13:42:13 UTC (rev 10851)
@@ -36,8 +36,10 @@
return null;
} else if(p.is12) {
return p.isSingle ? ENT_FILE_SEAM_PAGE_12 : ENT_FILE_SEAM_PAGES_12;
+ } else if(p.is20) {
+ return p.isSingle ? ENT_FILE_SEAM_PAGE_20 : ENT_FILE_SEAM_PAGES_20;
} else {
- return p.isSingle ? ENT_FILE_SEAM_PAGE_20 : ENT_FILE_SEAM_PAGES_20;
+ return p.isSingle ? ENT_FILE_SEAM_PAGE_21 : ENT_FILE_SEAM_PAGES_21;
}
}
@@ -45,6 +47,7 @@
boolean recognized = false;
boolean is12 = false;
boolean isSingle = false;
+ boolean is20 = false;
Parser(String body) {
int i = body.indexOf("<page"); //$NON-NLS-1$
@@ -62,6 +65,7 @@
if(s.indexOf("\"http://jboss.com/products/seam/pages\"") < 0) { //$NON-NLS-1$
return;
}
+ if(s.indexOf("2.0") >= 0) is20 = true;
}
recognized = true;
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesLoaderUtil.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesLoaderUtil.java 2008-10-15 13:41:35 UTC (rev 10850)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/SeamPagesLoaderUtil.java 2008-10-15 13:42:13 UTC (rev 10851)
@@ -107,6 +107,8 @@
? SUFF_12
: (entity.getName().endsWith(SUFF_20))
? SUFF_20
+ : (entity.getName().endsWith(SUFF_21))
+ ? SUFF_21
: null;
if(suff == null) {
System.out.println("Unknown suffix in seam page entity " + entity.getName());
Modified: trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/DiagramAdopt.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/DiagramAdopt.java 2008-10-15 13:41:35 UTC (rev 10850)
+++ trunk/seam/plugins/org.jboss.tools.seam.pages.xml/src/org/jboss/tools/seam/pages/xml/model/handlers/DiagramAdopt.java 2008-10-15 13:42:13 UTC (rev 10851)
@@ -88,8 +88,10 @@
public static String getPageSuffix(String entity) {
if(entity.endsWith(SUFF_12)) {
return SUFF_12;
+ } else if(entity.endsWith(SUFF_20)) {
+ return SUFF_20;
} else {
- return SUFF_20;
+ return SUFF_21;
}
}
17 years, 2 months
JBoss Tools SVN: r10850 - trunk/seam/plugins/org.jboss.tools.seam.ui.pages.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-15 09:41:35 -0400 (Wed, 15 Oct 2008)
New Revision: 10850
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui.pages/plugin.xml
Log:
JBIDE-2855 pages.xml 2.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui.pages/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui.pages/plugin.xml 2008-10-15 13:16:40 UTC (rev 10849)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui.pages/plugin.xml 2008-10-15 13:41:35 UTC (rev 10850)
@@ -6,14 +6,14 @@
<xmlEditor
class="org.jboss.tools.seam.ui.pages.editor.SeamPagesEditor"
contributorClass="org.jboss.tools.seam.ui.pages.editor.PagesMultiPageContributor"
- entities="FileSeamPages12,FileSeamPages20"
+ entities="FileSeamPages12,FileSeamPages20,FileSeamPages21"
icon="images/xstudio/editors/seam-pages.gif"
name="Seam Pages">
</xmlEditor>
<xmlEditor
class="org.jboss.tools.jst.web.ui.editors.WebCompoundEditor"
contributorClass="org.jboss.tools.common.model.ui.texteditors.MultiPageContributor"
- entities="FileSeamPage12,FileSeamPage20"
+ entities="FileSeamPage12,FileSeamPage20,FileSeamPage21"
icon="images/xstudio/editors/seam-pages.gif"
name="Seam Page">
</xmlEditor>
17 years, 2 months
JBoss Tools SVN: r10849 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-15 09:16:40 -0400 (Wed, 15 Oct 2008)
New Revision: 10849
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnTemplate.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -13,10 +13,12 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -28,13 +30,13 @@
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
Element sourceElement = (Element)sourceNode;
- nsIDOMElement td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
if(isHeader(sourceElement)) {
- td.setAttribute("class", "dr-table-headercell rich-table-headercell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-headercell rich-table-headercell"); //$NON-NLS-1$
} else if(isFooter(sourceElement)) {
- td.setAttribute("class", "dr-table-footercell rich-table-footercell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-footercell rich-table-footercell"); //$NON-NLS-1$
} else {
- td.setAttribute("class", "dr-table-cell rich-table-cell");
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-cell rich-table-cell"); //$NON-NLS-1$
}
ComponentUtil.copyAttributes(sourceNode, td);
VpeCreationData creationData = new VpeCreationData(td);
@@ -51,11 +53,11 @@
}
private boolean isHeader(Element sourceElement) {
- return icludedInFacet(sourceElement, "header");
+ return icludedInFacet(sourceElement, RichFaces.NAME_FACET_HEADER);
}
private boolean isFooter(Element sourceElement) {
- return icludedInFacet(sourceElement, "footer");
+ return icludedInFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
}
private boolean icludedInFacet(Element sourceElement, String facetName) {
@@ -63,7 +65,7 @@
if(parent!=null) {
if(ComponentUtil.isFacet(parent, facetName)) {
return true;
- } else if (parent.getNodeName().endsWith(":columnGroup")) {
+ } else if (parent.getNodeName().endsWith(RichFaces.TAG_COLUMN_GROUP)) {
return ComponentUtil.isFacet(parent.getParentNode(), facetName);
}
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesColumnsTemplate.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -16,11 +16,11 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -36,7 +36,7 @@
public class RichFacesColumnsTemplate extends AbstractRichFacesTemplate {
/** The Constant DEFAULT_CLASSES. */
- private static final String DEFAULT_CLASSES = "dr-table-cell rich-table-cell";
+ private static final String DEFAULT_CLASSES = "dr-table-cell rich-table-cell"; //$NON-NLS-1$
/**
* Create.
@@ -54,7 +54,7 @@
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
final Element sourceElement = (Element) sourceNode;
- final nsIDOMElement td = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_TD);
+ final nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
prepareData(sourceElement);
final VpeCreationData data = new VpeCreationData(td);
// Create mapping to Encode body
@@ -62,7 +62,7 @@
String clazz = DEFAULT_CLASSES;
if(ComponentUtil.isNotBlank(this.sourceStyleClass)){
- clazz = clazz+" "+this.sourceStyleClass;
+ clazz = clazz+Constants.WHITE_SPACE+this.sourceStyleClass;
}
if(ComponentUtil.isNotBlank(this.sourceWidth)){
td.setAttribute(RichFaces.ATTR_WIDTH, this.sourceWidth);
@@ -83,7 +83,7 @@
*/
private void prepareData(Element sourceElement) {
this.sourceStyleClass = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE_CLASS);
- this.sourceStyle = ComponentUtil.getAttribute(sourceElement, HTML.ATTR_STYLE);
+ this.sourceStyle = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_STYLE);
this.sourceWidth = ComponentUtil.getAttribute(sourceElement, RichFaces.ATTR_WIDTH);
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDataGridTemplate.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -15,9 +15,12 @@
import java.util.StringTokenizer;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -36,68 +39,68 @@
initStyleClasses(sourceElement);
- nsIDOMElement table = visualDocument.createElement("table");
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
ComponentUtil.copyAttributes(sourceNode, table);
VpeCreationData creationData = new VpeCreationData(table);
- ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css", "richFacesDataGrid");
- String tableClass = sourceElement.getAttribute("styleClass");
- table.setAttribute("class", "dr-table rich-table " + (tableClass==null?"":tableClass));
+ ComponentUtil.setCSSLink(pageContext, "dataTable/dataTable.css", "richFacesDataGrid"); //$NON-NLS-1$ //$NON-NLS-2$
+ String tableClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ table.setAttribute(HTML.ATTR_CLASS, "dr-table rich-table " + (tableClass==null?Constants.EMPTY:tableClass)); //$NON-NLS-1$
// Encode colgroup definition.
int columnsLength = getColumnsCount(sourceElement);
- nsIDOMElement colgroup = visualDocument.createElement("colgroup");
- colgroup.setAttribute("span", String.valueOf(columnsLength));
+ nsIDOMElement colgroup = visualDocument.createElement(HTML.TAG_COLGROUP);
+ colgroup.setAttribute(HTML.ATTR_SPAN, String.valueOf(columnsLength));
table.appendChild(colgroup);
//Encode Caption
encodeCaption(creationData, sourceElement, visualDocument, table);
// Encode Header
- Element header = ComponentUtil.getFacet(sourceElement, "header");
+ Element header = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_HEADER);
if(header!=null) {
- nsIDOMElement thead = visualDocument.createElement("thead");
+ nsIDOMElement thead = visualDocument.createElement(HTML.TAG_THEAD);
table.appendChild(thead);
- String headerClass = (String) sourceElement.getAttribute("headerClass");
+ String headerClass = (String) sourceElement.getAttribute(RichFaces.ATTR_HEADER_CLASS);
encodeTableHeaderOrFooterFacet(creationData, thead, columnsLength, visualDocument, header,
- "dr-table-header rich-table-header",
- "dr-table-header-continue rich-table-header-continue",
- "dr-table-headercell rich-table-headercell",
- headerClass, "td");
+ "dr-table-header rich-table-header", //$NON-NLS-1$
+ "dr-table-header-continue rich-table-header-continue", //$NON-NLS-1$
+ "dr-table-headercell rich-table-headercell", //$NON-NLS-1$
+ headerClass, HTML.TAG_TD);
}
// Encode Footer
- Element footer = ComponentUtil.getFacet(sourceElement, "footer");
+ Element footer = ComponentUtil.getFacet(sourceElement, RichFaces.NAME_FACET_FOOTER);
if (footer != null) {
- nsIDOMElement tfoot = visualDocument.createElement("tfoot");
+ nsIDOMElement tfoot = visualDocument.createElement(HTML.TAG_TFOOT);
table.appendChild(tfoot);
- String footerClass = (String) sourceElement.getAttribute("footerClass");
+ String footerClass = (String) sourceElement.getAttribute(RichFaces.ATTR_FOOTER_CLASS);
encodeTableHeaderOrFooterFacet(creationData, tfoot, columnsLength, visualDocument, footer,
- "dr-table-footer rich-table-footer",
- "dr-table-footer-continue rich-table-footer-continue",
- "dr-table-footercell rich-table-footercell",
- footerClass, "td");
+ "dr-table-footer rich-table-footer", //$NON-NLS-1$
+ "dr-table-footer-continue rich-table-footer-continue", //$NON-NLS-1$
+ "dr-table-footercell rich-table-footercell", //$NON-NLS-1$
+ footerClass, HTML.TAG_TD);
}
- nsIDOMElement tbody = visualDocument.createElement("tbody");
+ nsIDOMElement tbody = visualDocument.createElement(HTML.TAG_TBODY);
table.appendChild(tbody);
// Create mapping to Encode body
List<Node> children = ComponentUtil.getChildren(sourceElement);
- sourceElement.getAttribute("elements");
+ sourceElement.getAttribute(RichFaces.ATTR_ELEMENTS);
int elementsCount = getElementsCount(sourceElement, columnsLength);
if(columnsLength>0) {
int rowIndex = 0;
for(int elementIndex = 0; elementIndex<elementsCount; rowIndex++) {
- nsIDOMElement tr = visualDocument.createElement("tr");
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tbody.appendChild(tr);
- tr.setAttribute("class", "dr-table-row rich-table-row " + getRowClass(rowIndex));
+ tr.setAttribute(HTML.ATTR_CLASS, "dr-table-row rich-table-row " + getRowClass(rowIndex)); //$NON-NLS-1$
for(int columnIndex = 0; columnIndex<columnsLength && elementIndex<elementsCount; columnIndex++) {
- nsIDOMElement td = visualDocument.createElement("td");
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
tr.appendChild(td);
- td.setAttribute("class", "dr-table-cell rich-table-cell " + getColumnClass(columnIndex));
+ td.setAttribute(HTML.ATTR_CLASS, "dr-table-cell rich-table-cell " + getColumnClass(columnIndex)); //$NON-NLS-1$
if(!children.isEmpty()) {
VpeChildrenInfo childInfo = new VpeChildrenInfo(td);
for (Node child : children) {
@@ -114,23 +117,23 @@
}
private void initStyleClasses(Element sourceElement) {
- String columnClassesString = sourceElement.getAttribute("columnClasses");
- String rowClassesString = sourceElement.getAttribute("rowClasses");
+ String columnClassesString = sourceElement.getAttribute(RichFaces.ATTR_COLUMN_CLASSES);
+ String rowClassesString = sourceElement.getAttribute(RichFaces.ATTR_ROW_CLASSES);
columnClasses = parceClasses(columnClassesString);
rowClasses = parceClasses(rowClassesString);
}
private String[] parceClasses(String classes) {
if(classes==null) {
- return new String[]{""};
+ return new String[]{Constants.EMPTY};
}
ArrayList<String> list = new ArrayList<String>();
- StringTokenizer st = new StringTokenizer(classes, ",", false);
+ StringTokenizer st = new StringTokenizer(classes, Constants.COMMA, false);
while(st.hasMoreElements()) {
list.add((String)st.nextElement());
}
if(list.isEmpty()) {
- return new String[]{""};
+ return new String[]{Constants.EMPTY};
}
return (String[])list.toArray(new String[list.size()]);
}
@@ -147,7 +150,7 @@
int count = 0;
// check for exact value in component
try {
- int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ int span = Integer.parseInt(sourceElement.getAttribute(RichFaces.ATTR_COLUMNS));
count = span > 0 ? span : 0;
} catch (NumberFormatException e) {
// Ignore wrong formatted attribute
@@ -159,7 +162,7 @@
int elements = 0;
// check for exact value in component
try {
- int span = Integer.parseInt(sourceElement.getAttribute("elements"));
+ int span = Integer.parseInt(sourceElement.getAttribute(RichFaces.ATTR_ELEMENTS));
elements = span>0 ? span : columnCount * defaultRows;
} catch (NumberFormatException e) {
elements = columnCount * defaultRows;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/RichFaces.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -26,6 +26,7 @@
/** jsf tags which are used with richFaces. */
public static final String TAG_COLUMN = "column"; //$NON-NLS-1$
+ public static final String TAG_COLUMNS = "columns"; //$NON-NLS-1$
/** The Constant TAG_FACET. */
public static final String TAG_FACET = "facet"; //$NON-NLS-1$
public static final String TAG_COLUMN_GROUP = "columnGroup"; //$NON-NLS-1$
@@ -73,6 +74,7 @@
public static final String ATTR_CAPTION_CLASS = "captionClass"; //$NON-NLS-1$
public static final String ATTR_CAPTION_STYLE = "captionStyle"; //$NON-NLS-1$
public static final String ATTR_COLUMNS = "columns"; //$NON-NLS-1$
+ public static final String ATTR_ELEMENTS = "elements"; //$NON-NLS-1$
public static final String NAME_FACET_HEADER = "header"; //$NON-NLS-1$
public static final String NAME_FACET_FOOTER = "footer"; //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-15 13:16:40 UTC (rev 10849)
@@ -7,7 +7,7 @@
<TBODY>
<TR CLASS="dr-table-row rich-table-row">
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
@@ -18,7 +18,7 @@
</DIV>
</TD>
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
@@ -31,23 +31,23 @@
</TR>
<TR CLASS="dr-table-row rich-table-row">
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
- <DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-b rich-panel-body" >
<SPAN> #{data.field1}</SPAN>
</DIV>
</DIV>
</TD>
<TD CLASS="dr-table-cell rich-table-cell">
- <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl rich-panel" >
<DIV CLASS="dr-pnl-h rich-panel-header"
STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
- <DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-b rich-panel-body" >
<SPAN> #{data.field1}</SPAN>
</DIV>
</DIV>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml 2008-10-15 13:16:40 UTC (rev 10849)
@@ -9,9 +9,17 @@
<head>
</head>
<body>
- <!-- Data List -->
- <rich:dataList rows="5">
- <h:outputText value="testList" />
- </rich:dataList>
+<h1>dataList</h1>
+
+<rich:dataList var="data" value="#{bean.dtList}" rows="4" id="dataList" >
+ <h:outputText value="field1:"></h:outputText>
+ <h:outputText value="#{data.field1} " />
+ <h:outputText value="field2:"></h:outputText>
+ <h:outputText value="#{data.field2} " />
+ <h:outputText value="field3:"></h:outputText>
+ <h:outputText value="#{data.field3}" />
+ <h:outputText value="number:"></h:outputText>
+ <h:outputText value="#{data.number}" />
+</rich:dataList>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataList.xhtml.xml 2008-10-15 13:16:40 UTC (rev 10849)
@@ -0,0 +1,17 @@
+<tests>
+ <test id="dataList">
+ <UL VAR="data" VALUE="#{bean.dtList}" ROWS="4" ID="dataList"
+ CLASS="dr-list rich-datalist">
+ <LI CLASS="dr-list-item rich-list-item">
+ <SPAN> field1:</SPAN>
+ <SPAN > #{data.field1}</SPAN>
+ <SPAN> field2:</SPAN>
+ <SPAN> #{data.field2}</SPAN>
+ <SPAN> field3:</SPAN>
+ <SPAN> #{data.field3}</SPAN>
+ <SPAN> number:</SPAN>
+ <SPAN> #{data.number}</SPAN>
+ </LI>
+ </UL>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -87,7 +87,7 @@
}
public void testDataList() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performContentTest("components/dataList.xhtml");//$NON-NLS-1$
}
public void testDataOrderedList() throws Throwable {
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -19,8 +19,10 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Document;
@@ -77,6 +79,7 @@
TestUtil.waitForJobs();
+ TestUtil.delay(2000);
VpeController controller = getVpeController((JSPMultiPageEditor) editor);
// get xml test file
@@ -118,9 +121,9 @@
nsIDOMElement vpeElement = findElementById(controller, elementId);
assertNotNull(vpeElement);
- // DOMTreeDumper dumper = new DOMTreeDumper(
- // VpeDebug.VISUAL_DUMP_PRINT_HASH);
- // dumper.dumpToStream(System.out, vpeElement);
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.dumpToStream(System.out, vpeElement);
// get test element by id - get <test id="..." > element and get his
// first child
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-15 10:25:57 UTC (rev 10848)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-15 13:16:40 UTC (rev 10849)
@@ -21,7 +21,6 @@
import org.jboss.tools.common.model.util.XMLUtil;
import org.jboss.tools.vpe.editor.util.Constants;
-import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMAttr;
import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
@@ -122,17 +121,17 @@
throws ComparisonException {
if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
- throw new ComparisonException("name of tag is \""
- + vpeNode.getNodeName() + "\"but must be \""
- + modelNode.getNodeName() + "\"");
+ throw new ComparisonException("name of tag is \"" //$NON-NLS-1$
+ + vpeNode.getNodeName() + "\"but must be \"" //$NON-NLS-1$
+ + modelNode.getNodeName() + "\""); //$NON-NLS-1$
}
if ((modelNode.getNodeValue() != null)
&& (!modelNode.getNodeValue().trim().equalsIgnoreCase(
vpeNode.getNodeValue().trim()))) {
- throw new ComparisonException("value of " + vpeNode.getNodeName()
- + " is \"" + vpeNode.getNodeValue().trim()
- + "\" but must be \"" + modelNode.getNodeValue().trim()
- + "\"");
+ throw new ComparisonException("value of " + vpeNode.getNodeName() //$NON-NLS-1$
+ + " is \"" + vpeNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\" but must be \"" + modelNode.getNodeValue().trim() //$NON-NLS-1$
+ + "\""); //$NON-NLS-1$
}
// compare node's attributes
if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
@@ -205,18 +204,22 @@
for (String illegalAttributeName : illegalAttributes) {
if (vpeAttributes.getNamedItem(illegalAttributeName.trim()) != null)
- throw new ComparisonException("illegal attribute :"
+ throw new ComparisonException("illegal attribute :" //$NON-NLS-1$
+ illegalAttributeName);
}
} else {
+
+ if (vpeAttributes.getNamedItem(
+ name) == null)
+ throw new ComparisonException("there is not : \"" + name //$NON-NLS-1$
+ + "\" attribute"); //$NON-NLS-1$
+
nsIDOMAttr vpeAttr = (nsIDOMAttr) vpeAttributes.getNamedItem(
name).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
- if (vpeAttr == null)
- throw new ComparisonException("there is not : \"" + name
- + "\" attribute");
+
// if (HTML.ATTR_STYLE.equalsIgnoreCase(name)) {
//
@@ -255,12 +258,10 @@
// }
//
// }
- else {
compareComplexStrings(modelAttr.getNodeValue().trim(),
vpeAttr.getNodeValue().trim());
- }
}
}
}
@@ -276,13 +277,13 @@
Matcher matcher = Pattern.compile(regex).matcher(vpeString);
if (!matcher.find()) {
- throw new ComparisonException("string is\"" + vpeString
- + "\" but pattern is \"" + regex + "\"");
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but pattern is \"" + regex + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
} else if (!modelString.equals(vpeString)) {
- throw new ComparisonException("string is\"" + vpeString
- + "\" but must be \"" + modelString + "\"");
+ throw new ComparisonException("string is\"" + vpeString //$NON-NLS-1$
+ + "\" but must be \"" + modelString + "\""); //$NON-NLS-1$ //$NON-NLS-2$
}
}
17 years, 2 months
JBoss Tools SVN: r10848 - in trunk/esb/plugins: org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-15 06:25:57 -0400 (Wed, 15 Oct 2008)
New Revision: 10848
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-2889: fix the bad refresh issue
JBIDE-2902: could not publish esb project
JBIDE-2888: set server supplied esb runtime as default
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2008-10-15 10:25:57 UTC (rev 10848)
@@ -50,7 +50,7 @@
<supported>
<facet
id="jst.jboss.esb"
- version="4.2,4.3">
+ version="4.2,4.3,4.4">
</facet>
<runtime-component
id="org.jboss.ide.eclipse.as.runtime.component"
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-15 10:25:57 UTC (rev 10848)
@@ -12,5 +12,8 @@
public final static String ESB_CONFIG_QUEUE_SERVICE_JBM = "jbm-queue-service.xml";
public final static String ESB_CONFIG_QUEUE_SERVICE_JBMQ = "jbmq-queue-service.xml";
+ public final static String DEFAULT_ESB_CONFIG_RESOURCE_FOLDER = "resources";
+ public final static String DEFAULT_ESB_SOURCE_FOLDER = "src";
+
public final static String ESB_PROJECT_NATURE = "org.jboss.tools.esb.project.ESBNature";
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/facet/JBossESBFacetDataModelProvider.java 2008-10-15 10:25:57 UTC (rev 10848)
@@ -6,6 +6,7 @@
import org.eclipse.jst.j2ee.internal.J2EEVersionConstants;
import org.eclipse.jst.j2ee.project.facet.J2EEModuleFacetInstallDataModelProvider;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.esb.core.ESBProjectConstant;
public class JBossESBFacetDataModelProvider extends J2EEModuleFacetInstallDataModelProvider implements IJBossESBFacetDataModelProperties{
@@ -28,15 +29,17 @@
return JBOSSESB_PROJECT_FACET;
}
else if(IJBossESBFacetDataModelProperties.ESB_CONTENT_FOLDER.equals(propertyName)){
- return "esbcontent";
+ return "esbcontent";//ESBProjectConstant.DEFAULT_ESB_CONFIG_RESOURCE_FOLDER;
}
else if(IJBossESBFacetDataModelProperties.ESB_SOURCE_FOLDER.equals(propertyName)){
- return "src";
+ return ESBProjectConstant.DEFAULT_ESB_SOURCE_FOLDER;
}
else if(propertyName.equals(RUNTIME_ID)){
return "";
}else if(propertyName.equals(FACET_ID)){
return IJBossESBFacetDataModelProperties.JBOSS_ESB_FACET_ID;
+ } else if( propertyName.equals(RUNTIME_IS_SERVER_SUPPLIED)){
+ return true;
}
return super.getDefaultProperty(propertyName);
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-15 10:25:57 UTC (rev 10848)
@@ -40,40 +40,60 @@
IJavaProject javaPrj = JavaCore.create(project);
IPath output = javaPrj.getOutputLocation();
// if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder of the project
+ List<IModuleResource> mrs = getConfigModuleFile(project, configFolder);
+
+ IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
+ IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
+ IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
+ System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
+ System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
+ if(mrs.size() > 0){
+ IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
+ System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
+ }
+ return allResource;
+ }
+
+ private List<IModuleResource> getConfigModuleFile(IProject project, IFolder configFolder) throws CoreException {
List<IModuleResource> mrs = new ArrayList<IModuleResource>();
IFolder metainf = configFolder.getFolder(ESBProjectConstant.META_INF);
IResource res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ IModuleFile tmpmf;
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_JBOSSESB));
+ tmpmf = getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ if( tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
//check the deployment.xml just like jboss-esb.xml
res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT));
+ tmpmf = getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
+ if(tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM));
+ tmpmf = getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
+ if(tmpmf != null){
+ mrs.add(tmpmf);
+ }
}
res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
if(res == null){
- mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ));
+ tmpmf = getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
+ if( tmpmf != null ){
+ mrs.add(tmpmf);
+ }
}
- IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
- IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
- IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
- System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
- System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
- if(mrs.size() > 0){
- IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
- System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
- }
- return allResource;
+ return mrs;
}
+
@Override
public IStatus validate() {
return null;
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/plugin.xml 2008-10-15 10:25:57 UTC (rev 10848)
@@ -31,5 +31,12 @@
name="JBoss ESB Runtimes">
</page>
</extension>
-
+ <extension
+ point="org.eclipse.wst.server.ui.serverImages">
+ <image
+ icon="icons/wizards/esb.gif"
+ id="org.jboss.tools.esb.project.ui.image"
+ typeIds="jst.jboss.esb">
+ </image>
+ </extension>
</plugin>
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-10-15 10:25:57 UTC (rev 10848)
@@ -35,7 +35,7 @@
ESBFacetInstallationPage_Button_Text_New=New
ESBFacetInstallationPage_Default_SRC_Folder=src
ESBFacetInstallationPage_Description=Configure project structure and classpath
-ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=Please specify Target Runtime at the first wizard page.
+ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=Please specify the project primary target runtime
ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime does not contain a valid ESB runtime.
ESBFacetInstallationPage_Error_Message_No_Target_Runtime=No target runtime was specified.
ESBFacetInstallationPage_Error_Message_Specify_Content_Folder=Please specify a valid content folder.
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-15 09:04:53 UTC (rev 10847)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-15 10:25:57 UTC (rev 10848)
@@ -66,6 +66,9 @@
private Button btnServerSupplied;
private Button btnNew;
+ private IFacetedProjectListener fpListerner;
+ private IFacetedProjectWorkingCopy fpwc;
+
public ESBFacetInstallationPage() {
super( "esb.facet.install.page"); //$NON-NLS-1$
setTitle(JBossESBUIMessages.ESBFacetInstallationPage_Title);
@@ -94,33 +97,44 @@
Dialog.applyDialogFont(parent);
// add listener to listen the changes on the project facet
- final IFacetedProjectWorkingCopy fpwc = getFacetedProjectWorkingCopy();
- fpwc.addListener(new IFacetedProjectListener(){
+ fpwc = getFacetedProjectWorkingCopy();
+ if(fpListerner == null){
+ fpListerner = new IFacetedProjectListener(){
- public void handleEvent(IFacetedProjectEvent event) {
- IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
- final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
- Display.getDefault().syncExec(new Runnable() {
+ public void handleEvent(IFacetedProjectEvent event) {
+ IProjectFacet facet = ProjectFacetsManager.getProjectFacet(ESBProjectConstant.ESB_PROJECT_FACET);
+ final IProjectFacetVersion version = fpwc.getProjectFacetVersion(facet);
+ Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- if(version != null){
- initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
- }else{
- initializeRuntimesCombo(cmbRuntimes, null);
+ public void run() {
+ if(version != null){
+ initializeRuntimesCombo(cmbRuntimes, null, version.getVersionString());
+
+ }else{
+ initializeRuntimesCombo(cmbRuntimes, null);
+ }
+ changePageStatus();
}
- }
+
+ });
- });
-
- }
- }, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED);
+ }
+ };
+ }
+ if(fpwc != null){
+ fpwc.addListener(fpListerner, IFacetedProjectEvent.Type.PROJECT_FACETS_CHANGED,
+ IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
+ }
+ //set page status
+ changePageStatus();
+
return composite;
}
private void createProjectGroup(Composite parent){
- Group prjGroup = new Group(parent, SWT.BORDER);
+ Group prjGroup = new Group(parent, SWT.NONE);
prjGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Text_Folder);
prjGroup.setLayout(new GridLayout(1, false));
prjGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -208,7 +222,7 @@
private void createRuntimeGroup(Composite parent){
- Group runtimeGroup = new Group(parent, SWT.BORDER);
+ Group runtimeGroup = new Group(parent, SWT.NONE);
runtimeGroup.setText(JBossESBUIMessages.ESBFacetInstallationPage_Group_Runtime_Text);
runtimeGroup.setLayout(new GridLayout(3, false));
runtimeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -270,6 +284,9 @@
hasRuntime = false;
}
+ //set default ESB runtime option
+ btnServerSupplied.setSelection(true);
+ enableUserSupplied(false);
}
@@ -314,31 +331,11 @@
}
private void checkServerSuppliedESBRuntime() {
- String prjname = model.getStringProperty(FACET_PROJECT_NAME);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- prjname);
try {
- IFacetedProject fp = ProjectFacetsManager.create(project);
- if (fp != null) {
- IRuntime runtime = fp.getPrimaryRuntime();
- if (runtime == null) {
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
- hasRuntime = false;
- setPageComplete(isPageComplete());
- return;
- }
- org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
- .findRuntime(runtime.getProperty("id"));
- if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString())) {
- setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
- hasRuntime = false;
- setPageComplete(isPageComplete());
- return;
- }
- } else {
- IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
+ IFacetedProjectWorkingCopy ifpwc = getFacetedProjectWorkingCopy();
+ //when the UI is loaded from esb project creation wizard
+ if (ifpwc != null) {
IRuntime runtime = ifpwc.getPrimaryRuntime();
if (runtime == null) {
setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime);
@@ -356,8 +353,33 @@
setPageComplete(isPageComplete());
return;
}
+ }
+ // when the UI loaded from project facet properties page
+ else {
+ String prjname = model.getStringProperty(FACET_PROJECT_NAME);
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjname);
+ IFacetedProject fp = ProjectFacetsManager.create(project);
+ // if fp != null , the UI will be loaded for an exist project
+ if (fp != null) {
+ IRuntime runtime = fp.getPrimaryRuntime();
+ if (runtime == null) {
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_No_Target_Runtime);
+ hasRuntime = false;
+ setPageComplete(isPageComplete());
+ return;
+ }
+ org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
+ .findRuntime(runtime.getProperty("id"));
+ if (!JBossRuntimeManager.isValidESBServer(serverRuntime
+ .getLocation().toOSString())) {
+ setErrorMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime);
+ hasRuntime = false;
+ setPageComplete(isPageComplete());
+ return;
+ }
+ }
}
-
+
} catch (CoreException e) {
ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
}
@@ -419,7 +441,7 @@
selectedJbRuntime = jr;
selectIndex = i;
}
- // get default jbossws runtime
+ // get default jbossws runtime from esb runtime preference
if (jr.isDefault()) {
defaultJbws = jr;
defaultIndex = i;
@@ -428,10 +450,14 @@
if(selectedJbRuntime != null){
cmRuntime.select(selectIndex);
- saveJBossESBRuntimeToModel(selectedJbRuntime);
+ if(btnUserSupplied.getSelection()){
+ saveJBossESBRuntimeToModel(selectedJbRuntime);
+ }
}else if(defaultJbws != null){
cmRuntime.select(defaultIndex);
- saveJBossESBRuntimeToModel(defaultJbws);
+ if(btnUserSupplied.getSelection()){
+ saveJBossESBRuntimeToModel(defaultJbws);
+ }
}
}
@@ -523,7 +549,7 @@
/* private void fillMessageGroup(Composite parent){
- Group messageGroup = new Group(parent, SWT.BORDER);
+ Group messageGroup = new Group(parent, SWT.);
messageGroup.setText("Target Message Product");
messageGroup.setLayout(new GridLayout(1, false));
messageGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
@@ -547,5 +573,15 @@
return null;
}
+ @Override
+ public void dispose() {
+ if(fpwc != null){
+ fpwc.removeListener(fpListerner);
+ }
+ super.dispose();
+ }
+
+
+
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r10847 - in trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean: model and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-15 05:04:53 -0400 (Wed, 15 Oct 2008)
New Revision: 10847
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
Log:
JBIDE-2867
Deal with a problem that is the collection interface type property can't display/connect correctly
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-15 09:02:47 UTC (rev 10846)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/analyzer/JavaBeanAnalyzer.java 2008-10-15 09:04:53 UTC (rev 10847)
@@ -929,7 +929,7 @@
if (list == null)
return null;
if (parentModel.isList() || parentModel.isArray()) {
- if (list.size() >= 1) {
+ if (list.size() >= 1 && parentModel.hasGenericType()) {
JavaBeanModel m = (JavaBeanModel) list.get(0);
return m;
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-15 09:02:47 UTC (rev 10846)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/model/JavaBeanModel.java 2008-10-15 09:04:53 UTC (rev 10847)
@@ -41,6 +41,8 @@
private boolean collection = false;
private boolean isPrimitive = false;
+
+ private boolean hasGenericType = false;
private Class<? extends Object> beanClass = null;
@@ -117,6 +119,7 @@
.getActualTypeArguments()[0];
Class beanType = (Class) gtype;
componentClass = beanType;
+ setGenericType(true);
}
}
}
@@ -358,4 +361,12 @@
return buffer.toString();
}
+ public boolean hasGenericType() {
+ return hasGenericType;
+ }
+
+ public void setGenericType(boolean hasGenericType) {
+ this.hasGenericType = hasGenericType;
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10846 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-15 05:02:47 -0400 (Wed, 15 Oct 2008)
New Revision: 10846
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
Log:
JBIDE-2867
Deal with a problem that is the collection interface type property can't display/connect correctly
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-15 08:10:33 UTC (rev 10845)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-15 09:02:47 UTC (rev 10846)
@@ -454,7 +454,9 @@
protected void initTargetTreeViewer() {
if (this.targetTreeViewerInputModel != null) {
- targetViewer.setInput(targetTreeViewerInputModel);
+ List arrayList = new ArrayList();
+ arrayList.add(targetTreeViewerInputModel);
+ targetViewer.setInput(arrayList);
}
}
@@ -474,7 +476,9 @@
protected void initSourceTreeViewer() {
if (this.sourceTreeViewerInputModel != null) {
- sourceViewer.setInput(sourceTreeViewerInputModel);
+ List arrayList = new ArrayList();
+ arrayList.add(sourceTreeViewerInputModel);
+ sourceViewer.setInput(arrayList);
}
}
@@ -601,6 +605,7 @@
protected void createTargetGraphModels() {
Tree tree = targetViewer.getTree();
TreeItem[] items = tree.getItems();
+ clearExsitingGraphModels(TargetModel.class);
createGraphModels(items, TargetModel.class);
}
@@ -975,7 +980,9 @@
}
/**
- *
+ * It's a very important method <p>
+ * If call the method , there will open the data selection wizard to allow user select new data , <p>
+ * when user select the new data , the connections will be removed.
* @param viewer
*/
protected void showCreationWizard(TreeViewer viewer) {
@@ -991,19 +998,18 @@
this.getSmooksConfigurationFileGenerateContext().addProperties(
cw.getProperties());
String typeID = cw.getInputDataTypeID();
+ if (viewer.getInput() != null) {
+ if (!MessageDialog
+ .openQuestion(
+ getSite().getShell(),
+ "Changed Data ?",
+ "Do you want to change the data ? If you do so , all connections will be losted")) {
+ return;
+ }
+ }
if (UIUtils.setTheProvidersForTreeViewer(viewer, typeID)) {
- if (viewer.getInput() != null) {
- if (!MessageDialog
- .openQuestion(
- getSite().getShell(),
- "Changed Data?",
- "Do you want to change the data?if you do this , all connections will be losted")) {
- return;
- }
- }
viewer.setInput(cw.getTreeViewerInputContents());
try {
- // viewer.expandAll();
if (viewer == this.sourceViewer) {
this.createSourceGraphModels();
sourceDataTypeID = typeID;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-15 08:10:33 UTC (rev 10845)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-15 09:02:47 UTC (rev 10846)
@@ -106,53 +106,6 @@
this.showDataSelectPage = showDataSelectPage;
}
- // public boolean canFlipToNextPage() {
- // if (!showDataSelectPage) {
- // return isPageComplete() && getNextPage() != null;
- // }
- // return super.canFlipToNextPage();
- // }
-
- // /*
- // * (non-Javadoc)
- // *
- // * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
- // */
- // public IWizardPage getNextPage() {
- // if (!showDataSelectPage) {
- // if (this.getWizard() != null) {
- // return this.getWizard().getNextPage(this);
- // }
- // }
- // if (this.getSelectedNode() == null) {
- // return null;
- // }
- //
- // boolean isCreated = getSelectedNode().isContentCreated();
- //
- // IWizard wizard = getSelectedNode().getWizard();
- //
- // if (wizard == null) {
- // setSelectedNode(null);
- // return null;
- // }
- // if (!isCreated) {
- // if (wizard instanceof IStrucutredDataCreationWizard) {
- // String targetID = getDataTypeID(target);
- // if (targetID != null) {
- // ((IStrucutredDataCreationWizard) wizard)
- // .setNextDataCreationWizardNode(this
- // .getSourceWizard(targetID));
- // }
- // }
- // if (wizard instanceof INewWizard) {
- // ((INewWizard) wizard).init(null, selection);
- // }
- // wizard.addPages();
- // }
- // return wizard.getStartingPage();
- // }
-
/*
* (non-Javadoc)
*
@@ -350,34 +303,10 @@
if (viewer == source) {
String sourceID = getDataTypeID(source);
setSourceID(sourceID);
- // TODO don't use that to display the source selection
- // wizard page.
- // IWizardNode wn = getSourceWizard(sourceID);
- // setSelectedNode(wn);
- // IWizard sw = wn.getWizard();
- // if (sw instanceof IStrucutredDataCreationWizard) {
- // setSourceWizard((IStrucutredDataCreationWizard) sw);
- // }
}
if (viewer == target) {
- // IWizardNode node = getSelectedNode();
String targetID = getDataTypeID(target);
- // TODO don't use that to display the target selection
- // wizard page.
- // IWizardNode targetNode = getSourceWizard(targetID);
- // IWizard tnw = targetNode.getWizard();
- // if (tnw instanceof IStrucutredDataCreationWizard) {
- // setTargetWizard((IStrucutredDataCreationWizard) tnw);
- // }
- // if (node != null) {
- // IWizard wizard = node.getWizard();
- // if (wizard != null
- // && wizard instanceof IStrucutredDataCreationWizard) {
- // ((IStrucutredDataCreationWizard) wizard)
- // .setNextDataCreationWizardNode(targetNode);
- // }
- // }
setTargetID(targetID);
}
}
@@ -386,9 +315,6 @@
TableColumn nameColumn = new TableColumn(viewer.getTable(), SWT.NONE);
nameColumn.setWidth(100);
nameColumn.setText("Name");
- // TableColumn idColumn = new TableColumn(viewer.getTable(), SWT.NONE);
- // idColumn.setWidth(100);
- // idColumn.setText("ID");
viewer.setContentProvider(new TypeIDContentProvider());
viewer.setLabelProvider(new TypeIDLabelProvider());
return viewer;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-15 08:10:33 UTC (rev 10845)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-15 09:02:47 UTC (rev 10846)
@@ -4,6 +4,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -13,7 +14,6 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -22,7 +22,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
-import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
import org.jboss.tools.smooks.ui.editors.SmooksFileEditorInput;
import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
import org.jboss.tools.smooks.ui.editors.TypeIDSelectionWizardPage;
@@ -132,8 +131,21 @@
try {
SmooksFileEditorInput input = new SmooksFileEditorInput(
file);
- input.setSourceTreeViewerInputContents(typeIDPage.getSourceTreeViewerInputContents());
- input.setTargetTreeViewerInputContents(typeIDPage.getTargetTreeViewerInputContents());
+ Object sourceObj = typeIDPage.getSourceTreeViewerInputContents();
+ if(sourceObj instanceof List){
+ if(!((List)sourceObj).isEmpty()){
+ sourceObj = ((List)sourceObj).get(0);
+ }
+ }
+ input.setSourceTreeViewerInputContents(sourceObj);
+
+ Object targetObj = typeIDPage.getSourceTreeViewerInputContents();
+ if(targetObj instanceof List){
+ if(!((List)targetObj).isEmpty()){
+ targetObj = ((List)targetObj).get(0);
+ }
+ }
+ input.setTargetTreeViewerInputContents(targetObj);
IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
true);// openEditor(page, file, true);
17 years, 2 months
JBoss Tools SVN: r10845 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert: bpmnto/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-15 04:10:33 -0400 (Wed, 15 Oct 2008)
New Revision: 10845
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
Log:
JBIDE-2896:fix subprocess's name is null
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-15 07:09:35 UTC (rev 10844)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-15 08:10:33 UTC (rev 10845)
@@ -283,8 +283,8 @@
}
/*
- * Translate a bpmn subprocess to a jpdl processstate and a new jpdl process
- * difinition
+ * Translate a bpmn subprocess to a jpdl process-state and a new jpdl process
+ * definition
*/
private void translateSubprocess(Element subProcess, Element element) {
Element processRoot = translateGraph(subProcess);
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-15 07:09:35 UTC (rev 10844)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-15 08:10:33 UTC (rev 10845)
@@ -90,14 +90,31 @@
} else {
String str = generateProcessName(graph.getParent());
if (str == null) {
- return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ return generateElementName(graph);
} else {
return str + B2JMessages.Folder_Name_Separator
- + graph.attributeValue(B2JMessages.Dom_Element_Name);
+ + generateElementName(graph);
}
}
}
+
+ /*
+ * generate a element name
+ */
+ public static String generateElementName(Element graph){
+ String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+ if (name == null || "".equals(name)) {
+ name = "au_gen";
+ }
+ Integer i = nameMap.get(name);
+ if (i == null) {
+ nameMap.put(name, new Integer("1"));
+ } else {
+ nameMap.put(name, ++i);
+ }
+ return name;
+ }
/*
* check the bpmn element name is null or "" or same to another element name
@@ -109,7 +126,7 @@
String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
if (name == null || "".equals(name)) {
- name = "jboss_autogen";
+ name = "au_gen";
isOk = false;
}
Integer i = nameMap.get(name);
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-15 07:09:35 UTC (rev 10844)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-15 08:10:33 UTC (rev 10845)
@@ -129,7 +129,7 @@
public IWizardPage getNextPage(IWizardPage page) {
if (page.getName()
- .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ .equals(B2JMessages.Bpmn_Translate_Message_WizardPage_Name)) {
errorList = translateBpmnToStrings();
if (errorList.size() == 0) {
return locationPage;
17 years, 2 months
JBoss Tools SVN: r10844 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-15 03:09:35 -0400 (Wed, 15 Oct 2008)
New Revision: 10844
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
Log:
JBIDE-2898
have fixed it.
there were some problems with the getDataTypeID method
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-15 06:37:41 UTC (rev 10843)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-15 07:09:35 UTC (rev 10844)
@@ -275,7 +275,7 @@
Object[] objs = viewer.getCheckedElements();
if (objs == null)
return null;
- if (objs.length > 1)
+ if (objs.length <= 0)
return null;
DataTypeID d = (DataTypeID) objs[0];
return d.getId();
17 years, 2 months
JBoss Tools SVN: r10843 - trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-15 02:37:41 -0400 (Wed, 15 Oct 2008)
New Revision: 10843
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
Log:
JBIDE-2897
change the class full path display way.
Add title/description to JavaBean wizard page
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-15 05:20:39 UTC (rev 10842)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-15 06:37:41 UTC (rev 10843)
@@ -54,6 +54,8 @@
super("beansearchwizardpage");
this.project = selection;
setPageComplete(true);
+ setTitle("JavaBean Class selection page");
+ setDescription("Select the JavaBean class");
}
public void activeNextWizardNode(IWizardNode node){
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2008-10-15 05:20:39 UTC (rev 10842)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanModelLoadComposite.java 2008-10-15 06:37:41 UTC (rev 10843)
@@ -173,8 +173,8 @@
Class clazz = loader.loadClass(this.classText.getText());
rootJavaBean = JavaBeanModelFactory
.getJavaBeanModelWithLazyLoad(clazz);
- }catch(Exception e){
-
+ } catch (Exception e) {
+
}
}
// if (rootJavaBean != null)
@@ -203,8 +203,13 @@
Object result = results[0];
String packageFullName = JavaModelUtil
.getTypeContainerName((IType) result);
- classText.setText(packageFullName + "."
- + ((IType) result).getElementName());
+ if (packageFullName == null
+ || packageFullName.length() <= 0) {
+ classText.setText(((IType) result).getElementName());
+ } else {
+ classText.setText(packageFullName + "."
+ + ((IType) result).getElementName());
+ }
}
}
} catch (Exception e) {
@@ -213,6 +218,5 @@
}
}
-
}
17 years, 2 months
JBoss Tools SVN: r10842 - trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-15 01:20:39 -0400 (Wed, 15 Oct 2008)
New Revision: 10842
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
Log:
fix vpe junit tests errors
Modified: trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2008-10-15 05:17:07 UTC (rev 10841)
+++ trunk/vpe/tests/org.jboss.tools.vpe.test/src/org/jboss/tools/vpe/editor/template/VpeTemplateManagerTest.java 2008-10-15 05:20:39 UTC (rev 10842)
@@ -26,7 +26,7 @@
public void testGetAnyTemplates() {
List<VpeAnyData> templates = VpeTemplateManager.getInstance().getAnyTemplates();
- assertEquals(2, templates.size());
+ assertEquals(4, templates.size());
}
public void testReload() {
17 years, 2 months
JBoss Tools SVN: r10841 - in trunk: jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-15 01:17:07 -0400 (Wed, 15 Oct 2008)
New Revision: 10841
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
Log:
fix junit tests errors in common.text.ext.test plug-in
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-14 23:48:00 UTC (rev 10840)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-15 05:17:07 UTC (rev 10841)
@@ -16,8 +16,10 @@
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.DocumentProviderRegistry;
@@ -45,6 +47,7 @@
OPENON_TEST_PROJECT);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
JobUtils.waitForIdle();
+ IWorkbench workbench = PlatformUI.getWorkbench();
}
protected void tearDown() {
@@ -314,7 +317,9 @@
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
- "org.jboss.tools.test.TestBean1", true, true, false, false);
+ "b1", true, true, false, false);
+ reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset()+reg.getLength(),
+ "b1", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
assertNotNull(links);
assertTrue(links.length!=0);
@@ -323,12 +328,11 @@
links[0].open();
JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<jsp:useBean id=\"b1\" class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
- String fileName = editor.getEditorInput().getName();
- assertTrue("TestBean1.java".equals(fileName));
-
- reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset(),
- "b1", true, true, false, false);
+ reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "org.jboss.tools.test.TestBean1", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
assertNotNull(links);
assertTrue(links.length!=0);
@@ -337,8 +341,8 @@
links[0].open();
JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
- assertEquals("<jsp:useBean id=\"b1\" class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("TestBean1.java".equals(fileName));
}
public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/forwardHiperlinkTests.jsp";
@@ -379,7 +383,7 @@
assertTrue("forwardHiperlinkPage1Tests.jsp".equals(fileName));
}
- public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/includeHiperlinkTests.page.jsp";
+ public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/includeHiperlinkTests.jsp";
public void testJspIncludeOpenOn() throws CoreException, BadLocationException {
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14 23:48:00 UTC (rev 10840)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-15 05:17:07 UTC (rev 10841)
@@ -79,7 +79,7 @@
}
- assertTrue("Content Assistant peturned no proposals", (result != null && result.length > 0));
+ assertTrue("Content Assistant returned no proposals", (result != null && result.length > 0));
boolean bPropoosalToApplyFound = false;
for (int i = 0; i < result.length; i++) {
17 years, 2 months
JBoss Tools SVN: r10840 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-14 19:48:00 -0400 (Tue, 14 Oct 2008)
New Revision: 10840
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
Log:
placeholder added for WTP Server View
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2008-10-14 19:27:44 UTC (rev 10839)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamPerspectiveFactory.java 2008-10-14 23:48:00 UTC (rev 10840)
@@ -34,7 +34,7 @@
bottom.addView(IPageLayout.ID_TASK_LIST);
bottom.addView(SEAM_COMPONENTS_NAVIGATOR);
bottom.addView(JBOSS_SERVERS_VIEW);
- //bottom.addView(WTP_SERVERS_VIEW); // We don't need this anymore since our server view now has synchro info.
+ bottom.addPlaceholder(WTP_SERVERS_VIEW);
IFolderLayout rightTop = layout.createFolder("right", IPageLayout.RIGHT, (float)0.8, editorArea); //$NON-NLS-1$
rightTop.addView("org.jboss.tools.common.model.ui.views.palette.PaletteView"); //$NON-NLS-1$
17 years, 2 months
JBoss Tools SVN: r10839 - trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-14 15:27:44 -0400 (Tue, 14 Oct 2008)
New Revision: 10839
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
fix JUnit Test errors in common.model.test plugin
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-14 19:14:10 UTC (rev 10838)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-14 19:27:44 UTC (rev 10839)
@@ -572,7 +572,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.VpeTaglibReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Edit TLD Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
17 years, 2 months
JBoss Tools SVN: r10838 - in trunk: common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test and 18 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-14 15:14:10 -0400 (Tue, 14 Oct 2008)
New Revision: 10838
Removed:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
Modified:
trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF
trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java
trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
Log:
fix test project import/deletion
Modified: trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/plugins/org.jboss.tools.common.text.ext/src/org/jboss/tools/common/text/ext/hyperlink/CSSClassHyperlink.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -24,9 +24,6 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.rules.IToken;
@@ -37,7 +34,6 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMText;
import org.jboss.tools.common.text.ext.ExtensionsPlugin;
-import org.jboss.tools.common.text.ext.hyperlink.jsp.JSPRootHyperlinkPartitioner;
import org.jboss.tools.common.text.ext.hyperlink.xpl.Messages;
import org.jboss.tools.common.text.ext.util.CSSTextScanner;
import org.jboss.tools.common.text.ext.util.RegionHolder;
@@ -282,10 +278,10 @@
for (int i = 0; list != null && i < list.getLength(); i++) {
IDOMNode element = (IDOMNode)list.item(i);
- String axis = JSPRootHyperlinkPartitioner.computeAxis(getDocument(), element.getStartOffset());
- axis = axis.toLowerCase();
+ //String axis = JSPRootHyperlinkPartitioner.computeAxis(getDocument(), element.getStartOffset());
+ //axis = axis.toLowerCase();
- if (axis.endsWith("/link")) {
+ if ("link".equals(element.getNodeName())) {
Node relAttr = element.getAttributes().getNamedItem("rel");
if (relAttr != null) {
String val = relAttr.getNodeValue().toLowerCase();
@@ -298,7 +294,7 @@
}
}
- if (axis.endsWith("/style")) {
+ if ("link".equals(element.getNodeName())) {
// String value = element.getNodeValue();
styleLinks.add(element);
}
Modified: trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.model.test/src/org/jboss/tools/common/model/test/ClassPathTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -5,6 +5,8 @@
import java.net.URL;
import java.util.List;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -18,11 +20,9 @@
import org.eclipse.jdt.core.JavaCore;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.test.util.TestProjectProvider;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.framework.Bundle;
-import junit.framework.TestCase;
-
/**
* Automatic test for JBIDE-1811.
* Checks that EclipseResourceUtil.getClassPath(IProject)
@@ -53,7 +53,7 @@
project1.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
project2.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
IJavaProject jp = JavaCore.create(project2);
IClasspathEntry[] es = jp.getRawClasspath();
@@ -70,7 +70,7 @@
jp.setRawClasspath(esn, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testGetClassPath() throws CoreException, IOException {
Modified: trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.test/META-INF/MANIFEST.MF 2008-10-14 19:14:10 UTC (rev 10838)
@@ -8,7 +8,8 @@
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.junit,
- org.jboss.tools.common
+ org.jboss.tools.common,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Provide-Package: org.jboss.tools.common.test.util
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.common.reporting.test,
Modified: trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.test/src/org/jboss/tools/common/test/util/TestProjectProvider.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -10,30 +10,25 @@
******************************************************************************/
package org.jboss.tools.common.test.util;
-import java.io.File;
import java.io.IOException;
-import java.net.URL;
+import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceRunnable;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
-import org.jboss.tools.common.test.CommonAllTests;
import org.jboss.tools.common.util.FileUtil;
-import org.osgi.framework.Bundle;
+import org.jboss.tools.test.util.JobUtils;
+import org.jboss.tools.test.util.ResourcesUtils;
/**
* Test plugins may define test projects to be added
@@ -59,80 +54,36 @@
* @throws Exception
*/
public TestProjectProvider(String bundleName, String projectPath, String name, boolean makeCopy) throws CoreException {
- if(projectPath == null) {
- projectPath = "/projects/" + name;
- } else if(name == null) {
- name = projectPath.substring(projectPath.lastIndexOf('/')+1);
+ try {
+ if( null == projectPath ) {
+ project = ResourcesUtils.importProject(bundleName, "projects" + Path.SEPARATOR + name, null);
+ } else {
+ project = ResourcesUtils.importProject(bundleName, projectPath, null);
+ }
+ } catch (IOException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
+ } catch (InvocationTargetException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
+ } catch (InterruptedException e) {
+ throw new CoreException(new Status(Status.ERROR,bundleName,e.getMessage(),e));
}
- this.makeCopy = makeCopy;
- init(bundleName, projectPath, name);
}
public IProject getProject() {
return project;
}
- private void init(String bundleName, String projectPath, String name) throws CoreException {
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
- if(p.exists()) {
- project = p;
- if(!p.isOpen()) {
- project.open(new NullProgressMonitor());
- System.out.println("open");
- }
- return;
- }
-
- Bundle bundle = Platform.getBundle(bundleName);
- URL url = null;
- try {
- url = FileLocator.resolve(bundle.getEntry(projectPath));
- } catch (IOException e) {
- String msg = "Cannot find project " + name + " in " + bundleName;
- IStatus status = new Status(IStatus.ERROR, CommonAllTests.PLUGIN_ID, msg, e);
- throw new CoreException(status);
- }
- String location = url.getFile();
- if(makeCopy) {
- IPath root = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- File destination = new File(root.toFile(), name);
- FileUtil.copyDir(new File(location), destination, true);
- importExistingProject(p, destination.getAbsolutePath(), name);
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } else {
- importExistingProject(p, location, name);
- }
- if(p.exists()) {
- project = p;
- }
- }
-
- static void importExistingProject(IProject project, String location, String name) throws CoreException {
- IPath path = new Path(location).append(".project");
- IProjectDescription description = ResourcesPlugin.getWorkspace().loadProjectDescription(path);
- description.setName(name);
- try {
- project.create(description, new NullProgressMonitor());
- project.open(IResource.BACKGROUND_REFRESH, new NullProgressMonitor());
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- } catch (Exception e) {
- throw new RuntimeException("Cannot create project " + name + " from " + location, e);
- }
- }
-
public void dispose() throws CoreException {
if(project == null || !project.exists()) return;
- ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- IPath loc = project.getLocation();
- project.close(new NullProgressMonitor());
- project.delete(false, true, new NullProgressMonitor());
- if(makeCopy) {
- FileUtil.remove(loc.toFile());
- }
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- }
- }, new NullProgressMonitor());
+ boolean oldAutoBuilding = true;
+ try {
+ oldAutoBuilding = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
+ project.delete(true, null);
+ JobUtils.waitForIdle();
+ } finally {
+ ResourcesUtils.setBuildAutomatically(oldAutoBuilding);
+ }
}
TestDescriptionFactory tests = null;
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-14 19:14:10 UTC (rev 10838)
@@ -15,11 +15,6 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.tools.common.verification.verifybuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp 2008-10-14 19:14:10 UTC (rev 10838)
@@ -1,2 +0,0 @@
-<jsp:forward page="forward/forwardHiperlinkPage2Tests.jsp"></jsp:forward>
-<jsp:forward page="forwardHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Deleted: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp 2008-10-14 19:14:10 UTC (rev 10838)
@@ -1,2 +0,0 @@
-<jsp:forward page="include/includeHiperlinkPage2Tests.jsp"></jsp:forward>
-<jsp:forward page="includeHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/model/helpers/converter/OpenTagLib.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -25,18 +25,19 @@
if(uri.length() == 0) return JSFUIMessages.URI_ISNOT_SPECIFIED;
XModelObject t = findTagLib(model, uri);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_TAG_LIBRARY, uri);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
if(tag != null) {
if(tag.length() == 0) return JSFUIMessages.TAG_ISNOT_SPECIFIED;
t = findTag(t, tag);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_TAG_IN_LIBRARY, tag, uri);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
}
- FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
if(attribute != null) {
if(attribute.length() == 0) return JSFUIMessages.ATTRIBUTE_ISNOT_SPECIFIED;
t = findAttribute(t, attribute);
if(t == null) return NLS.bind(JSFUIMessages.CANNOT_FIND_ATTRIBUTE_IN_TAG, attribute, tag);
+ FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
}
- FindObjectHelper.findModelObject(t, FindObjectHelper.IN_EDITOR_ONLY);
return null;
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jsf/tests/org.jboss.tools.jsf.text.ext.test/src/org/jboss/tools/jsf/text/ext/test/ELExprPartitionerTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -33,13 +33,11 @@
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.ui.internal.editor.EditorModelUtil;
-import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.jsf.text.ext.hyperlink.JSPExprHyperlinkPartitioner;
-import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class ELExprPartitionerTest extends TestCase {
TestProjectProvider provider = null;
@@ -72,8 +70,9 @@
}
public void testELExprPartitioner() {
- try { EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) {
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
assertNull("An exception caught: " + e.getMessage(), e);
}
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -18,7 +18,7 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class ContentAssistantTestCase extends TestCase {
protected IProject project = null;
@@ -31,7 +31,7 @@
protected void openEditor(String fileName) {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
@@ -61,7 +61,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();;
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1704Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -6,7 +6,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
@@ -15,7 +14,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide1704Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -52,7 +51,7 @@
public void testJsfJspJbide1704 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide1717Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -8,11 +8,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide1717Test extends ContentAssistantTestCase {
@@ -90,7 +89,7 @@
assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JsfJspJbide2437Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -14,7 +14,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JsfJspJbide2437Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -51,7 +51,7 @@
public void testJsfJspJbide2437 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1641Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -6,11 +6,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JstJspJbide1641Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -98,7 +97,7 @@
assertTrue("The proposal to apply not found.", bPropoosalToApplyFound);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/JstJspJbide1759Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -9,11 +9,10 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class JstJspJbide1759Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -51,7 +50,7 @@
public void testJstJspJbide1641() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -107,7 +106,7 @@
assertFalse("Content Assistant returned no proposals of type CustomCompletionProposal.",customCompletionProposals.isEmpty());
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.jsp.test/src/org/jboss/tools/jst/jsp/test/ca/StrutsJspJbide1648Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -6,10 +6,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class StrutsJspJbide1648Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -45,7 +44,7 @@
public void testStrutsJspJbide1648() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
Modified: trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/jst/tests/org.jboss.tools.jst.web.test/src/org/jboss/tools/jst/web/test/WebContentAssistProviderTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -47,7 +47,6 @@
}
public void testJsfBeanPropertyList() {
- waitForJobs();
// seam beans list
List beanList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_BEAN_PROPERTIES, "facesManagedBean", new Properties());
assertTrue("Bean property list does not contain Managed bean property in XModel.", beanList.contains("property1"));
@@ -61,17 +60,8 @@
List bundlePropertyList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_BUNDLE_PROPERTIES, "org.jboss.seam.example.numberguess.test", null);
assertTrue("Bundle property list does not contain expected property in XModel.", bundlePropertyList.contains("bundleProperty1"));
}
-
- void waitForJobs() {
- try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
- fail("Interrupted");
- }
- }
public void testTlds() {
- waitForJobs();
List tldList = webPromptingProvider.getList(projectModel, WebPromptingProvider.JSF_GET_TAGLIBS, "", null);
assertTrue("TLD list does not contain expected TLD in XModel.", tldList.contains("http://jboss.com/products/seam/taglib"));
}
@@ -81,7 +71,6 @@
project = provider.getProject();
project.refreshLocal(IResource.DEPTH_INFINITE, null);
project.build(IncrementalProjectBuilder.FULL_BUILD,null);
- waitForJobs();
XModelObject xmo = EclipseResourceUtil.getObjectByResource(project);
assertNotNull("Can't get XModel Object for test project.", xmo);
projectModel = xmo.getModel();
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -21,8 +21,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.model.XJob;
-import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.BeanType;
import org.jboss.tools.seam.core.BijectedAttributeType;
import org.jboss.tools.seam.core.IBijectedAttribute;
@@ -52,7 +50,6 @@
import org.jboss.tools.seam.internal.core.scanner.lib.LibraryScanner;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class ScannerTest extends TestCase {
IProject project = null;
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamBigProjectTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -16,6 +16,8 @@
import java.util.List;
import java.util.Set;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IncrementalProjectBuilder;
@@ -28,11 +30,9 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.framework.Bundle;
-import junit.framework.TestCase;
-
/**
* Test checks that loading Seam model does not depend as N*N on the number of components N.
* It works as follows:
@@ -58,7 +58,7 @@
File template = getTemplateFile();
SeamBigProjectGenerator g = new SeamBigProjectGenerator();
g.generate(folder, template);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
//To ensure that the project is built.
project.build(IncrementalProjectBuilder.INCREMENTAL_BUILD, new NullProgressMonitor());
}
@@ -121,7 +121,7 @@
ISeamProject sp = getSeamProject();
SeamProject impl = (SeamProject)sp;
if(impl != null) impl.clearStorage();
- EditorTestHelper.joinJobs(1000, 10000, 500);
+ JobUtils.waitForIdle();
provider.dispose();
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -10,8 +10,6 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
-import java.lang.reflect.InvocationTargetException;
-
import junit.framework.TestCase;
import org.eclipse.core.resources.IProject;
@@ -19,17 +17,11 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.refactoring.RenameSupport;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
/**
* @author V.Kabanovich
@@ -58,14 +50,13 @@
projectWAR.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
projectEJB.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
private ISeamProject getSeamProject(IProject project) throws CoreException {
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
-
+ JobUtils.waitForIdle();
ISeamProject seamProject = null;
/*
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamProjectPropertyValidatorTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -15,8 +15,8 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
/**
@@ -59,8 +59,8 @@
pref.put(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, "invalidConnectionName");
pref.flush();
- EditorTestHelper.joinBackgroundActivities();
- EditorTestHelper.runEventQueue(2000);
+ JobUtils.waitForIdle();
+ JobUtils.delay(2000);
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -16,7 +16,6 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -31,8 +30,9 @@
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.validation.ISeamValidator;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.AbstractResourceMarkerTest;
public class SeamValidatorsTest extends AbstractResourceMarkerTest {
@@ -57,18 +57,20 @@
project = setup.importProject();
}
this.project = project.getProject();
- this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void tearDown() throws Exception {
- if(project != null){
-// project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
- project.close(new NullProgressMonitor());
- project.delete(true, new NullProgressMonitor());
- project = null;
- EditorTestHelper.joinBackgroundActivities();
+ boolean autoBuild = ResourcesUtils.setBuildAutomatically(false);
+ try {
+ if(project != null){
+ JobUtils.waitForIdle();
+ project.delete(true, new NullProgressMonitor());
+ project = null;
+ JobUtils.waitForIdle();
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(autoBuild);
}
}
@@ -123,13 +125,6 @@
public void testJiraJbide1631() throws CoreException {
// Test for http://jira.jboss.com/jira/browse/JBIDE-1631
IFile jbide1631XHTMLFile = project.getFile("WebContent/JBIDE-1631.xhtml");
- IFile jbide1631XHTMLFileWithFoo = project.getFile("WebContent/JBIDE-1631.1");
- try{
- jbide1631XHTMLFile.setContents(jbide1631XHTMLFileWithFoo.getContents(), true, false, new NullProgressMonitor());
- }catch(Exception ex){
- JUnitUtils.fail("Error in changing 'JBIDE-1631.xhtml' content to " +
- "'JBIDE-1631.1'", ex);
- }
refreshProject(project);
assertMarkerIsCreated(jbide1631XHTMLFile, null, "\"foo1\" cannot be resolved", 16 );
assertMarkerIsCreated(jbide1631XHTMLFile, null, "\"foo2\" cannot be resolved", 16 );
@@ -848,10 +843,8 @@
}
private void refreshProject(IProject project){
- waitForJob();
+ JobUtils.delay(1000);
+ JobUtils.waitForIdle();
+ JobUtils.delay(500);
}
-
- public static void waitForJob() {
- EditorTestHelper.joinJobs(1000,10000,500);
- }
}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SerializationTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -4,6 +4,8 @@
import java.util.Properties;
import java.util.Set;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.NullProgressMonitor;
@@ -21,12 +23,10 @@
import org.jboss.tools.seam.internal.core.SeamXmlComponentDeclaration;
import org.jboss.tools.seam.internal.core.SeamXmlFactory;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.w3c.dom.Element;
-import junit.framework.TestCase;
-
public class SerializationTest extends TestCase {
IProject project = null;
boolean makeCopy = true;
@@ -39,7 +39,7 @@
project = ResourcesUtils.importProject(
"org.jboss.tools.seam.core.test","/projects/TestScanner" , new NullProgressMonitor());
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
protected void tearDown() throws Exception {
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/refactoring/SeamPropertyRefactoringTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -52,9 +52,9 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author Alexey Kazakov
@@ -110,7 +110,7 @@
private ISeamProject loadSeamProject(IProject project) throws CoreException {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null", seamProject);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return seamProject;
}
@@ -296,7 +296,7 @@
JUnitUtils.fail("Exception during perform folder renaming: " + folderPath, e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
IPath path = new Path(folderPath);
String newFolderPath = path.removeLastSegments(1).append(newFolderName).toString();
@@ -370,7 +370,7 @@
} catch (InvocationTargetException e) {
JUnitUtils.fail("Rename failed", e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
private IFolder moveFolder(String folderPath, String destinationFolderPath) throws CoreException {
@@ -423,7 +423,7 @@
JUnitUtils.fail("Exception during perform folder moving: " + folderPath, e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
String newFolderPath = destination.getFullPath().append(resource.getName()).toString();
resource = ResourcesPlugin.getWorkspace().getRoot().findMember(newFolderPath);
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1645Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -6,12 +6,11 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class SeamELContentAssistJbide1645Test extends ContentAssistantTestCase {
TestProjectProvider provider = null;
@@ -83,7 +82,7 @@
}
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistJbide1676Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -26,7 +26,7 @@
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class SeamELContentAssistJbide1676Test extends TestCase {
TestProjectProvider provider = null;
@@ -224,7 +224,7 @@
public void testSeamELContentAssistJbide1676() {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -256,7 +256,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -18,7 +18,6 @@
import org.eclipse.jface.text.ITextViewer;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionList;
@@ -29,10 +28,8 @@
import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
-import sun.management.counter.Units;
-
public class SeamELContentAssistTest extends ContentAssistantTestCase {
TestProjectProvider provider = null;
boolean makeCopy = false;
@@ -78,7 +75,7 @@
}catch(Exception e){
JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.1'", e);
}
- EditorTestHelper.joinJobs(1000,10000,500);
+ JobUtils.waitForIdle();
checkProposals("/WebContent/varAttributes.xhtml", 458, new String[]{"test.name"}, false);
checkProposals("/WebContent/varAttributes.xhtml", 640, new String[]{"item.name"}, false);
@@ -88,7 +85,7 @@
}catch(Exception e){
JUnitUtils.fail("Error during changing 'TestComponentForVarAttributes.java' content to 'TestComponentForVarAttributes.2'", e);
}
- EditorTestHelper.joinJobs(1000,10000,500);
+ JobUtils.waitForIdle();
}
private static final String[] VALID_SEAM_EL_PROPOSALS = new String[] {
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/hyperlink/SeamViewHyperlinkPartitionerTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -31,8 +31,8 @@
import org.jboss.tools.common.text.ext.hyperlink.IHyperlinkRegion;
import org.jboss.tools.common.text.ext.util.AxisUtil;
import org.jboss.tools.seam.text.ext.hyperlink.SeamViewHyperlinkPartitioner;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
public class SeamViewHyperlinkPartitionerTest extends TestCase {
@@ -63,7 +63,7 @@
public void testSeamViewPartitioner() throws CoreException {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/preferences/SeamSettingsPreferencesPageTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -33,8 +33,8 @@
import org.jboss.tools.seam.ui.preferences.SeamPreferencesMessages;
import org.jboss.tools.seam.ui.preferences.SeamSettingsPreferencePage;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.osgi.framework.Bundle;
/**
@@ -58,7 +58,7 @@
assertNotNull(PROJECT_NAME + " project is not imported.", project);
this.project = project.getProject();
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testSettingsPage() throws Exception {
@@ -99,7 +99,7 @@
dialog.close();
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
assertNotNull("Can't load seam project. It seems seam nature was not added to rpoject by seam settings page.", seamProject);
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -36,7 +36,6 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.navigator.CommonNavigator;
-import org.jboss.tools.jst.web.ui.WebDevelopmentPerspectiveFactory;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.SeamCorePlugin;
@@ -44,8 +43,8 @@
import org.jboss.tools.seam.ui.SeamPerspectiveFactory;
import org.jboss.tools.seam.ui.views.actions.SeamViewLayoutActionGroup.SeamContributionItem;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
*
@@ -73,7 +72,7 @@
assertTrue("Cannot find components.xml in test project", componentsFile != null && componentsFile.exists());
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
public void testAddComponentInXmlFile() throws CoreException{
@@ -155,7 +154,7 @@
seamPackage = findSeamPackage(tree, "myPackage");
assertTrue("Expected package 'myPackage' was not found it tree",
seamPackage!=null);
- EditorTestHelper.runEventQueue(1000);
+ JobUtils.delay(1000);
component = findSeamComponent(seamPackage, "myPackage.myTextComponent");
assertTrue("Expected component 'myPackage.myTextComponent' not found " +
"after renaming",component!=null);
@@ -175,7 +174,7 @@
navigator.getCommonViewer().expandAll();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
seamPackage = findSeamPackage(tree, "myNewPackage");
assertTrue("Expected package 'myNewPackage' was not found it tree after " +
@@ -191,7 +190,7 @@
CommonNavigator navigator = getSeamComponentsView();
navigator.getCommonViewer().expandAll();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
Tree tree = navigator.getCommonViewer().getTree();
ISeamPackage seamPackage = findSeamPackage(tree, "myNewPackage");
@@ -538,7 +537,7 @@
System.out.println("Refresh project "+count);
try {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (CoreException e) {
JUnitUtils.fail("Cannot build test Project", e);
break;
@@ -547,7 +546,7 @@
count++;
if(count > NUMBER_OF_REFRESHES) break;
}
- EditorTestHelper.runEventQueue(1000);
+ JobUtils.delay(1000);
}
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTestSetup.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -17,9 +17,9 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.jst.web.ui.WebDevelopmentPerspectiveFactory;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author eskimo
@@ -45,16 +45,16 @@
WorkbenchUtils.getWorkbench().showPerspective(
WebDevelopmentPerspectiveFactory.PERSPECTIVE_ID,
WorkbenchUtils.getWorkbench().getActiveWorkbenchWindow());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
project = ResourcesUtils.importProject(Platform.getBundle("org.jboss.tools.seam.ui.test"), "/projects/TestComponentView", new NullProgressMonitor());
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
/* (non-Javadoc)
* @see junit.extensions.TestSetup#tearDown()
*/
protected void tearDown() throws Exception {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();;
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
try {
project.delete(true,true, null);
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/AbstractSeamNewOperationTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -52,7 +52,7 @@
import org.jboss.tools.seam.ui.wizard.SeamEntityWizard.SeamEntityCreateOperation;
import org.jboss.tools.seam.ui.wizard.SeamFormWizard.SeamFormCreateOperation;
import org.jboss.tools.test.util.JUnitUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
import org.osgi.service.prefs.BackingStoreException;
abstract public class AbstractSeamNewOperationTest extends AbstractSeamFacetTest {
@@ -86,11 +86,11 @@
protected void setUp() throws Exception {
super.setUp();
try {
- EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
- EditorTestHelper.runEventQueue(3000);
+ JobUtils.delay(3000);
}
abstract protected IProject getProject();
@@ -121,7 +121,7 @@
protected ISeamProject loadSeamProject(IProject project) throws CoreException {
ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, true);
assertNotNull("Seam project for " + project.getName() + " is null", seamProject);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return seamProject;
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/OpenSeamComponentDialogTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -14,17 +14,15 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ui.PlatformUI;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog;
import org.jboss.tools.seam.ui.wizard.OpenSeamComponentDialog.SeamComponentWrapper;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author Daniel Azarov
@@ -50,19 +48,19 @@
this.project = project.getProject();
this.project.build(IncrementalProjectBuilder.FULL_BUILD, null);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
@Override
protected void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
if(project != null){
project.close(new NullProgressMonitor());
project.delete(true, new NullProgressMonitor());
project = null;
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
} finally {
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
@@ -95,7 +93,7 @@
dialog.beginTest();
if(wait){
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}catch(Exception ex){
ex.printStackTrace();
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12EARNewOperationTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -23,8 +23,9 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.ui.wizard.IParameter;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.WorkbenchUtils;
public class Seam12EARNewOperationTest extends AbstractSeamNewOperationTest {
@@ -59,7 +60,7 @@
createSeamEarProject(SEAM_EAR_PROJECTNAME);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
@@ -88,7 +89,7 @@
}
protected void tearDown() throws Exception {
- EditorTestHelper.closeAllEditors();
+ WorkbenchUtils.closeAllEditors();
super.tearDown();
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/wizard/Seam12WARNewOperationTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -24,8 +24,9 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.ui.wizard.IParameter;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ProjectImportTestSetup;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.WorkbenchUtils;
public class Seam12WARNewOperationTest extends AbstractSeamNewOperationTest {
private static final String SEAM_WAR_PROJECTNAME = "seam_war";
@@ -53,7 +54,7 @@
createSeamWarProject(SEAM_WAR_PROJECTNAME);
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
JUnitUtils.fail(e.getMessage(), e);
}
@@ -74,7 +75,7 @@
protected void tearDown() throws Exception {
- EditorTestHelper.closeAllEditors();
+ WorkbenchUtils.closeAllEditors();
super.tearDown();
Modified: trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java
===================================================================
--- trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/struts/tests/org.jboss.tools.struts.text.ext.test/src/org/jboss/tools/struts/text/tests/hyperlink/StrutsJbide1762Test.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -26,7 +26,7 @@
import org.jboss.tools.common.model.ui.texteditors.XMLTextEditorComponent;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.jst.jsp.test.TestUtil;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
+import org.jboss.tools.test.util.JobUtils;
public class StrutsJbide1762Test extends TestCase {
TestProjectProvider provider = null;
@@ -61,7 +61,7 @@
public void testStrutsJbide1762 () {
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
}
@@ -93,7 +93,7 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
@@ -141,7 +141,7 @@
}
try {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
} catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -19,7 +19,6 @@
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
* @author eskimo
@@ -55,9 +54,9 @@
public IProject[] importProjects() throws Exception {
IProject[] projects = new IProject[projectPaths.length];
for (int i = 0; i < projectPaths.length; i++) {
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
projects[i] = (IProject)ResourcesUtils.importProject(bundleName, projectPaths[i]);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
return projects;
}
@@ -71,7 +70,7 @@
} catch (ResourceException e) {
JUnitUtils.fail(e.getMessage(), e);
}
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return result;
}
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -100,4 +100,8 @@
}
return part;
}
+
+ public static void closeAllEditors() {
+ getWorkbenchActivePage().closeAllEditors(false);
+ }
}
\ No newline at end of file
Modified: trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java
===================================================================
--- trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-10-14 18:50:05 UTC (rev 10837)
+++ trunk/ws/tests/org.jboss.tools.ws.core.test/src/org/jboss/tools/ws/core/test/command/AbstractJBossWSCommandTest.java 2008-10-14 19:14:10 UTC (rev 10838)
@@ -60,7 +60,6 @@
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
-import org.jboss.tools.test.util.xpl.EditorTestHelper;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
public abstract class AbstractJBossWSCommandTest extends TestCase {
@@ -110,15 +109,19 @@
createServer(JBOSS_RUNTIME_42, JBOSS_SERVER_42, JBOSS_AS_42_HOME, "default");
- try { EditorTestHelper.joinBackgroundActivities(); }
- catch (Exception e) { JUnitUtils.fail(e.getMessage(), e); }
- EditorTestHelper.runEventQueue(3000);
+ try {
+ JobUtils.waitForIdle();
+ } catch (Exception e) {
+ JUnitUtils.fail(e.getMessage(), e);
+ }
+
+ JobUtils.delay(3000);
}
public IProject createProject(String prjName) throws CoreException {
provider = new TestProjectProvider(BUNDLE,"/projects/"+prjName , prjName, true);
IProject prj = provider.getProject();
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
return prj;
}
17 years, 2 months
JBoss Tools SVN: r10837 - in trunk/jsf: tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-14 14:50:05 -0400 (Tue, 14 Oct 2008)
New Revision: 10837
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplateHelper.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
Log:
Minor changes (a class renamed)
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java 2008-10-14 17:30:12 UTC (rev 10836)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java 2008-10-14 18:50:05 UTC (rev 10837)
@@ -1,579 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.richfaces.template;
-
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.WeakHashMap;
-
-import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
-import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
-import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
-import org.jboss.tools.vpe.editor.util.Constants;
-import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
-import org.mozilla.interfaces.nsIDOMDocument;
-import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
-
-/**
- * @author yradtsevich
- *
- */
-public class RichFacesComboBoxCreator {
- private static final WeakHashMap<Node, Object> expandedComboBoxes = new WeakHashMap<Node, Object>();
- private static final String DISABLED_ATTR_NAME = "disabled"; //$NON-NLS-1$
- private static final String BUTTON_ICON_CLASSES_DISABLED =
- "rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"; //$NON-NLS-1$
- private static final String BUTTON_ICON_CLASSES =
- "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"; //$NON-NLS-1$
- private static final String SECOND_DIV = "secondDiv"; //$NON-NLS-1$
- private static final String THIRD_DIV = "thirdDiv"; //$NON-NLS-1$
- private static final String THIRD_EMPTY_DIV = "thirdEmptyDiv"; //$NON-NLS-1$
- private static final String TEXT_FIELD = "textField"; //$NON-NLS-1$
- private static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
-
- /** CSS_FILE_NAME. */
- private static final String CSS_FILE_NAME = "comboBox/comboBox.css"; //$NON-NLS-1$
-
- /** The Constant DEFAULT_LIST_WIDTH. */
- private static final String DEFAULT_LIST_WIDTH = "150px"; //$NON-NLS-1$
-
- /** IMAGE_NAME_DOWN. */
- private static final String IMAGE_NAME_DOWN = "/comboBox/down.gif"; //$NON-NLS-1$
-
- /** The Constant BUTTON_BACKGROUND. */
- private static final String BUTTON_BACKGROUND = "buttonBackground"; //$NON-NLS-1$
-
- /** The Constant STYLE_EXT. */
- private static final String STYLE_EXT = "richFacesComboBox"; //$NON-NLS-1$
-
- private static final int LIST_ITEM_HEIGHT_DEFAULT_VALUE = 18;
-
- /** The style clasess. */
- private final Map<String, String> styleClasess = new HashMap<String, String>();
-
- /** The source align. */
- // Commented because of not working alignment in RichFaces implementation
- // private String sourceAlign;
-
- /** The source button style. */
- private String sourceButtonStyle;
-
- /** The source default label. */
- private String sourceDefaultLabel = null;
-
- /** The source list height. */
- private String sourceListHeight;
-
- /** The source list width. */
- private String sourceListWidth;
-
- /** The source value. */
- private String sourceValue;
-
- /** The source width. */
- private String sourceWidth;
-
- /** The source style. */
- private String sourceStyle;
-
- /** The source input style. */
- private String sourceInputStyle;
-
- /** The source input class. */
- private String sourceInputClass;
-
- /** The source list style. */
- private String sourceListStyle;
-
- /** The source list class. */
- private String sourceListClass;
-
- /** The source item class. */
- private String sourceItemClass;
-
-
- /** Source button icon **/
- private String sourceButtonIcon;
-
- private String sourceButtonIconInactive;
-
- private String sourceButtonIconDisabled;
-
- private boolean disabled;
- private boolean expanded;
-
- private final VpePageContext pageContext;
- private final Node sourceNode;
- private final nsIDOMDocument visualDocument;
- private final VpeCreationData vpeCreationData;
-
- /**
- * The Constructor.
- */
- public RichFacesComboBoxCreator(final VpePageContext pageContext, final Node sourceNode,
- final nsIDOMDocument visualDocument) {
- this.pageContext = pageContext;
- this.sourceNode = sourceNode;
- this.visualDocument = visualDocument;
- initDefaultClasses();
- vpeCreationData = create();
- }
-
- /**
- * Calculate with for div.
- *
- * @param with the with
- * @param minus the minus
- *
- * @return the string
- */
- private static String calculateWithForDiv(final String with, final int minus) {
- try {
- Integer intValue = 0;
- if (with.endsWith("px")) { //$NON-NLS-1$
- intValue = Integer.parseInt(with.substring(0, with.length() - 2));
- } else {
- intValue = Integer.parseInt(with);
- }
- return String.valueOf((intValue - minus)) + "px"; //$NON-NLS-1$
- } catch (final NumberFormatException e) {
- return with;
- }
-
- }
- public VpeCreationData getVpeCreationData() {
- return vpeCreationData;
- }
-
- /**
- * Create.
- *
- * @param visualDocument the visual document
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return the vpe creation data
- */
- private VpeCreationData create() {
- ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, STYLE_EXT);
-
- final Element source = (Element) sourceNode;
-
- prepareData(source);
- final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- //Fix https://jira.jboss.org/jira/browse/JBIDE-2430 issue with resizement.
- rootDiv.setAttribute(HTML.ATTR_STYLE,
- HTML.STYLE_PARAMETER_WIDTH + Constants.COLON+sourceWidth);
- final nsIDOMElement comboBoxDiv = visualDocument.createElement(HTML.TAG_DIV);
- final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- // Commented because of not working alignment in RichFaces implementation
- // comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
- // secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
-
-
- //comboBoxDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
- secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_DIV));
- String secondDivSubStyle = "; position: {0}; z-index: {1} ;"; //$NON-NLS-1$
-
- if (expanded) {
- secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "relative", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "static", "0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- comboBoxDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
- + Constants.SEMICOLON + secondDivSubStyle);
- secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
- + Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
- final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
- thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_DIV));
- thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceWidth
- + "; z-index: 1;"); //$NON-NLS-1$
- final nsIDOMElement textField = visualDocument.createElement(HTML.TAG_INPUT);
- textField.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
-
- textField.setAttribute(HTML.ATTR_CLASS,
- styleClasess.get(TEXT_FIELD) + Constants.WHITE_SPACE + sourceInputClass);
- textField.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
- textField.setAttribute(HTML.ATTR_STYLE,
- HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + calculateWithForDiv(sourceWidth, 17)
- + Constants.SEMICOLON + sourceInputStyle);
- String value = null;
- if (ComponentUtil.isNotBlank(sourceDefaultLabel)) {
- value = sourceDefaultLabel;
- } else if (ComponentUtil.isNotBlank(sourceValue) && ComponentUtil.isBlank(sourceDefaultLabel)) {
- value = sourceValue;
- }
-
- if (value != null) {
- textField.setAttribute(RichFaces.ATTR_VALUE, value);
- }
- final nsIDOMElement buttonBackground = visualDocument.createElement(HTML.TAG_INPUT);
- buttonBackground.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
-
- if (disabled) {
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES_DISABLED);
- } else {
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
- }
-
- buttonBackground.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_BACKGROUND));
- buttonBackground.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- buttonBackground.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- if (sourceButtonStyle != null) {
- buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
- }
-
- final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
- buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
- ;
- buttonIcon.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_ICON));
- buttonIcon.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- buttonIcon.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- if (sourceButtonStyle != null) {
- buttonIcon.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
- }
-
- String actualSourceButton;
- if (disabled) {
- actualSourceButton = sourceButtonIconDisabled;
- } else if (expanded) {
- actualSourceButton = sourceButtonIcon;
- } else {
- actualSourceButton = sourceButtonIconInactive;
- }
-
- if (ComponentUtil.isNotBlank(actualSourceButton) && (actualSourceButton != IMAGE_NAME_DOWN)) {
- String buttonIconPath = VpeStyleUtil.addFullPathToImgSrc(actualSourceButton, pageContext, true);
- buttonIconPath = buttonIconPath.replace('\\', '/');
- final String style = "background-image: url(" + buttonIconPath + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- buttonIcon.setAttribute(HTML.ATTR_STYLE, buttonIcon.getAttribute(HTML.ATTR_STYLE) + style);
- }
- final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
- forthEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
- forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
- + calculateWithForDiv(sourceWidth, 10));
- forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts")); //$NON-NLS-1$
-
- rootDiv.appendChild(comboBoxDiv);
- comboBoxDiv.appendChild(secondDiv);
-
- secondDiv.appendChild(thirdDiv);
- if (expanded) {
- comboBoxDiv.appendChild(createToogleDiv());
- }
- thirdDiv.appendChild(textField);
- thirdDiv.appendChild(buttonBackground);
- thirdDiv.appendChild(buttonIcon);
- thirdDiv.appendChild(forthEmptyDiv);
-
- final VpeCreationData creationData = new VpeCreationData(rootDiv);
-
- return creationData;
- }
-
- /**
- * Creates the toogle div.
- *
- * @param visualDocument the visual document
- * @param pageContext the page context
- * @param source the source
- *
- * @return the ns IDOM node
- */
- private nsIDOMNode createToogleDiv() {
-
- final nsIDOMElement thirdEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, sourceListStyle + Constants.SEMICOLON
- + " z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
- thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS,
- styleClasess.get(THIRD_EMPTY_DIV) + " " + sourceListClass); //$NON-NLS-1$
- thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE,
- "z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
-
- final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- final nsIDOMElement positionDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- positionDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-position"); //$NON-NLS-1$
-
- final nsIDOMElement decorationDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- decorationDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-decoration"); //$NON-NLS-1$
- // decorationDiv.setAttribute(HTML.ATTR_STYLE,
- // "height: 54px; width: 208px;");
-
- final nsIDOMElement scrollDiv = visualDocument.createElement(HTML.TAG_DIV);
- scrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-scroll"); //$NON-NLS-1$
- final List<Element> items = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
- int defaultHeight = LIST_ITEM_HEIGHT_DEFAULT_VALUE;
-
- if((items!=null) && (items.size() > 1)){
- defaultHeight = ((items.size() - 1)* LIST_ITEM_HEIGHT_DEFAULT_VALUE);
- }
-
- final String listHeight = ComponentUtil.isNotBlank(sourceListHeight)
- ? sourceListHeight
- : String.valueOf(defaultHeight) + "px"; //$NON-NLS-1$
- scrollDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_MAX_HEIGHT
- + Constants.COLON + listHeight + Constants.SEMICOLON
- + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
- + calculateWithForDiv(sourceListWidth, 2));
-
- final List<Element> selectItems = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
-
- if (selectItems.size() > 0) {
- for (final Element e : selectItems) {
- scrollDiv.appendChild(createSelectItem(e));
- }
- }
-
- shadovDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow"); //$NON-NLS-1$
-
- final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
- table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
- String width = Constants.EMPTY;
- try {
-
- int w = ComponentUtil.parseWidthHeightValue(sourceListWidth);
- w += 7;
- width = String.valueOf(w);
- } catch (final ParseException e) {
- width = "217"; //$NON-NLS-1$
- }
- table.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH
- + Constants.COLON + width + Constants.PIXEL
- + Constants.SEMICOLON + HTML.STYLE_PARAMETER_HEIGHT
- + Constants.COLON + "63px;"); //$NON-NLS-1$
-
- final nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
- final nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
-
- final nsIDOMElement tr1_td1 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr1_td2 = visualDocument.createElement(HTML.TAG_TD);
-
- final nsIDOMElement tr2_td1 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr2_td2 = visualDocument.createElement(HTML.TAG_TD);
-
- final nsIDOMElement tr1_td1_img = visualDocument.createElement(HTML.TAG_IMG);
- final nsIDOMElement tr1_td2_img = visualDocument.createElement(HTML.TAG_IMG);
-
- final nsIDOMElement tr2_td1_img = visualDocument.createElement(HTML.TAG_IMG);
- final nsIDOMElement tr2_td2_img = visualDocument.createElement(HTML.TAG_IMG);
-
- tr1_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tl"); //$NON-NLS-1$
- tr1_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tr"); //$NON-NLS-1$
-
- tr2_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-bl"); //$NON-NLS-1$
- tr2_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-br"); //$NON-NLS-1$
-
- setUpImg(tr1_td1_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr1_td2_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr2_td1_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr2_td2_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
-
- thirdEmptyDiv.appendChild(shadovDiv);
- shadovDiv.appendChild(table);
- thirdEmptyDiv.appendChild(positionDiv);
- positionDiv.appendChild(decorationDiv);
- decorationDiv.appendChild(scrollDiv);
-
- table.appendChild(tr1);
- table.appendChild(tr2);
- tr1.appendChild(tr1_td1);
- tr1.appendChild(tr1_td2);
-
- tr2.appendChild(tr2_td1);
- tr2.appendChild(tr2_td2);
-
- tr1_td1.appendChild(tr1_td1_img);
- tr1_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr1_td2.appendChild(tr1_td2_img);
- tr1_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr2_td1.appendChild(tr2_td1_img);
- tr2_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr2_td2.appendChild(tr2_td2_img);
- tr2_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- return thirdEmptyDiv;
- }
-
- /**
- * Creates the select item.
- *
- * @param visualDocument the visual document
- * @param e the e
- *
- * @return the ns IDOM node
- */
- private nsIDOMNode createSelectItem(final Element e) {
- final nsIDOMElement item = visualDocument.createElement(HTML.TAG_SPAN);
-
- item.setAttribute(HTML.ATTR_CLASS, "rich-combobox-item " + sourceItemClass); //$NON-NLS-1$
- item.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
- return item;
- }
-
- /**
- * Inits the default classes.
- */
- private void initDefaultClasses() {
- styleClasess.put(SECOND_DIV, "rich-combobox-font rich-combobox"); //$NON-NLS-1$
- styleClasess.put(THIRD_DIV, "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$
- styleClasess.put(THIRD_EMPTY_DIV, "rich-combobox-list-cord"); //$NON-NLS-1$
- styleClasess.put(TEXT_FIELD, "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$
- styleClasess.put(BUTTON_BACKGROUND,
- "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
- styleClasess.put("forthEmptyDiv", "rich-combobox-strut rich-combobox-font"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Prepare data.
- *
- * @param source the source
- */
- private void prepareData(final Element source) {
- final AttributeMap attributeMap = new AttributeMap(source);
-
- // Commented because of not working alignment in RichFaces implementation
- // if (attributeMap.isBlank(RichFaces.ATTR_ALIGN)) {
- // this.sourceAlign = DEFAULT_ALIGN;
- // } else {
- // this.sourceAlign = attributeMap.getString(RichFaces.ATTR_ALIGN);
- // }
-
- if (attributeMap.isBlank(RichFaces.ATTR_LIST_WIDTH)) {
- sourceListWidth = DEFAULT_LIST_WIDTH;
- } else {
- sourceListWidth = attributeMap.getString(RichFaces.ATTR_LIST_WIDTH);
- }
-
- sourceListHeight = attributeMap.getString(RichFaces.ATTR_LIST_HEIGHT);
-
- if (attributeMap.isBlank(RichFaces.ATTR_WIDTH)) {
- sourceWidth = DEFAULT_LIST_WIDTH;
- } else {
- sourceWidth = attributeMap.getString(RichFaces.ATTR_WIDTH);
-
- if(sourceListWidth == DEFAULT_LIST_WIDTH) {
- sourceListWidth = sourceWidth;
- }
- }
-
- if (ComponentUtil.isNotBlank(sourceWidth) && (sourceWidth != DEFAULT_LIST_WIDTH)) {
- if(!sourceWidth.endsWith(Constants.PIXEL)){
- try {
- final int intValue = Integer.parseInt(sourceWidth);
- sourceWidth = String.valueOf(intValue)+Constants.PIXEL;
- } catch (final NumberFormatException e) {
- sourceListWidth = DEFAULT_LIST_WIDTH;
- }
- }
- }
-
- sourceDefaultLabel = attributeMap.getString("defaultLabel"); //$NON-NLS-1$
- sourceValue = attributeMap.getString( RichFaces.ATTR_VALUE);
-
- sourceButtonStyle = attributeMap.getString("buttonStyle"); //$NON-NLS-1$
-
- final String sourceStyleClasess = attributeMap.getString(RichFaces.ATTR_STYLE_CLASS);
-
- if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
- styleClasess.put(SECOND_DIV, styleClasess.get(SECOND_DIV) + " " + sourceStyleClasess); //$NON-NLS-1$
- }
-
- sourceStyle = attributeMap.getString(HTML.ATTR_STYLE);
- sourceInputStyle = attributeMap.getString("inputStyle"); //$NON-NLS-1$
- sourceInputClass = attributeMap.getString("inputClass"); //$NON-NLS-1$
- sourceListClass = attributeMap.getString("listClass"); //$NON-NLS-1$
- sourceListStyle = attributeMap.getString("listStyle"); //$NON-NLS-1$
- sourceItemClass = attributeMap.getString("itemClass"); //$NON-NLS-1$
-
- sourceButtonIcon = attributeMap.getString(BUTTON_ICON);
- sourceButtonIconInactive = attributeMap.getString("buttonIconInactive"); //$NON-NLS-1$
- sourceButtonIconDisabled = attributeMap.getString("buttonIconDisabled"); //$NON-NLS-1$
- disabled = isDisabled(attributeMap);
- expanded = isExpanded(source);
-
- if(ComponentUtil.isBlank(sourceButtonIcon)){
- sourceButtonIcon = IMAGE_NAME_DOWN;
- }
-
- }
-
- /**
- * Sets the up img.
- *
- * @param i *
- * @param width the width
- * @param height the height
- * @param img the img
- * @param j *
- * @param image the image
- * @param border the border
- * @param td1Img */
- protected static void setUpImg(final nsIDOMElement img, final int width, final int height,
- final int border, final String image) {
- ComponentUtil.setImg(img, image);
- img.setAttribute(HTML.ATTR_WIDTH, String.valueOf(width));
- img.setAttribute(HTML.ATTR_HEIGHT, String.valueOf(height));
- img.setAttribute(HTML.ATTR_BORDER, String.valueOf(border));
-
- }
-
- /**
- * Inverts <code>expanded</code> state of the ComboBox
- *
- * @param builder the builder
- * @param sourceNode the source node
- * @param toggleId the toggle id
- */
- public static void toggle(final VpeVisualDomBuilder builder, final Node sourceNode, final String toggleId) {
- AttributeMap attributes = new AttributeMap((Element)sourceNode);
- if (isDisabled(attributes) || isExpanded(sourceNode)) {
- expandedComboBoxes.remove(sourceNode);
- } else {
- expandedComboBoxes.put(sourceNode, null);
- }
- }
-
- public static void stopToggling(final Node sourceNode) {
- expandedComboBoxes.remove(sourceNode);
- }
-
- public static boolean isDisabled(final AttributeMap attributes) {
- return attributes.getBoolean(DISABLED_ATTR_NAME) == Boolean.TRUE;
- }
-
- private static boolean isExpanded(Node node) {
- return expandedComboBoxes.containsKey(node);
- }
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-14 17:30:12 UTC (rev 10836)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-14 18:50:05 UTC (rev 10837)
@@ -34,20 +34,20 @@
/**
* @see org.jboss.tools.vpe.editor.template.VpeToggableTemplate#toggle(org.jboss.tools.vpe.editor.VpeVisualDomBuilder, org.w3c.dom.Node, java.lang.String)
- * @see RichFacesComboBoxCreator#toggle(VpeVisualDomBuilder, Node, String)
+ * @see RichFacesComboBoxTemplateHelper#toggle(VpeVisualDomBuilder, Node, String)
*/
public void toggle(final VpeVisualDomBuilder builder, final Node sourceNode, final String toggleId) {
- RichFacesComboBoxCreator.toggle(builder, sourceNode, toggleId);
+ RichFacesComboBoxTemplateHelper.toggle(builder, sourceNode, toggleId);
}
/**
* @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
- * @see RichFacesComboBoxCreator
+ * @see RichFacesComboBoxTemplateHelper
*/
public VpeCreationData create(final VpePageContext pageContext, final Node sourceNode,
final nsIDOMDocument visualDocument) {
- final RichFacesComboBoxCreator creator =
- new RichFacesComboBoxCreator(pageContext, sourceNode, visualDocument);
+ final RichFacesComboBoxTemplateHelper creator =
+ new RichFacesComboBoxTemplateHelper(pageContext, sourceNode, visualDocument);
return creator.getVpeCreationData();
}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplateHelper.java (from rev 10821, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplateHelper.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplateHelper.java 2008-10-14 18:50:05 UTC (rev 10837)
@@ -0,0 +1,579 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
+
+/**
+ * @author yradtsevich
+ *
+ */
+public class RichFacesComboBoxTemplateHelper {
+ private static final WeakHashMap<Node, Object> expandedComboBoxes = new WeakHashMap<Node, Object>();
+ private static final String DISABLED_ATTR_NAME = "disabled"; //$NON-NLS-1$
+ private static final String BUTTON_ICON_CLASSES_DISABLED =
+ "rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String BUTTON_ICON_CLASSES =
+ "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String SECOND_DIV = "secondDiv"; //$NON-NLS-1$
+ private static final String THIRD_DIV = "thirdDiv"; //$NON-NLS-1$
+ private static final String THIRD_EMPTY_DIV = "thirdEmptyDiv"; //$NON-NLS-1$
+ private static final String TEXT_FIELD = "textField"; //$NON-NLS-1$
+ private static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
+
+ /** CSS_FILE_NAME. */
+ private static final String CSS_FILE_NAME = "comboBox/comboBox.css"; //$NON-NLS-1$
+
+ /** The Constant DEFAULT_LIST_WIDTH. */
+ private static final String DEFAULT_LIST_WIDTH = "150px"; //$NON-NLS-1$
+
+ /** IMAGE_NAME_DOWN. */
+ private static final String IMAGE_NAME_DOWN = "/comboBox/down.gif"; //$NON-NLS-1$
+
+ /** The Constant BUTTON_BACKGROUND. */
+ private static final String BUTTON_BACKGROUND = "buttonBackground"; //$NON-NLS-1$
+
+ /** The Constant STYLE_EXT. */
+ private static final String STYLE_EXT = "richFacesComboBox"; //$NON-NLS-1$
+
+ private static final int LIST_ITEM_HEIGHT_DEFAULT_VALUE = 18;
+
+ /** The style clasess. */
+ private final Map<String, String> styleClasess = new HashMap<String, String>();
+
+ /** The source align. */
+ // Commented because of not working alignment in RichFaces implementation
+ // private String sourceAlign;
+
+ /** The source button style. */
+ private String sourceButtonStyle;
+
+ /** The source default label. */
+ private String sourceDefaultLabel = null;
+
+ /** The source list height. */
+ private String sourceListHeight;
+
+ /** The source list width. */
+ private String sourceListWidth;
+
+ /** The source value. */
+ private String sourceValue;
+
+ /** The source width. */
+ private String sourceWidth;
+
+ /** The source style. */
+ private String sourceStyle;
+
+ /** The source input style. */
+ private String sourceInputStyle;
+
+ /** The source input class. */
+ private String sourceInputClass;
+
+ /** The source list style. */
+ private String sourceListStyle;
+
+ /** The source list class. */
+ private String sourceListClass;
+
+ /** The source item class. */
+ private String sourceItemClass;
+
+
+ /** Source button icon **/
+ private String sourceButtonIcon;
+
+ private String sourceButtonIconInactive;
+
+ private String sourceButtonIconDisabled;
+
+ private boolean disabled;
+ private boolean expanded;
+
+ private final VpePageContext pageContext;
+ private final Node sourceNode;
+ private final nsIDOMDocument visualDocument;
+ private final VpeCreationData vpeCreationData;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesComboBoxTemplateHelper(final VpePageContext pageContext, final Node sourceNode,
+ final nsIDOMDocument visualDocument) {
+ this.pageContext = pageContext;
+ this.sourceNode = sourceNode;
+ this.visualDocument = visualDocument;
+ initDefaultClasses();
+ vpeCreationData = create();
+ }
+
+ /**
+ * Calculate with for div.
+ *
+ * @param with the with
+ * @param minus the minus
+ *
+ * @return the string
+ */
+ private static String calculateWithForDiv(final String with, final int minus) {
+ try {
+ Integer intValue = 0;
+ if (with.endsWith("px")) { //$NON-NLS-1$
+ intValue = Integer.parseInt(with.substring(0, with.length() - 2));
+ } else {
+ intValue = Integer.parseInt(with);
+ }
+ return String.valueOf((intValue - minus)) + "px"; //$NON-NLS-1$
+ } catch (final NumberFormatException e) {
+ return with;
+ }
+
+ }
+ public VpeCreationData getVpeCreationData() {
+ return vpeCreationData;
+ }
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ private VpeCreationData create() {
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, STYLE_EXT);
+
+ final Element source = (Element) sourceNode;
+
+ prepareData(source);
+ final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ //Fix https://jira.jboss.org/jira/browse/JBIDE-2430 issue with resizement.
+ rootDiv.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON+sourceWidth);
+ final nsIDOMElement comboBoxDiv = visualDocument.createElement(HTML.TAG_DIV);
+ final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ // Commented because of not working alignment in RichFaces implementation
+ // comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+ // secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+
+
+ //comboBoxDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
+ secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_DIV));
+ String secondDivSubStyle = "; position: {0}; z-index: {1} ;"; //$NON-NLS-1$
+
+ if (expanded) {
+ secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "relative", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "static", "0"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ comboBoxDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
+ + Constants.SEMICOLON + secondDivSubStyle);
+ secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
+ + Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
+ final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
+ thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_DIV));
+ thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceWidth
+ + "; z-index: 1;"); //$NON-NLS-1$
+ final nsIDOMElement textField = visualDocument.createElement(HTML.TAG_INPUT);
+ textField.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ textField.setAttribute(HTML.ATTR_CLASS,
+ styleClasess.get(TEXT_FIELD) + Constants.WHITE_SPACE + sourceInputClass);
+ textField.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
+ textField.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + calculateWithForDiv(sourceWidth, 17)
+ + Constants.SEMICOLON + sourceInputStyle);
+ String value = null;
+ if (ComponentUtil.isNotBlank(sourceDefaultLabel)) {
+ value = sourceDefaultLabel;
+ } else if (ComponentUtil.isNotBlank(sourceValue) && ComponentUtil.isBlank(sourceDefaultLabel)) {
+ value = sourceValue;
+ }
+
+ if (value != null) {
+ textField.setAttribute(RichFaces.ATTR_VALUE, value);
+ }
+ final nsIDOMElement buttonBackground = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonBackground.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ if (disabled) {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES_DISABLED);
+ } else {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
+ }
+
+ buttonBackground.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_BACKGROUND));
+ buttonBackground.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonBackground.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ if (sourceButtonStyle != null) {
+ buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+
+ final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+ ;
+ buttonIcon.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_ICON));
+ buttonIcon.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonIcon.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ if (sourceButtonStyle != null) {
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+
+ String actualSourceButton;
+ if (disabled) {
+ actualSourceButton = sourceButtonIconDisabled;
+ } else if (expanded) {
+ actualSourceButton = sourceButtonIcon;
+ } else {
+ actualSourceButton = sourceButtonIconInactive;
+ }
+
+ if (ComponentUtil.isNotBlank(actualSourceButton) && (actualSourceButton != IMAGE_NAME_DOWN)) {
+ String buttonIconPath = VpeStyleUtil.addFullPathToImgSrc(actualSourceButton, pageContext, true);
+ buttonIconPath = buttonIconPath.replace('\\', '/');
+ final String style = "background-image: url(" + buttonIconPath + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, buttonIcon.getAttribute(HTML.ATTR_STYLE) + style);
+ }
+ final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
+ forthEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
+ forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + calculateWithForDiv(sourceWidth, 10));
+ forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts")); //$NON-NLS-1$
+
+ rootDiv.appendChild(comboBoxDiv);
+ comboBoxDiv.appendChild(secondDiv);
+
+ secondDiv.appendChild(thirdDiv);
+ if (expanded) {
+ comboBoxDiv.appendChild(createToogleDiv());
+ }
+ thirdDiv.appendChild(textField);
+ thirdDiv.appendChild(buttonBackground);
+ thirdDiv.appendChild(buttonIcon);
+ thirdDiv.appendChild(forthEmptyDiv);
+
+ final VpeCreationData creationData = new VpeCreationData(rootDiv);
+
+ return creationData;
+ }
+
+ /**
+ * Creates the toogle div.
+ *
+ * @param visualDocument the visual document
+ * @param pageContext the page context
+ * @param source the source
+ *
+ * @return the ns IDOM node
+ */
+ private nsIDOMNode createToogleDiv() {
+
+ final nsIDOMElement thirdEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, sourceListStyle + Constants.SEMICOLON
+ + " z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
+ thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS,
+ styleClasess.get(THIRD_EMPTY_DIV) + " " + sourceListClass); //$NON-NLS-1$
+ thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE,
+ "z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
+
+ final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ final nsIDOMElement positionDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ positionDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-position"); //$NON-NLS-1$
+
+ final nsIDOMElement decorationDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ decorationDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-decoration"); //$NON-NLS-1$
+ // decorationDiv.setAttribute(HTML.ATTR_STYLE,
+ // "height: 54px; width: 208px;");
+
+ final nsIDOMElement scrollDiv = visualDocument.createElement(HTML.TAG_DIV);
+ scrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-scroll"); //$NON-NLS-1$
+ final List<Element> items = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
+ int defaultHeight = LIST_ITEM_HEIGHT_DEFAULT_VALUE;
+
+ if((items!=null) && (items.size() > 1)){
+ defaultHeight = ((items.size() - 1)* LIST_ITEM_HEIGHT_DEFAULT_VALUE);
+ }
+
+ final String listHeight = ComponentUtil.isNotBlank(sourceListHeight)
+ ? sourceListHeight
+ : String.valueOf(defaultHeight) + "px"; //$NON-NLS-1$
+ scrollDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_MAX_HEIGHT
+ + Constants.COLON + listHeight + Constants.SEMICOLON
+ + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + calculateWithForDiv(sourceListWidth, 2));
+
+ final List<Element> selectItems = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
+
+ if (selectItems.size() > 0) {
+ for (final Element e : selectItems) {
+ scrollDiv.appendChild(createSelectItem(e));
+ }
+ }
+
+ shadovDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow"); //$NON-NLS-1$
+
+ final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ String width = Constants.EMPTY;
+ try {
+
+ int w = ComponentUtil.parseWidthHeightValue(sourceListWidth);
+ w += 7;
+ width = String.valueOf(w);
+ } catch (final ParseException e) {
+ width = "217"; //$NON-NLS-1$
+ }
+ table.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH
+ + Constants.COLON + width + Constants.PIXEL
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_HEIGHT
+ + Constants.COLON + "63px;"); //$NON-NLS-1$
+
+ final nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
+
+ final nsIDOMElement tr1_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr1_td2 = visualDocument.createElement(HTML.TAG_TD);
+
+ final nsIDOMElement tr2_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr2_td2 = visualDocument.createElement(HTML.TAG_TD);
+
+ final nsIDOMElement tr1_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr1_td2_img = visualDocument.createElement(HTML.TAG_IMG);
+
+ final nsIDOMElement tr2_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr2_td2_img = visualDocument.createElement(HTML.TAG_IMG);
+
+ tr1_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tl"); //$NON-NLS-1$
+ tr1_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tr"); //$NON-NLS-1$
+
+ tr2_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-bl"); //$NON-NLS-1$
+ tr2_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-br"); //$NON-NLS-1$
+
+ setUpImg(tr1_td1_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr1_td2_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr2_td1_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr2_td2_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+
+ thirdEmptyDiv.appendChild(shadovDiv);
+ shadovDiv.appendChild(table);
+ thirdEmptyDiv.appendChild(positionDiv);
+ positionDiv.appendChild(decorationDiv);
+ decorationDiv.appendChild(scrollDiv);
+
+ table.appendChild(tr1);
+ table.appendChild(tr2);
+ tr1.appendChild(tr1_td1);
+ tr1.appendChild(tr1_td2);
+
+ tr2.appendChild(tr2_td1);
+ tr2.appendChild(tr2_td2);
+
+ tr1_td1.appendChild(tr1_td1_img);
+ tr1_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr1_td2.appendChild(tr1_td2_img);
+ tr1_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr2_td1.appendChild(tr2_td1_img);
+ tr2_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr2_td2.appendChild(tr2_td2_img);
+ tr2_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ return thirdEmptyDiv;
+ }
+
+ /**
+ * Creates the select item.
+ *
+ * @param visualDocument the visual document
+ * @param e the e
+ *
+ * @return the ns IDOM node
+ */
+ private nsIDOMNode createSelectItem(final Element e) {
+ final nsIDOMElement item = visualDocument.createElement(HTML.TAG_SPAN);
+
+ item.setAttribute(HTML.ATTR_CLASS, "rich-combobox-item " + sourceItemClass); //$NON-NLS-1$
+ item.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
+ return item;
+ }
+
+ /**
+ * Inits the default classes.
+ */
+ private void initDefaultClasses() {
+ styleClasess.put(SECOND_DIV, "rich-combobox-font rich-combobox"); //$NON-NLS-1$
+ styleClasess.put(THIRD_DIV, "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$
+ styleClasess.put(THIRD_EMPTY_DIV, "rich-combobox-list-cord"); //$NON-NLS-1$
+ styleClasess.put(TEXT_FIELD, "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$
+ styleClasess.put(BUTTON_BACKGROUND,
+ "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
+ styleClasess.put("forthEmptyDiv", "rich-combobox-strut rich-combobox-font"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ private void prepareData(final Element source) {
+ final AttributeMap attributeMap = new AttributeMap(source);
+
+ // Commented because of not working alignment in RichFaces implementation
+ // if (attributeMap.isBlank(RichFaces.ATTR_ALIGN)) {
+ // this.sourceAlign = DEFAULT_ALIGN;
+ // } else {
+ // this.sourceAlign = attributeMap.getString(RichFaces.ATTR_ALIGN);
+ // }
+
+ if (attributeMap.isBlank(RichFaces.ATTR_LIST_WIDTH)) {
+ sourceListWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ sourceListWidth = attributeMap.getString(RichFaces.ATTR_LIST_WIDTH);
+ }
+
+ sourceListHeight = attributeMap.getString(RichFaces.ATTR_LIST_HEIGHT);
+
+ if (attributeMap.isBlank(RichFaces.ATTR_WIDTH)) {
+ sourceWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ sourceWidth = attributeMap.getString(RichFaces.ATTR_WIDTH);
+
+ if(sourceListWidth == DEFAULT_LIST_WIDTH) {
+ sourceListWidth = sourceWidth;
+ }
+ }
+
+ if (ComponentUtil.isNotBlank(sourceWidth) && (sourceWidth != DEFAULT_LIST_WIDTH)) {
+ if(!sourceWidth.endsWith(Constants.PIXEL)){
+ try {
+ final int intValue = Integer.parseInt(sourceWidth);
+ sourceWidth = String.valueOf(intValue)+Constants.PIXEL;
+ } catch (final NumberFormatException e) {
+ sourceListWidth = DEFAULT_LIST_WIDTH;
+ }
+ }
+ }
+
+ sourceDefaultLabel = attributeMap.getString("defaultLabel"); //$NON-NLS-1$
+ sourceValue = attributeMap.getString( RichFaces.ATTR_VALUE);
+
+ sourceButtonStyle = attributeMap.getString("buttonStyle"); //$NON-NLS-1$
+
+ final String sourceStyleClasess = attributeMap.getString(RichFaces.ATTR_STYLE_CLASS);
+
+ if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
+ styleClasess.put(SECOND_DIV, styleClasess.get(SECOND_DIV) + " " + sourceStyleClasess); //$NON-NLS-1$
+ }
+
+ sourceStyle = attributeMap.getString(HTML.ATTR_STYLE);
+ sourceInputStyle = attributeMap.getString("inputStyle"); //$NON-NLS-1$
+ sourceInputClass = attributeMap.getString("inputClass"); //$NON-NLS-1$
+ sourceListClass = attributeMap.getString("listClass"); //$NON-NLS-1$
+ sourceListStyle = attributeMap.getString("listStyle"); //$NON-NLS-1$
+ sourceItemClass = attributeMap.getString("itemClass"); //$NON-NLS-1$
+
+ sourceButtonIcon = attributeMap.getString(BUTTON_ICON);
+ sourceButtonIconInactive = attributeMap.getString("buttonIconInactive"); //$NON-NLS-1$
+ sourceButtonIconDisabled = attributeMap.getString("buttonIconDisabled"); //$NON-NLS-1$
+ disabled = isDisabled(attributeMap);
+ expanded = isExpanded(source);
+
+ if(ComponentUtil.isBlank(sourceButtonIcon)){
+ sourceButtonIcon = IMAGE_NAME_DOWN;
+ }
+
+ }
+
+ /**
+ * Sets the up img.
+ *
+ * @param i *
+ * @param width the width
+ * @param height the height
+ * @param img the img
+ * @param j *
+ * @param image the image
+ * @param border the border
+ * @param td1Img */
+ protected static void setUpImg(final nsIDOMElement img, final int width, final int height,
+ final int border, final String image) {
+ ComponentUtil.setImg(img, image);
+ img.setAttribute(HTML.ATTR_WIDTH, String.valueOf(width));
+ img.setAttribute(HTML.ATTR_HEIGHT, String.valueOf(height));
+ img.setAttribute(HTML.ATTR_BORDER, String.valueOf(border));
+
+ }
+
+ /**
+ * Inverts <code>expanded</code> state of the ComboBox
+ *
+ * @param builder the builder
+ * @param sourceNode the source node
+ * @param toggleId the toggle id
+ */
+ public static void toggle(final VpeVisualDomBuilder builder, final Node sourceNode, final String toggleId) {
+ AttributeMap attributes = new AttributeMap((Element)sourceNode);
+ if (isDisabled(attributes) || isExpanded(sourceNode)) {
+ expandedComboBoxes.remove(sourceNode);
+ } else {
+ expandedComboBoxes.put(sourceNode, null);
+ }
+ }
+
+ public static void stopToggling(final Node sourceNode) {
+ expandedComboBoxes.remove(sourceNode);
+ }
+
+ public static boolean isDisabled(final AttributeMap attributes) {
+ return attributes.getBoolean(DISABLED_ATTR_NAME) == Boolean.TRUE;
+ }
+
+ private static boolean isExpanded(Node node) {
+ return expandedComboBoxes.containsKey(node);
+ }
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplateHelper.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2008-10-14 17:30:12 UTC (rev 10836)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2008-10-14 18:50:05 UTC (rev 10837)
@@ -11,7 +11,7 @@
<body>
<h1>comboBox</h1>
<rich:comboBox value="#{bean.cbString}" defaultLabel="Select Any Value"
- style="width:250px" id="comboBox">
+ style="width:250px" id="comboBox" listHeight="150px">
<f:selectItem itemValue="suggestion 1" />
<f:selectItem itemValue="suggestion 2" />
<f:selectItem itemValue="suggestion 3" />
17 years, 2 months
JBoss Tools SVN: r10836 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-14 13:30:12 -0400 (Tue, 14 Oct 2008)
New Revision: 10836
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-14 17:02:08 UTC (rev 10835)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-14 17:30:12 UTC (rev 10836)
@@ -17,20 +17,34 @@
<section id="birt_designer_UI" xreflabel="birt_designer_UI">
<title>BIRT User Interface</title>
- <para>The central part of the user interface is the Layout Editor. It displays the whole process of building a report and contains the following tabs:</para>
+ <para>The central part of the user interface is the <property>Layout Editor</property>. It displays the whole process of building a report and contains the following tabs:</para>
<itemizedlist>
<listitem><para><emphasis role="bold">Layout</emphasis> - this is an area where you can edit your report design;</para></listitem>
<listitem><para><emphasis role="bold">Preview</emphasis> - runs your report created and shows the output;</para></listitem>
<listitem><para><emphasis role="bold">Script</emphasis> - on this page you can add JavaScript to your report to customize its behavior;</para></listitem>
<listitem><para><emphasis role="bold">XML Source</emphasis> - this is an area where you can view and modify the XML source of your report;</para></listitem>
- <listitem><para><emphasis role="bold">Master Page</emphasis> - use it to format page data.</para></listitem>
+ <listitem><para><emphasis role="bold">Master Page</emphasis> - use it to format page data.</para></listitem> </itemizedlist>
+ <para>The next part of user interface is different <property>Views</property> that can be arranged around the Layout Editor area the way you like:</para>
+ <itemizedlist>
+ <listitem><para><emphasis role="bold">Palette</emphasis> - BIRT View that shows the standard report items you can add to your report using drag and drop.</para></listitem>
+ <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT View that shows the structure of your report as a tree view.</para></listitem>
+ <listitem><para><emphasis role="bold">Navigator</emphasis> - Standard Eclipse view that shows your projects, and the reports within your projects.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - BIRT View that shows your data sources (connections), data sets (queries) and report parameters. You also use this view to add data set columns to your report layout.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - BIRT View that displays properties for many report items. It has tabs and groupings that organize properties into categories.</para></listitem>
+ <listitem><para><emphasis role="bold">Properties View</emphasis> - Standard Eclipse view that shows all properties for a report item as a simple list. This view is optional, and we will not use it in this tutorial.</para></listitem>
+ <listitem><para><emphasis role="bold">Library Explorer View</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. The Library Explorer will display Libraries that exist in the resource folder. Developed libraries can be added to the resource folder by selecting File→Publish Library to Resource Folder or by right clicking in Library Explorer and selecting add. The resource folder location can be configured. </para></listitem>
+
+
+
+ </itemizedlist>
- </itemizedlist>
+
+
</section>
<section id="birt_designer_features">
17 years, 2 months
JBoss Tools SVN: r10835 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-14 13:02:08 -0400 (Tue, 14 Oct 2008)
New Revision: 10835
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731 2.1 and 2.2 are done
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-14 16:53:33 UTC (rev 10834)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-14 17:02:08 UTC (rev 10835)
@@ -13,6 +13,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Properties;
@@ -35,6 +36,8 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.model.IModelProvider;
@@ -56,6 +59,7 @@
import org.eclipse.jst.javaee.web.WebResourceCollection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -67,6 +71,7 @@
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.osgi.service.prefs.BackingStoreException;
@@ -302,25 +307,30 @@
webLibFolder = new File(webContentFolder, WEB_LIBRARIES_RELATED_PATH);
srcFolder = isWarConfiguration(model) ? new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(), "model") : srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
- final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
+ if(runtimeName!=null) {
+ final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
- seamHomePath = selectedRuntime.getHomeDir();
+ seamHomePath = selectedRuntime.getHomeDir();
- seamHomeFolder = new File(seamHomePath);
- seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
- seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
+ seamHomeFolder = new File(seamHomePath);
+ seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
+ seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
- seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
- seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
- dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
- componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
+ seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
+ dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
+ componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
- hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
- //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
- persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+ hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
+ persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
- copyFilesToWarProject(project, fv, model, monitor);
+ copyFilesToWarProject(project, fv, model, monitor);
+ } else {
+ // If seam runtime is null then just modify web.xml and add seam nature.
+ configureWebXml(project);
+ }
ClasspathHelper.addClasspathEntries(project, fv);
createSeamProjectPreferenes(project, model);
@@ -483,6 +493,7 @@
IProjectFacetVersion ejbVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.EJB_FACET);
IProjectFacetVersion webVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.DYNAMIC_WEB_FACET);
IProjectFacetVersion earVersion = facetedProject.getProjectFacetVersion(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET);
+ initDefaultModelValues(model, webVersion!=null);
if(ejbVersion!=null) {
doExecuteForEjb(project, fv, model, monitor);
} else if(webVersion!=null) {
@@ -492,6 +503,40 @@
}
}
+ private void initDefaultModelValues(IDataModel model, boolean warProject) {
+ if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS)==null) {
+ model.setProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, warProject?ISeamFacetDataModelProperties.DEPLOY_AS_WAR:ISeamFacetDataModelProperties.DEPLOY_AS_EAR);
+ }
+ if(model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME)==null) {
+ model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".session"); //$NON-NLS-1$
+ }
+ if(model.getProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME)==null) {
+ model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".entity"); //$NON-NLS-1$
+ }
+ if(model.getProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME)==null) {
+ model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".test"); //$NON-NLS-1$
+ }
+ if(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME)==null) {
+ String runtimeName = SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model);
+ if((runtimeName!=null && runtimeName.length()>0)) {
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, runtimeName);
+ }
+ }
+ if(model.getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE)==null) {
+ String defaultDs = SeamProjectPreferences.getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE);
+ IConnectionProfile[] profiles = ProfileManager.getInstance().getProfilesByCategory("org.eclipse.datatools.connectivity.db.category"); //$NON-NLS-1$
+ List<String> names = new ArrayList<String>();
+ for (IConnectionProfile connectionProfile : profiles) {
+ names.add(connectionProfile.getName());
+ }
+ if(names.contains(defaultDs)) {
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, defaultDs);
+ } else if(names.size()>0) {
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, names.get(0));
+ }
+ }
+ }
+
/**
*
*/
@@ -536,8 +581,12 @@
prefs.put(JBOSS_AS_DEPLOY_AS, model.getProperty(JBOSS_AS_DEPLOY_AS).toString());
prefs.put(SEAM_SETTINGS_VERSION, SEAM_SETTINGS_VERSION_1_1);
- prefs.put(SEAM_RUNTIME_NAME, model.getProperty(SEAM_RUNTIME_NAME).toString());
- prefs.put(SEAM_CONNECTION_PROFILE, model.getProperty(SEAM_CONNECTION_PROFILE).toString());
+ if(model.getProperty(SEAM_RUNTIME_NAME)!=null) {
+ prefs.put(SEAM_RUNTIME_NAME, model.getProperty(SEAM_RUNTIME_NAME).toString());
+ }
+ if(model.getProperty(SEAM_CONNECTION_PROFILE)!=null) {
+ prefs.put(SEAM_CONNECTION_PROFILE, model.getProperty(SEAM_CONNECTION_PROFILE).toString());
+ }
prefs.put(SESSION_BEAN_PACKAGE_NAME, model.getProperty(SESSION_BEAN_PACKAGE_NAME).toString());
prefs.put(ENTITY_BEAN_PACKAGE_NAME, model.getProperty(ENTITY_BEAN_PACKAGE_NAME).toString());
prefs.put(TEST_CASES_PACKAGE_NAME, model.getProperty(TEST_CASES_PACKAGE_NAME).toString());
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-14 16:53:33 UTC (rev 10834)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-14 17:02:08 UTC (rev 10835)
@@ -97,9 +97,11 @@
*/
public Object getDefaultProperty(String propertyName) {
if (JBOSS_AS_HOME.equals(propertyName)) {
- return "Jboss_AS_HOME"; //$NON-NLS-1$
+// return "Jboss_AS_HOME"; //$NON-NLS-1$
+ return null;
} else if (JBOSS_AS_DEPLOY_AS.equals(propertyName)) {
- return "Jboos_DEPLOY_AS"; //$NON-NLS-1$
+// return "Jboos_DEPLOY_AS"; //$NON-NLS-1$
+ return null;
} else if (propertyName.equals(FACET_ID)) {
return ISeamFacetDataModelProperties.SEAM_FACET_ID;
} else if (SEAM_TEST_PROJECT.equals(propertyName)) {
@@ -173,12 +175,9 @@
model.setProperty(ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME, "");
model.setProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS, false);
model.setProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY, false);
- if(model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)!=null) {
- model.setProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".session"); //$NON-NLS-1$
- model.setProperty(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".entity"); //$NON-NLS-1$
- model.setProperty(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME, "org.domain." + model.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME) + ".test"); //$NON-NLS-1$
- }
- // TODO
+// SESSION_BEAN_PACKAGE_NAME
+// ENTITY_BEAN_PACKAGE_NAME
+// TEST_CASES_PACKAGE_NAME
// jBossSeamHome
// jBossAsDeployAs
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2008-10-14 16:53:33 UTC (rev 10834)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2008-10-14 17:02:08 UTC (rev 10835)
@@ -52,7 +52,7 @@
.node(SeamCorePlugin.PLUGIN_ID);
node.put(SeamProjectPreferences.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
- node.put(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE, "DefaultDS"); //$NON-NLS-1$
+// node.put(SeamProjectPreferences.SEAM_DEFAULT_CONNECTION_PROFILE, "DefaultDS"); //$NON-NLS-1$
node.put(SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS, "war"); //$NON-NLS-1$
node.put(SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE, "HSQL"); //$NON-NLS-1$
initializeDefault(node,getSeamGenBuildPath());
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2008-10-14 16:53:33 UTC (rev 10834)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/ComboFieldEditor.java 2008-10-14 17:02:08 UTC (rev 10835)
@@ -86,7 +86,9 @@
* @see org.jboss.tools.seam.ui.widget.editor.ITaggedFieldEditor#setTags(java.lang.String[])
*/
public void setTags(String[] tags) {
- comboField.setTags(tags,getValueAsString());
+ if(comboField!=null) {
+ comboField.setTags(tags,getValueAsString());
+ }
}
/* (non-Javadoc)
17 years, 2 months
JBoss Tools SVN: r10834 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-10-14 12:53:33 -0400 (Tue, 14 Oct 2008)
New Revision: 10834
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java
Log:
JBIDE-2893 NPE for fileset view provider
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java 2008-10-14 16:22:39 UTC (rev 10833)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ServerViewProvider.java 2008-10-14 16:53:33 UTC (rev 10834)
@@ -33,6 +33,7 @@
private boolean enabled;
private int weight;
+ private boolean loadFailed = false;
public ServerViewProvider(IConfigurationElement element) {
this.element = element;
@@ -84,11 +85,12 @@
public JBossServerViewExtension getDelegate() {
try {
- if( extension == null ) {
+ if( extension == null && !loadFailed) {
extension = (JBossServerViewExtension)element.createExecutableExtension(PROVIDER_LABEL);
extension.setViewProvider(this);
}
} catch( CoreException ce ) {
+ loadFailed = true;
ce.printStackTrace();
}
return extension;
@@ -105,15 +107,15 @@
public void setEnabled(boolean enable) {
if( enable && !enabled ) {
enabled = true;
- getDelegate().enable();
+ if(getDelegate() != null ) getDelegate().enable();
} else if( !enable && enabled ) {
enabled = false;
- getDelegate().disable();
+ if(getDelegate() != null ) getDelegate().disable();
}
}
public boolean supports(IServer server) {
- return getDelegate().supports(server);
+ return getDelegate() == null ? false : getDelegate().supports(server);
}
public int getWeight() {
@@ -125,7 +127,8 @@
}
public void dispose() {
- getDelegate().dispose();
+ if( getDelegate() != null )
+ getDelegate().dispose();
if( icon != null && iconDescriptor != null )
icon.dispose();
17 years, 2 months
JBoss Tools SVN: r10833 - in trunk: vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-14 12:22:39 -0400 (Tue, 14 Oct 2008)
New Revision: 10833
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-14 15:06:57 UTC (rev 10832)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-14 16:22:39 UTC (rev 10833)
@@ -9,7 +9,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
+ STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body">
@@ -20,7 +20,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
+ STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body">
@@ -33,7 +33,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
+ STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
@@ -44,7 +44,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
+ STYLE="/background-image: url\(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif\);/">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 15:06:57 UTC (rev 10832)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 16:22:39 UTC (rev 10833)
@@ -45,9 +45,9 @@
final public static String ILLEGAL_ATTRIBUTES_SEPARATOR = Constants.COMMA;
- final public static String START_REGEX = "{"; //$NON-NLS-1$
+ final public static String START_REGEX = "/"; //$NON-NLS-1$
- final public static String END_REGEX = "}"; //$NON-NLS-1$
+ final public static String END_REGEX = "/"; //$NON-NLS-1$
public static Document getDocument(File file) throws FileNotFoundException {
// create reader
@@ -218,41 +218,45 @@
throw new ComparisonException("there is not : \"" + name
+ "\" attribute");
- if (HTML.ATTR_STYLE.equalsIgnoreCase(name)) {
+// if (HTML.ATTR_STYLE.equalsIgnoreCase(name)) {
+//
+// String[] modelParameters = modelAttr.getNodeValue().split(
+// Constants.SEMICOLON);
+// String[] vpeParameters = vpeAttr.getNodeValue().split(
+// Constants.SEMICOLON);
+//
+// for (int j = 0; j < modelParameters.length; j++) {
+// String modelParam = modelParameters[j];
+// String vpeParam = vpeParameters[j];
+//
+// String[] splittedModelParam = modelParam.split(
+// Constants.COLON, 2);
+//
+// String[] splittedVpeParam = vpeParam.split(
+// Constants.COLON, 2);
+//
+// if (!splittedModelParam[0].trim().equals(
+// splittedVpeParam[0].trim())) {
+// throw new ComparisonException(
+// "param of style attribute is\""
+// + splittedVpeParam[0].trim()
+// + "\" but must be \""
+// + splittedModelParam[0].trim()
+// + "\"");
+// }
+//
+//// compareComplexStrings(splittedModelParam[0].trim(), splittedVpeParam[0].trim());
+//
+//
+// if (splittedModelParam.length > 1)
+// compareComplexStrings(splittedModelParam[1].trim(),
+// splittedVpeParam[1].trim());
+//
+// }
+//
+// }
+ else {
- String[] modelParameters = modelAttr.getNodeValue().split(
- Constants.SEMICOLON);
- String[] vpeParameters = vpeAttr.getNodeValue().split(
- Constants.SEMICOLON);
-
- for (int j = 0; j < modelParameters.length; j++) {
- String modelParam = modelParameters[j];
- String vpeParam = vpeParameters[j];
-
- String[] splittedModelParam = modelParam.split(
- Constants.COLON, 2);
-
- String[] splittedVpeParam = vpeParam.split(
- Constants.COLON, 2);
-
- if (!splittedModelParam[0].trim().equals(
- splittedVpeParam[0].trim())) {
- throw new ComparisonException(
- "param of style attribute is\""
- + splittedVpeParam[0].trim()
- + "\" but must be \""
- + splittedModelParam[0].trim()
- + "\"");
- }
-
- if (splittedModelParam.length > 1)
- compareComplexStrings(splittedModelParam[1].trim(),
- splittedVpeParam[1].trim());
-
- }
-
- } else {
-
compareComplexStrings(modelAttr.getNodeValue().trim(),
vpeAttr.getNodeValue().trim());
17 years, 2 months
JBoss Tools SVN: r10832 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-14 11:06:57 -0400 (Tue, 14 Oct 2008)
New Revision: 10832
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-14 15:05:38 UTC (rev 10831)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-14 15:06:57 UTC (rev 10832)
@@ -91,6 +91,7 @@
public static final String ATTR_DISPLAY = "display"; //$NON-NLS-1$
public static final String ATTR_READONLY = "readonly"; //$NON-NLS-1$
public static final String ATTR_SCOPE = "scope"; //$NON-NLS-1$
+ public static final String ATTR_SPAN = "span"; //$NON-NLS-1$
public static final String VALUE_TOP_ALIGN = "top"; //$NON-NLS-1$
public static final String VALUE_RIGHT_ALIGN = "right"; //$NON-NLS-1$
17 years, 2 months
JBoss Tools SVN: r10831 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-14 11:05:38 -0400 (Tue, 14 Oct 2008)
New Revision: 10831
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 13:38:02 UTC (rev 10830)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 15:05:38 UTC (rev 10831)
@@ -245,8 +245,9 @@
+ "\"");
}
- compareComplexStrings(splittedModelParam[1].trim(),
- splittedVpeParam[1].trim());
+ if (splittedModelParam.length > 1)
+ compareComplexStrings(splittedModelParam[1].trim(),
+ splittedVpeParam[1].trim());
}
17 years, 2 months
JBoss Tools SVN: r10830 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-10-14 09:38:02 -0400 (Tue, 14 Oct 2008)
New Revision: 10830
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2892
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-10-14 13:37:04 UTC (rev 10829)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2008-10-14 13:38:02 UTC (rev 10830)
@@ -40,7 +40,7 @@
import org.w3c.dom.Node;
public class VpeFunctionSrc extends VpeFunction {
- static final String IMG_UNRESOLVED = "unresolved.gif"; //$NON-NLS-1$
+ static final String IMG_UNRESOLVED = "unresolved_image.gif"; //$NON-NLS-1$
static final String IMG_PREFIX = "file:///"; //$NON-NLS-1$
public VpeValue exec(VpePageContext pageContext, Node sourceNode) throws VpeExpressionException {
@@ -179,7 +179,7 @@
}
protected String getUnresolved() {
- return IMG_UNRESOLVED;
+ return IMG_PREFIX + getAbsoluteResourcePath(IMG_UNRESOLVED);
}
protected String getPrefix() {
@@ -243,4 +243,16 @@
resolvedValue = ElService.getInstance().replaceEl(file, resolvedValue);
return resolvedValue;
}
+
+ public static String getAbsoluteResourcePath(String resourcePathInPlugin) {
+ String pluginPath = VpePlugin.getPluginResourcePath();
+ IPath pluginFile = new Path(pluginPath);
+ File file = pluginFile.append(resourcePathInPlugin).toFile();
+ if (file.exists()) {
+ return file.getAbsolutePath();
+ } else {
+ throw new RuntimeException("Can't get path for " //$NON-NLS-1$
+ + resourcePathInPlugin);
+ }
+ }
}
\ No newline at end of file
17 years, 2 months
JBoss Tools SVN: r10829 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-14 09:37:04 -0400 (Tue, 14 Oct 2008)
New Revision: 10829
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-14 13:34:51 UTC (rev 10828)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-14 13:37:04 UTC (rev 10829)
@@ -20,7 +20,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body">
@@ -33,7 +33,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
@@ -44,7 +44,7 @@
<TD CLASS="dr-table-cell rich-table-cell">
<DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
<DIV CLASS="dr-pnl-h rich-panel-header"
- STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
<SPAN> #{data.number}</SPAN>
</DIV>
<DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
17 years, 2 months
JBoss Tools SVN: r10828 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-10-14 09:34:51 -0400 (Tue, 14 Oct 2008)
New Revision: 10828
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComparisonException.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2810
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+<body>
+<h1>column</h1>
+<h:form>
+ <rich:dataTable cellpadding="0" cellspacing="0" width="700" border="0"
+ var="row" value="#{bean.dtList}" rowKeyVar="rowKey" id="dataTable">
+
+ <f:facet name="header">
+ <rich:columnGroup>
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3" id="column1">
+ <h:outputText value="FIELDS" />
+ </rich:column>
+ <rich:column breakBefore="true" id="column2">
+ <h:outputText value="field1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field3" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+
+ <rich:columnGroup>
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column id="column3">
+ <h:outputText value="#{row.field1}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field2}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field3}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:columnGroup>
+
+
+
+ <f:facet name="footer">
+
+ <rich:columnGroup>
+ <rich:column></rich:column>
+ <rich:column id="column4">
+ <h:outputText value="footer1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer3" />
+ </rich:column>
+
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/column.xhtml.xml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,24 @@
+<tests>
+ <test id="column1">
+ <TD CLASS="dr-table-headercell rich-table-headercell" COLSPAN="3"
+ ID="column1">
+ <SPAN> FIELDS</SPAN>
+ </TD>
+ </test>
+ <test id="column2">
+ <TD CLASS="dr-table-headercell rich-table-headercell" BREAKBEFORE="true"
+ ID="column2">
+ <SPAN > field1</SPAN>
+ </TD>
+ </test>
+ <test id="column3">
+ <TD CLASS="dr-table-cell rich-table-cell" ID="column3">
+ <SPAN> #{row.field1}</SPAN>
+ </TD>
+ </test>
+ <test id="column4">
+ <TD CLASS="dr-table-footercell rich-table-footercell" ID="column4">
+ <SPAN> footer1</SPAN>
+ </TD>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,79 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+<body>
+<h1>columnGroup</h1>
+<h:form>
+ <rich:dataTable cellpadding="0" cellspacing="0" width="700" border="0"
+ var="row" value="#{bean.dtList}" rowKeyVar="rowKey" id="dataTable">
+
+ <f:facet name="header">
+ <rich:columnGroup id="columnGroup1">
+ <rich:column rowspan="2">
+ <rich:spacer />
+ </rich:column>
+ <rich:column colspan="3">
+ <h:outputText value="FIELDS" />
+ </rich:column>
+ <rich:column breakBefore="true">
+ <h:outputText value="field1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="field3" />
+ </rich:column>
+ </rich:columnGroup>
+ </f:facet>
+
+
+ <rich:columnGroup id="columnGroup2">
+ <rich:column>
+ <h:outputText value="#{rowKey}" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field1}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field2}">
+ </h:outputText>
+ </rich:column>
+ <rich:column>
+ <h:outputText value="#{row.field3}">
+ </h:outputText>
+ </rich:column>
+
+ </rich:columnGroup>
+
+
+
+ <f:facet name="footer">
+
+ <rich:columnGroup id="columnGroup3">
+ <rich:column></rich:column>
+ <rich:column>
+ <h:outputText value="footer1" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer2" />
+ </rich:column>
+ <rich:column>
+ <h:outputText value="footer3" />
+ </rich:column>
+
+ </rich:columnGroup>
+ </f:facet>
+
+ </rich:dataTable>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columnGroup.xhtml.xml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,25 @@
+<tests>
+ <test id="columnGroup1">
+ <TR ID="columnGroup1" CLASS="dr-table-header rich-table-header">
+ <TD CLASS="dr-table-headercell rich-table-headercell" ROWSPAN="2">
+ <IMG WIDTH="1" HEIGHT="1" />
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell" COLSPAN="3">
+ <SPAN> FIELDS</SPAN>
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-header-continue rich-table-header-continue" ID="columnGroup1">
+ <TD
+ CLASS="__drag__available_style dr-table-headercell rich-table-headercell"
+ BREAKBEFORE="true">
+ <SPAN> field1</SPAN>
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell">
+ <SPAN> field2</SPAN>
+ </TD>
+ <TD CLASS="dr-table-headercell rich-table-headercell">
+ <SPAN> field3</SPAN>
+ </TD>
+ </TR>
+ </test>
+</tests>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,23 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:h="http://java.sun.com/jsf/html"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:a4j="http://richfaces.org/a4j"
+ xmlns:rich="http://richfaces.org/rich">
+
+<head>
+</head>
+<body>
+<h1>columns</h1>
+
+<h:form>
+ <rich:dataTable value="#{bookList.books}" var="book" border="4"
+ style="background-color:grey; width : 117px;">
+ <rich:columns value="#{bookList.books}" var="label" id="columns">
+ <h:outputText value="#{book.price}" />
+ </rich:columns>
+ </rich:dataTable>
+</h:form>
+</body>
+</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/columns.xhtml.xml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,7 @@
+<tests>
+ <test id="columns">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <SPAN> #{book.price}</SPAN>
+ </TD>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml 2008-10-14 12:52:11 UTC (rev 10827)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -9,30 +9,17 @@
<head>
</head>
<body>
- <!-- Data Grid -->
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Car Store"></h:outputText>
- </f:facet>
- <h:form>
- <rich:dataGrid columns="2" elements="12">
- <rich:panel>
- <f:facet name="header">
- <h:outputText value="Car"></h:outputText>
- </f:facet>
- <h:panelGrid columns="2">
- <h:outputText value="Price:"></h:outputText>
- <h:outputText value="30000" />
- <h:outputText value="Mileage:"></h:outputText>
- <h:outputText value="345345345" />
- <h:outputText value="VIN:"></h:outputText>
- <h:outputText value="HKFFGHGKHJKLJ" />
- <h:outputText value="Stock:"></h:outputText>
- <h:outputText value="GHKFGH" />
- </h:panelGrid>
- </rich:panel>
- </rich:dataGrid>
- </h:form>
- </rich:panel>
+<h1>dataGrid</h1>
+<h:form>
+ <rich:dataGrid value="#{bean.dtList}" var="data" columns="2"
+ elements="4" id="dataGrid">
+ <rich:panel>
+ <f:facet name="header">
+ <h:outputText value="#{data.number}"></h:outputText>
+ </f:facet>
+ <h:outputText value="#{data.field1}" />
+ </rich:panel>
+ </rich:dataGrid>
+</h:form>
</body>
</html>
\ No newline at end of file
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/dataGrid.xhtml.xml 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,59 @@
+<tests>
+ <test id="dataGrid">
+ <TABLE VALUE="#{bean.dtList}" VAR="data" COLUMNS="2" ELEMENTS="4"
+ ID="dataGrid" CLASS="dr-table rich-table">
+ <COLGROUP SPAN="2">
+ </COLGROUP>
+ <TBODY>
+ <TR CLASS="dr-table-row rich-table-row">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="background-image: {url(.*org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif)};">
+ <SPAN> #{data.number}</SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <SPAN> #{data.field1}</SPAN>
+ </DIV>
+ </DIV>
+ </TD>
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ <SPAN> #{data.number}</SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body">
+ <SPAN> #{data.field1}</SPAN>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ <TR CLASS="dr-table-row rich-table-row">
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ <SPAN> #{data.number}</SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
+ <SPAN> #{data.field1}</SPAN>
+ </DIV>
+ </DIV>
+ </TD>
+ <TD CLASS="dr-table-cell rich-table-cell">
+ <DIV CLASS="dr-pnl rich-panel" TITLE="rich:panel">
+ <DIV CLASS="dr-pnl-h rich-panel-header"
+ STYLE="background-image: url(file:////home/transfer/work/RHDS/repository/trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/common/background.gif);">
+ <SPAN> #{data.number}</SPAN>
+ </DIV>
+ <DIV CLASS="dr-pnl-b rich-panel-body" TITLE="rich:panel">
+ <SPAN> #{data.field1}</SPAN>
+ </DIV>
+ </DIV>
+ </TD>
+ </TR>
+ </TBODY>
+ </TABLE>
+ </test>
+</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-14 12:52:11 UTC (rev 10827)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComponentContentTest.java 2008-10-14 13:34:51 UTC (rev 10828)
@@ -25,6 +25,10 @@
setCheckWarning(false);
}
+ /**
+ *
+ * @throws Throwable
+ */
public void testAjaxValidator() throws Throwable {
performInvisibleTagTest(
"components/ajaxValidator.xhtml", "ajaxValidator");//$NON-NLS-1$ //$NON-NLS-2$
@@ -62,12 +66,12 @@
}
public void testDatascroller() throws Throwable {
-
+
performContentTest("components/datascroller.xhtml");//$NON-NLS-1$
}
public void testColumns() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performContentTest("components/columns.xhtml");//$NON-NLS-1$
}
public void testColumnGroup() throws Throwable {
@@ -75,11 +79,11 @@
}
public void testColumn() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performContentTest("components/column.xhtml");//$NON-NLS-1$
}
public void testDataGrid() throws Throwable {
- assertTrue("it is necessary to add a body of the test ", false);//$NON-NLS-1$
+ performContentTest("components/dataGrid.xhtml");//$NON-NLS-1$
}
public void testDataList() throws Throwable {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-14 12:52:11 UTC (rev 10827)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-14 13:34:51 UTC (rev 10828)
@@ -87,8 +87,8 @@
public static final String ATTR_ALIGN = "align"; //$NON-NLS-1$
public static final String ATTR_SRC = "src"; //$NON-NLS-1$
public static final String ATTR_ALT = "alt"; //$NON-NLS-1$
- public static final String ATTR_JSFC = "jsfc"; //$NON-NLS-1$
- public static final String ATTR_DISPLAY = "display"; //$NON-NLS-1$
+ public static final String ATTR_JSFC = "jsfc"; //$NON-NLS-1$
+ public static final String ATTR_DISPLAY = "display"; //$NON-NLS-1$
public static final String ATTR_READONLY = "readonly"; //$NON-NLS-1$
public static final String ATTR_SCOPE = "scope"; //$NON-NLS-1$
@@ -102,9 +102,10 @@
public static final String VALUE_CHECKBOX_TYPE = "checkbox"; //$NON-NLS-1$
public static final String VALUE_HIDDEN_TYPE = "hidden"; //$NON-NLS-1$
public static final String VALUE_BUTTON_TYPE = "button"; //$NON-NLS-1$
- public static final String VALUE_ALIGN_CENTER= "center"; //$NON-NLS-1$
+ public static final String VALUE_ALIGN_CENTER = "center"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_WIDTH = "width"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_HEIGHT = "height"; //$NON-NLS-1$
+ public static final String STYLE_PARAMETER_BACKGROUND_IMAGE = "background-image"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
}
\ No newline at end of file
Added: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComparisonException.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComparisonException.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComparisonException.java 2008-10-14 13:34:51 UTC (rev 10828)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.ui.test;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class ComparisonException extends Exception {
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = 7127064462771778364L;
+
+ public ComparisonException() {
+ super();
+ }
+
+ public ComparisonException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ComparisonException(String message) {
+ super(message);
+ }
+
+ public ComparisonException(Throwable cause) {
+ super(cause);
+ }
+
+}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-14 12:52:11 UTC (rev 10827)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/ComponentContentTest.java 2008-10-14 13:34:51 UTC (rev 10828)
@@ -92,8 +92,7 @@
for (String id : ids) {
- assertEquals(true, compareElements(controller, xmlTestDocument, id,
- id));
+ compareElements(controller, xmlTestDocument, id, id);
}
if (getException() != null) {
@@ -109,14 +108,20 @@
* @param elementId
* @param xmlTestId
* @return
+ * @throws ComparisonException
*/
- protected boolean compareElements(VpeController controller,
- Document xmlTestDocument, String elementId, String xmlTestId) {
+ protected void compareElements(VpeController controller,
+ Document xmlTestDocument, String elementId, String xmlTestId)
+ throws ComparisonException {
// get element by id
nsIDOMElement vpeElement = findElementById(controller, elementId);
assertNotNull(vpeElement);
+ // DOMTreeDumper dumper = new DOMTreeDumper(
+ // VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ // dumper.dumpToStream(System.out, vpeElement);
+
// get test element by id - get <test id="..." > element and get his
// first child
Element xmlModelElement = TestDomUtil.getFirstChildElement(TestDomUtil
@@ -125,7 +130,7 @@
assertNotNull(xmlModelElement);
// compare DOMs
- return TestDomUtil.compareNodes(vpeElement, xmlModelElement);
+ TestDomUtil.compareNodes(vpeElement, xmlModelElement);
}
@@ -186,9 +191,7 @@
.getDocumentElement();
assertNotNull(modelElement);
- // compare elements
- assertEquals(true, TestDomUtil
- .compareNodes(visualElement, modelElement));
+ TestDomUtil.compareNodes(visualElement, modelElement);
if (getException() != null) {
throw getException();
@@ -234,7 +237,7 @@
nsIDOMElement visualElement = findElementById(controller, elementId);
assertNull(visualElement);
- // check children of non-visual
+ // check children of non-visual
NodeList children = sourceELement.getChildNodes();
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
@@ -261,8 +264,7 @@
assertNotNull(modelElement);
// compare elements
- assertEquals(true, TestDomUtil
- .compareNodes(visualElement, modelElement));
+ TestDomUtil.compareNodes(visualElement, modelElement);
if (getException() != null) {
throw getException();
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 12:52:11 UTC (rev 10827)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestDomUtil.java 2008-10-14 13:34:51 UTC (rev 10828)
@@ -16,9 +16,14 @@
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
import org.jboss.tools.common.model.util.XMLUtil;
-import org.mozilla.interfaces.nsIDOMElement;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMAttr;
+import org.mozilla.interfaces.nsIDOMNamedNodeMap;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
import org.w3c.dom.Attr;
@@ -34,8 +39,16 @@
*/
public class TestDomUtil {
- public static String ID_ATTRIBUTE = "id";
+ final public static String ID_ATTRIBUTE = "id"; //$NON-NLS-1$
+ final public static String ILLEGAL_ATTRIBUTES = "illegalAttributes"; //$NON-NLS-1$
+
+ final public static String ILLEGAL_ATTRIBUTES_SEPARATOR = Constants.COMMA;
+
+ final public static String START_REGEX = "{"; //$NON-NLS-1$
+
+ final public static String END_REGEX = "}"; //$NON-NLS-1$
+
public static Document getDocument(File file) throws FileNotFoundException {
// create reader
FileReader reader = new FileReader(file);
@@ -103,40 +116,34 @@
* @param vpeNode
* @param schemeNode
* @return
+ * @throws ComparisonException
*/
- public static boolean compareNodes(nsIDOMNode vpeNode, Node schemeNode) {
+ public static void compareNodes(nsIDOMNode vpeNode, Node modelNode)
+ throws ComparisonException {
- // compare node's features
- if ((schemeNode.getNodeType() != vpeNode.getNodeType())
- || (!schemeNode.getNodeName().equalsIgnoreCase(
- vpeNode.getNodeName()))
- || ((schemeNode.getNodeValue() != null) && (!schemeNode
- .getNodeValue().trim().equalsIgnoreCase(
- vpeNode.getNodeValue().trim()))))
- return false;
-
+ if (!modelNode.getNodeName().equalsIgnoreCase(vpeNode.getNodeName())) {
+ throw new ComparisonException("name of tag is \""
+ + vpeNode.getNodeName() + "\"but must be \""
+ + modelNode.getNodeName() + "\"");
+ }
+ if ((modelNode.getNodeValue() != null)
+ && (!modelNode.getNodeValue().trim().equalsIgnoreCase(
+ vpeNode.getNodeValue().trim()))) {
+ throw new ComparisonException("value of " + vpeNode.getNodeName()
+ + " is \"" + vpeNode.getNodeValue().trim()
+ + "\" but must be \"" + modelNode.getNodeValue().trim()
+ + "\"");
+ }
// compare node's attributes
- if (schemeNode.getNodeType() == Node.ELEMENT_NODE) {
+ if (modelNode.getNodeType() == Node.ELEMENT_NODE) {
- NamedNodeMap attributes = schemeNode.getAttributes();
- nsIDOMElement vpeElement = (nsIDOMElement) vpeNode
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- if (attributes != null) {
- for (int i = 0; i < attributes.getLength(); i++) {
- Attr attr = (Attr) attributes.item(i);
-
- if ((!vpeElement.hasAttribute(attr.getName()))
- || (!attr.getNodeValue().trim().equals(
- vpeElement.getAttributeNode(attr.getName())
- .getNodeValue().trim())))
- return false;
- }
- }
+ compareAttributes(modelNode.getAttributes(), vpeNode
+ .getAttributes());
}
// compare children
nsIDOMNodeList vpeChildren = vpeNode.getChildNodes();
- NodeList schemeChildren = schemeNode.getChildNodes();
+ NodeList schemeChildren = modelNode.getChildNodes();
int realCount = 0;
for (int i = 0; i < schemeChildren.getLength(); i++) {
@@ -158,13 +165,10 @@
}
- if (!compareNodes(vpeChild, schemeChild))
- return false;
+ compareNodes(vpeChild, schemeChild);
}
- return true;
-
}
/**
@@ -185,4 +189,118 @@
}
return ids;
}
+
+ private static void compareAttributes(NamedNodeMap modelAttributes,
+ nsIDOMNamedNodeMap vpeAttributes) throws ComparisonException {
+
+ for (int i = 0; i < modelAttributes.getLength(); i++) {
+ Attr modelAttr = (Attr) modelAttributes.item(i);
+ String name = modelAttr.getName();
+
+ // if there are limitation of attributes
+ if (ILLEGAL_ATTRIBUTES.equals(name)) {
+
+ String[] illegalAttributes = modelAttr.getNodeValue().split(
+ ILLEGAL_ATTRIBUTES_SEPARATOR);
+
+ for (String illegalAttributeName : illegalAttributes) {
+ if (vpeAttributes.getNamedItem(illegalAttributeName.trim()) != null)
+ throw new ComparisonException("illegal attribute :"
+ + illegalAttributeName);
+ }
+
+ } else {
+
+ nsIDOMAttr vpeAttr = (nsIDOMAttr) vpeAttributes.getNamedItem(
+ name).queryInterface(nsIDOMAttr.NS_IDOMATTR_IID);
+
+ if (vpeAttr == null)
+ throw new ComparisonException("there is not : \"" + name
+ + "\" attribute");
+
+ if (HTML.ATTR_STYLE.equalsIgnoreCase(name)) {
+
+ String[] modelParameters = modelAttr.getNodeValue().split(
+ Constants.SEMICOLON);
+ String[] vpeParameters = vpeAttr.getNodeValue().split(
+ Constants.SEMICOLON);
+
+ for (int j = 0; j < modelParameters.length; j++) {
+ String modelParam = modelParameters[j];
+ String vpeParam = vpeParameters[j];
+
+ String[] splittedModelParam = modelParam.split(
+ Constants.COLON, 2);
+
+ String[] splittedVpeParam = vpeParam.split(
+ Constants.COLON, 2);
+
+ if (!splittedModelParam[0].trim().equals(
+ splittedVpeParam[0].trim())) {
+ throw new ComparisonException(
+ "param of style attribute is\""
+ + splittedVpeParam[0].trim()
+ + "\" but must be \""
+ + splittedModelParam[0].trim()
+ + "\"");
+ }
+
+ compareComplexStrings(splittedModelParam[1].trim(),
+ splittedVpeParam[1].trim());
+
+ }
+
+ } else {
+
+ compareComplexStrings(modelAttr.getNodeValue().trim(),
+ vpeAttr.getNodeValue().trim());
+
+ }
+ }
+ }
+ }
+
+ static private void compareComplexStrings(String modelString,
+ String vpeString) throws ComparisonException {
+
+ if (modelString.startsWith(START_REGEX)
+ && modelString.endsWith(END_REGEX)) {
+
+ String regex = modelString.substring(START_REGEX.length(),
+ modelString.length() - END_REGEX.length());
+
+ Matcher matcher = Pattern.compile(regex).matcher(vpeString);
+ if (!matcher.find()) {
+ throw new ComparisonException("string is\"" + vpeString
+ + "\" but pattern is \"" + regex + "\"");
+ }
+
+ } else if (!modelString.equals(vpeString)) {
+ throw new ComparisonException("string is\"" + vpeString
+ + "\" but must be \"" + modelString + "\"");
+ }
+
+ }
+
+ /**
+ * is created to be sure that attributes/parameters will be correctly
+ * compared ( ignore case )
+ *
+ * @param list
+ * @param string
+ * @return
+ */
+ static private boolean findIgnoreCase(String[] strings,
+ String requiredString) {
+
+ for (String string : strings) {
+
+ if (string.equalsIgnoreCase(requiredString))
+ return true;
+
+ }
+
+ return false;
+ }
+
}
17 years, 2 months
JBoss Tools SVN: r10827 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-14 08:52:11 -0400 (Tue, 14 Oct 2008)
New Revision: 10827
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta 2008-10-14 12:34:46 UTC (rev 10826)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-persistence.meta 2008-10-14 12:52:11 UTC (rev 10827)
@@ -155,7 +155,14 @@
attributes="name,class,scope,precedence,installed,auto-create,startup"
entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="filter name" xmlname="persistence:name.#text"/>
- <XModelAttribute PROPERTIES="category=advanced" name="enabled" xmlname="enabled"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="enabled" xmlname="enabled">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -298,6 +305,52 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="persistence:hibernate-session-factory" name="SeamPersistenceHibernateSessionFactory21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamPersistenceMappingClasses" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPersistenceMappingFiles" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPersistenceMappingJars" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPersistenceMappingPackages" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPersistenceMappingResources" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamPersistenceCfgProperties" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.core.bundle" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="hibernate session factory"
+ loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="cfg-resource-name" xmlname="cfg-resource-name"/>
+ <XModelAttribute PROPERTIES="category=general" name="naming-strategy" xmlname="persistence:naming-strategy.#text"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamPersistenceHibernateSessionFactory"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPersistenceHibernateSessionFactory"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPersistenceHibernateSessionFactory"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPersistenceHibernateSessionFactory"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="persistence:managed-persistence-context" name="SeamPersistenceManagedContext">
<XChildrenEntities>
<XChildEntity maxCount="1" name="SeamPersistenceFilters" required="yes"/>
@@ -865,7 +918,7 @@
<XChildEntity name="SeamPersistenceEntityManagerFactory"/>
<XChildEntity name="SeamPersistenceFilter"/>
<XChildEntity name="SeamPersistenceManagedHibernateSession"/>
- <XChildEntity name="SeamPersistenceHibernateSessionFactory"/>
+ <XChildEntity name="SeamPersistenceHibernateSessionFactory21"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -908,9 +961,10 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Hibernate Session Factory..." kind="action" name="AddHibernateSessionFactory">
- <EntityData EntityName="SeamPersistenceHibernateSessionFactory">
+ <EntityData EntityName="SeamPersistenceHibernateSessionFactory21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="cfg-resource-name" Mandatory="no"/>
+ <AttributeData AttributeName="naming-strategy" Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
17 years, 2 months
JBoss Tools SVN: r10826 - trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-14 08:34:46 -0400 (Tue, 14 Oct 2008)
New Revision: 10826
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java
trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java 2008-10-14 12:34:27 UTC (rev 10825)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/PropertyListFormLayoutData.java 2008-10-14 12:34:46 UTC (rev 10826)
@@ -28,6 +28,7 @@
static String ENT_FILTERS_20 = "SeamPersistenceFilters"; //$NON-NLS-1$
static String ENT_RULE_FILES = "SeamDroolsRuleFiles"; //$NON-NLS-1$
static String ENT_INTERCEPTORS = "SeamCoreInterceptors"; //$NON-NLS-1$
+ static String ENT_SUPPORTED_LOCALES = "SeamInternationalSupportedLocales"; //$NON-NLS-1$
static String ENT_RESTRICTIONS = "SeamFrameworkRestrictions"; //$NON-NLS-1$
static String ENT_HINTS = "SeamFrameworkHints"; //$NON-NLS-1$
@@ -121,6 +122,13 @@
final static IFormData INTERCEPTORS_DEFINITION = new FormData(
ENT_INTERCEPTORS, new String[]{null}, INTERCEPTORS_DEFINITIONS);
+ private final static IFormData[] SUPPORTED_LOCALES_DEFINITIONS = new IFormData[] {
+ createListDefinition("Supported Locales") //$NON-NLS-1$
+ };
+
+ final static IFormData SUPPORTED_LOCALES_DEFINITION = new FormData(
+ ENT_SUPPORTED_LOCALES, new String[]{null}, SUPPORTED_LOCALES_DEFINITIONS);
+
private final static IFormData[] FILTERS_DEFINITIONS = new IFormData[] {
createListDefinition("Filters") //$NON-NLS-1$
};
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java 2008-10-14 12:34:27 UTC (rev 10825)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml.ui/src/org/jboss/tools/seam/xml/ui/editor/form/core/SeamComponentsCoreFormLayoutData.java 2008-10-14 12:34:46 UTC (rev 10826)
@@ -34,6 +34,7 @@
PropertyListFormLayoutData.PAGEFLOW_20_DEFS_FORM_DEFINITION,
PropertyListFormLayoutData.BUNDLE_NAMES_FORM_DEFINITION,
PropertyListFormLayoutData.INTERCEPTORS_DEFINITION,
+ PropertyListFormLayoutData.SUPPORTED_LOCALES_DEFINITION,
PropertyListFormLayoutData.FILTERS_FORM_DEFINITION,
PropertyListFormLayoutData.FILTERS_20_FORM_DEFINITION,
17 years, 2 months
JBoss Tools SVN: r10825 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-14 08:34:27 -0400 (Tue, 14 Oct 2008)
New Revision: 10825
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-10-14 12:00:10 UTC (rev 10824)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-web.meta 2008-10-14 12:34:27 UTC (rev 10825)
@@ -51,7 +51,7 @@
attributes="url-pattern,disabled,regex-url-pattern"
entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=general" name="enable-cache" xmlname="enable-cache">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -59,7 +59,7 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="force-parser" xmlname="force-parser">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -107,7 +107,9 @@
<XModelAttribute PROPERTIES="category=advanced" name="realm" xmlname="realm"/>
<XModelAttribute PROPERTIES="category=advanced" name="key" xmlname="key"/>
<XModelAttribute PROPERTIES="category=advanced"
- name="nonce-validity-seconds" xmlname="nonce-validity-seconds"/>
+ name="nonce-validity-seconds" xmlname="nonce-validity-seconds">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="auth-type" xmlname="auth-type"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -148,7 +150,7 @@
entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=general" name="encoding" xmlname="encoding"/>
<XModelAttribute PROPERTIES="category=general" name="override-client" xmlname="override-client">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -236,7 +238,14 @@
attributes="class,scope,precedence,installed,auto-create"
entity="SeamComponent" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
- <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="disabled" xmlname="disabled">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
name="regex-url-pattern" xmlname="regex-url-pattern"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
@@ -326,6 +335,42 @@
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="web:identity-filter" name="SeamWebIdentityFilter21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="identity filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.web.identityFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="web:logging-filter" name="SeamWebLoggingFilter20">
<XChildrenEntities/>
<XEntityRenderer>
@@ -381,7 +426,7 @@
<XModelAttribute PROPERTIES="category=general" name="url-pattern" xmlname="url-pattern"/>
<XModelAttribute PROPERTIES="category=advanced"
name="create-temp-files" xmlname="create-temp-files">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -389,7 +434,9 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
- name="max-request-size" xmlname="max-request-size"/>
+ name="max-request-size" xmlname="max-request-size">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -428,7 +475,7 @@
entity="SeamWebContextFilter20" name="filter"/>
<XModelAttribute PROPERTIES="category=advanced"
name="create-temp-files" xmlname="create-temp-files">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -436,7 +483,9 @@
<Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced"
- name="max-request-size" xmlname="max-request-size"/>
+ name="max-request-size" xmlname="max-request-size">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -541,7 +590,7 @@
entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general"
name="invalidate-on-scheme-change" xmlname="invalidate-on-scheme-change">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -563,6 +612,102 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="web:session" name="SeamWebSession21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="session" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="invalidate-on-scheme-change" xmlname="invalidate-on-scheme-change">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="web:wicket-filter" name="SeamWebWicketFilter21">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.web.filter" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="wicket filter" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.web.wicketFilter" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create,startup"
+ entity="SeamComponent20" name="component"/>
+ <XModelAttributeReference
+ attributes="url-pattern,disabled,regex-url-pattern"
+ entity="SeamWebContextFilter20" name="filter"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="application-class" xmlname="application-class">
+ <Constraint loader="QClassName"/>
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general"
+ name="application-factory-class" xmlname="application-factory-class">
+ <Constraint loader="QClassName"/>
+ <Editor name="AccessibleJava"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced"
+ name="detect-portlet-context" xmlname="detect-portlet-context">
+ <Constraint loader="%ListEL%">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamWebContextFilter" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamWebContextFilter"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XEntityExtension name="FileSeamComponents12">
<XChildrenEntities>
<XChildEntity name="SeamWebContextFilter"/>
@@ -756,7 +901,9 @@
<XChildEntity name="SeamWebCharacterFilter20"/>
<XChildEntity name="SeamWebAjaxFilter20"/>
<XChildEntity name="SeamWebLoggingFilter20"/>
- <XChildEntity name="SeamWebServletSession20"/>
+ <XChildEntity name="SeamWebSession21"/>
+ <XChildEntity name="SeamWebIdentityFilter21"/>
+ <XChildEntity name="SeamWebWicketFilter21"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -829,12 +976,28 @@
</XActionItem>
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
- displayName="Servlet Session..." kind="action" name="AddServletSession">
- <EntityData EntityName="SeamWebServletSession20">
+ displayName="Session..." kind="action" name="AddSession">
+ <EntityData EntityName="SeamWebSession21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="scope" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Identity Filter..." kind="action" name="AddIdentityFilter">
+ <EntityData EntityName="SeamWebIdentityFilter21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="url-pattern" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Wicket Filter..." kind="action" name="AddWicketFilter">
+ <EntityData EntityName="SeamWebWicketFilter21">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="url-pattern" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
17 years, 2 months
JBoss Tools SVN: r10824 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-14 08:00:10 -0400 (Tue, 14 Oct 2008)
New Revision: 10824
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-14 11:38:47 UTC (rev 10823)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-14 12:00:10 UTC (rev 10824)
@@ -32,7 +32,7 @@
</itemizedlist>
</section>
-
+
<section id="birt_designer_features">
<title>BIRT Report Designer Features</title>
17 years, 2 months
JBoss Tools SVN: r10823 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-14 07:38:47 -0400 (Tue, 14 Oct 2008)
New Revision: 10823
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta 2008-10-14 11:04:18 UTC (rev 10822)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-international.meta 2008-10-14 11:38:47 UTC (rev 10823)
@@ -46,14 +46,16 @@
entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="locale-string" xmlname="locale-string"/>
<XModelAttribute PROPERTIES="category=advanced" name="cookie-enabled" xmlname="cookie-enabled">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -102,14 +104,16 @@
entity="SeamComponent20" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="time-zone-id" xmlname="time-zone-id"/>
<XModelAttribute PROPERTIES="category=advanced" name="cookie-enabled" xmlname="cookie-enabled">
- <Constraint loader="List">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
</Constraint>
<Editor name="List"/>
</XModelAttribute>
- <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="cookie-max-age" xmlname="cookie-max-age">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -138,6 +142,79 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="international:locale-config" name="SeamInternationalLocaleConfig">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamInternationalSupportedLocales" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.core.bundle" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="locale config" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="org.jboss.seam.international.localeConfig" name="name" xmlname="name"/>
+ <XModelAttributeReference
+ attributes="class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="default-locale" xmlname="default-locale"/>
+ <XModelAttribute PROPERTIES="category=general"
+ name="supported-locales" xmlname="supported-locales"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamCoreLocaleSelector20"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamCoreLocaleSelector20"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamCoreLocaleSelector20"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamCoreLocaleSelector20"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;children=%Ordered%;childrenLoader=list;saveDefault=false"
+ XMLSUBPATH="international:supported-locales" name="SeamInternationalSupportedLocales">
+ <XChildrenEntities>
+ <XChildEntity name="SeamListEntry"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="bundle-names" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="supported-locales" name="name">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItemReference entity="SeamPropertyList" name="CreateActions" path="CreateActions"/>
+ <XActionItemReference entity="SeamPropertyList" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamPropertyList" name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamPropertyList" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamPropertyList" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
<XEntityExtension name="FileSeamComponents20">
<XChildrenEntities>
<XChildEntity name="SeamCoreLocaleSelector20"/>
@@ -172,6 +249,7 @@
<XChildrenEntities>
<XChildEntity name="SeamCoreLocaleSelector20"/>
<XChildEntity name="SeamCoreTimeZoneSelector20"/>
+ <XChildEntity name="SeamInternationalLocaleConfig"/>
</XChildrenEntities>
<XActionItem kind="list">
<XActionItem ICON="action.empty" displayName="New" group="1"
@@ -194,6 +272,14 @@
<AttributeData AttributeName="time-zone-id" Mandatory="no"/>
</EntityData>
</XActionItem>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="Locale Config..." kind="action" name="AddLocaleConfig">
+ <EntityData EntityName="SeamInternationalLocaleConfig">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="default-locale" Mandatory="no"/>
+ </EntityData>
+ </XActionItem>
</XActionItem>
</XActionItem>
</XActionItem>
17 years, 2 months
JBoss Tools SVN: r10822 - trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-10-14 07:04:18 -0400 (Tue, 14 Oct 2008)
New Revision: 10822
Modified:
trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
Log:
JBIDE-2855
Modified: trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-10-14 08:00:49 UTC (rev 10821)
+++ trunk/seam/plugins/org.jboss.tools.seam.xml/resources/meta/seam-framework.meta 2008-10-14 11:04:18 UTC (rev 10822)
@@ -31,7 +31,7 @@
</ICONS>
<GlobalActions kind="list"/>
<XModelEntity ImplementingClass="%Custom%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;saveDefault=false"
XMLSUBPATH="framework:ejbql" name="SeamFrameworkEjbql">
<XChildrenEntities/>
<XEntityRenderer>
@@ -98,14 +98,7 @@
<XModelAttribute PROPERTIES="category=advanced" name="new-instance" xmlname="new-instance"/>
<XModelAttribute name="created-message" xmlname="created-message"/>
<XModelAttribute PROPERTIES="category=advanced"
- name="updated-message" xmlname="updated-message">
- <Constraint loader="ListString">
- <value/>
- <value name="true"/>
- <value name="false"/>
- </Constraint>
- <Editor name="ListString"/>
- </XModelAttribute>
+ name="updated-message" xmlname="updated-message"/>
<XModelAttribute PROPERTIES="category=advanced"
name="deleted-message" xmlname="deleted-message"/>
<XModelAttribute PROPERTIES="category=advanced" name="entity-manager" xmlname="entity-manager"/>
@@ -160,7 +153,9 @@
entity="SeamComponent" name="component"/>
<XModelAttribute PROPERTIES="category=general" name="ejbql" xmlname="ejbql"/>
<XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
- <XModelAttribute name="max-results" xmlname="max-results"/>
+ <XModelAttribute name="max-results" xmlname="max-results">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="entity-manager" xmlname="entity-manager"/>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
@@ -191,6 +186,86 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;saveDefault=false"
+ XMLSUBPATH="framework:entity-query" name="SeamFrameworkEntityQuery21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamFrameworkEjbql" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkOrder" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkRestrictions" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkGroupby" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkHints" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.framework.query" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="entity query" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="name,class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="ejbql" xmlname="ejbql"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="max-results" xmlname="max-results">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced" name="entity-manager" xmlname="entity-manager"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="group-by" xmlname="group-by"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamFrameworkEntityQuery"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamFrameworkEntityQuery"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamFrameworkEntityQuery"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamFrameworkEntityQuery"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;saveDefault=false"
+ XMLSUBPATH="framework:group-by" name="SeamFrameworkGroupby">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.framework.home" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="group-by" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="id=true;category=general"
+ default="group-by" name="name" visibility="false">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="value" xmlname="#text"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamFrameworkEjbql" name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamFrameworkEjbql"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamFrameworkEjbql" name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamFrameworkEjbql" name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
XMLSUBPATH="framework:hibernate-entity-home" name="SeamFrameworkHibernateEntityHome">
<XChildrenEntities/>
@@ -264,7 +339,7 @@
<XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
<XModelAttribute name="max-results" xmlname="max-results"/>
<XModelAttribute PROPERTIES="category=advanced" name="cacheable" xmlname="cacheable">
- <Constraint loader="ListString">
+ <Constraint loader="%ListEL%">
<value/>
<value name="true"/>
<value name="false"/>
@@ -273,7 +348,9 @@
</XModelAttribute>
<XModelAttribute PROPERTIES="category=advanced" name="cache-region" xmlname="cache-region"/>
<XModelAttribute PROPERTIES="category=advanced" name="session" xmlname="session"/>
- <XModelAttribute PROPERTIES="category=advanced" name="fetch-size" xmlname="fetch-size"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="fetch-size" xmlname="fetch-size">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
<XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
<Editor name="Note"/>
</XModelAttribute>
@@ -303,6 +380,63 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%Custom%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData"
+ XMLSUBPATH="framework:hibernate-entity-query" name="SeamFrameworkHibernateEntityQuery21">
+ <XChildrenEntities>
+ <XChildEntity maxCount="1" name="SeamFrameworkEjbql" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkOrder" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkRestrictions" required="yes"/>
+ <XChildEntity maxCount="1" name="SeamFrameworkGroupby" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.seam.framework.query" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="hibernate entity query"
+ loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="name,class,scope,precedence,installed,auto-create"
+ entity="SeamComponent" name="component"/>
+ <XModelAttribute PROPERTIES="category=general" name="ejbql" xmlname="ejbql"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="order" xmlname="order"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="max-results" xmlname="max-results"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="group-by" xmlname="group-by"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="cacheable" xmlname="cacheable">
+ <Constraint loader="ListString">
+ <value/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=advanced" name="cache-region" xmlname="cache-region"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="session" xmlname="session"/>
+ <XModelAttribute PROPERTIES="category=advanced" name="fetch-size" xmlname="fetch-size">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions"/>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="SeamFrameworkHibernateEntityQuery"
+ name="CopyActions" path="CopyActions"/>
+ <XActionItemReference entity="SeamFrameworkHibernateEntityQuery"
+ name="DeleteActions" path="DeleteActions"/>
+ <XActionItemReference entity="SeamFrameworkHibernateEntityQuery"
+ name="Properties" path="Properties"/>
+ <XActionItemReference entity="SeamFrameworkHibernateEntityQuery"
+ name="MoveActions" path="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%Custom%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.seam.xml.ui.editor.form.core.SeamComponentsCoreFormLayoutData;children=%Ordered%;childrenLoader=map;saveDefault=false"
XMLSUBPATH="framework:hints" name="SeamFrameworkHints">
<XChildrenEntities>
@@ -603,8 +737,8 @@
</XEntityExtension>
<XEntityExtension name="FileSeamComponents21">
<XChildrenEntities>
- <XChildEntity name="SeamFrameworkEntityQuery"/>
- <XChildEntity name="SeamFrameworkHibernateEntityQuery"/>
+ <XChildEntity name="SeamFrameworkEntityQuery21"/>
+ <XChildEntity name="SeamFrameworkHibernateEntityQuery21"/>
<XChildEntity name="SeamFrameworkEntityHome"/>
<XChildEntity name="SeamFrameworkHibernateEntityHome"/>
</XChildrenEntities>
@@ -616,7 +750,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Entity Query..." kind="action" name="AddEntityQuery">
- <EntityData EntityName="SeamFrameworkEntityQuery">
+ <EntityData EntityName="SeamFrameworkEntityQuery21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="ejbql" Mandatory="no"/>
</EntityData>
@@ -624,7 +758,7 @@
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
displayName="Hibernate Entity Query..." kind="action" name="AddHibernateEntityQuery">
- <EntityData EntityName="SeamFrameworkHibernateEntityQuery">
+ <EntityData EntityName="SeamFrameworkHibernateEntityQuery21">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="ejbql" Mandatory="no"/>
</EntityData>
17 years, 2 months
JBoss Tools SVN: r10821 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-14 04:00:49 -0400 (Tue, 14 Oct 2008)
New Revision: 10821
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
Log:
Minor changes (an unused field removed from class EichFacesComboBoxCreator)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java 2008-10-14 05:12:13 UTC (rev 10820)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java 2008-10-14 08:00:49 UTC (rev 10821)
@@ -38,7 +38,6 @@
*
*/
public class RichFacesComboBoxCreator {
- private static final String EXPANDED_ATTR_NAME = "expanded"; //$NON-NLS-1$
private static final WeakHashMap<Node, Object> expandedComboBoxes = new WeakHashMap<Node, Object>();
private static final String DISABLED_ATTR_NAME = "disabled"; //$NON-NLS-1$
private static final String BUTTON_ICON_CLASSES_DISABLED =
@@ -245,7 +244,7 @@
if (sourceButtonStyle != null) {
buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
}
- //
+
final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
;
@@ -565,7 +564,7 @@
expandedComboBoxes.put(sourceNode, null);
}
}
-
+
public static void stopToggling(final Node sourceNode) {
expandedComboBoxes.remove(sourceNode);
}
17 years, 2 months
JBoss Tools SVN: r10820 - trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-14 01:12:13 -0400 (Tue, 14 Oct 2008)
New Revision: 10820
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.jsp
Log:
fix test errors
Copied: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.jsp (from rev 10781, trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp)
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.jsp 2008-10-14 05:12:13 UTC (rev 10820)
@@ -0,0 +1,2 @@
+<jsp:forward page="forward/forwardHiperlinkPage2Tests.jsp"></jsp:forward>
+<jsp:forward page="forwardHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.jsp (from rev 10781, trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp)
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.jsp 2008-10-14 05:12:13 UTC (rev 10820)
@@ -0,0 +1,2 @@
+<jsp:forward page="include/includeHiperlinkPage2Tests.jsp"></jsp:forward>
+<jsp:forward page="includeHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r10819 - trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-14 01:09:02 -0400 (Tue, 14 Oct 2008)
New Revision: 10819
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/TestBean1.java
Log:
fix test errors
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/TestBean1.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/TestBean1.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/TestBean1.java 2008-10-14 05:09:02 UTC (rev 10819)
@@ -0,0 +1,36 @@
+package org.jboss.tools.test;
+
+public class TestBean1 {
+
+ private String property1;
+
+ private String property2;
+
+ private int property3;
+
+ public String getProperty1() {
+ return property1;
+ }
+
+ public void setProperty1(String property1) {
+ this.property1 = property1;
+ }
+
+ public String getProperty2() {
+ return property2;
+ }
+
+ public void setProperty2(String property2) {
+ this.property2 = property2;
+ }
+
+ public int getProperty3() {
+ return property3;
+ }
+
+ public void setProperty3(int property3) {
+ this.property3 = property3;
+ }
+
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/TestBean1.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
17 years, 2 months
JBoss Tools SVN: r10818 - trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-13 22:47:53 -0400 (Mon, 13 Oct 2008)
New Revision: 10818
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
Log:
JBIDE-2885
Validate the file path
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-14 02:40:34 UTC (rev 10817)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-14 02:47:53 UTC (rev 10818)
@@ -3,6 +3,7 @@
*/
package org.jboss.tools.smooks.xml;
+import java.io.File;
import java.util.Collections;
import org.eclipse.core.resources.IFile;
@@ -182,12 +183,9 @@
// dialog.setInitialSelections(selectedResources);
if (files.length > 0) {
IFile file = files[0];
- String s = ResourcesPlugin.getWorkspace().getRoot().getLocation().append(
- file.getFullPath()).toString();
+ String s = file.getLocation().toOSString();
relationT.setText(s);
- return;
}
- relationT.setText("");
}
protected Composite createFileSelectionComposite(Composite parent) {
@@ -313,9 +311,7 @@
String path = dialog.open();
if (path != null) {
relationText.setText(path);
- } else {
- relationText.setText("");
- }
+ }
}
protected void changeWizardPageStatus() {
@@ -323,6 +319,12 @@
String error = null;
if (text == null || "".equals(text))
error = "Please Select a file";
+
+ File tempFile = new File(text);
+ if(!tempFile.exists()){
+ error = "Can't find the file , please select another one.";
+ }
+
// if (!reasourceLoaded) {
// error = "Resource must be loaded";
// }
17 years, 3 months
JBoss Tools SVN: r10817 - in trunk/jbpm/plugins: org.jboss.tools.jbpm.convert and 32 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-13 22:40:34 -0400 (Mon, 13 Oct 2008)
New Revision: 10817
Added:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.project
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/icons/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/icons/sample.gif
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/lib/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.xml
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
add bpmn -> jpdl plugin to trunk
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.classpath 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="bin/" sourcepath="src/org/jboss/tools/jbpm/convert/b2j/messages"/>
+ <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.project
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.project (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.project 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jbpm.convert</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,7 @@
+#Wed Jul 23 02:43:33 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %PLUGIN_NAME
+Bundle-SymbolicName: org.jboss.tools.jbpm.convert.bpmnto;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.common;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .,
+ lib/dom4j-1.6.1.jar,
+ bin/
+Bundle-Vendor: %PLUGIN_PROVIDER
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.model
+Export-Package: org.jboss.tools.jbpm.convert.bpmnto,
+ org.jboss.tools.jbpm.convert.bpmnto.translate,
+ org.jboss.tools.jbpm.convert.bpmnto.util,
+ org.jboss.tools.jbpm.convert.bpmnto.wizard
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ lib/dom4j-1.6.1.jar,\
+ bin/
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/icons/sample.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/icons/sample.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.properties 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,5 @@
+wizard.name=BPMN -> JPDL
+wizard.description = Export a BPMN file to JPDL
+category.name=BPMN Export
+PLUGIN_NAME=BPMNExport
+PLUGIN_PROVIDER=Red Hat, Inc.
\ No newline at end of file
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.xml (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/plugin.xml 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.ui.exportWizards">
+ <category name="%category.name"
+ id="org.jboss.tools.jbpm.convert.export.category"/>
+ <wizard name="%wizard.name"
+ icon="icons/sample.gif"
+ category="org.jboss.tools.jbpm.convert.export.category"
+ class="org.jboss.tools.jbpm.convert.b2j.wizard.B2JExportWizard"
+ id="org.jboss.tools.jbpm.convert.export.b2jexportwizard">
+ <description>%wizard.description</description>
+ <selection name="*.bpmn" class="org.eclipse.core.resources.IFile"/>
+ </wizard>
+ </extension>
+
+</plugin>
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class B2JMessages {
+
+ private static final String BUNDLE_NAME = "org.jboss.tools.jbpm.convert.b2j.messages.B2J"; //$NON-NLS-1$
+
+ private B2JMessages() {
+ // Do not instantiate
+ }
+
+ public static String Loop_Decision;
+ public static String To;
+ public static String Folder_Name_Separator;
+ public static String Space;
+ public static String Underline;
+ public static String Width_Attribute_Name;
+ public static String Height_Attribute_Name;
+ public static String X_Attribute_Name;
+ public static String Y_Attribute_Name;
+ public static String Label_Select_All;
+ public static String Label_Deselect_All;
+ public static String Label_Button_Browse;
+ public static String Bpmn_Diagram_Name_Suffix;
+ public static String Bpmn_Pool_Element_Name;
+ public static String Bpmn_Element_ID;
+ public static String Bpmn_Vertice_Element_Name;
+ public static String Bpmn_SequenceFlow_Element_Name;
+ public static String Bpmn_Looping_Attribute_Name;
+ public static String Bpmn_InFlow_Attribute_Name;
+ public static String Bpmn_XmiType_Attribute_Name;
+ public static String Bpmn_Href_Attribute_Name;
+ public static String Bpmn_ActivityType_Attribute_Name;
+ public static String Bpmn_FlowSource_Attribute_Name;
+ public static String Bpmn_FlowTarget_Attribute_Name;
+ public static String Bpmn_FlowDefault_Attribute_Name;
+ public static String Bpmn_Wizard_Title;
+ public static String Bpmn_File_Choose_WizardPage_Name;
+ public static String Bpmn_File_Choose_WizardPage_Title;
+ public static String Bpmn_File_Choose_WizardPage_Message;
+ public static String Bpmn_File_Choose_WizardPage_ViewerTitle;
+ public static String Bpmn_Pool_Choose_WizardPage_Name;
+ public static String Bpmn_Pool_Choose_WizardPage_Message;
+ public static String Bpmn_Pool_Choose_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Name;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Message;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_CheckBox;
+ public static String Bpmn_Translate_Message_WizardPage_Name;
+ public static String Bpmn_Translate_Message_WizardPage_Title;
+ public static String Bpmn_Translate_Message_WizardPage_Message;
+ public static String Bpmn_Translate_Message_WizardpageViewer_Title;
+ public static String Bpmn_EAnnotations_Element_Name;
+ public static String Bpmn_Details_Element_Name;
+ public static String Bpmn_Value_Attribute_Name;
+ public static String Jpdl_Element_Decision_Suffix;
+ public static String Jpdl_Element_Complete_Suffix;
+ public static String Jpdl_Element_Cancel_Suffix;
+ public static String Jpdl_Element_Successful_Name;
+ public static String Jpdl_Suffix;
+ public static String Jpdl_Process_Definition_Name;
+ public static String Jpdl_ProcessState_Element_Name;
+ public static String Jpdl_SubProcess_Element_Name;
+ public static String Jpdl_32_Namespace_Url;
+ public static String Jpdl_Process_Definition_Element_Name;
+ public static String Jpdl_Transition_Element;
+ public static String Jpdl_Decision_Element_Name;
+ public static String Jpdl_Fork_Element_Name;
+ public static String Jpdl_Join_Element_Name;
+ public static String Jpdl_Start_Element_Name;
+ public static String Jpdl_State_Element_Name;
+ public static String Jpdl_End_Element_Name;
+ public static String Jpdl_Node_Element_Name;
+ public static String Gpd_Definition_Name;
+ public static String Gpd_Layout_Element_Name;
+ public static String Gpd_Element_Name;
+ public static String Gpd_Process_Diagram_Name;
+ public static String Gpd_Label_Element_Name;
+ public static String Dom_Element_Name;
+ public static String Dom_Element_ID;
+ public static String Translate_Error_JpdlProcess_Definition_Null;
+ public static String Translate_Error_JpdlFile_CanNotWrite;
+ public static String Translate_Error_JpdlFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotWrite;
+ public static String Translate_Error_File_CanNotRead;
+ public static String Translate_Warning_Bpmn_Element_Name;
+ public static String Translate_Warning_Bpmn_Element_Type;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, B2JMessages.class);
+ }
+}
\ No newline at end of file
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,466 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn ->jpdl
+ */
+public class BPMN2JPDL extends BPMNTranslator {
+
+ Document bpmnDocument;
+ List<Document> processDefs = new ArrayList<Document>();
+
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public Map<String, Element> getMap() {
+ return map;
+ }
+
+ public void setMap(Map<String, Element> map) {
+ this.map = map;
+ }
+
+ public BPMN2JPDL() {
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ Document bpmnDocument) {
+ this(bpmnFileName, bpmnFilePath, null, bpmnDocument);
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList, Document bpmnDocument) {
+ super(bpmnFileName, bpmnFilePath, poolIDList);
+ this.bpmnDocument = bpmnDocument;
+ }
+
+ /*
+ * Translate a bpmn diagram to string[]. Every string is jpdl process
+ * definition
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[processDefs.size()];
+ int i = 0;
+ for (Document def : processDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_JpdlFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+
+ return strForProcessDefs;
+ }
+
+ /*
+ * Translate a bpmn diagram to file[]. Every file is a jpdl file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForProcessDefs = translateToStrings();
+ String[] jpdlFileNames = new String[processDefs.size()];
+
+ int i = 0;
+ for (Document def : processDefs) {
+ jpdlFileNames[i] = def.getName();
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForProcessDefs, jpdlFileNames,
+ B2JMessages.Jpdl_Process_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_JpdlFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn diagram Domument tree to some jpdl process Dom trees
+ */
+ public void translateDiagram() {
+
+ // set the namemap = null
+ TranslateHelper.setNameMap(new HashMap<String, Integer>());
+
+ Element diagram = bpmnDocument.getRootElement();
+ if (this.poolIDList == null || this.poolIDList.size() == 0) {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ translateGraph((Element) pool);
+ }
+ } else {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (this.poolIDList.contains(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID))) {
+ translateGraph((Element) pool);
+ }
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn pool or subprocess to a jpdl process Dom tree
+ */
+ private Element translateGraph(Element graph) {
+ Document processDef = TranslateHelper.createJpdlDomTree(true);
+ Element processRoot = processDef.getRootElement();
+
+ DomXmlWriter.addAttribute(processRoot, B2JMessages.Dom_Element_Name,
+ TranslateHelper.generateProcessName(graph));
+ processDef.setName(processRoot
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ map.put(graph.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Pool_Element_Name, processRoot);
+
+ for (Object activity : graph.elements()) {
+ if (B2JMessages.Bpmn_Vertice_Element_Name
+ .equals(((Element) activity).getName())) {
+ translateActivity(((Element) activity), processRoot);
+ }
+ }
+ translateSequenceFlows(graph, processRoot);
+ processDefs.add(processDef);
+
+ return processRoot;
+ }
+
+ /*
+ * Translate a bpmn activity to a jpdl node according to activity type
+ */
+ private void translateActivity(Element activity, Element processRoot) {
+ String type = activity
+ .attributeValue(B2JMessages.Bpmn_XmiType_Attribute_Name);
+ Element element = null;
+
+ // According to bpmn activity type, map to different jpdl node
+ // Some type can not be supported by this translation, we give
+ // a warining message for it.
+ if ("bpmn:Activity".equals(type)) {
+ String activityType = activity
+ .attributeValue(B2JMessages.Bpmn_ActivityType_Attribute_Name);
+ if (activityType == null || "Task".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ } else if ("EventStartEmpty".equals(activityType)
+ || "EventStartMessage".equals(activityType)
+ || "EventStartRule".equals(activityType)
+ || "EventStartTimer".equals(activityType)
+ || "EventStartLink".equals(activityType)
+ || "EventStartMultiple".equals(activityType)
+ || "EventStartSignal".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Start_Element_Name);
+ if (!"EventStartEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventIntermediateEmpty".equals(activityType)
+ || "EventIntermediateMessage".equals(activityType)
+ || "EventIntermediateTimer".equals(activityType)
+ || "EventIntermediateError".equals(activityType)
+ || "EventIntermediateCompensation".equals(activityType)
+ || "EventIntermediateRule".equals(activityType)
+ || "EventIntermediateMultiple".equals(activityType)
+ || "EventIntermediateCancel".equals(activityType)
+ || "EventIntermediateLink".equals(activityType)
+ || "EventIntermediateSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_State_Element_Name);
+ if (!"EventIntermediateEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventEndEmpty".equals(activityType)
+ || "EventEndMessage".equals(activityType)
+ || "EventEndError".equals(activityType)
+ || "EventEndCompensation".equals(activityType)
+ || "EventEndTerminate".equals(activityType)
+ || "EventEndLink".equals(activityType)
+ || "EventEndMultiple".equals(activityType)
+ || "EventEndCancel".equals(activityType)
+ || "EventEndSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_End_Element_Name);
+ if (!"EventEndEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayDataBasedExclusive".equals(activityType)
+ || "GatewayEventBasedExclusive".equals(activityType)
+ || "GatewayComplex".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+ if (!"GatewayDataBasedExclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayParallel".equals(activityType)
+ || "GatewayDataBasedInclusive".equals(activityType)) {
+ if (activity
+ .attributeValue(B2JMessages.Bpmn_InFlow_Attribute_Name) == null
+ || activity.attributeValue(
+ B2JMessages.Bpmn_InFlow_Attribute_Name).split(
+ B2JMessages.Space).length == 1) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Fork_Element_Name);
+ } else {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Join_Element_Name);
+ }
+ if (!"GatewayDataBasedInclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ }
+ } else if ("bpmn:SubProcess".equals(type)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_ProcessState_Element_Name);
+ translateSubprocess(activity, element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(activity, element)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + activity.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), element);
+
+ // If bpmn activity is loop type, then create a structure to mock it.
+ if ("true".equals(activity
+ .attributeValue(B2JMessages.Bpmn_Looping_Attribute_Name))) {
+ createMockLoop(activity, element);
+ }
+ }
+
+ /*
+ * Translate a bpmn subprocess to a jpdl processstate and a new jpdl process
+ * difinition
+ */
+ private void translateSubprocess(Element subProcess, Element element) {
+ Element processRoot = translateGraph(subProcess);
+ Element ele = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_SubProcess_Element_Name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name,
+ processRoot);
+
+ // translate the transaction of subprocess
+ Element eAnnot = subProcess
+ .element(B2JMessages.Bpmn_EAnnotations_Element_Name);
+ if (eAnnot != null) {
+ Element details = eAnnot
+ .element(B2JMessages.Bpmn_Details_Element_Name);
+ if (details != null
+ && "true"
+ .equals(details
+ .attributeValue(B2JMessages.Bpmn_Value_Attribute_Name))) {
+ translateTransaction(processRoot);
+ }
+ }
+ }
+
+ /*
+ * translate a transaction of sub process
+ */
+ private void translateTransaction(Element processRoot) {
+ List<Element> lastEleList = TranslateHelper.locateLastElements(processRoot);
+
+ if (lastEleList.size() == 0) {
+ return;
+ }
+ // create a decision
+ Element decision = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Successful_Name);
+ // get bpmn id from map
+ String bpmnId = null;
+ for (String key : map.keySet()) {
+ if (map.get(key) == lastEleList.get(0)) {
+ bpmnId = key;
+ break;
+ }
+ }
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Decision_Suffix, decision);
+
+ // create a transition from element to decision
+ for (Element ele : lastEleList) {
+ Element transition = DomXmlWriter.addElement(ele,
+ B2JMessages.Jpdl_Transition_Element);
+ transition.addAttribute(B2JMessages.Dom_Element_Name, ele
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.To + B2JMessages.Jpdl_Decision_Element_Name);
+ transition.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ // create a complete element
+ Element complete = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(complete, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Complete_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Complete_Suffix, complete);
+
+ // create a cancel element
+ Element cancel = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(cancel, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Cancel_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Cancel_Suffix, cancel);
+
+ // create transition from decision to complete element
+ Element toComplete = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toComplete.addAttribute(B2JMessages.Dom_Element_Name, "true");
+ toComplete.addAttribute(B2JMessages.To, complete
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create transition from decision to cancel element
+ Element toCancel = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toCancel.addAttribute(B2JMessages.Dom_Element_Name, "false");
+ toCancel.addAttribute(B2JMessages.To, cancel
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+
+ /*
+ * Translate bpmn sequenceflows to jpdl transitions
+ */
+ private void translateSequenceFlows(Element graph, Element processRoot) {
+ for (Object edge : graph
+ .elements(B2JMessages.Bpmn_SequenceFlow_Element_Name)) {
+ translateSequenceFlow((Element) edge, processRoot);
+ }
+ }
+
+ /*
+ * Translate a bpmn sequenceflow to a jpdl transition
+ */
+ private void translateSequenceFlow(Element edge, Element processRoot) {
+
+ Element source = map.get(edge
+ .attributeValue(B2JMessages.Bpmn_FlowSource_Attribute_Name));
+
+ Element transition = null;
+ if ("true".equals(edge
+ .attributeValue(B2JMessages.Bpmn_FlowDefault_Attribute_Name))
+ && source.element(B2JMessages.Jpdl_Transition_Element) != null) {
+ // move default transition to the first of transition list
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element, 0);
+ } else {
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(edge, transition)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + edge.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ transition
+ .addAttribute(
+ B2JMessages.To,
+ map
+ .get(
+ edge
+ .attributeValue(B2JMessages.Bpmn_FlowTarget_Attribute_Name))
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ /*
+ * create a jpdl decision structure to map bpmn loop activity
+ */
+ private void createMockLoop(Element activity, Element element) {
+
+ // create a decision
+ Element decision = DomXmlWriter.addElement(element.getParent(),
+ B2JMessages.Jpdl_Decision_Element_Name);
+ String name = activity.attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.Underline + B2JMessages.Loop_Decision;
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name, name);
+
+ // use the decision to replace the activity in the map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), decision);
+ // add the activity to map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Vertice_Element_Name, element);
+
+ // create a transition from element to decision
+ Element first = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_Transition_Element);
+ first.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline + name);
+ first.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create a transition from decision to element
+ Element second = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ second.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline
+ + element.attributeValue(B2JMessages.Dom_Element_Name));
+ second.addAttribute(B2JMessages.To, element
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ }
+
+ public List<Document> getProcessDefs() {
+ return processDefs;
+ }
+
+ public void setProcessDefs(List<Document> processDefs) {
+ this.processDefs = processDefs;
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn_diagram to gpd of jpdl
+ */
+public class GraphicalFileGenerator extends BPMNTranslator {
+
+ Document document;
+
+ // gpd.xml documents list
+ List<Document> gpdDefs = new ArrayList<Document>();
+
+ // the pool of gpd.xml name
+ List<String> gpdPoolNames = new ArrayList<String>();
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public GraphicalFileGenerator(Document bpmnDiagramDocument,
+ Map<String, Element> map, String rootLocation, String bpmnFileName) {
+ this.rootLocation = rootLocation;
+ this.bpmnFileName = bpmnFileName;
+ this.document = bpmnDiagramDocument;
+ this.map = map;
+ }
+
+ /*
+ * translate a bpmn_diagram document to a gpd document string
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_GpdFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+ return strForProcessDefs;
+ }
+
+ /*
+ * translate every gpd document string to a gpd file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForGpdDefs = translateToStrings();
+ String[] gpdFileNames = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ gpdFileNames[i] = def.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name);
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForGpdDefs, gpdFileNames,
+ B2JMessages.Gpd_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_GpdFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * translate the graphical bpmn_diagram document
+ */
+ public void translateDiagram() {
+ Element rootElement = document.getRootElement();
+ List<Element> eleList = DomXmlWriter.getElementsByName(rootElement,
+ B2JMessages.Gpd_Element_Name);
+
+ for (String bpmnID : map.keySet()) {
+ if (bpmnID != null) {
+ // when translate bpmn loop activity, we create a mock
+ // structure and when translate bpmn transaction, we create a
+ // mock structure too. For these reason, we need to give a (x,y)
+ // increment to avoid two element overlap
+ int xIncre = 0;
+ int yIncre = 0;
+ Element bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ bpmnID, eleList);
+ if (bpmnGpdEle == null) {
+ if (bpmnID.endsWith(B2JMessages.Bpmn_Vertice_Element_Name)) {
+ bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ TranslateHelper.getPureBpmnID(bpmnID,
+ B2JMessages.Bpmn_Vertice_Element_Name),
+ eleList);
+ xIncre = 150;
+ yIncre = 50;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Decision_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Decision_Suffix),
+ eleList);
+ xIncre = 150;
+ yIncre = 100;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Complete_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Complete_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 0;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Cancel_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Cancel_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 200;
+ }
+ }
+ if (bpmnGpdEle == null) {
+ continue;
+ }
+ translateGraphicalElement(TranslateHelper.getXY(bpmnGpdEle,
+ xIncre, yIncre), map.get(bpmnID), eleList);
+ }
+ }
+
+ }
+
+ private void translateGraphicalElement(String[] xy, Element jpdlEle,
+ List<Element> eleList) {
+ if (jpdlEle == null) {
+ return;
+ }
+
+ // if not translate, then translate the pool of the element
+ if (!gpdPoolNames.contains(jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))
+ && B2JMessages.Jpdl_Process_Definition_Element_Name
+ .equals(jpdlEle.getParent().getName())) {
+ translatePool(eleList, jpdlEle);
+ }
+
+ // translate the bpmn graphical element
+ Element poolEle = null;
+ for (Document doc : gpdDefs) {
+ if (doc.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name).equals(
+ jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))) {
+ poolEle = doc.getRootElement();
+ }
+ }
+ Element pgdEle = TranslateHelper.createNode(poolEle,
+ B2JMessages.Jpdl_Node_Element_Name, jpdlEle);
+
+ TranslateHelper.mapXY(pgdEle, xy[0], xy[1]);
+
+ // translate the sequence flow of the element
+ for (Object ele : jpdlEle.elements(B2JMessages.Jpdl_Transition_Element)) {
+ TranslateHelper.createTransition(pgdEle,
+ B2JMessages.Jpdl_Transition_Element, (Element) ele);
+ }
+ }
+
+ private void translatePool(List<Element> eleList, Element jpdlEle) {
+ // get the bpmn pool id
+ String poolBpmnID = null;
+ for (String id : map.keySet()) {
+ if (map.get(id) == jpdlEle.getParent()) {
+ poolBpmnID = TranslateHelper.getPureBpmnID(id,
+ B2JMessages.Bpmn_Pool_Element_Name);
+ break;
+ }
+ }
+ // get the bpmn pool graphical element
+ if (poolBpmnID != null) {
+ Element poolBpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ poolBpmnID, eleList);
+ Document processDiagramDef = DomXmlWriter.createDomTree(false,
+ null, B2JMessages.Gpd_Process_Diagram_Name);
+ Element poolEle = processDiagramDef.getRootElement();
+ DomXmlWriter.mapAttribute(poolEle, B2JMessages.Dom_Element_Name,
+ jpdlEle.getParent());
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Width_Attribute_Name, poolBpmnGpdEle);
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Height_Attribute_Name, poolBpmnGpdEle);
+
+ gpdDefs.add(processDiagramDef);
+ gpdPoolNames.add(poolEle
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a helper class for bpmn ->jpdl
+ */
+public class TranslateHelper {
+
+ // the map for the bpmn element id : the corresponding generated element
+ static Map<String, Integer> nameMap = new HashMap<String, Integer>();
+
+ public static void setNameMap(Map<String, Integer> nameMap) {
+ TranslateHelper.nameMap = nameMap;
+ }
+
+ /*
+ * get the bpmn_diagram file name
+ */
+ public static String getBpmnDiagramName(String bpmnFileName) {
+ return bpmnFileName + B2JMessages.Bpmn_Diagram_Name_Suffix;
+ }
+
+ /*
+ * create a jpdl dom tree
+ */
+ public static Document createJpdlDomTree(boolean useNamespace) {
+ return DomXmlWriter.createDomTree(useNamespace,
+ B2JMessages.Jpdl_32_Namespace_Url,
+ B2JMessages.Jpdl_Process_Definition_Element_Name);
+
+ }
+
+ /*
+ * create translated files from dom strings
+ */
+ public static File[] createFiles(String parentFolder, String bpmnFileName,
+ String[] strsForGenerate, String[] fileFolders, String fileName,
+ boolean isOverWrite) throws IOException {
+ File jpdlFolder = BPMNToUtil.createFile(parentFolder,
+ B2JMessages.Jpdl_Suffix, null, isOverWrite);
+ File diagramFolder = BPMNToUtil.createFile(
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
+
+ File[] files = new File[strsForGenerate.length];
+ File processFolder = null;
+ int i = 0;
+ for (String str : strsForGenerate) {
+ processFolder = BPMNToUtil.createFile(diagramFolder
+ .getAbsolutePath(), fileFolders[i], null, isOverWrite);
+ files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
+ fileName, str, isOverWrite);
+ i++;
+ }
+ return files;
+ }
+
+ /*
+ * generate a process definition name. the name is composed of the names
+ * from bpmn diagram to the element
+ */
+ public static String generateProcessName(Element graph) {
+ if ("BpmnDiagram".equals(graph.getName())) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ String str = generateProcessName(graph.getParent());
+ if (str == null) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ return str + B2JMessages.Folder_Name_Separator
+ + graph.attributeValue(B2JMessages.Dom_Element_Name);
+ }
+ }
+
+ }
+
+ /*
+ * check the bpmn element name is null or "" or same to another element name
+ * and generate a different name
+ */
+ public static boolean check_mapElementName(Element graph, Element graphEle) {
+
+ boolean isOk = true;
+ String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+
+ if (name == null || "".equals(name)) {
+ name = "jboss_autogen";
+ isOk = false;
+ }
+ Integer i = nameMap.get(name);
+ if (i == null) {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name);
+ nameMap.put(name, new Integer("1"));
+ } else {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name + "_" + i);
+ nameMap.put(name, ++i);
+ isOk = false;
+ }
+
+ return isOk;
+
+ }
+
+ /*
+ * select the elements from process. These elements have no transitions sub
+ * element or have transtions to end-state.
+ */
+ public static List<Element> locateLastElements(Element processRoot) {
+ List<Element> list = new ArrayList<Element>();
+
+ if (processRoot.element(B2JMessages.Jpdl_End_Element_Name) != null) {
+ Element endState = processRoot
+ .element(B2JMessages.Jpdl_End_Element_Name);
+ for (Object ele : processRoot.elements()) {
+ Element subEle = ((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element);
+ if (subEle != null
+ && endState
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ .equals(subEle.attributeValue(B2JMessages.To))) {
+ list.add((Element) ele);
+ }
+ }
+ } else {
+ for (Object ele : processRoot.elements()) {
+ if (((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element) == null) {
+ list.add((Element) ele);
+ }
+ }
+ }
+
+ return list;
+ }
+
+ /*
+ * get the layout element from bpmn_diagram file by id
+ */
+ public static Element getDiagramLayoutElement(String bpmnID,
+ List<Element> eleList) {
+ Element element = null;
+ for (Element ele : eleList) {
+ String str = ele
+ .attributeValue(B2JMessages.Bpmn_Href_Attribute_Name);
+ if (str != null && str.contains(bpmnID)) {
+ element = ele;
+ break;
+ }
+ }
+
+ if (element != null
+ && element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name) != null) {
+ return element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name);
+ }
+
+ return null;
+ }
+
+ /*
+ * create a graphical jpdl transition
+ */
+ public static Element createTransition(Element parentEle, String name,
+ Element jpdlEle) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+
+ Element label = DomXmlWriter.addElement(ele,
+ B2JMessages.Gpd_Label_Element_Name);
+ TranslateHelper.mapXY(label, "5", "-10");
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl element
+ */
+ private static Element createElement(Element parentEle, String name,
+ String width, String height) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Width_Attribute_Name, width);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Height_Attribute_Name,
+ height);
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl node
+ */
+ public static Element createNode(Element rootEle, String name,
+ Element jpdlEle) {
+ Element ele = TranslateHelper.createElement(rootEle, name, "100", "40");
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+ return ele;
+ }
+
+ /*
+ * map bpmn x,y attribute to jpdl graphical element
+ */
+ public static void mapXY(Element pgdEle, String x, String y) {
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.X_Attribute_Name,
+ x == null ? "0" : x);
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.Y_Attribute_Name,
+ y == null ? "0" : y);
+
+ }
+
+ /*
+ * get a bpmn element id from a given string by subtract suffix for example
+ * bpmn pool has pools suffix a bpmn loop activity has vertices suffix
+ */
+ public static String getPureBpmnID(String bpmnID, String suffix) {
+ return bpmnID.substring(0, bpmnID.length() - suffix.length());
+ }
+
+ /*
+ * get (x,y) from a graphical element and add increments
+ */
+ public static String[] getXY(Element bpmnGpdEle, int xIncre, int yIncre) {
+ String xy[] = new String[2];
+ xy[0] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.X_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.X_Attribute_Name))
+ + xIncre);
+ xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.Y_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.Y_Attribute_Name))
+ + yIncre);
+ return xy;
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.b2j.translate.BPMN2JPDL;
+import org.jboss.tools.jbpm.convert.b2j.translate.GraphicalFileGenerator;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn to jpdl translation
+ */
+public class B2JExportWizard extends BpmnToWizard {
+
+ private List<String> strForProcessList = new ArrayList<String>();
+ private List<String> strForGpdList = new ArrayList<String>();
+ private List<String> generatedFoldersList = new ArrayList<String>();
+
+ public void createGeneratedFile(boolean isOverWrite) {
+ String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
+
+ int i = 0;
+ for (String name : this.generatedFoldersList) {
+ jpdlFolderNames[i] = name;
+ i++;
+ }
+
+ String location = super.getContainerPath((IContainer) super
+ .getTargetLocationSelection().getFirstElement());
+
+ if (this.strForProcessList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForProcessList.size()];
+ for (String pro : this.strForProcessList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames,
+ B2JMessages.Jpdl_Process_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ if (this.strForGpdList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForGpdList.size()];
+ for (String pro : this.strForGpdList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ }
+
+ public List<String> translateBpmnToStrings() {
+ List<String> warningList = new ArrayList<String>();
+ List<String> errorList = new ArrayList<String>();
+
+ Document bpmnDocument = null;
+ try {
+ bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ }
+
+ BPMN2JPDL translator = new BPMN2JPDL(bpmnFileName, bpmnFileParentPath,
+ poolIdList, bpmnDocument);
+
+ this.setStrForProcessList(Arrays
+ .asList(translator.translateToStrings()));
+
+ for (Document def : translator.getProcessDefs()) {
+ this.generatedFoldersList.add(def.getName());
+ }
+
+ warningList.addAll(translator.getWarnings());
+ errorList.addAll(translator.getErrors());
+
+ // generate jpdl gpd file from *.bpmn_diagram
+ Document bpmnDiagramDocument = null;
+ try {
+ bpmnDiagramDocument = getDocument(bpmnFileParentPath,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName));
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName)));
+ }
+ GraphicalFileGenerator generator = new GraphicalFileGenerator(
+ bpmnDiagramDocument, translator.getMap(), bpmnFileParentPath,
+ bpmnFileName);
+
+ this.setStrForGpdList(Arrays.asList(generator.translateToStrings()));
+
+ warningList.addAll(generator.getWarnings());
+ errorList.addAll(generator.getErrors());
+
+ List<String> list = new ArrayList<String>();
+ list.addAll(errorList);
+ list.addAll(warningList);
+
+ return list;
+ }
+
+ public List<String> getStrForProcessList() {
+ return strForProcessList;
+ }
+
+ public void setStrForProcessList(List<String> strForProcessList) {
+ this.strForProcessList = strForProcessList;
+ }
+
+ public List<String> getStrForGpdList() {
+ return strForGpdList;
+ }
+
+ public void setStrForGpdList(List<String> strForGpdList) {
+ this.strForGpdList = strForGpdList;
+ }
+
+ public List<String> getGeneratedFoldersList() {
+ return generatedFoldersList;
+ }
+
+ public void setGeneratedFoldersList(List<String> generatedFoldersList) {
+ this.generatedFoldersList = generatedFoldersList;
+ }
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto;
+
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Grid Qian
+ *
+ * this a plugin class
+ */
+public class BpmnToPlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jbpm.convert.bpmnto";
+
+ // The shared instance
+ private static BpmnToPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public BpmnToPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static BpmnToPlugin getDefault() {
+ return plugin;
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.translate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a root translator. You should extend it and realize the
+ * method: translateDiagram.
+ */
+public abstract class BPMNTranslator {
+
+ // the bpmn file name
+ public String bpmnFileName;
+
+ //the location of the folder containing the bpmn file
+ public String rootLocation;
+
+ // the bpmn pool's id list that are translated
+ public List<String> poolIDList;
+
+
+ // the warning messages when translate
+ public List<String> warnings = new ArrayList<String>();
+
+ // the error messages when translate
+ public List<String> errors = new ArrayList<String>();
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<String> errors) {
+ this.errors = errors;
+ }
+
+ public List<String> getWarnings() {
+ return warnings;
+ }
+
+ public void setWarnings(List<String> warnings) {
+ this.warnings = warnings;
+ }
+
+ public BPMNTranslator() {
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath) {
+ this(bpmnFileName, bpmnFilePath, null);
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList) {
+ this.bpmnFileName = bpmnFileName;
+ this.rootLocation = bpmnFilePath;
+ this.poolIDList = poolIDList;
+ }
+
+ /*
+ * Translate a bpmn diagram to anything
+ */
+ public abstract void translateDiagram();
+}
\ No newline at end of file
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+
+/**
+ * @author Grid Qian
+ *
+ * this a util class
+ */
+public class BPMNToUtil {
+
+ /*
+ * create a file
+ */
+ public static File createFile(String parentFolder, String fileName,
+ String inputStr, boolean isOverWrite) throws IOException {
+ File child = new File(parentFolder, fileName);
+ if (inputStr == null) {
+ if (!child.exists() || isOverWrite) {
+ child.mkdir();
+ }
+ } else {
+ if (!child.exists() || isOverWrite) {
+ child.createNewFile();
+ }
+ FileWriter childWriter = new FileWriter(child);
+ PrintWriter printFile = new PrintWriter(childWriter);
+ printFile.println(inputStr);
+ printFile.close();
+ childWriter.close();
+
+ }
+ return child;
+ }
+
+ /*
+ * get a sax input source
+ */
+ public static InputSource getInputSource(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ return new InputSource(BPMNToUtil
+ .getInputStream(parentFolder, fileName));
+
+ }
+
+ /*
+ * get a input stream
+ */
+ public static InputStream getInputStream(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ File file = new File(parentFolder, fileName);
+ InputStream input = new FileInputStream(file);
+ return input;
+
+ }
+
+ /*
+ * parse a file to a dom document
+ */
+ public static Document parse(String parentFolder, String fileName)
+ throws Exception {
+ Document document = null;
+ SAXReader saxReader = createSaxReader();
+ document = saxReader.read(BPMNToUtil.getInputSource(parentFolder,
+ fileName));
+ return document;
+ }
+
+ /*
+ * create a sax reader
+ */
+ public static SAXReader createSaxReader() throws Exception {
+ XMLReader xmlReader = createXmlReader();
+ SAXReader saxReader = new SAXReader(xmlReader);
+ return saxReader;
+ }
+
+ /*
+ * create a sax xml reader
+ */
+ public static XMLReader createXmlReader() throws Exception {
+
+ SAXParser saxParser = createSaxParserFactory().newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ saxParser.setProperty(
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+ "http://www.w3.org/2001/XMLSchema");
+
+ xmlReader.setFeature(
+ "http://apache.org/xml/features/validation/dynamic", true);
+
+ return xmlReader;
+ }
+
+ /*
+ * create a sax parser factory
+ */
+ private static SAXParserFactory createSaxParserFactory() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
+ return saxParserFactory;
+ }
+
+ /*
+ * get bpmn pool id list from a dom document
+ */
+ public static Map<String, String> getPoolIDsFromDocument(Document document) {
+ Map<String, String> poolIDMap = new HashMap<String, String>();
+ Element diagram = document.getRootElement();
+ for (Object pool : diagram.elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (((Element) pool).attributeValue(B2JMessages.Bpmn_Element_ID) != null) {
+ poolIDMap.put(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID),
+ ((Element) pool)
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+ }
+ return poolIDMap;
+ }
+
+ public static Composite createComposite(Composite parent, int numColumns) {
+ Composite composite = new Composite(parent, SWT.NULL);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return composite;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static boolean checkSelectedResources(ISelection selectedResources) {
+ boolean res = true;
+ if (selectedResources instanceof IStructuredSelection
+ && !selectedResources.isEmpty()) {
+ IStructuredSelection ss = (IStructuredSelection) selectedResources;
+ for (Iterator it = ss.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof IFile) {
+ if (!((IFile) o).getFileExtension()
+ .equalsIgnoreCase("bpmn")) {
+ res = false;
+ break;
+ }
+ } else {
+ res = false;
+ break;
+ }
+ }
+ } else {
+ res = false;
+ }
+ return res;
+ }
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dom4j.*;
+import org.dom4j.io.*;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is for generating dom element or attribute
+ */
+public class DomXmlWriter {
+
+ /*
+ * map a dom document to a string
+ */
+ public static String toString(Document document) throws IOException {
+ OutputFormat outputFormat = new OutputFormat(" ", true);
+ Writer writer = new StringWriter();
+ XMLWriter xmlWriter = new XMLWriter(writer, outputFormat);
+ xmlWriter.write(document);
+ xmlWriter.flush();
+ writer.flush();
+ return writer.toString();
+ }
+
+ /*
+ * create a dom tree
+ */
+ public static Document createDomTree(boolean useNamespace, String url,
+ String rootElementName) {
+ Document document = DocumentHelper.createDocument();
+ Element root = null;
+
+ if (useNamespace) {
+ Namespace jbpmNamespace = new Namespace(null, url);
+ root = document.addElement(rootElementName, jbpmNamespace.getURI());
+ } else {
+ root = document.addElement(rootElementName);
+ }
+ root.addText(System.getProperty("line.separator"));
+
+ return document;
+ }
+
+ /*
+ * add a new element to a dom element
+ */
+ public static Element addElement(Element element, String elementName) {
+ Element newElement = element.addElement(elementName);
+ return newElement;
+ }
+
+ /*
+ * add a new element to the location of a dom element
+ */
+ @SuppressWarnings("unchecked")
+ public static Element addElement(Element element, String elementName,
+ int location) {
+ Element newElement = null;
+ if (element.elements(elementName) != null
+ && element.elements(elementName).size() > location
+ && location >= 0) {
+ newElement = DocumentHelper.createElement(elementName);
+ element.elements(elementName).add(location, newElement);
+ }
+ return newElement;
+ }
+
+ /*
+ * add a attribute to a dom element
+ */
+ public static void addAttribute(Element e, String attributeName,
+ String value) {
+ if (value != null) {
+ e.addAttribute(attributeName, value);
+ }
+ }
+
+ /*
+ * get a named element from a element (any depth)
+ */
+ public static List<Element> getElementsByName(Element element, String name) {
+ List<Element> list = new ArrayList<Element>();
+ for (Object ele : element.elements()) {
+ if (name.equals(((Element) ele).getName())) {
+ list.add((Element) ele);
+ }
+ list.addAll(getElementsByName((Element) ele, name));
+ }
+ return list;
+ }
+
+ /*
+ * set a element attribute using a same name attribute of other element
+ */
+ public static void mapAttribute(Element ele, String attrName, Element sourceEle){
+ DomXmlWriter.addAttribute(ele, attrName,sourceEle.attributeValue(attrName));
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProjectFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn file
+ */
+public class BPMNResourcesChoicePage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private IWizard wizard;
+
+ public BPMNResourcesChoicePage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setTitle(title);
+ this.setDescription(description);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ super.setControl(composite);
+
+ initializePage();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(B2JMessages.Bpmn_File_Choose_WizardPage_ViewerTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProjectFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ viewer.setSelection(currentSelection, true);
+ }
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (viewer != null) {
+ return BPMNToUtil.checkSelectedResources(viewer.getSelection());
+ }
+ return super.isPageComplete();
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void setSelection(ISelection selection) {
+ this.currentSelection = selection;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+}
+
+class ProjectFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ boolean res = false;
+ if (element instanceof IFile) {
+ IFile file = (IFile) element;
+ if (file.getFileExtension().equalsIgnoreCase("bpmn")) {
+ res = true;
+ }
+ }
+ if (element instanceof IContainer) {
+ res = true;
+ }
+ return res;
+ }
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn pool from a bpmn diagram
+ */
+public class BpmnPoolsChoicePage extends WizardPage {
+
+ CheckboxTableViewer listViewer;
+ String listTitle;
+ private Map<String, String> idMap;
+
+ private IWizard wizard;
+
+ public BpmnPoolsChoicePage(String pageName, String title, String listTitle) {
+ super(pageName);
+ this.listTitle = listTitle;
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ addSelectionButtons(composite);
+ setControl(composite);
+
+ initializePage();
+ initializeViewer();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(listTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ listViewer.addCheckStateListener(new ICheckStateListener() {
+ @SuppressWarnings("unchecked")
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked()) {
+ (((BpmnToWizard) wizard)).getPoolIdList().add(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ } else {
+ (((BpmnToWizard) wizard)).getPoolIdList().remove(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ }
+ changeComplete();
+ }
+ });
+ }
+
+ private void addSelectionButtons(Composite composite) {
+ Composite buttonComposite = new Composite(composite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = 4;
+ buttonComposite.setLayout(layout);
+ buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true,
+ false));
+
+ Button selectButton = createButton(buttonComposite,
+ B2JMessages.Label_Select_All, false);
+
+ SelectionListener listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(true);
+ (((BpmnToWizard) wizard)).getPoolIdList()
+ .addAll(idMap.keySet());
+ changeComplete();
+ }
+ };
+ selectButton.addSelectionListener(listener);
+
+ Button deselectButton = createButton(buttonComposite,
+ B2JMessages.Label_Deselect_All, false);
+
+ listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(false);
+ (((BpmnToWizard) wizard)).getPoolIdList().clear();
+ changeComplete();
+ }
+ };
+ deselectButton.addSelectionListener(listener);
+ }
+
+ private Button createButton(Composite parent, String label,
+ boolean defaultButton) {
+ // increment the number of columns in the button bar
+ ((GridLayout) parent.getLayout()).numColumns++;
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(label);
+ if (defaultButton) {
+ Shell shell = parent.getShell();
+ if (shell != null) {
+ shell.setDefaultButton(button);
+ }
+ }
+ setButtonLayoutData(button);
+ return button;
+ }
+
+ private void initializePage() {
+ setPageComplete(false);
+ }
+
+ private void initializeViewer() {
+ if (listViewer == null) {
+ return;
+ }
+ listViewer.setInput(idMap.entrySet());
+ wizard = this.getWizard();
+ List<String> poolIdList = ((BpmnToWizard) wizard).getPoolIdList();
+ if (poolIdList.size() == 0) {
+ listViewer.setAllChecked(false);
+ } else {
+ for (String id : poolIdList) {
+ Set<Entry<String, String>> set = idMap.entrySet();
+ Entry<String, String> selectedEntry = null;
+ for (Entry<String, String> entry : set) {
+ if (entry.getKey().equals(id)) {
+ selectedEntry = entry;
+ break;
+ }
+ }
+ listViewer.setChecked(selectedEntry, true);
+ }
+ }
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void changeComplete() {
+ if (listViewer.getCheckedElements().length != 0) {
+ setPageComplete(true);
+ } else {
+ setPageComplete(false);
+ }
+ }
+
+ public Map<String, String> getIdMap() {
+ return idMap;
+ }
+
+ public void setIdMap(Map<String, String> idMap) {
+ this.idMap = idMap;
+ initializeViewer();
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnPoolsChoicePage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ErrorMessagesPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.GeneratedFileLocationPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BPMNResourcesChoicePage;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn translation
+ */
+public abstract class BpmnToWizard extends Wizard implements IExportWizard {
+
+ private BPMNResourcesChoicePage bpmnResPage;
+ private BpmnPoolsChoicePage poolsPage;
+ private GeneratedFileLocationPage locationPage;
+ private ErrorMessagesPage errorPage;
+
+ // the selected *.bpmn file
+ private IStructuredSelection selection;
+ // the selected folder to save these generated files
+ private IStructuredSelection targetLocationSelection;
+ // bpmn pool id:name map
+ private Map<String, String> idMap;
+
+ protected String bpmnFileName;
+ protected String bpmnFileParentPath;
+ protected List<String> poolIdList = new ArrayList<String>();
+ // the list contains errors or warnings when generating
+ protected List<String> errorList = new ArrayList<String>();
+
+ public BpmnToWizard() {
+ super();
+ super.setWindowTitle(B2JMessages.Bpmn_Wizard_Title);
+ }
+
+ public void addPages() {
+ super.addPages();
+
+ bpmnResPage = new BPMNResourcesChoicePage(
+ B2JMessages.Bpmn_File_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Message);
+ bpmnResPage.setSelection(selection);
+ poolsPage = new BpmnPoolsChoicePage(
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Message);
+ errorPage = new ErrorMessagesPage(
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Name,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Title,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Message);
+ locationPage = new GeneratedFileLocationPage(
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Name,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Title,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Message);
+ locationPage.setSelection(selection);
+ addPage(bpmnResPage);
+ addPage(poolsPage);
+ addPage(errorPage);
+ addPage(locationPage);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ /*
+ * do some initial tasks
+ */
+ private void initialize() {
+ if (selection.getFirstElement() instanceof IFile) {
+ IFile bpmnFile = (IFile) selection.getFirstElement();
+ bpmnFileName = bpmnFile.getName();
+ bpmnFileParentPath = bpmnFile.getParent().getLocation()
+ .toOSString();
+ try {
+ idMap = BPMNToUtil.getPoolIDsFromDocument(getDocument(
+ bpmnFileParentPath, bpmnFileName));
+ poolIdList.clear();
+ } catch (Exception e) {
+ errorList.add(0, NLS.bind(
+ B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ e.printStackTrace();
+ }
+ }
+ if (poolsPage != null) {
+ poolsPage.setIdMap(idMap);
+ }
+ }
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page.getName()
+ .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ errorList = translateBpmnToStrings();
+ if (errorList.size() == 0) {
+ return locationPage;
+ }
+ errorPage.getListViewer().setInput(errorList);
+ return super.getNextPage(page);
+ } else {
+ return super.getNextPage(page);
+ }
+
+ }
+
+ public boolean performFinish() {
+
+ createGeneratedFile(locationPage.isOverWrite());
+ refreshWorkspace();
+ return true;
+ }
+
+ /*
+ * do the translation from bpmn to string list the sub class need to create
+ * a string list to reserve these strings
+ * the return list is error or warning messages
+ */
+ public abstract List<String> translateBpmnToStrings();
+
+ /*
+ * write the generated strings to the files
+ */
+ public abstract void createGeneratedFile(boolean b);
+
+ /*
+ * get the path of the eclipse workspace container
+ */
+ protected String getContainerPath(IContainer container) {
+ return container.getLocation().toOSString();
+ }
+
+ /*
+ * get the dom document from a given path and file name
+ */
+ public Document getDocument(String bpmnFileParentPath, String bpmnFileName)
+ throws Exception {
+ Document bpmnDocument = null;
+ bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
+ return bpmnDocument;
+ }
+
+ /*
+ * refresh eclipse workspace
+ */
+ public void refreshWorkspace() {
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
+ IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public List<String> getPoolIdList() {
+ return poolIdList;
+ }
+
+ public void setPoolIdList(List<String> poolIdList) {
+ this.poolIdList = poolIdList;
+ }
+
+ public List<String> getErrorList() {
+ return errorList;
+ }
+
+ public void setErrorList(List<String> errorList) {
+ this.errorList = errorList;
+ }
+
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ public String getBpmnFileName() {
+ return bpmnFileName;
+ }
+
+ public void setBpmnFileName(String bpmnFileName) {
+ this.bpmnFileName = bpmnFileName;
+ }
+
+ public String getBpmnFileParentPath() {
+ return bpmnFileParentPath;
+ }
+
+ public void setBpmnFileParentPath(String bpmnFileParentPath) {
+ this.bpmnFileParentPath = bpmnFileParentPath;
+ }
+
+ public IStructuredSelection getTargetLocationSelection() {
+ return targetLocationSelection;
+ }
+
+ public void setTargetLocationSelection(
+ IStructuredSelection targetLocationSelection) {
+ this.targetLocationSelection = targetLocationSelection;
+ }
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for showing the error and warning messages from translating
+ */
+public class ErrorMessagesPage extends WizardPage {
+
+ private TableViewer listViewer;
+
+ protected ErrorMessagesPage(String pageName, String title, String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ setControl(composite);
+
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_Translate_Message_WizardpageViewer_Title);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = new TableViewer(composite, SWT.SINGLE | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ return true;
+ }
+
+
+ public TableViewer getListViewer() {
+ return listViewer;
+ }
+
+ public void setListViewer(TableViewer listViewer) {
+ this.listViewer = listViewer;
+ }
+
+}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-14 02:40:34 UTC (rev 10817)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for the generated file location
+ */
+public class GeneratedFileLocationPage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private Button button;
+ private IWizard wizard;
+ private boolean isOverWrite;
+
+
+ protected GeneratedFileLocationPage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ createCheckbox(composite);
+ super.setControl(composite);
+
+ initializePage();
+
+ }
+
+ private Label createListTitleArea(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle);
+ label.setFont(parent.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setTargetLocationSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private Button createCheckbox(Composite parent) {
+ button = new Button(parent, SWT.CHECK | SWT.NONE);
+ button
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_CheckBox);
+ button.setFont(parent.getFont());
+ button.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ isOverWrite = button.getSelection();
+ }});
+ return button;
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ if (currentSelection != null
+ && currentSelection instanceof ITreeSelection) {
+ // Select the parent project of this first bpmn file chosen
+ ITreeSelection node = (ITreeSelection) currentSelection;
+ TreePath[] paths = node.getPaths();
+ TreePath projPath = new TreePath(new Object[] { paths[0]
+ .getFirstSegment() });
+ TreeSelection projSel = new TreeSelection(projPath);
+ viewer.setSelection(projSel, true);
+ }
+ }
+ button.setSelection(true);
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ if (viewer != null && viewer.getSelection() == null) {
+ return false;
+ }
+ return true;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+
+ public void setSelection(ISelection currentSelection) {
+ this.currentSelection = currentSelection;
+ }
+
+
+ public boolean isOverWrite() {
+ return isOverWrite;
+ }
+
+ public void setOverWrite(boolean isOverWrite) {
+ this.isOverWrite = isOverWrite;
+ }
+
+}
+
+class ProFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ return element instanceof IContainer;
+ }
+}
17 years, 3 months
JBoss Tools SVN: r10816 - workspace/snjeza/seam-examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-13 18:14:46 -0400 (Mon, 13 Oct 2008)
New Revision: 10816
Added:
workspace/snjeza/seam-examples/booking-ear.zip
workspace/snjeza/seam-examples/booking-ejb.zip
workspace/snjeza/seam-examples/booking.zip
Log:
Adding Seam booking projects
Added: workspace/snjeza/seam-examples/booking-ear.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/booking-ear.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/seam-examples/booking-ejb.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/booking-ejb.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/seam-examples/booking.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/booking.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r10815 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-13 18:02:32 -0400 (Mon, 13 Oct 2008)
New Revision: 10815
Modified:
workspace/examples/projectExamples.xml
Log:
Adding Seam booking projects
Modified: workspace/examples/projectExamples.xml
===================================================================
--- workspace/examples/projectExamples.xml 2008-10-13 21:23:21 UTC (rev 10814)
+++ workspace/examples/projectExamples.xml 2008-10-13 22:02:32 UTC (rev 10815)
@@ -39,6 +39,48 @@
</project>
<project>
+ <category>Seam</category>
+ <name>booking</name>
+ <shortDescription>Seam Booking Example - WAR</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+</description>
+ <size>2900000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking-ejb</name>
+ <shortDescription>Seam Booking Example - EJB</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+</description>
+ <size>70000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>booking-ejb</name>
+ <shortDescription>Seam Booking Example - EAR</shortDescription>
+ <description>This example demonstrates the use of Seam in a Java EE 5 environment.
+Transaction and persistence context management is handled by the EJB container.
+This example can also run in Tomcat with JBoss Embedded.
+</description>
+ <size>4700000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
<category>Portlet</category>
<name>TestJavaPortlet</name>
<shortDescription>JBoss Java Portlet Example</shortDescription>
17 years, 3 months
JBoss Tools SVN: r10814 - in trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-13 17:23:21 -0400 (Mon, 13 Oct 2008)
New Revision: 10814
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-2744 Creating Seam Web projects based on the Seam example applications
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2008-10-13 21:09:51 UTC (rev 10813)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2008-10-13 21:23:21 UTC (rev 10814)
@@ -223,8 +223,10 @@
file.deleteOnExit();
BufferedOutputStream destination = new BufferedOutputStream(new FileOutputStream(file));
IStatus result = getTransport().download(prefix,url.toExternalForm(), destination, monitor);
- if (!result.isOK())
+ if (!result.isOK()) {
+ ProjectExamplesActivator.getDefault().getLog().log(result);
return null;
+ }
} catch (FileNotFoundException e) {
ProjectExamplesActivator.log(e);
return null;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2008-10-13 21:09:51 UTC (rev 10813)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizard.java 2008-10-13 21:23:21 UTC (rev 10814)
@@ -15,6 +15,9 @@
*
*/
import java.io.File;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import java.util.zip.ZipFile;
import org.eclipse.core.resources.IProject;
@@ -74,8 +77,8 @@
@Override
public boolean performFinish() {
- final Project project = page.getSelectedProject();
- if (project == null) {
+
+ if (page.getSelection() == null || page.getSelection().size() <= 0) {
return false;
}
WorkspaceJob job = new WorkspaceJob("Downloading...") {
@@ -83,15 +86,30 @@
@Override
public IStatus runInWorkspace(IProgressMonitor monitor)
throws CoreException {
- String url = project.getUrl();
- String name = project.getName();
- final File file = ProjectUtil.getProjectExamplesFile(url, name,
- ".zip",monitor);
- if (file == null) {
- return Status.CANCEL_STATUS;
+ IStructuredSelection selection= page.getSelection();
+ Iterator iterator = selection.iterator();
+ List<Project> projects = new ArrayList<Project>();
+ List<File> files = new ArrayList<File>();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Project) {
+ Project project = (Project) object;
+ String url = project.getUrl();
+ String name = project.getName();
+ final File file = ProjectUtil.getProjectExamplesFile(
+ url, name, ".zip", monitor);
+ if (file == null) {
+ return Status.CANCEL_STATUS;
+ }
+ projects.add(project);
+ files.add(file);
+ }
}
try {
- importProject(project, file, monitor);
+ int i = 0;
+ for (Project project:projects) {
+ importProject(project, files.get(i++), monitor);
+ }
} catch (final Exception e) {
Display.getDefault().syncExec(new Runnable() {
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2008-10-13 21:09:51 UTC (rev 10813)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2008-10-13 21:23:21 UTC (rev 10814)
@@ -11,6 +11,7 @@
package org.jboss.tools.project.examples.wizard;
+import java.util.Iterator;
import java.util.List;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -40,7 +41,7 @@
*/
public class NewProjectExamplesWizardPage extends WizardPage {
- private Project selectedProject;
+ private IStructuredSelection selection;
public NewProjectExamplesWizardPage() {
super("org.jboss.tools.project.examples");
@@ -58,7 +59,7 @@
gd.widthHint= 225;
composite.setLayoutData(gd);
- TreeViewer viewer = new TreeViewer(composite,SWT.SINGLE);
+ TreeViewer viewer = new TreeViewer(composite,SWT.MULTI);
Tree tree = viewer.getTree();
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
tree.setFont(parent.getFont());
@@ -97,23 +98,33 @@
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- IStructuredSelection selection = (IStructuredSelection) event.getSelection();
+ selection = (IStructuredSelection) event.getSelection();
Object selected = selection.getFirstElement();
- if (selected instanceof Project) {
- selectedProject = (Project) selected;
+ if (selected instanceof Project && selection.size() == 1) {
+ Project selectedProject = (Project) selected;
text.setText(selectedProject.getDescription());
- setPageComplete(true);
projectName.setText(selectedProject.getName());
projectURL.setText(selectedProject.getUrl());
projectSize.setText(selectedProject.getSizeAsText());
} else {
- selectedProject=null;
+ Project selectedProject=null;
text.setText("");
projectName.setText("");
projectURL.setText("");
projectSize.setText("");
- setPageComplete(false);
}
+ boolean canFinish = false;
+ Iterator iterator = selection.iterator();
+ while (iterator.hasNext()) {
+ Object object = iterator.next();
+ if (object instanceof Project) {
+ canFinish=true;
+ } else {
+ canFinish=false;
+ break;
+ }
+ }
+ setPageComplete(canFinish);
}
});
@@ -180,7 +191,7 @@
}
- public Project getSelectedProject() {
- return selectedProject;
+ public IStructuredSelection getSelection() {
+ return selection;
}
}
17 years, 3 months
JBoss Tools SVN: r10812 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/.settings.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-13 16:11:18 -0400 (Mon, 13 Oct 2008)
New Revision: 10812
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/.settings/org.eclipse.jdt.core.prefs
Log:
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/.settings/org.eclipse.jdt.core.prefs 2008-10-13 19:08:40 UTC (rev 10811)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/.settings/org.eclipse.jdt.core.prefs 2008-10-13 20:11:18 UTC (rev 10812)
@@ -1,7 +1,12 @@
-#Tue Jul 15 11:36:35 CEST 2008
+#Mon Oct 13 16:08:45 EDT 2008
eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.5
17 years, 3 months
JBoss Tools SVN: r10811 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-10-13 15:08:40 -0400 (Mon, 13 Oct 2008)
New Revision: 10811
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-13 18:41:55 UTC (rev 10810)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-13 19:08:40 UTC (rev 10811)
@@ -12,26 +12,13 @@
import java.io.File;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.project.facet.SeamRuntime;
-import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
// TODO: why not just *one* global filter set to avoid any missing names ? (assert for it in our unittests!
public class Seam2FacetInstallDelegate extends SeamFacetAbstractInstallDelegate{
@@ -100,186 +87,25 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForWar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- protected void doExecuteForWar(final IProject project, IProjectFacetVersion fv,
+ protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
-
- // get WebContents folder path from DWP model
- IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- final IVirtualFolder srcRootFolder = component.getRootFolder().getFolder(new Path("/WEB-INF/classes")); //$NON-NLS-1$
- IContainer webRootFolder = webRootVirtFolder.getUnderlyingFolder();
-
- model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
-
- Boolean dbExists = (Boolean)model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
- Boolean dbRecreate = (Boolean)model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
- if(!dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"update"); //$NON-NLS-1$
- } else if(dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"validate"); //$NON-NLS-1$
- } else if(dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"create-drop"); //$NON-NLS-1$
- }
-
- final File webContentFolder = webRootFolder.getLocation().toFile();
- final File webInfFolder = new File(webContentFolder,"WEB-INF"); //$NON-NLS-1$
- final File webInfClasses = new File(webInfFolder,"classes"); //$NON-NLS-1$
- final File webInfClassesMetaInf = new File(webInfClasses, "META-INF"); //$NON-NLS-1$
- webInfClassesMetaInf.mkdirs();
- final File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
- final File srcFolder = isWarConfiguration(model)?new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(),"model"):srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
- final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
-
- final String seamHomePath = selectedRuntime.getHomeDir();
-
- final File seamHomeFolder = new File(seamHomePath);
- final File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
- final File seamGenResFolder = new File(seamHomePath,"seam-gen/resources"); //$NON-NLS-1$
-
- final File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
- final File seamGenHomeFolder = new File(seamHomePath,"seam-gen"); //$NON-NLS-1$
- final File seamGenViewSource = new File(seamGenHomeFolder,"view"); //$NON-NLS-1$
- final File dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
- final File componentsFile = new File(seamGenResFolder,"WEB-INF/components"+(isWarConfiguration(model)?"-war":"")+".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- final File hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- final File hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
- //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
- final File persistenceFile = new File(seamGenResFolder,"META-INF/persistence-" + (isWarConfiguration(model)?DEV_WAR_PROFILE:DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
-
- //final File applicationFile = new File(seamGenResFolder,"META-INF/application.xml"); //$NON-NLS-1$
-
- final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
- final FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- final FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
-
- // ****************************************************************
- // Copy view folder from seam-gen installation to WebContent folder
- // ****************************************************************
- final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
- final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
- viewFilterSetCollection.addFilterSet(jdbcFilterSet);
- viewFilterSetCollection.addFilterSet(projectFilterSet);
- viewFilterSetCollection.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
-
- AntCopyUtils.copyFilesAndFolders(
- seamGenViewSource,
- webContentFolder,
- new AntCopyUtils.FileSetFileFilter(viewFileSet),
- viewFilterSetCollection,
- true);
-
- // *******************************************************************
- // Copy manifest and configuration resources the same way as view
- // *******************************************************************
- AntCopyUtils.FileSet webInfSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
-
- configureWebXml(project);
-
- AntCopyUtils.copyFileToFile(
- componentsFile,
- new File(webInfFolder,"components.xml"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);
-
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,webContentFolder,new AntCopyUtils.FileSetFileFilter(webInfSet), viewFilterSetCollection, true);
-
- final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
- hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
- hibernateDialectFilterSet.addFilterSet(projectFilterSet);
- hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
-
- // ********************************************************************************************
- // Handle WAR configurations
- // ********************************************************************************************
+ super.copyFilesToWarProject(project, fv, model, monitor);
+ final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
if(isWarConfiguration(model)) {
- AntCopyUtils.FileSet webInfClassesSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,srcFolder,new AntCopyUtils.FileSetFileFilter(webInfClassesSet), viewFilterSetCollection, true);
-
- createComponentsProperties(srcFolder, "", false); //$NON-NLS-1$ //$NON-NLS-2$
-
- /*AntCopyUtils.copyFileToFolder(
- hibernateConsolePref,
- new File(project.getLocation().toFile(),".settings"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);*/
-
- // In case of WAR configuration
- AntCopyUtils.copyFiles(seamHomeFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
- AntCopyUtils.copyFiles(seamLibFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(droolsLibFolder,webLibFolder,new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
-
- // ********************************************************************************************
- // Copy seam project indicator
- // ********************************************************************************************
+ AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
final IContainer source = srcRootFolder.getUnderlyingFolder();
-
- IPath actionSrcPath = new Path(source.getFullPath().removeFirstSegments(1)+"/action"); //$NON-NLS-1$
- IPath modelSrcPath = new Path(source.getFullPath().removeFirstSegments(1)+"/model"); //$NON-NLS-1$
-
- srcRootFolder.delete(IVirtualFolder.FORCE, monitor);
- WtpUtils.createSourceFolder(project, actionSrcPath, source.getFullPath().removeFirstSegments(1), webRootFolder.getFullPath().removeFirstSegments(1).append("WEB-INF/dev")); //$NON-NLS-1$
- WtpUtils.createSourceFolder(project, modelSrcPath, source.getFullPath().removeFirstSegments(1), null);
-
- srcRootFolder.createLink(actionSrcPath, 0, null);
- srcRootFolder.createLink(modelSrcPath, 0, null);
-
File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1) + "/action/");
-
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"), actionsSrc, true); //$NON-NLS-1$
-
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder,"src/Authenticator.java"), //$NON-NLS-1$
- new File(actionsSrc, model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/')+"/"+"Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new FilterSetCollection(filtersFilterSet), true);
-
- AntCopyUtils.copyFileToFile(
- persistenceFile,
- new File(srcFolder,"META-INF/persistence.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- File resources = new File(project.getLocation().toFile(),"resources");
- AntCopyUtils.copyFileToFile(
- dataSourceDsFile,
- new File(resources,project.getName()+"-ds.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- // to fix seam2 tests for war deployment
-// File srcModelMetaInf = new File(project.getLocation().append(modelSrcPath).toFile(),"META-INF");
-// AntCopyUtils.copyFileToFile(
-// dataSourceDsFile,
-// new File(srcModelMetaInf,project.getName()+"-ds.xml"), //$NON-NLS-1$
-// viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFile(
- hibernateConsoleLaunchFile,
- new File(project.getLocation().toFile(),project.getName()+".launch"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePropsFile,
- project.getLocation().toFile(),
- hibernateDialectFilterSet, true);
-
- WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
+ AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
} else {
- // In case of EAR configuration
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "messages_en.properties"), srcFolder, true); //$NON-NLS-1$
}
-
- ClasspathHelper.addClasspathEntries(project, fv);
-
- createSeamProjectPreferenes(project, model);
-
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
-
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-13 18:41:55 UTC (rev 10810)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-13 19:08:40 UTC (rev 10811)
@@ -17,9 +17,12 @@
import java.util.List;
import java.util.Properties;
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.ILogListener;
@@ -33,6 +36,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.jface.dialogs.ErrorDialog;
+import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.model.IModelProvider;
import org.eclipse.jst.j2ee.model.ModelProviderManager;
import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
@@ -59,8 +63,12 @@
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCoreMessages;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
@@ -238,6 +246,26 @@
}
}
+ protected IVirtualFolder srcRootFolder;
+ protected File seamHomeFolder;
+ protected String seamHomePath;
+ protected File seamLibFolder;
+ protected File seamGenResFolder;
+ protected File srcFolder;
+ protected File webContentFolder;
+ protected File webLibFolder;
+ protected IContainer webRootFolder;
+ protected File seamGenHomeFolder;
+ protected File seamGenViewSource;
+ protected File dataSourceDsFile;
+ protected File componentsFile;
+ protected File webInfFolder;
+ protected File webInfClasses;
+ protected File webInfClassesMetaInf;
+ protected File persistenceFile;
+ protected File hibernateConsoleLaunchFile;
+ protected File hibernateConsolePropsFile;
+
/**
*
* @param project
@@ -246,9 +274,60 @@
* @param monitor
* @throws CoreException
*/
- protected abstract void doExecuteForWar(IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected void doExecuteForWar(IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+ // get WebContents folder path from DWP model
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ srcRootFolder = component.getRootFolder().getFolder(new Path("/WEB-INF/classes")); //$NON-NLS-1$
+ webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
+
+ Boolean dbExists = (Boolean) model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
+ Boolean dbRecreate = (Boolean) model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
+ if (!dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "update"); //$NON-NLS-1$
+ } else if (dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "validate"); //$NON-NLS-1$
+ } else if (dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
+ }
+
+ webContentFolder = webRootFolder.getLocation().toFile();
+ webInfFolder = new File(webContentFolder, "WEB-INF"); //$NON-NLS-1$
+ webInfClasses = new File(webInfFolder, "classes"); //$NON-NLS-1$
+ webInfClassesMetaInf = new File(webInfClasses, "META-INF"); //$NON-NLS-1$
+ webInfClassesMetaInf.mkdirs();
+ webLibFolder = new File(webContentFolder, WEB_LIBRARIES_RELATED_PATH);
+ srcFolder = isWarConfiguration(model) ? new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(), "model") : srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
+ Object runtimeName = model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME);
+ final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName.toString());
+
+ seamHomePath = selectedRuntime.getHomeDir();
+
+ seamHomeFolder = new File(seamHomePath);
+ seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
+ seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
+
+ seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
+ seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
+ dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
+ componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
+ persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ copyFilesToWarProject(project, fv, model, monitor);
+
+ ClasspathHelper.addClasspathEntries(project, fv);
+ createSeamProjectPreferenes(project, model);
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ }
+
/**
*
* @param project
@@ -257,6 +336,124 @@
* @param monitor
* @throws CoreException
*/
+ protected void copyFilesToWarProject(IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+ final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ final FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
+ final FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+
+ // ****************************************************************
+ // Copy view folder from seam-gen installation to WebContent folder
+ // ****************************************************************
+ final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
+ final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
+ viewFilterSetCollection.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenViewSource,
+ webContentFolder,
+ new AntCopyUtils.FileSetFileFilter(viewFileSet),
+ viewFilterSetCollection,
+ true);
+
+ // *******************************************************************
+ // Copy manifest and configuration resources the same way as view
+ // *******************************************************************
+ AntCopyUtils.FileSet webInfSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
+
+ configureWebXml(project);
+
+ AntCopyUtils.copyFileToFile(
+ componentsFile,
+ new File(webInfFolder, "components.xml"), //$NON-NLS-1$
+ new FilterSetCollection(projectFilterSet), true);
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder, webContentFolder, new AntCopyUtils.FileSetFileFilter(webInfSet), viewFilterSetCollection, true);
+
+ final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
+ hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
+ hibernateDialectFilterSet.addFilterSet(projectFilterSet);
+ hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
+ // ********************************************************************************************
+ // Handle WAR configurations
+ // ********************************************************************************************
+ if (isWarConfiguration(model)) {
+ AntCopyUtils.FileSet webInfClassesSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder, srcFolder, new AntCopyUtils.FileSetFileFilter(webInfClassesSet), viewFilterSetCollection, true);
+
+ createComponentsProperties(srcFolder, "", false); //$NON-NLS-1$ //$NON-NLS-2$
+
+ /*AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"), //$NON-NLS-1$
+ new FilterSetCollection(projectFilterSet), true);*/
+
+ // ********************************************************************************************
+ // Copy seam project indicator
+ // ********************************************************************************************
+
+ final IContainer source = srcRootFolder.getUnderlyingFolder();
+
+ IPath actionSrcPath = new Path(source.getFullPath().removeFirstSegments(1) + "/action"); //$NON-NLS-1$
+ IPath modelSrcPath = new Path(source.getFullPath().removeFirstSegments(1) + "/model"); //$NON-NLS-1$
+
+ srcRootFolder.delete(IVirtualFolder.FORCE, monitor);
+ WtpUtils.createSourceFolder(project, actionSrcPath, source.getFullPath().removeFirstSegments(1), webRootFolder.getFullPath().removeFirstSegments(1).append("WEB-INF/dev")); //$NON-NLS-1$
+ WtpUtils.createSourceFolder(project, modelSrcPath, source.getFullPath().removeFirstSegments(1), null);
+
+ srcRootFolder.createLink(actionSrcPath, 0, null);
+ srcRootFolder.createLink(modelSrcPath, 0, null);
+
+ File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1) + "/action/");
+
+ //AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"), actionsSrc, true); //$NON-NLS-1$
+
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
+ new File(actionsSrc,model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), true);
+
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(srcFolder, "META-INF/persistence.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ File resources = new File(project.getLocation().toFile(), "resources");
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(resources, project.getName() + "-ds.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(project.getLocation().toFile(), project.getName() + ".launch"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ project.getLocation().toFile(),
+ hibernateDialectFilterSet, true);
+
+ WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
+ } else {
+ // In case of EAR configuration
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "messages_en.properties"), srcFolder, true); //$NON-NLS-1$
+ }
+ }
+
+ /**
+ *
+ * @param project
+ * @param fv
+ * @param model
+ * @param monitor
+ * @throws CoreException
+ */
protected abstract void doExecuteForEar(IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-13 18:41:55 UTC (rev 10810)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2008-10-13 19:08:40 UTC (rev 10811)
@@ -19,8 +19,12 @@
import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamProjectPreferences;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
/**
* Data model provider for Seam facet wizard page
@@ -140,6 +144,22 @@
"/templates")).getPath()); //$NON-NLS-1$
}
+ /**
+ * Returns default seam runtime name.
+ * @param seamModel
+ * @return
+ */
+ public static String getSeamRuntimeDefaultValue(IDataModel seamModel) {
+ String seamFacetVersion = seamModel.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
+ SeamVersion seamVersion = SeamVersion.parseFromString(seamFacetVersion);
+
+ SeamRuntime defaultRuntime = SeamRuntimeManager.getInstance().getDefaultRuntime(seamVersion);
+ if(defaultRuntime==null) {
+ return "";
+ }
+ return defaultRuntime.getName();
+ }
+
/*
* (non-Javadoc)
* @see org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider#init()
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-13 18:41:55 UTC (rev 10810)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-13 19:08:40 UTC (rev 10811)
@@ -12,32 +12,15 @@
import java.io.File;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
import org.eclipse.jst.javaee.core.DisplayName;
import org.eclipse.jst.javaee.core.JavaeeFactory;
import org.eclipse.jst.javaee.web.Filter;
import org.eclipse.jst.javaee.web.WebApp;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.project.facet.SeamRuntime;
-import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
/**
* Install delegate for seam facet version 1.2
@@ -133,177 +116,22 @@
/*
* (non-Javadoc)
- * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForWar(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
+ * @see org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject, org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, org.eclipse.wst.common.frameworks.datamodel.IDataModel, org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
- protected void doExecuteForWar(final IProject project, IProjectFacetVersion fv,
+ protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
-
- // get WebContents folder path from DWP model
- IVirtualComponent component = ComponentCore.createComponent(project);
- IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
- final IVirtualFolder srcRootFolder = component.getRootFolder().getFolder(new Path("/WEB-INF/classes")); //$NON-NLS-1$
- IContainer webRootFolder = webRootVirtFolder.getUnderlyingFolder();
-
- model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
-
- Boolean dbExists = (Boolean) model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
- Boolean dbRecreate = (Boolean) model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
- if (!dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "update"); //$NON-NLS-1$
- } else if (dbExists && !dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "validate"); //$NON-NLS-1$
- } else if (dbRecreate) {
- model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO, "create-drop"); //$NON-NLS-1$
- }
-
- final File webContentFolder = webRootFolder.getLocation().toFile();
- final File webInfFolder = new File(webContentFolder, "WEB-INF"); //$NON-NLS-1$
- final File webInfClasses = new File(webInfFolder, "classes"); //$NON-NLS-1$
- final File webInfClassesMetaInf = new File(webInfClasses, "META-INF"); //$NON-NLS-1$
- webInfClassesMetaInf.mkdirs();
- final File webLibFolder = new File(webContentFolder, WEB_LIBRARIES_RELATED_PATH);
- final File srcFolder = isWarConfiguration(model) ? new File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(), "model") : srcRootFolder.getUnderlyingFolder().getLocation().toFile(); //$NON-NLS-1$
- final SeamRuntime selectedRuntime = SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
-
- final String seamHomePath = selectedRuntime.getHomeDir();
-
- final File seamHomeFolder = new File(seamHomePath);
- final File seamLibFolder = new File(seamHomePath, SEAM_LIB_RELATED_PATH);
- final File seamGenResFolder = new File(seamHomePath, "seam-gen/resources"); //$NON-NLS-1$
-
+ super.copyFilesToWarProject(project, fv, model, monitor);
final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
- final File seamGenHomeFolder = new File(seamHomePath, "seam-gen"); //$NON-NLS-1$
- final File seamGenViewSource = new File(seamGenHomeFolder, "view"); //$NON-NLS-1$
- final File dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
- final File componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
-
- final File hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- final File hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
- //final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
- final File persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
-
- final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
- final FilterSet projectFilterSet = SeamFacetFilterSetFactory.createProjectFilterSet(model);
- final FilterSet filtersFilterSet = SeamFacetFilterSetFactory.createFiltersFilterSet(model);
-
- // ****************************************************************
- // Copy view folder from seam-gen installation to WebContent folder
- // ****************************************************************
- final AntCopyUtils.FileSet viewFileSet = new AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
- final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
- viewFilterSetCollection.addFilterSet(jdbcFilterSet);
- viewFilterSetCollection.addFilterSet(projectFilterSet);
-
- AntCopyUtils.copyFilesAndFolders(
- seamGenViewSource,
- webContentFolder,
- new AntCopyUtils.FileSetFileFilter(viewFileSet),
- viewFilterSetCollection,
- true);
-
- // *******************************************************************
- // Copy manifest and configuration resources the same way as view
- // *******************************************************************
- AntCopyUtils.FileSet webInfSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
-
- configureWebXml(project);
-
- AntCopyUtils.copyFileToFile(
- componentsFile,
- new File(webInfFolder, "components.xml"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);
-
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder, webContentFolder, new AntCopyUtils.FileSetFileFilter(webInfSet), viewFilterSetCollection, true);
-
- final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
- hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
- hibernateDialectFilterSet.addFilterSet(projectFilterSet);
- hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
-
- // ********************************************************************************************
- // Handle WAR configurations
- // ********************************************************************************************
if (isWarConfiguration(model)) {
- AntCopyUtils.FileSet webInfClassesSet = new AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder, srcFolder, new AntCopyUtils.FileSetFileFilter(webInfClassesSet), viewFilterSetCollection, true);
-
- createComponentsProperties(srcFolder, "", false); //$NON-NLS-1$ //$NON-NLS-2$
-
- /*AntCopyUtils.copyFileToFolder(
- hibernateConsolePref,
- new File(project.getLocation().toFile(),".settings"), //$NON-NLS-1$
- new FilterSetCollection(projectFilterSet), true);*/
-
- // In case of WAR configuration
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
-
- // ********************************************************************************************
- // Copy seam project indicator
- // ********************************************************************************************
-
- final IContainer source = srcRootFolder.getUnderlyingFolder();
-
- IPath actionSrcPath = new Path(source.getFullPath().removeFirstSegments(1) + "/action"); //$NON-NLS-1$
- IPath modelSrcPath = new Path(source.getFullPath().removeFirstSegments(1) + "/model"); //$NON-NLS-1$
-
- srcRootFolder.delete(IVirtualFolder.FORCE, monitor);
- WtpUtils.createSourceFolder(project, actionSrcPath, source.getFullPath().removeFirstSegments(1), webRootFolder.getFullPath().removeFirstSegments(1).append("WEB-INF/dev")); //$NON-NLS-1$
- WtpUtils.createSourceFolder(project, modelSrcPath, source.getFullPath().removeFirstSegments(1), null);
-
- srcRootFolder.createLink(actionSrcPath, 0, null);
- srcRootFolder.createLink(modelSrcPath, 0, null);
-
- File actionsSrc = new File(project.getLocation().toFile(), source.getFullPath().removeFirstSegments(1) + "/action/");
-
- //AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"), actionsSrc, true); //$NON-NLS-1$
-
- AntCopyUtils.copyFileToFile(
- new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
- new File(actionsSrc,model.getProperty(ISeamFacetDataModelProperties.SESSION_BEAN_PACKAGE_NAME).toString().replace('.', '/') + "/" + "Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- new FilterSetCollection(filtersFilterSet), true);
-
- AntCopyUtils.copyFileToFile(
- persistenceFile,
- new File(srcFolder, "META-INF/persistence.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- File resources = new File(project.getLocation().toFile(), "resources");
- AntCopyUtils.copyFileToFile(
- dataSourceDsFile,
- new File(resources, project.getName() + "-ds.xml"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFile(
- hibernateConsoleLaunchFile,
- new File(project.getLocation().toFile(), project.getName() + ".launch"), //$NON-NLS-1$
- viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePropsFile,
- project.getLocation().toFile(),
- hibernateDialectFilterSet, true);
-
- WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
} else {
- // In case of EAR configuration
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new AntCopyUtils.FileSetFileFilter(new AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
- AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "messages_en.properties"), srcFolder, true); //$NON-NLS-1$
}
-
- ClasspathHelper.addClasspathEntries(project, fv);
-
- createSeamProjectPreferenes(project, model);
-
- EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
-
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
/*
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-10-13 18:41:55 UTC (rev 10810)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-10-13 19:08:40 UTC (rev 10811)
@@ -61,6 +61,7 @@
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.widget.editor.CompositeEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
@@ -213,21 +214,6 @@
return names;
}
- /**
- *
- * @return
- */
- private Object getSeamRuntimeDefaultValue() {
- String seamFacetVersion = model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
- SeamVersion seamVersion = SeamVersion.parseFromString(seamFacetVersion);
-
- SeamRuntime defaultRuntime = SeamRuntimeManager.getInstance().getDefaultRuntime(seamVersion);
- if(defaultRuntime==null) {
- return "";
- }
- return defaultRuntime.getName();
- }
-
private DataModelSynchronizer sync;
/**
@@ -308,7 +294,7 @@
* Creates Seam Facet Wizard Page contents
*/
public void createControl(Composite parent) {
- jBossSeamHomeEditor = SeamWizardFactory.createSeamRuntimeSelectionFieldEditor(new SeamVersion[0], getSeamRuntimeDefaultValue().toString(), new NewSeamRuntimeAction());
+ jBossSeamHomeEditor = SeamWizardFactory.createSeamRuntimeSelectionFieldEditor(new SeamVersion[0], SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model), new NewSeamRuntimeAction());
initializeDialogUnits(parent);
@@ -479,7 +465,7 @@
List<String> runtimes = getRuntimeNames(model.getProperty(
IFacetDataModelProperties.FACET_VERSION_STR).toString());
if (oldValue == null || !runtimes.contains(oldValue)) {
- Object defaultRnt = getSeamRuntimeDefaultValue();
+ Object defaultRnt = SeamFacetInstallDataModelProvider.getSeamRuntimeDefaultValue(model);
if (defaultRnt != null && runtimes.contains(defaultRnt)) {
newValue = defaultRnt;
} else if (runtimes.size() > 0) {
@@ -581,13 +567,12 @@
if(wizard instanceof NewProjectDataModelFacetWizard) {
return new DeploymentTypeValidator(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, ((NewProjectDataModelFacetWizard)wizard).getDataModel());
}
- return new DeploymentTypeValidator(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, model);
-// return new IValidator() {
-// public Map<String, String> validate(Object value, Object context) {
-// SeamInstallWizardPage.this.validate();
-// return ValidatorFactory.NO_ERRORS;
-// }
-// };
+// return new DeploymentTypeValidator(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS, model);
+ return new IValidator() {
+ public Map<String, String> validate(Object value, Object context) {
+ return ValidatorFactory.NO_ERRORS;
+ }
+ };
}
static class DeploymentTypeValidator implements IValidator {
17 years, 3 months
JBoss Tools SVN: r10810 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-10-13 14:41:55 -0400 (Mon, 13 Oct 2008)
New Revision: 10810
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2761
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css 2008-10-13 18:26:27 UTC (rev 10809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css 2008-10-13 18:41:55 UTC (rev 10810)
@@ -24,6 +24,13 @@
font-family: Arial, Verdana, sans-serif;
}
+.extendedTable-input {
+ border-color:#C4C0B9;
+ border-style: inset;
+ border-width:1px;
+ width:100%;
+}
+
.dr-table-header {
background-color: #D4CFC7;
background-position: top left;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java 2008-10-13 18:26:27 UTC (rev 10809)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java 2008-10-13 18:41:55 UTC (rev 10810)
@@ -34,6 +34,11 @@
*/
public class RichFacesExtendedDataTableTemplate extends VpeAbstractTemplate {
+ private static final String DISPLAY_NONE = "display : none"; //$NON-NLS-1$
+ private static final String FILTER_BY = "filterBy"; //$NON-NLS-1$
+ private static final String DIV_STYLE = "padding : 4px"; //$NON-NLS-1$
+ private static final String EXTENDED_TABLE_INPUT = "extendedTable-input"; //$NON-NLS-1$
+ private static final String INPUT_TYPE_ATTR = "text"; //$NON-NLS-1$
private static final String COLUMNS = "columns"; //$NON-NLS-1$
private static final String FALSE = "false"; //$NON-NLS-1$
private static final String SCOP = "scop"; //$NON-NLS-1$
@@ -77,7 +82,8 @@
final static String ZERRO = "0"; //$NON-NLS-1$
final static String SORTABLE_PATH = "extendedDataTable/sortable.gif"; //$NON-NLS-1$
- private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px; height: 100%;"; //$NON-NLS-1$
+ private static String STYLE_FOR_RIGHT_SCROLL = "height: 100%; overflow-y: scroll"; //$NON-NLS-1$
+ private static String TD_STYLE_FOR_RIGHT_SCROLL = "height: 100%;width : 17px;"; //$NON-NLS-1$
private static final int NUM_ROW = 5;
@@ -116,6 +122,7 @@
tr1.appendChild(tr1_TD1);
nsIDOMElement tr1_TD2 = visualDocument.createElement(HTML.TAG_TD);
+ tr1_TD2.setAttribute(HTML.ATTR_STYLE, TD_STYLE_FOR_RIGHT_SCROLL);
tr1.appendChild(tr1_TD2);
nsIDOMElement tr1_td2_DIV = visualDocument.createElement(HTML.TAG_DIV);
@@ -177,17 +184,22 @@
}
if (!columnsHeaders.isEmpty()) {
nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ nsIDOMElement filterTR = visualDocument.createElement(HTML.TAG_TR);
thead.appendChild(tr);
+ thead.appendChild(filterTR);
String styleClass = encodeStyleClass(null,
DR_TABLE_SUBHEADER_RICH_TABLE_SUBHEADER, null,
headerClass);
if (styleClass != null) {
tr.setAttribute(HTML.ATTR_CLASS, styleClass);
+ filterTR.setAttribute(HTML.ATTR_CLASS, styleClass);
}
- encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ encodeHeaderFacets(creationData, tr, filterTR, visualDocument,
columnsHeaders,
DR_TABLE_SUBHEADERCELL_RICH_TABLE_SUBHEADERCELL,
- headerClass, HEADER, HTML.TAG_TD);
+ headerClass);
+
+
}
}
@@ -208,10 +220,10 @@
if (styleClass != null) {
tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
- encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ encodeFooterFacets(creationData, tr, visualDocument,
columnsFooters,
DR_TABLE_SUBFOOTERCELL_RICH_TABLE_SUBFOOTERCELL,
- footerClass, FOOTER, HTML.TAG_TD);
+ footerClass);
}
if (footer != null) {
encodeTableHeaderOrFooterFacet(creationData, tfoot,
@@ -319,23 +331,35 @@
*
* @param creationData
* @param parentTr
+ * @param filterTR
* @param visualDocument
- * @param headersOrFooters
+ * @param headers
* @param skinCellClass
* @param headerClass
- * @param facetName
- * @param element
*/
- public static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
- nsIDOMElement parentTr, nsIDOMDocument visualDocument,
- ArrayList<Element> headersOrFooters, String skinCellClass,
- String headerClass, String facetName, String element) {
- String extClass = "Class"; //$NON-NLS-1$
- for (Element column : headersOrFooters) {
- String classAttribute = facetName + extClass;
+ public static void encodeHeaderFacets(VpeCreationData creationData,
+ nsIDOMElement parentTr, nsIDOMElement filterTR,
+ nsIDOMDocument visualDocument, ArrayList<Element> headers,
+ String skinCellClass, String headerClass) {
+ String classAttribute = "headerClass"; //$NON-NLS-1$
+ // Check filter
+ boolean existFilters = false;
+ for (Element column : headers) {
+ if (ComponentUtil.getAttribute(column, FILTER_BY).length() > 0) {
+ existFilters = true;
+ break;
+ }
+ }
+
+ // Not filters
+ if (!existFilters) {
+ filterTR.setAttribute(HTML.ATTR_STYLE, DISPLAY_NONE);
+ }
+
+ for (Element column : headers) {
String columnHeaderClass = column.getAttribute(classAttribute);
- nsIDOMElement td = visualDocument.createElement(element);
-
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+
nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
td.appendChild(table);
table.setAttribute(HTML.ATTR_BORDER, ZERRO);
@@ -347,7 +371,7 @@
table.appendChild(tr);
tr.appendChild(trTd1);
tr.appendChild(trTd2);
-
+
parentTr.appendChild(td);
String styleClass = encodeStyleClass(null, skinCellClass,
headerClass, columnHeaderClass);
@@ -357,11 +381,36 @@
if (colspan != null && colspan.length() > 0) {
td.setAttribute(HTML.ATTR_COLSPAN, colspan);
}
- Element facetBody = ComponentUtil.getFacet(column, facetName);
+ Element facetBody = ComponentUtil.getFacet(column, HEADER);
VpeChildrenInfo child = new VpeChildrenInfo(trTd1);
child.addSourceChild(facetBody);
creationData.addChildrenInfo(child);
+ // Add filter
+ if (existFilters) {
+ nsIDOMElement filterTD = visualDocument
+ .createElement(HTML.TAG_TD);
+
+ filterTR.appendChild(filterTD);
+ filterTD.setAttribute(HTML.ATTR_CLASS, styleClass);
+ filterTD.setAttribute(SCOP, COL);
+ if (colspan != null && colspan.length() > 0) {
+ filterTD.setAttribute(HTML.ATTR_COLSPAN, colspan);
+ }
+ // Check current filter
+ if(ComponentUtil.getAttribute(column, FILTER_BY).length() > 0) {
+ // Add input
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ div.setAttribute(HTML.ATTR_STYLE, DIV_STYLE);
+ filterTD.appendChild(div);
+ nsIDOMElement input = visualDocument.createElement(HTML.TAG_INPUT);
+ div.appendChild(input);
+ input.setAttribute(HTML.ATTR_TYPE, INPUT_TYPE_ATTR);
+ input.setAttribute(HTML.ATTR_CLASS, EXTENDED_TABLE_INPUT);
+ }
+
+
+ }
// Add sortable attribute
String sortable = ComponentUtil.getAttribute(column, ATTR_SORTABLE);
if (sortable.equalsIgnoreCase(FALSE)) {
@@ -372,7 +421,41 @@
trTd2.appendChild(img);
}
}
+
+ /**
+ *
+ * @param creationData
+ * @param parentTr
+ * @param visualDocument
+ * @param footers
+ * @param skinCellClass
+ * @param footerClass
+ */
+ public static void encodeFooterFacets(VpeCreationData creationData,
+ nsIDOMElement parentTr, nsIDOMDocument visualDocument,
+ ArrayList<Element> footers, String skinCellClass, String footerClass) {
+ String classAttribute = "footerClass"; //$NON-NLS-1$
+ for (Element column : footers) {
+ String columnHeaderClass = column.getAttribute(classAttribute);
+ nsIDOMElement td = visualDocument.createElement(HTML.TAG_TD);
+ parentTr.appendChild(td);
+ String styleClass = encodeStyleClass(null, skinCellClass,
+ footerClass, columnHeaderClass);
+ td.setAttribute(HTML.ATTR_CLASS, styleClass);
+ td.setAttribute(SCOP, COL);
+ String colspan = column.getAttribute(HTML.ATTR_COLSPAN);
+ if (colspan != null && colspan.length() > 0) {
+ td.setAttribute(HTML.ATTR_COLSPAN, colspan);
+ }
+ Element facetBody = ComponentUtil.getFacet(column, FOOTER);
+
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
+ child.addSourceChild(facetBody);
+ creationData.addChildrenInfo(child);
+ }
+ }
+
/**
*
* @param creationData
17 years, 3 months
JBoss Tools SVN: r10809 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-13 14:26:27 -0400 (Mon, 13 Oct 2008)
New Revision: 10809
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EndState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/StartState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/State.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SuperState.java
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java
Log:
jpdl initial serialization experiment
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EndState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EndState.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/EndState.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -3,5 +3,9 @@
import org.jboss.tools.flow.common.model.DefaultNode;
public class EndState extends DefaultNode {
+
+ public EndState() {
+ setMetaData("xml", "end-state");
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Process.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -7,6 +7,11 @@
public class Process extends DefaultFlow {
+ public Process() {
+ super();
+ setMetaData("xml", "process-definition");
+ }
+
public StartState getStartState() {
for (Iterator<Node> iterator = getNodes().iterator(); iterator.hasNext(); ) {
Node node = iterator.next();
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/StartState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/StartState.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/StartState.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -3,5 +3,9 @@
import org.jboss.tools.flow.common.model.DefaultNode;
public class StartState extends DefaultNode {
+
+ public StartState() {
+ setMetaData("xml", "start-state");
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/State.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/State.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/State.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -3,5 +3,8 @@
import org.jboss.tools.flow.common.model.DefaultNode;
public class State extends DefaultNode {
-
+
+ public State() {
+ setMetaData("xml", "state");
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SuperState.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SuperState.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/SuperState.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -4,4 +4,7 @@
public class SuperState extends DefaultContainer {
+ public SuperState() {
+ setMetaData("xml", "super-state");
+ }
}
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java 2008-10-13 18:26:06 UTC (rev 10808)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/model/Transition.java 2008-10-13 18:26:27 UTC (rev 10809)
@@ -5,8 +5,13 @@
public class Transition extends DefaultConnection {
+ public Transition() {
+ this(null, null);
+ }
+
public Transition(Node from, Node to) {
super(from, to);
+ setMetaData("xml", "transition");
}
}
17 years, 3 months
JBoss Tools SVN: r10808 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-13 14:26:06 -0400 (Mon, 13 Oct 2008)
New Revision: 10808
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
Log:
jpdl initial serialization experiment
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-13 18:24:33 UTC (rev 10807)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlEditor.java 2008-10-13 18:26:06 UTC (rev 10808)
@@ -3,12 +3,18 @@
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
+import java.util.List;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.palette.PaletteRoot;
import org.jboss.tools.flow.common.editor.GenericModelEditor;
import org.jboss.tools.flow.common.editpart.DefaultEditPartFactory;
+import org.jboss.tools.flow.common.model.Element;
import org.jboss.tools.flow.common.registry.ElementRegistry;
+import org.jboss.tools.flow.common.wrapper.ConnectionWrapper;
+import org.jboss.tools.flow.common.wrapper.ContainerWrapper;
+import org.jboss.tools.flow.common.wrapper.NodeWrapper;
+import org.jboss.tools.flow.common.wrapper.Wrapper;
public class JpdlEditor extends GenericModelEditor {
@@ -24,8 +30,34 @@
return ElementRegistry.createWrapper("org.jboss.tools.flow.jpdl4.process");
}
+ private void write(Wrapper wrapper, OutputStream os) {
+ Object object = wrapper.getElement();
+ if (object instanceof Element) {
+ Element element = (Element)object;
+ String xml = (String)element.getMetaData("xml");
+ System.out.println(xml);
+ }
+ if (wrapper instanceof ContainerWrapper) {
+ ContainerWrapper containerWrapper = (ContainerWrapper)wrapper;
+ List<NodeWrapper> children = containerWrapper.getElements();
+ for (NodeWrapper nodeWrapper : children) {
+ write(nodeWrapper, os);
+ }
+ }
+ if (wrapper instanceof NodeWrapper) {
+ NodeWrapper nodeWrapper = (NodeWrapper)wrapper;
+ List<ConnectionWrapper> children = nodeWrapper.getOutgoingConnections();
+ for (ConnectionWrapper connectionWrapper : children) {
+ write(connectionWrapper, os);
+ }
+ }
+ }
+
protected void writeModel(OutputStream os) throws IOException {
- // TODO
+ Object object = getModel();
+ if (object instanceof Wrapper) {
+ write((Wrapper)object, os);
+ }
}
protected void createModel(InputStream is) {
17 years, 3 months
JBoss Tools SVN: r10807 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-10-13 14:24:33 -0400 (Mon, 13 Oct 2008)
New Revision: 10807
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
Log:
file formatting
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-13 18:22:12 UTC (rev 10806)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/plugin.xml 2008-10-13 18:24:33 UTC (rev 10807)
@@ -74,7 +74,8 @@
<node>
<figure>
<rounded-rectangle></rounded-rectangle>
- </figure></node>
+ </figure>
+ </node>
</element>
<element
class="org.jboss.tools.flow.jpdl4.model.Transition"
17 years, 3 months
JBoss Tools SVN: r10806 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-13 14:22:12 -0400 (Mon, 13 Oct 2008)
New Revision: 10806
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
Bug fix https://jira.jboss.org/jira/browse/JBIDE-2856 (Part 3)
- Now value of listHeight define max-height in rich:comboBox and it does not affect the height of comboBox's list if sum of heights of items less than the value
- Created class RichFacesComboBoxCreator. It instantiated every time when new rich:comboBox created in VPE, so its attributes like 'styleClass' are never shared between different views.
- Toggling now works better.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-10-13 18:03:55 UTC (rev 10805)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2008-10-13 18:22:12 UTC (rev 10806)
@@ -21,6 +21,7 @@
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeSourceDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxCreator.java 2008-10-13 18:22:12 UTC (rev 10806)
@@ -0,0 +1,580 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.text.MessageFormat;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.WeakHashMap;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.Constants;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
+
+/**
+ * @author yradtsevich
+ *
+ */
+public class RichFacesComboBoxCreator {
+ private static final String EXPANDED_ATTR_NAME = "expanded"; //$NON-NLS-1$
+ private static final WeakHashMap<Node, Object> expandedComboBoxes = new WeakHashMap<Node, Object>();
+ private static final String DISABLED_ATTR_NAME = "disabled"; //$NON-NLS-1$
+ private static final String BUTTON_ICON_CLASSES_DISABLED =
+ "rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String BUTTON_ICON_CLASSES =
+ "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String SECOND_DIV = "secondDiv"; //$NON-NLS-1$
+ private static final String THIRD_DIV = "thirdDiv"; //$NON-NLS-1$
+ private static final String THIRD_EMPTY_DIV = "thirdEmptyDiv"; //$NON-NLS-1$
+ private static final String TEXT_FIELD = "textField"; //$NON-NLS-1$
+ private static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
+
+ /** CSS_FILE_NAME. */
+ private static final String CSS_FILE_NAME = "comboBox/comboBox.css"; //$NON-NLS-1$
+
+ /** The Constant DEFAULT_LIST_WIDTH. */
+ private static final String DEFAULT_LIST_WIDTH = "150px"; //$NON-NLS-1$
+
+ /** IMAGE_NAME_DOWN. */
+ private static final String IMAGE_NAME_DOWN = "/comboBox/down.gif"; //$NON-NLS-1$
+
+ /** The Constant BUTTON_BACKGROUND. */
+ private static final String BUTTON_BACKGROUND = "buttonBackground"; //$NON-NLS-1$
+
+ /** The Constant STYLE_EXT. */
+ private static final String STYLE_EXT = "richFacesComboBox"; //$NON-NLS-1$
+
+ private static final int LIST_ITEM_HEIGHT_DEFAULT_VALUE = 18;
+
+ /** The style clasess. */
+ private final Map<String, String> styleClasess = new HashMap<String, String>();
+
+ /** The source align. */
+ // Commented because of not working alignment in RichFaces implementation
+ // private String sourceAlign;
+
+ /** The source button style. */
+ private String sourceButtonStyle;
+
+ /** The source default label. */
+ private String sourceDefaultLabel = null;
+
+ /** The source list height. */
+ private String sourceListHeight;
+
+ /** The source list width. */
+ private String sourceListWidth;
+
+ /** The source value. */
+ private String sourceValue;
+
+ /** The source width. */
+ private String sourceWidth;
+
+ /** The source style. */
+ private String sourceStyle;
+
+ /** The source input style. */
+ private String sourceInputStyle;
+
+ /** The source input class. */
+ private String sourceInputClass;
+
+ /** The source list style. */
+ private String sourceListStyle;
+
+ /** The source list class. */
+ private String sourceListClass;
+
+ /** The source item class. */
+ private String sourceItemClass;
+
+
+ /** Source button icon **/
+ private String sourceButtonIcon;
+
+ private String sourceButtonIconInactive;
+
+ private String sourceButtonIconDisabled;
+
+ private boolean disabled;
+ private boolean expanded;
+
+ private final VpePageContext pageContext;
+ private final Node sourceNode;
+ private final nsIDOMDocument visualDocument;
+ private final VpeCreationData vpeCreationData;
+
+ /**
+ * The Constructor.
+ */
+ public RichFacesComboBoxCreator(final VpePageContext pageContext, final Node sourceNode,
+ final nsIDOMDocument visualDocument) {
+ this.pageContext = pageContext;
+ this.sourceNode = sourceNode;
+ this.visualDocument = visualDocument;
+ initDefaultClasses();
+ vpeCreationData = create();
+ }
+
+ /**
+ * Calculate with for div.
+ *
+ * @param with the with
+ * @param minus the minus
+ *
+ * @return the string
+ */
+ private static String calculateWithForDiv(final String with, final int minus) {
+ try {
+ Integer intValue = 0;
+ if (with.endsWith("px")) { //$NON-NLS-1$
+ intValue = Integer.parseInt(with.substring(0, with.length() - 2));
+ } else {
+ intValue = Integer.parseInt(with);
+ }
+ return String.valueOf((intValue - minus)) + "px"; //$NON-NLS-1$
+ } catch (final NumberFormatException e) {
+ return with;
+ }
+
+ }
+ public VpeCreationData getVpeCreationData() {
+ return vpeCreationData;
+ }
+
+ /**
+ * Create.
+ *
+ * @param visualDocument the visual document
+ * @param sourceNode the source node
+ * @param pageContext the page context
+ *
+ * @return the vpe creation data
+ */
+ private VpeCreationData create() {
+ ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, STYLE_EXT);
+
+ final Element source = (Element) sourceNode;
+
+ prepareData(source);
+ final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ //Fix https://jira.jboss.org/jira/browse/JBIDE-2430 issue with resizement.
+ rootDiv.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON+sourceWidth);
+ final nsIDOMElement comboBoxDiv = visualDocument.createElement(HTML.TAG_DIV);
+ final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ // Commented because of not working alignment in RichFaces implementation
+ // comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+ // secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+
+
+ //comboBoxDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
+ secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_DIV));
+ String secondDivSubStyle = "; position: {0}; z-index: {1} ;"; //$NON-NLS-1$
+
+ if (expanded) {
+ secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "relative", "2"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "static", "0"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ comboBoxDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
+ + Constants.SEMICOLON + secondDivSubStyle);
+ secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceListWidth
+ + Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
+ final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
+ thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_DIV));
+ thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + sourceWidth
+ + "; z-index: 1;"); //$NON-NLS-1$
+ final nsIDOMElement textField = visualDocument.createElement(HTML.TAG_INPUT);
+ textField.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ textField.setAttribute(HTML.ATTR_CLASS,
+ styleClasess.get(TEXT_FIELD) + Constants.WHITE_SPACE + sourceInputClass);
+ textField.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
+ textField.setAttribute(HTML.ATTR_STYLE,
+ HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + calculateWithForDiv(sourceWidth, 17)
+ + Constants.SEMICOLON + sourceInputStyle);
+ String value = null;
+ if (ComponentUtil.isNotBlank(sourceDefaultLabel)) {
+ value = sourceDefaultLabel;
+ } else if (ComponentUtil.isNotBlank(sourceValue) && ComponentUtil.isBlank(sourceDefaultLabel)) {
+ value = sourceValue;
+ }
+
+ if (value != null) {
+ textField.setAttribute(RichFaces.ATTR_VALUE, value);
+ }
+ final nsIDOMElement buttonBackground = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonBackground.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ if (disabled) {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES_DISABLED);
+ } else {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
+ }
+
+ buttonBackground.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_BACKGROUND));
+ buttonBackground.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonBackground.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ if (sourceButtonStyle != null) {
+ buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+ //
+ final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+ ;
+ buttonIcon.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_ICON));
+ buttonIcon.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonIcon.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ if (sourceButtonStyle != null) {
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ }
+
+ String actualSourceButton;
+ if (disabled) {
+ actualSourceButton = sourceButtonIconDisabled;
+ } else if (expanded) {
+ actualSourceButton = sourceButtonIcon;
+ } else {
+ actualSourceButton = sourceButtonIconInactive;
+ }
+
+ if (ComponentUtil.isNotBlank(actualSourceButton) && (actualSourceButton != IMAGE_NAME_DOWN)) {
+ String buttonIconPath = VpeStyleUtil.addFullPathToImgSrc(actualSourceButton, pageContext, true);
+ buttonIconPath = buttonIconPath.replace('\\', '/');
+ final String style = "background-image: url(" + buttonIconPath + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, buttonIcon.getAttribute(HTML.ATTR_STYLE) + style);
+ }
+ final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
+ forthEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
+ forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + calculateWithForDiv(sourceWidth, 10));
+ forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts")); //$NON-NLS-1$
+
+ rootDiv.appendChild(comboBoxDiv);
+ comboBoxDiv.appendChild(secondDiv);
+
+ secondDiv.appendChild(thirdDiv);
+ if (expanded) {
+ comboBoxDiv.appendChild(createToogleDiv());
+ }
+ thirdDiv.appendChild(textField);
+ thirdDiv.appendChild(buttonBackground);
+ thirdDiv.appendChild(buttonIcon);
+ thirdDiv.appendChild(forthEmptyDiv);
+
+ final VpeCreationData creationData = new VpeCreationData(rootDiv);
+
+ return creationData;
+ }
+
+ /**
+ * Creates the toogle div.
+ *
+ * @param visualDocument the visual document
+ * @param pageContext the page context
+ * @param source the source
+ *
+ * @return the ns IDOM node
+ */
+ private nsIDOMNode createToogleDiv() {
+
+ final nsIDOMElement thirdEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, sourceListStyle + Constants.SEMICOLON
+ + " z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
+ thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS,
+ styleClasess.get(THIRD_EMPTY_DIV) + " " + sourceListClass); //$NON-NLS-1$
+ thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE,
+ "z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
+
+ final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ final nsIDOMElement positionDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ positionDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-position"); //$NON-NLS-1$
+
+ final nsIDOMElement decorationDiv = visualDocument.createElement(HTML.TAG_DIV);
+
+ decorationDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-decoration"); //$NON-NLS-1$
+ // decorationDiv.setAttribute(HTML.ATTR_STYLE,
+ // "height: 54px; width: 208px;");
+
+ final nsIDOMElement scrollDiv = visualDocument.createElement(HTML.TAG_DIV);
+ scrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-scroll"); //$NON-NLS-1$
+ final List<Element> items = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
+ int defaultHeight = LIST_ITEM_HEIGHT_DEFAULT_VALUE;
+
+ if((items!=null) && (items.size() > 1)){
+ defaultHeight = ((items.size() - 1)* LIST_ITEM_HEIGHT_DEFAULT_VALUE);
+ }
+
+ final String listHeight = ComponentUtil.isNotBlank(sourceListHeight)
+ ? sourceListHeight
+ : String.valueOf(defaultHeight) + "px"; //$NON-NLS-1$
+ scrollDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_MAX_HEIGHT
+ + Constants.COLON + listHeight + Constants.SEMICOLON
+ + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
+ + calculateWithForDiv(sourceListWidth, 2));
+
+ final List<Element> selectItems = ComponentUtil.getSelectItems(sourceNode.getChildNodes());
+
+ if (selectItems.size() > 0) {
+ for (final Element e : selectItems) {
+ scrollDiv.appendChild(createSelectItem(e));
+ }
+ }
+
+ shadovDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow"); //$NON-NLS-1$
+
+ final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+ table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
+ table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
+ String width = Constants.EMPTY;
+ try {
+
+ int w = ComponentUtil.parseWidthHeightValue(sourceListWidth);
+ w += 7;
+ width = String.valueOf(w);
+ } catch (final ParseException e) {
+ width = "217"; //$NON-NLS-1$
+ }
+ table.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH
+ + Constants.COLON + width + Constants.PIXEL
+ + Constants.SEMICOLON + HTML.STYLE_PARAMETER_HEIGHT
+ + Constants.COLON + "63px;"); //$NON-NLS-1$
+
+ final nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
+ final nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
+
+ final nsIDOMElement tr1_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr1_td2 = visualDocument.createElement(HTML.TAG_TD);
+
+ final nsIDOMElement tr2_td1 = visualDocument.createElement(HTML.TAG_TD);
+ final nsIDOMElement tr2_td2 = visualDocument.createElement(HTML.TAG_TD);
+
+ final nsIDOMElement tr1_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr1_td2_img = visualDocument.createElement(HTML.TAG_IMG);
+
+ final nsIDOMElement tr2_td1_img = visualDocument.createElement(HTML.TAG_IMG);
+ final nsIDOMElement tr2_td2_img = visualDocument.createElement(HTML.TAG_IMG);
+
+ tr1_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tl"); //$NON-NLS-1$
+ tr1_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tr"); //$NON-NLS-1$
+
+ tr2_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-bl"); //$NON-NLS-1$
+ tr2_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-br"); //$NON-NLS-1$
+
+ setUpImg(tr1_td1_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr1_td2_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr2_td1_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+ setUpImg(tr2_td2_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
+
+ thirdEmptyDiv.appendChild(shadovDiv);
+ shadovDiv.appendChild(table);
+ thirdEmptyDiv.appendChild(positionDiv);
+ positionDiv.appendChild(decorationDiv);
+ decorationDiv.appendChild(scrollDiv);
+
+ table.appendChild(tr1);
+ table.appendChild(tr2);
+ tr1.appendChild(tr1_td1);
+ tr1.appendChild(tr1_td2);
+
+ tr2.appendChild(tr2_td1);
+ tr2.appendChild(tr2_td2);
+
+ tr1_td1.appendChild(tr1_td1_img);
+ tr1_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr1_td2.appendChild(tr1_td2_img);
+ tr1_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr2_td1.appendChild(tr2_td1_img);
+ tr2_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ tr2_td2.appendChild(tr2_td2_img);
+ tr2_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
+
+ return thirdEmptyDiv;
+ }
+
+ /**
+ * Creates the select item.
+ *
+ * @param visualDocument the visual document
+ * @param e the e
+ *
+ * @return the ns IDOM node
+ */
+ private nsIDOMNode createSelectItem(final Element e) {
+ final nsIDOMElement item = visualDocument.createElement(HTML.TAG_SPAN);
+
+ item.setAttribute(HTML.ATTR_CLASS, "rich-combobox-item " + sourceItemClass); //$NON-NLS-1$
+ item.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
+ return item;
+ }
+
+ /**
+ * Inits the default classes.
+ */
+ private void initDefaultClasses() {
+ styleClasess.put(SECOND_DIV, "rich-combobox-font rich-combobox"); //$NON-NLS-1$
+ styleClasess.put(THIRD_DIV, "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$
+ styleClasess.put(THIRD_EMPTY_DIV, "rich-combobox-list-cord"); //$NON-NLS-1$
+ styleClasess.put(TEXT_FIELD, "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$
+ styleClasess.put(BUTTON_BACKGROUND,
+ "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES);
+ styleClasess.put("forthEmptyDiv", "rich-combobox-strut rich-combobox-font"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
+ /**
+ * Prepare data.
+ *
+ * @param source the source
+ */
+ private void prepareData(final Element source) {
+ final AttributeMap attributeMap = new AttributeMap(source);
+
+ // Commented because of not working alignment in RichFaces implementation
+ // if (attributeMap.isBlank(RichFaces.ATTR_ALIGN)) {
+ // this.sourceAlign = DEFAULT_ALIGN;
+ // } else {
+ // this.sourceAlign = attributeMap.getString(RichFaces.ATTR_ALIGN);
+ // }
+
+ if (attributeMap.isBlank(RichFaces.ATTR_LIST_WIDTH)) {
+ sourceListWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ sourceListWidth = attributeMap.getString(RichFaces.ATTR_LIST_WIDTH);
+ }
+
+ sourceListHeight = attributeMap.getString(RichFaces.ATTR_LIST_HEIGHT);
+
+ if (attributeMap.isBlank(RichFaces.ATTR_WIDTH)) {
+ sourceWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ sourceWidth = attributeMap.getString(RichFaces.ATTR_WIDTH);
+
+ if(sourceListWidth == DEFAULT_LIST_WIDTH) {
+ sourceListWidth = sourceWidth;
+ }
+ }
+
+ if (ComponentUtil.isNotBlank(sourceWidth) && (sourceWidth != DEFAULT_LIST_WIDTH)) {
+ if(!sourceWidth.endsWith(Constants.PIXEL)){
+ try {
+ final int intValue = Integer.parseInt(sourceWidth);
+ sourceWidth = String.valueOf(intValue)+Constants.PIXEL;
+ } catch (final NumberFormatException e) {
+ sourceListWidth = DEFAULT_LIST_WIDTH;
+ }
+ }
+ }
+
+ sourceDefaultLabel = attributeMap.getString("defaultLabel"); //$NON-NLS-1$
+ sourceValue = attributeMap.getString( RichFaces.ATTR_VALUE);
+
+ sourceButtonStyle = attributeMap.getString("buttonStyle"); //$NON-NLS-1$
+
+ final String sourceStyleClasess = attributeMap.getString(RichFaces.ATTR_STYLE_CLASS);
+
+ if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
+ styleClasess.put(SECOND_DIV, styleClasess.get(SECOND_DIV) + " " + sourceStyleClasess); //$NON-NLS-1$
+ }
+
+ sourceStyle = attributeMap.getString(HTML.ATTR_STYLE);
+ sourceInputStyle = attributeMap.getString("inputStyle"); //$NON-NLS-1$
+ sourceInputClass = attributeMap.getString("inputClass"); //$NON-NLS-1$
+ sourceListClass = attributeMap.getString("listClass"); //$NON-NLS-1$
+ sourceListStyle = attributeMap.getString("listStyle"); //$NON-NLS-1$
+ sourceItemClass = attributeMap.getString("itemClass"); //$NON-NLS-1$
+
+ sourceButtonIcon = attributeMap.getString(BUTTON_ICON);
+ sourceButtonIconInactive = attributeMap.getString("buttonIconInactive"); //$NON-NLS-1$
+ sourceButtonIconDisabled = attributeMap.getString("buttonIconDisabled"); //$NON-NLS-1$
+ disabled = isDisabled(attributeMap);
+ expanded = isExpanded(source);
+
+ if(ComponentUtil.isBlank(sourceButtonIcon)){
+ sourceButtonIcon = IMAGE_NAME_DOWN;
+ }
+
+ }
+
+ /**
+ * Sets the up img.
+ *
+ * @param i *
+ * @param width the width
+ * @param height the height
+ * @param img the img
+ * @param j *
+ * @param image the image
+ * @param border the border
+ * @param td1Img */
+ protected static void setUpImg(final nsIDOMElement img, final int width, final int height,
+ final int border, final String image) {
+ ComponentUtil.setImg(img, image);
+ img.setAttribute(HTML.ATTR_WIDTH, String.valueOf(width));
+ img.setAttribute(HTML.ATTR_HEIGHT, String.valueOf(height));
+ img.setAttribute(HTML.ATTR_BORDER, String.valueOf(border));
+
+ }
+
+ /**
+ * Inverts <code>expanded</code> state of the ComboBox
+ *
+ * @param builder the builder
+ * @param sourceNode the source node
+ * @param toggleId the toggle id
+ */
+ public static void toggle(final VpeVisualDomBuilder builder, final Node sourceNode, final String toggleId) {
+ AttributeMap attributes = new AttributeMap((Element)sourceNode);
+ if (isDisabled(attributes) || isExpanded(sourceNode)) {
+ expandedComboBoxes.remove(sourceNode);
+ } else {
+ expandedComboBoxes.put(sourceNode, null);
+ }
+ }
+
+ public static void stopToggling(final Node sourceNode) {
+ expandedComboBoxes.remove(sourceNode);
+ }
+
+ public static boolean isDisabled(final AttributeMap attributes) {
+ return attributes.getBoolean(DISABLED_ATTR_NAME) == Boolean.TRUE;
+ }
+
+ private static boolean isExpanded(Node node) {
+ return expandedComboBoxes.containsKey(node);
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-13 18:03:55 UTC (rev 10805)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-13 18:22:12 UTC (rev 10806)
@@ -1,4 +1,4 @@
-/*******************************************************************************
+/*******************************************************************************
* Copyright (c) 2007 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
@@ -8,824 +8,60 @@
* Contributors:
* Red Hat, Inc. - initial API and implementation
******************************************************************************/
-
-
package org.jboss.tools.jsf.vpe.richfaces.template;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
-import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
-import org.jboss.tools.vpe.editor.mapping.AttributeData;
-import org.jboss.tools.vpe.editor.mapping.VpeElementData;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
-import org.jboss.tools.vpe.editor.util.Constants;
-import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import com.sun.org.apache.xerces.internal.impl.xpath.regex.ParseException;
-
-
/**
* The Class RichFacesComboBoxTemplate.
- *
+ *
* @author Eugene Stherbin
*/
public class RichFacesComboBoxTemplate extends AbstractEditableRichFacesTemplate implements VpeToggableTemplate {
- private static final String BUTTON_ICON_CLASSES_DISABLED = "rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"; //$NON-NLS-1$
- private static final String BUTTON_ICON_CLASSES = "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"; //$NON-NLS-1$
- private static final String SECOND_DIV = "secondDiv"; //$NON-NLS-1$
- private static final String THIRD_DIV = "thirdDiv"; //$NON-NLS-1$
- private static final String THIRD_EMPTY_DIV = "thirdEmptyDiv"; //$NON-NLS-1$
- private static final String TEXT_FIELD = "textField"; //$NON-NLS-1$
- private static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
+ /**
+ * @see org.jboss.tools.vpe.editor.template.VpeToggableTemplate#stopToggling(org.w3c.dom.Node)
+ */
+ public void stopToggling(final Node sourceNode) {
+ }
- /** CSS_FILE_NAME. */
- private static final String CSS_FILE_NAME = "comboBox/comboBox.css"; //$NON-NLS-1$
+ /**
+ * @see org.jboss.tools.vpe.editor.template.VpeToggableTemplate#toggle(org.jboss.tools.vpe.editor.VpeVisualDomBuilder, org.w3c.dom.Node, java.lang.String)
+ * @see RichFacesComboBoxCreator#toggle(VpeVisualDomBuilder, Node, String)
+ */
+ public void toggle(final VpeVisualDomBuilder builder, final Node sourceNode, final String toggleId) {
+ RichFacesComboBoxCreator.toggle(builder, sourceNode, toggleId);
+ }
- /** The Constant DEFAULT_ALIGN. */
- private static final String DEFAULT_ALIGN = "left"; //$NON-NLS-1$
+ /**
+ * @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
+ * @see RichFacesComboBoxCreator
+ */
+ public VpeCreationData create(final VpePageContext pageContext, final Node sourceNode,
+ final nsIDOMDocument visualDocument) {
+ final RichFacesComboBoxCreator creator =
+ new RichFacesComboBoxCreator(pageContext, sourceNode, visualDocument);
+
+ return creator.getVpeCreationData();
+ }
- /** DEFAULT_INPUT_SIZE. */
- private static final String DEFAULT_INPUT_SIZE = "10"; //$NON-NLS-1$
-
- /** DEFAULT_INPUT_STYLE. */
- private static final String DEFAULT_INPUT_STYLE = "rich-combobox-default-input"; //$NON-NLS-1$
-
- /** The Constant DEFAULT_LIST_WIDTH. */
- private static final String DEFAULT_LIST_WIDTH = "150px"; //$NON-NLS-1$
-
- /** The Constant DEFAULT_WIDTH. */
- private static final String DEFAULT_WIDTH = "width : 150px"; //$NON-NLS-1$
-
- /** IMAGE_NAME_DOWN. */
- private static final String IMAGE_NAME_DOWN = "/comboBox/down.gif"; //$NON-NLS-1$
-
- /** The Constant RICH_COMBOBOX_BUTTON_STYLE_CLASS. */
- private static final String RICH_COMBOBOX_BUTTON_STYLE_CLASS = "rich-combobox-button"; //$NON-NLS-1$
-
- /** The Constant RICH_COMBOBOX_IMAGE_STYLE_CLASS. */
- private static final String RICH_COMBOBOX_IMAGE_STYLE_CLASS = "rich-combobox-image"; //$NON-NLS-1$
-
- /** The Constant RICH_COMBOBOX_INPUT_CELL_STYLE. */
- private static final String RICH_COMBOBOX_INPUT_CELL_STYLE = "rich-combobox-inputCell"; //$NON-NLS-1$
-
- /** The Constant BUTTON_BACKGROUND. */
- private static final String BUTTON_BACKGROUND = "buttonBackground"; //$NON-NLS-1$
-
- /** The Constant STYLE_EXT. */
- private static final String STYLE_EXT = "richFacesComboBox"; //$NON-NLS-1$
-
- private static final int LIST_ITEM_HEIGHT_DEFAULT_VALUE=18;
-
- /** The style clasess. */
- private Map<String, String> styleClasess = new HashMap<String, String>();
-
- /** The Constant ZERO_STRING. */
- private static final String ZERO_STRING = "0"; //$NON-NLS-1$
-
- /** The source align. */
- // Commented because of not working alignment in RichFaces implementation
- // private String sourceAlign;
-
- /** The source button style. */
- private String sourceButtonStyle;
-
- /** The source default label. */
- private String sourceDefaultLabel = null;
-
- /** The source list height. */
- private String sourceListHeight;
-
- /** The source list width. */
- private String sourceListWidth;
-
- /** The source value. */
- private String sourceValue;
-
- /** The source width. */
- private String sourceWidth;
-
- /** The source style. */
- private String sourceStyle;
-
- /** The source input style. */
- private String sourceInputStyle;
-
- /** The source input class. */
- private String sourceInputClass;
-
- /** The is toggle. */
- private boolean isToggle = false;
-
- /** The source list style. */
- private String sourceListStyle;
-
- /** The source list class. */
- private String sourceListClass;
-
- /** The source item class. */
- private String sourceItemClass;
-
-
- /** Source button icon **/
- private String sourceButtonIcon;
-
- private String sourceButtonIconInactive;
-
- private String sourceButtonIconDisabled;
-
- private boolean disabled;
-
- /**
- * The Constructor.
- */
- public RichFacesComboBoxTemplate() {
- super();
- initDefaultClasses();
- }
-
- /**
- * Calculate with for div.
- *
- * @param with the with
- * @param minus the minus
- *
- * @return the string
- */
- private String calculateWithForDiv(String with, int minus) {
- try {
- Integer intValue = 0;
- if (with.endsWith("px")) { //$NON-NLS-1$
- intValue = Integer.parseInt(with.substring(0, with.length() - 2));
- } else {
- intValue = Integer.parseInt(with);
- }
- return String.valueOf((intValue - minus)) + "px"; //$NON-NLS-1$
- } catch (NumberFormatException e) {
- return with;
- }
-
- }
-
- /**
- * Create.
- *
- * @param visualDocument the visual document
- * @param sourceNode the source node
- * @param pageContext the page context
- *
- * @return the vpe creation data
- */
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
- ComponentUtil.setCSSLink(pageContext, CSS_FILE_NAME, STYLE_EXT);
-
- final Element source = (Element) sourceNode;
-
- prepareData(source);
- final nsIDOMElement rootDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- //Fix https://jira.jboss.org/jira/browse/JBIDE-2430 issue with resizement.
- rootDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+Constants.COLON+sourceWidth);
- final nsIDOMElement comboBoxDiv = visualDocument.createElement(HTML.TAG_DIV);
- final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- // Commented because of not working alignment in RichFaces implementation
- // comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
- // secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
-
-
- //comboBoxDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
- secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_DIV)); //$NON-NLS-1$
- String secondDivSubStyle = "; position: {0}; z-index: {1} ;"; //$NON-NLS-1$
-
- if (isToggle) {
- secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "relative", "2"); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "static", "0"); //$NON-NLS-1$ //$NON-NLS-2$
- }
- // TODO add ATTR_STYLE.
- comboBoxDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + this.sourceListWidth
- + Constants.SEMICOLON + secondDivSubStyle);
- secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + this.sourceListWidth
- + Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
- final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
- thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_DIV));
- thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + this.sourceWidth
- + "; z-index: 1;"); //$NON-NLS-1$
- final nsIDOMElement textField = visualDocument.createElement(HTML.TAG_INPUT);
- textField.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
-
- textField.setAttribute(HTML.ATTR_CLASS, styleClasess.get(TEXT_FIELD) + Constants.WHITE_SPACE + sourceInputClass); //$NON-NLS-1$
- textField.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
- textField.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+ Constants.COLON + calculateWithForDiv(this.sourceWidth, 17) + Constants.SEMICOLON
- + sourceInputStyle);
- String value = null;
- if (ComponentUtil.isNotBlank(this.sourceDefaultLabel)) {
- value = this.sourceDefaultLabel;
- } else if (ComponentUtil.isNotBlank(this.sourceValue) && ComponentUtil.isBlank(this.sourceDefaultLabel)) {
- value = this.sourceValue;
- }
-
- if (value != null) {
- textField.setAttribute(RichFaces.ATTR_VALUE, value);
- }
- final nsIDOMElement buttonBackground = visualDocument.createElement(HTML.TAG_INPUT);
- buttonBackground.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
-
- if (disabled) {
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES_DISABLED); //$NON-NLS-1$
- } else {
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES); //$NON-NLS-1$
- }
-
- buttonBackground.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_BACKGROUND));
- buttonBackground.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- buttonBackground.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- if (this.sourceButtonStyle != null) {
- buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
- }
- //
- final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
- buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
- ;
- buttonIcon.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_ICON)); //$NON-NLS-1$
- buttonIcon.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- buttonIcon.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
- if (this.sourceButtonStyle != null) {
- buttonIcon.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
- }
-
- String actualSourceButton;
- if (disabled) {
- actualSourceButton = sourceButtonIconDisabled;
- } else if (isToggle) {
- actualSourceButton = sourceButtonIcon;
- } else {
- actualSourceButton = sourceButtonIconInactive;
- }
-
- if (ComponentUtil.isNotBlank(actualSourceButton) && (actualSourceButton != IMAGE_NAME_DOWN)) {
- String buttonIconPath = VpeStyleUtil.addFullPathToImgSrc(actualSourceButton, pageContext, true);
- buttonIconPath = buttonIconPath.replace('\\', '/');
- String style = "background-image: url(" + buttonIconPath + ")"; //$NON-NLS-1$ //$NON-NLS-2$
- buttonIcon.setAttribute(HTML.ATTR_STYLE, buttonIcon.getAttribute(HTML.ATTR_STYLE) + style);
- }
- final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
- forthEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
- forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
- + calculateWithForDiv(this.sourceWidth, 10));
- forthEmptyDiv.appendChild(visualDocument.createTextNode("Struts")); //$NON-NLS-1$
-
- rootDiv.appendChild(comboBoxDiv);
- comboBoxDiv.appendChild(secondDiv);
-
- secondDiv.appendChild(thirdDiv);
- if (isToggle) {
- comboBoxDiv.appendChild(createToogleDiv(pageContext, source, visualDocument));
- }
- thirdDiv.appendChild(textField);
- thirdDiv.appendChild(buttonBackground);
- thirdDiv.appendChild(buttonIcon);
- thirdDiv.appendChild(forthEmptyDiv);
-
- final VpeCreationData creationData = new VpeCreationData(rootDiv);
-// final DOMTreeDumper dumper = new DOMTreeDumper();
-// dumper.dumpToStream(System.err, secondDiv);
-
- return creationData;
- }
-
- /**
- * Creates the toogle div.
- *
- * @param visualDocument the visual document
- * @param pageContext the page context
- * @param source the source
- *
- * @return the ns IDOM node
- */
- private nsIDOMNode createToogleDiv(VpePageContext pageContext, Element source, nsIDOMDocument visualDocument) {
-
- final nsIDOMElement thirdEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, this.sourceListStyle + Constants.SEMICOLON
- + " z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
- thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_EMPTY_DIV) + " " + this.sourceListClass); //$NON-NLS-1$ //$NON-NLS-2$
- thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, "z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
-
- final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- final nsIDOMElement positionDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- positionDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-position"); //$NON-NLS-1$
-
- final nsIDOMElement decorationDiv = visualDocument.createElement(HTML.TAG_DIV);
-
- decorationDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-decoration"); //$NON-NLS-1$
- // decorationDiv.setAttribute(HTML.ATTR_STYLE,
- // "height: 54px; width: 208px;");
-
- final nsIDOMElement scrollDiv = visualDocument.createElement(HTML.TAG_DIV);
- scrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-list-scroll"); //$NON-NLS-1$
- final List<Element> items = ComponentUtil.getSelectItems(source.getChildNodes());
- int defaultHeight = LIST_ITEM_HEIGHT_DEFAULT_VALUE;
-
- if((items!=null) && (items.size() > 1)){
- defaultHeight = ((items.size() - 1)* LIST_ITEM_HEIGHT_DEFAULT_VALUE);
- }
-
- final String listHeight = ComponentUtil.isNotBlank(this.sourceListHeight) ? this.sourceListHeight : String.valueOf(defaultHeight)
- + "px"; //$NON-NLS-1$
- scrollDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_HEIGHT
- + Constants.COLON + listHeight + Constants.SEMICOLON
- + HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
- + calculateWithForDiv(sourceListWidth, 2));
-
- final List<Element> selectItems = ComponentUtil.getSelectItems(source.getChildNodes());
-
- if (selectItems.size() > 0) {
- for (Element e : selectItems) {
- scrollDiv.appendChild(createSelectItem(e, visualDocument));
- }
- }
-
- shadovDiv.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow"); //$NON-NLS-1$
-
- final nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
- table.setAttribute(HTML.ATTR_CELLPADDING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_CELLSPACING, "0"); //$NON-NLS-1$
- table.setAttribute(HTML.ATTR_BORDER, "0"); //$NON-NLS-1$
- String width = Constants.EMPTY;
- try {
-
- int w = ComponentUtil.parseWidthHeightValue(sourceListWidth);
- w += 7;
- width = String.valueOf(w);
- } catch (ParseException e) {
- width = "217"; //$NON-NLS-1$
- }
- table.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH
- + Constants.COLON + width + Constants.PIXEL
- + Constants.SEMICOLON + HTML.STYLE_PARAMETER_HEIGHT
- + Constants.COLON + "63px;"); //$NON-NLS-1$
-
- final nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
- final nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
-
- final nsIDOMElement tr1_td1 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr1_td2 = visualDocument.createElement(HTML.TAG_TD);
-
- final nsIDOMElement tr2_td1 = visualDocument.createElement(HTML.TAG_TD);
- final nsIDOMElement tr2_td2 = visualDocument.createElement(HTML.TAG_TD);
-
- final nsIDOMElement tr1_td1_img = visualDocument.createElement(HTML.TAG_IMG);
- final nsIDOMElement tr1_td2_img = visualDocument.createElement(HTML.TAG_IMG);
-
- final nsIDOMElement tr2_td1_img = visualDocument.createElement(HTML.TAG_IMG);
- final nsIDOMElement tr2_td2_img = visualDocument.createElement(HTML.TAG_IMG);
-
- tr1_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tl"); //$NON-NLS-1$
- tr1_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-tr"); //$NON-NLS-1$
-
- tr2_td1.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-bl"); //$NON-NLS-1$
- tr2_td2.setAttribute(HTML.ATTR_CLASS, "rich-combobox-shadow-br"); //$NON-NLS-1$
-
- setUpImg(tr1_td1_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr1_td2_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr2_td1_img, 1, 10, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
- setUpImg(tr2_td2_img, 10, 1, 0, "comboBox/spacer.gif"); //$NON-NLS-1$
-
- thirdEmptyDiv.appendChild(shadovDiv);
- shadovDiv.appendChild(table);
- thirdEmptyDiv.appendChild(positionDiv);
- positionDiv.appendChild(decorationDiv);
- decorationDiv.appendChild(scrollDiv);
-
- table.appendChild(tr1);
- table.appendChild(tr2);
- tr1.appendChild(tr1_td1);
- tr1.appendChild(tr1_td2);
-
- tr2.appendChild(tr2_td1);
- tr2.appendChild(tr2_td2);
-
- tr1_td1.appendChild(tr1_td1_img);
- tr1_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr1_td2.appendChild(tr1_td2_img);
- tr1_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr2_td1.appendChild(tr2_td1_img);
- tr2_td1.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- tr2_td2.appendChild(tr2_td2_img);
- tr2_td2.appendChild(visualDocument.createElement(HTML.TAG_BR));
-
- return thirdEmptyDiv;
- }
-
- /**
- * Creates the select item.
- *
- * @param visualDocument the visual document
- * @param e the e
- *
- * @return the ns IDOM node
- */
- private nsIDOMNode createSelectItem(Element e, nsIDOMDocument visualDocument) {
- final nsIDOMElement item = visualDocument.createElement(HTML.TAG_SPAN);
-
- item.setAttribute(HTML.ATTR_CLASS, "rich-combobox-item " + sourceItemClass); //$NON-NLS-1$
- item.appendChild(visualDocument.createTextNode(ComponentUtil.getSelectItemValue(e)));
- return item;
- }
-
- /**
- * Creates the button table.
- *
- * @param visualDocument the visual document
- * @param sourceNode the source node
- *
- * @return the ns IDOM element
- */
- private nsIDOMElement createButtonTable(nsIDOMDocument visualDocument, Node sourceNode) {
- nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
- setUpTable(table);
-
- nsIDOMElement rowUp = visualDocument.createElement(HTML.TAG_TR);
-
- table.appendChild(rowUp);
-
- nsIDOMElement rowDown = visualDocument.createElement(HTML.TAG_TR);
- nsIDOMElement cellDown = visualDocument.createElement(HTML.TAG_TD);
-
- nsIDOMElement imageDownElement = visualDocument.createElement(HTML.TAG_INPUT);
-
- imageDownElement.setAttribute(HTML.ATTR_BORDER, ZERO_STRING);
- imageDownElement.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_IMAGE_TYPE);
- imageDownElement.setAttribute(HTML.ATTR_CLASS, RICH_COMBOBOX_IMAGE_STYLE_CLASS);
- cellDown.appendChild(imageDownElement);
- rowDown.appendChild(cellDown);
- table.appendChild(rowDown);
-
- return table;
- }
-
- /**
- * Create a HTML-part containg input element.
- *
- * @param sourceElement the source element
- * @param visualDocument The current node of the source tree.
- * @param sourceNode The document of the visual tree.
- * @param elementData the element data
- *
- * @return a HTML-part containg input element
- */
- private nsIDOMElement createInputElement(nsIDOMDocument visualDocument, Element sourceElement, VpeElementData elementData) {
- nsIDOMElement inputElement = visualDocument.createElement(HTML.TAG_INPUT);
-
- inputElement.setAttribute(HTML.ATTR_CLASS, getInputClass(sourceElement));
-
- inputElement.setAttribute(HTML.ATTR_STYLE, getInputStyle(sourceElement));
-
- inputElement.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
-
- inputElement.setAttribute(HTML.ATTR_SIZE, getInputSize(sourceElement));
- inputElement.setAttribute(HTML.ATTR_VALUE, getInputValue(sourceElement));
-
- if ((sourceElement).hasAttribute(RichFaces.ATTR_VALUE)) {
- elementData.addNodeData(new AttributeData(sourceElement.getAttributeNode(RichFaces.ATTR_VALUE), inputElement, true));
- } else {
- elementData.addNodeData(new AttributeData(RichFaces.ATTR_VALUE, inputElement, true));
- }
-
- return inputElement;
- }
-
- /**
- * Gets the default input class.
- *
- * @return the default input class
- */
- public String getDefaultInputClass() {
- return DEFAULT_INPUT_STYLE;
- }
-
- /**
- * Gets the default input size.
- *
- * @return the default input size
- */
- public String getDefaultInputSize() {
- return DEFAULT_INPUT_SIZE;
- }
-
- /**
- * Return a input class.
- *
- * @param sourceElement the source element
- * @param sourceNode a sourceNode
- *
- * @return a input class
- */
- public String getInputClass(Element sourceElement) {
- String returnValue = getDefaultInputClass();
- String tmp = getAttribute(sourceElement, RichFaces.ATTR_INPUT_CLASS);
- if (tmp.length() != 0) {
- returnValue = new StringBuffer().append(returnValue).append(Constants.WHITE_SPACE)
- .append(tmp).toString();
- }
- return returnValue;
- }
-
- /**
- * Return a input size.
- *
- * @param sourceElement the source element
- * @param sourceNode a sourceNode
- *
- * @return a input size
- */
- protected String getInputSize(Element sourceElement) {
- String returnValue = getDefaultInputSize();
- String tmp = getAttribute(sourceElement, RichFaces.ATTR_INPUT_SIZE);
- if (tmp.length() != 0) {
- returnValue = tmp;
- }
- return returnValue;
- }
-
- /**
- * Return a input style.
- *
- * @param sourceElement the source element
- * @param sourceNode a sourceNode
- *
- * @return a input style
- */
- private String getInputStyle(Element sourceElement) {
- String returnValue = getAttribute(sourceElement, RichFaces.ATTR_INPUT_STYLE);
- return returnValue;
- }
-
- /**
- * Return a input value.
- *
- * @param sourceElement the source element
- * @param sourceNode a sourceNode
- *
- * @return a input value
- */
- private String getInputValue(Element sourceElement) {
- String returnValue = getAttribute(sourceElement, RichFaces.ATTR_VALUE);
- final String defaultLabel = getAttribute(sourceElement, RichFaces.ATTR_DEFAULT_LABEL);
-
- if (defaultLabel != null && defaultLabel.length() > 0) {
- returnValue = defaultLabel;
- }
- return returnValue;
- }
-
- /**
- * Inits the default classes.
- */
- private void initDefaultClasses() {
- styleClasess.put(SECOND_DIV, "rich-combobox-font rich-combobox"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put(THIRD_DIV, "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put(THIRD_EMPTY_DIV, "rich-combobox-list-cord"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put(TEXT_FIELD, "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put(BUTTON_BACKGROUND, "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
- styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put("forthEmptyDiv", "rich-combobox-strut rich-combobox-font"); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /**
- * Checks if is recreate at attr change.
- *
- * @param sourceElement the source element
- * @param value the value
- * @param visualDocument the visual document
- * @param visualNode the visual node
- * @param data the data
- * @param pageContext the page context
- * @param name the name
- *
- * @return true, if is recreate at attr change
- */
- @Override
- public boolean isRecreateAtAttrChange(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- // TODO Auto-generated method stub
- return true;
- }
-
- /**
- * Prepare data.
- *
- * @param source the source
- */
- private void prepareData(Element source) {
- AttributeMap attributeMap = new AttributeMap(source);
-
- // Commented because of not working alignment in RichFaces implementation
- // if (attributeMap.isBlank(RichFaces.ATTR_ALIGN)) {
- // this.sourceAlign = DEFAULT_ALIGN;
- // } else {
- // this.sourceAlign = attributeMap.getString(RichFaces.ATTR_ALIGN);
- // }
-
- if (attributeMap.isBlank(RichFaces.ATTR_LIST_WIDTH)) {
- this.sourceListWidth = DEFAULT_LIST_WIDTH;
- } else {
- this.sourceListWidth = attributeMap.getString(RichFaces.ATTR_LIST_WIDTH);
- }
-
- this.sourceListHeight = attributeMap.getString(RichFaces.ATTR_LIST_HEIGHT);
-
- if (attributeMap.isBlank(RichFaces.ATTR_WIDTH)) {
- this.sourceWidth = DEFAULT_LIST_WIDTH;
- } else {
- this.sourceWidth = attributeMap.getString(RichFaces.ATTR_WIDTH);
-
- if(this.sourceListWidth == DEFAULT_LIST_WIDTH) {
- this.sourceListWidth = this.sourceWidth;
- }
- }
-
- if (ComponentUtil.isNotBlank(this.sourceWidth) && (this.sourceWidth != DEFAULT_LIST_WIDTH)) {
- if(!this.sourceWidth.endsWith(Constants.PIXEL)){
- try {
- int intValue = Integer.parseInt(this.sourceWidth);
- this.sourceWidth = String.valueOf(intValue)+Constants.PIXEL;
- } catch (NumberFormatException e) {
- this.sourceListWidth = DEFAULT_LIST_WIDTH;
- }
- }
- }
-
- this.sourceDefaultLabel = attributeMap.getString("defaultLabel"); //$NON-NLS-1$
- this.sourceValue = attributeMap.getString( RichFaces.ATTR_VALUE);
-
- this.sourceButtonStyle = attributeMap.getString("buttonStyle"); //$NON-NLS-1$
-
- final String sourceStyleClasess = attributeMap.getString(RichFaces.ATTR_STYLE_CLASS);
-
- if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
- styleClasess.put(SECOND_DIV, styleClasess.get(SECOND_DIV) + " " + sourceStyleClasess); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
- }
-
- this.sourceStyle = attributeMap.getString(HTML.ATTR_STYLE);
- this.sourceInputStyle = attributeMap.getString("inputStyle"); //$NON-NLS-1$
- this.sourceInputClass = attributeMap.getString("inputClass"); //$NON-NLS-1$
- this.sourceListClass = attributeMap.getString("listClass"); //$NON-NLS-1$
- this.sourceListStyle = attributeMap.getString("listStyle"); //$NON-NLS-1$
- this.sourceItemClass = attributeMap.getString("itemClass"); //$NON-NLS-1$
-
- this.sourceButtonIcon = attributeMap.getString(BUTTON_ICON); //$NON-NLS-1$
- this.sourceButtonIconInactive = attributeMap.getString("buttonIconInactive"); //$NON-NLS-1$
- this.sourceButtonIconDisabled = attributeMap.getString("buttonIconDisabled"); //$NON-NLS-1$
- this.disabled = (attributeMap.getBoolean("disabled") == Boolean.TRUE); //$NON-NLS-1$
-
- if(ComponentUtil.isBlank(this.sourceButtonIcon)){
- this.sourceButtonIcon = IMAGE_NAME_DOWN;
- }
-
- }
-
- /**
- * Sets the attribute.
- *
- * @param sourceElement the source element
- * @param value the value
- * @param visualDocument the visual document
- * @param visualNode the visual node
- * @param data the data
- * @param pageContext the page context
- * @param name the name
- *
- * @see com.exadel.vpe.editor.template.VpeAbstractTemplate#setAttribute(com.
- * exadel.vpe.editor.context.VpePageContext, org.w3c.dom.Element,
- * org.w3c.dom.Document, org.w3c.dom.Node, java.lang.Object,
- * java.lang.String, java.lang.String)
- */
- @Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode,
- Object data, String name, String value) {
- // 1. Call super method
- super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
-
- // nsIDOMElement table = (nsIDOMElement) visualNode.queryInterface(
- // nsIDOMElement.NS_IDOMELEMENT_IID);
- // nsIDOMNodeList listTable = table.getChildNodes();
- // nsIDOMNode nodeTr = listTable.item(0);
- // nsIDOMNodeList listTr = nodeTr.getChildNodes();
- // nsIDOMNode nodeTd = listTr.item(0);
- //
- // nsIDOMNodeList listTd = nodeTd.getChildNodes();
- // nsIDOMNode entry0 = listTd.item(0);
- //
- // nsIDOMElement inputElement = (nsIDOMElement) entry0.queryInterface(
- // nsIDOMElement.NS_IDOMELEMENT_IID);
- //
- // inputElement.setAttribute(HTML.ATTR_CLASS, getInputClass(
- // sourceElement));
- //
- // inputElement.setAttribute(HTML.ATTR_STYLE, getInputStyle(
- // sourceElement));
- // inputElement.setAttribute(HTML.ATTR_SIZE, getInputSize(sourceElement)
- // );
- // inputElement.setAttribute(HTML.ATTR_VALUE, getInputValue(
- // sourceElement));
- //
- // // 3. Set a style for main container
- // String strStyle = getAttribute(sourceElement, RichFaces.ATTR_STYLE);
- // strStyle = ((strStyle.length() == 0) ? DEFAULT_WIDTH : strStyle);
- //
- // table.setAttribute(HTML.ATTR_STYLE, strStyle);
-
- }
-
- /**
- * Sets the up img.
- *
- * @param i *
- * @param width the width
- * @param height the height
- * @param img the img
- * @param j *
- * @param image the image
- * @param border the border
- * @param td1Img */
- protected void setUpImg(nsIDOMElement img, int width, int height, int border, String image) {
- ComponentUtil.setImg(img, image);
- img.setAttribute(HTML.ATTR_WIDTH, String.valueOf(width));
- img.setAttribute(HTML.ATTR_HEIGHT, String.valueOf(height));
- img.setAttribute(HTML.ATTR_BORDER, String.valueOf(border));
-
- }
-
- /**
- * Sets the up table.
- *
- * @param table the table
- */
- private void setUpTable(final nsIDOMElement table) {
- table.setAttribute(HTML.ATTR_BORDER, ZERO_STRING);
- table.setAttribute(HTML.ATTR_CELLPADDING, ZERO_STRING);
- table.setAttribute(HTML.ATTR_CELLSPACING, ZERO_STRING);
- }
-
- /**
- * Sets the up td.
- *
- * @param visualDocument the visual document
- * @param elementData the element data
- * @param cellInput the cell input
- * @param source the source
- */
- private void setUpTd(nsIDOMDocument visualDocument, final Element source, final VpeElementData elementData,
- final nsIDOMElement cellInput) {
- cellInput.setAttribute(HTML.ATTR_CLASS, RICH_COMBOBOX_INPUT_CELL_STYLE);
- cellInput.setAttribute(HTML.ATTR_VALIGN, HTML.VALUE_TOP_ALIGN);
- cellInput.appendChild(createInputElement(visualDocument, source, elementData));
- }
-
- /**
- * Stop toggling.
- *
- * @param sourceNode the source node
- */
- public void stopToggling(Node sourceNode) {
- isToggle = false;
- }
-
- /**
- * Toggle.
- *
- * @param builder the builder
- * @param sourceNode the source node
- * @param toggleId the toggle id
- */
- public void toggle(VpeVisualDomBuilder builder, Node sourceNode, String toggleId) {
- if (disabled) {
- isToggle = false;
- } else {
- isToggle = !isToggle;
- }
-
- }
+ /* (non-Javadoc)
+ * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument, org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String, java.lang.String)
+ */
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ // TODO Auto-generated method stub
+ return true;
+ }
+
+
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java 2008-10-13 18:03:55 UTC (rev 10805)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java 2008-10-13 18:22:12 UTC (rev 10806)
@@ -15,13 +15,15 @@
/**
* A wrapper of DOM Element that can extract its attributes as objects of different types.
- * The methods of the class never throw exceptions. In case if parsing is impossible they
- * always return a correct value.
+ * The methods of the class never throw any exception. In case if parsing is impossible they
+ * always return a correct value(see methods descriptions).
*
* @author yradtsevich
* @see Element
*/
public class AttributeMap {
+ private static final String FALSE_VALUE = "false"; //$NON-NLS-1$
+ private static final String TRUE_VALUE = "true"; //$NON-NLS-1$
private Element element;
public AttributeMap(Element element) {
@@ -54,9 +56,9 @@
Boolean ret;
- if ("true".equals(attribute)) {
+ if (TRUE_VALUE.equals(attribute)) {
ret = Boolean.TRUE;
- } else if ("false".equals(attribute)) {
+ } else if (FALSE_VALUE.equals(attribute)) {
ret = Boolean.FALSE;
} else {
ret = null;
@@ -65,8 +67,24 @@
return ret;
}
+ public void setAttribute(String name, boolean value) {
+ if (value) {
+ element.setAttribute(name, TRUE_VALUE);
+ } else {
+ element.setAttribute(name, FALSE_VALUE);
+ }
+ }
+
+ /**
+ * Tests if its parameter is blank string
+ *
+ * @param attributeName
+ * @return <code>true</code> if and only if <code>attributeName</code> is
+ * either <code>null</code>, or blank, or contains non-printable characters only
+ */
public boolean isBlank(String attributeName) {
String value = getString(attributeName);
return ComponentUtil.isBlank(value);
}
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-13 18:03:55 UTC (rev 10805)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-10-13 18:22:12 UTC (rev 10806)
@@ -106,5 +106,5 @@
public static final String STYLE_PARAMETER_WIDTH = "width"; //$NON-NLS-1$
public static final String STYLE_PARAMETER_HEIGHT = "height"; //$NON-NLS-1$
-
+ public static final String STYLE_PARAMETER_MAX_HEIGHT = "max-height"; //$NON-NLS-1$
}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r10805 - trunk/seam/plugins/org.jboss.tools.seam.ui.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-13 14:03:55 -0400 (Mon, 13 Oct 2008)
New Revision: 10805
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-10-13 17:51:34 UTC (rev 10804)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-10-13 18:03:55 UTC (rev 10805)
@@ -342,16 +342,34 @@
<contentAssistProcessor
class="org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor"
id="org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor">
- <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
- <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
- <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
- <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
- <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
- <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
- <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ <contenttype id="org.eclipse.jst.jsp.core.jspsource">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
+ <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ </contenttype>
+ <contenttype id="org.eclipse.wst.html.core.htmlsource">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
+ <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ </contenttype>
+ <contenttype id="org.eclipse.core.runtime.xml">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ </contenttype>
+ <contenttype id="org.jboss.tools.common.model.ui.xml">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ </contenttype>
+
</contentAssistProcessor>
- </extension>
+ </extension>
<extension
point="org.eclipse.ui.popupMenus">
17 years, 3 months
JBoss Tools SVN: r10804 - trunk/jst/plugins/org.jboss.tools.jst.jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-13 13:51:34 -0400 (Mon, 13 Oct 2008)
New Revision: 10804
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-10-13 17:50:52 UTC (rev 10803)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2008-10-13 17:51:34 UTC (rev 10804)
@@ -304,11 +304,11 @@
</extension-->
<extension point="org.jboss.tools.jst.jsp.occurrenceStructureProviders">
- <provider
- class="org.jboss.tools.jst.jsp.text.JSPOccurrenceProvider"
- editorId="org.jboss.tools.jst.jsp"
- name="%defaultOccurrenceStructureProviderName" />
- </extension>
+ <provider
+ class="org.jboss.tools.jst.jsp.text.JSPOccurrenceProvider"
+ editorId="org.jboss.tools.jst.jsp"
+ name="%defaultOccurrenceStructureProviderName" />
+ </extension>
<extension
point="org.eclipse.core.runtime.contentTypes">
<file-association
@@ -341,4 +341,64 @@
class="org.jboss.tools.jst.jsp.outline.VpeProperties"/>
</extension>
+ <extension
+ point="org.jboss.tools.common.text.xml.contentAssistProcessor"
+ id="org.jboss.tools.jst.jsp.contentAssistProcessor"
+ name="org.jboss.tools.jst.jsp.contentAssistProcessor">
+
+ <contentAssistProcessor
+ class="org.jboss.tools.jst.jsp.contentassist.ExtendedJSPContentAssistProcessor"
+ id="org.jboss.tools.jst.jsp.contentassist.ExtendedJSPContentAssistProcessor">
+ <contenttype id="org.eclipse.jst.jsp.core.jspsource">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
+ <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ </contenttype>
+ <contenttype id="org.eclipse.wst.html.core.htmlsource">
+ <partitiontype id="org.eclipse.wst.xml.XML_DEFAULT" />
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.DEFAULT_JSP" />
+ <partitiontype id="org.eclipse.jst.jsp.JSP_DIRECTIVE" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.DELIMITER" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
+ </contenttype>
+ </contentAssistProcessor>
+
+ <contentAssistProcessor
+ class="org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor"
+ id="org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor">
+ <contenttype id="org.eclipse.jst.jsp.core.jspsource">
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" /> <!-- Is this forgotten? -->
+ </contenttype>
+ <contenttype id="org.eclipse.wst.html.core.htmlsource">
+ <partitiontype id="org.eclipse.wst.html.HTML_DEFAULT" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL" />
+ <partitiontype id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" /> <!-- Is this forgotten? -->
+ </contenttype>
+ </contentAssistProcessor>
+
+ <!--
+ //added by estherbin
+ //fix http://jira.jboss.com/jira/browse/JBIDE-1791
+ -->
+ <contentAssistProcessor
+ class="org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor"
+ id="org.eclipse.wst.css.ui.internal.contentassist.CSSContentAssistProcessor">
+ <contenttype id="org.eclipse.jst.jsp.core.jspsource">
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
+ </contenttype>
+ <contenttype id="org.eclipse.wst.html.core.htmlsource">
+ <partitiontype id="org.eclipse.wst.css.STYLE" />
+ </contenttype>
+ </contentAssistProcessor>
+
+ </extension>
+
</plugin>
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r10803 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-13 13:50:52 -0400 (Mon, 13 Oct 2008)
New Revision: 10803
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2008-10-13 17:46:31 UTC (rev 10802)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/HTMLTextViewerConfiguration.java 2008-10-13 17:50:52 UTC (rev 10803)
@@ -32,6 +32,7 @@
import org.eclipse.wst.sse.ui.internal.format.StructuredFormattingStrategy;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
+import org.jboss.tools.common.text.xml.contentassist.SortingCompoundContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.format.HTMLFormatProcessor;
import org.osgi.framework.Bundle;
@@ -44,6 +45,15 @@
@SuppressWarnings("restriction")
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
+ SortingCompoundContentAssistProcessor sortingCompoundProcessor = new SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
+ List<IContentAssistProcessor> processors = new ArrayList<IContentAssistProcessor>();
+
+// if (sortingCompoundProcessor.size() > 0) {
+ if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
+ processors.add(sortingCompoundProcessor);
+ }
+
+/*
// IContentAssistProcessor[] processors = null;
// if we have our own processors we need
@@ -51,6 +61,7 @@
// plugins using extention point
// "org.jboss.tools.common.text.xml.contentAssistProcessor"
+
ContentAssistProcessorDefinition[] defs = ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(partitionType);
if(defs==null) return null;
@@ -73,6 +84,7 @@
processors.add(new CSSContentAssistProcessor());
}
+*/
return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2008-10-13 17:46:31 UTC (rev 10802)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JSPTextViewerConfiguration.java 2008-10-13 17:50:52 UTC (rev 10803)
@@ -31,6 +31,7 @@
import org.jboss.tools.common.model.plugin.ModelPlugin;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
+import org.jboss.tools.common.text.xml.contentassist.SortingCompoundContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.FaceletsHtmlContentAssistProcessor;
import org.jboss.tools.jst.jsp.contentassist.ExtendedJSPContentAssistProcessor;
@@ -44,6 +45,16 @@
}
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
+ SortingCompoundContentAssistProcessor sortingCompoundProcessor = new SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
+ List<IContentAssistProcessor> processors = new ArrayList<IContentAssistProcessor>();
+
+// if (sortingCompoundProcessor.size() > 0) {
+ if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
+ processors.add(sortingCompoundProcessor);
+ return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
+ }
+
+ /*
// if we have our own processors we need
// to define them in plugin.xml file of their
// plugins using extention point
@@ -71,6 +82,8 @@
processors.add(new ExtendedJSPContentAssistProcessor());
return (IContentAssistProcessor[])processors.toArray(new IContentAssistProcessor[0]);
}
+ */
+
IContentAssistProcessor[] superProcessors = super.getContentAssistProcessors(sourceViewer, partitionType);
if (superProcessors != null && superProcessors.length > 0) {
17 years, 3 months
JBoss Tools SVN: r10802 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-13 13:46:31 -0400 (Mon, 13 Oct 2008)
New Revision: 10802
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
loading for perspective was added to test setUp
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-13 17:46:26 UTC (rev 10801)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-10-13 17:46:31 UTC (rev 10802)
@@ -31,12 +31,17 @@
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IViewPart;
import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.WorkbenchException;
import org.eclipse.ui.navigator.CommonNavigator;
+import org.jboss.tools.jst.web.ui.WebDevelopmentPerspectiveFactory;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamPackage;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.ui.ISeamUiConstants;
+import org.jboss.tools.seam.ui.SeamPerspectiveFactory;
import org.jboss.tools.seam.ui.views.actions.SeamViewLayoutActionGroup.SeamContributionItem;
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -55,7 +60,12 @@
@Override
protected void setUp() throws Exception {
super.setUp();
-
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ try {
+ workbench.showPerspective(SeamPerspectiveFactory.PERSPECTIVE_ID,workbench.getActiveWorkbenchWindow());
+ } catch (WorkbenchException e) {
+ fail("Cannot load perspective '" + SeamPerspectiveFactory.PERSPECTIVE_ID + "'");
+ }
project = (IProject)ResourcesPlugin.getWorkspace().getRoot().findMember("TestComponentView");
assertNotNull("",project);
this.project.refreshLocal(IResource.DEPTH_INFINITE, null);
17 years, 3 months
JBoss Tools SVN: r10801 - in trunk/common/plugins/org.jboss.tools.common.text.xml: src/org/jboss/tools/common/text/xml and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-10-13 13:46:26 -0400 (Mon, 13 Oct 2008)
New Revision: 10801
Added:
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
Modified:
trunk/common/plugins/org.jboss.tools.common.text.xml/schema/contentAssistProcessor.exsd
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorBuilder.java
trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorDefinition.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2118 Cleanup/unify the EL code completion used in JSF, Java, Seam completions
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/schema/contentAssistProcessor.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/schema/contentAssistProcessor.exsd 2008-10-13 16:37:31 UTC (rev 10800)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/schema/contentAssistProcessor.exsd 2008-10-13 17:46:26 UTC (rev 10801)
@@ -74,6 +74,26 @@
</complexType>
</element>
+ <element name="contenttype">
+ <annotation>
+ <documentation>
+ Defined the editor's content type to be assotiated with the Content Assist Processor. The value is either one of the WTP structured model content type ID or any other structured text content type ID
+ </documentation>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="partitiontype" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="id" type="string" use="required">
+ <annotation>
+ <documentation>
+ A unique ID for this contenttype. The value is either one of the WTP structured model content type ID or any other structured text content type ID.
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
<element name="partitiontype">
<annotation>
<documentation>
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2008-10-13 16:37:31 UTC (rev 10800)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/XMLTextViewerConfiguration.java 2008-10-13 17:46:26 UTC (rev 10801)
@@ -26,6 +26,7 @@
import org.eclipse.wst.xml.ui.StructuredTextViewerConfigurationXML;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorBuilder;
import org.jboss.tools.common.text.xml.contentassist.ContentAssistProcessorDefinition;
+import org.jboss.tools.common.text.xml.contentassist.SortingCompoundContentAssistProcessor;
/**
* @author Igels
@@ -43,7 +44,15 @@
}
protected IContentAssistProcessor[] getContentAssistProcessors(ISourceViewer sourceViewer, String partitionType) {
-
+
+ SortingCompoundContentAssistProcessor sortingCompoundProcessor = new SortingCompoundContentAssistProcessor(sourceViewer, partitionType);
+ List<IContentAssistProcessor> processors = new ArrayList<IContentAssistProcessor>();
+
+// if (sortingCompoundProcessor.size() > 0) {
+ if (sortingCompoundProcessor.supportsPartitionType(partitionType)) {
+ processors.add(sortingCompoundProcessor);
+ }
+/*
// if we have our own processors we need
// to define them in plugin.xml file of their
// plugins using extention point
@@ -53,18 +62,17 @@
if(defs==null) return null;
- List processors = new ArrayList();
for(int i=0; i<defs.length; i++) {
IContentAssistProcessor processor = defs[i].createContentAssistProcessor();
if(!processors.contains(processor)) {
processors.add(processor);
}
}
-
+*/
IContentAssistProcessor[] in = getInitialProcessors(sourceViewer, partitionType);
if(in != null && in.length > 0) {
- //we do not need super processors - make initial processors responcible for that
+ //we do not need super processors - make initial processors responsible for that
for(int i=0; i<in.length; i++) {
if(!processors.contains(in[i])) {
processors.add(in[i]);
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorBuilder.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorBuilder.java 2008-10-13 16:37:31 UTC (rev 10800)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorBuilder.java 2008-10-13 17:46:26 UTC (rev 10801)
@@ -12,6 +12,8 @@
package org.jboss.tools.common.text.xml.contentassist;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -26,6 +28,7 @@
public static final String PL_CONTENTASSISTPROCESSOR = "contentAssistProcessor"; //$NON-NLS-1$
public static final String TAG_CONTENTASSISTPROCESSOR = "contentAssistProcessor"; //$NON-NLS-1$
+ public static final String TAG_CONTENT_TYPE = "contenttype"; //$NON-NLS-1$
public static final String TAG_PARTITION_TYPE = "partitiontype"; //$NON-NLS-1$
public static final String ATT_ID = "id"; //$NON-NLS-1$
@@ -37,6 +40,7 @@
private List<ContentAssistProcessorDefinition> fContentAssistProcessorDefs = null;
private ContentAssistProcessorDefinition fCurrentDefinition = null;
+ private String fCurrentDefinitionContentType = null;
/**
* returns singleton instance of ContentAssistProcessorBuilder
@@ -94,6 +98,24 @@
}
/**
+ * Processes element which should be a configuration element specifying an
+ * open on object. Creates a new ContentAssistProcessor definitio object and adds it to the
+ * list of ContentAssistProcessor definition objects
+ *
+ * @param element ContentAssistProcessor configuration element
+ */
+ private void processContentTypeTag(IConfigurationElement element) {
+ String theId = getId(element);
+
+ if (theId != null && fCurrentDefinition != null) {
+ fCurrentDefinitionContentType = theId;
+ }
+ else {
+ fCurrentDefinitionContentType = null;
+ }
+ }
+
+ /**
* Processes element which should be a configuration element specifying a partition
* type for the current contentAssistProcessor tag. Assumes that there is a valid
* current contentAssistProcessor tag.
@@ -104,8 +126,8 @@
// add to current HyperlinkDefinition/contentType
String theId = getId(element);
- if (theId != null) {
- fCurrentDefinition.addPartitionType(theId);
+ if (theId != null && fCurrentDefinition != null && fCurrentDefinitionContentType != null) {
+ fCurrentDefinition.addPartitionType(fCurrentDefinitionContentType, theId);
}
}
@@ -123,6 +145,14 @@
}
return true;
}
+ else if (tag.equals(TAG_CONTENT_TYPE)) {
+ processContentTypeTag(element);
+
+ if (fCurrentDefinition != null) {
+ readElementChildren(element);
+ }
+ return true;
+ }
else if (tag.equals(TAG_PARTITION_TYPE)) {
processPartitionTypeTag(element);
return true;
@@ -147,7 +177,36 @@
(ContentAssistProcessorDefinition[])fContentAssistProcessorDefs.toArray(new ContentAssistProcessorDefinition[fContentAssistProcessorDefs.size()]));
}
+
/**
+ * Returns all the valid ContentTypes for partitionType
+ *
+ * @param partitionType
+ * @return if partitionType is null, null is returned
+ */
+ public Collection<String> getContentAssistProcessorContentTypes(String partitionType) {
+ if (partitionType == null) {
+ return null;
+ }
+
+ ContentAssistProcessorDefinition[] allDefs = getContentAssistProcessorDefinitions();
+ List<ContentAssistProcessorDefinition> defs = new ArrayList<ContentAssistProcessorDefinition>();
+ List<ContentAssistProcessorDefinition> lastDefs = new ArrayList<ContentAssistProcessorDefinition>();
+
+ HashSet<String> validContentTypes = new HashSet<String>();
+ for (int i = 0; i < allDefs.length; ++i) {
+ Collection<String> contentTypes = allDefs[i].getContentTypes();
+
+ if (contentTypes != null) {
+ validContentTypes.addAll(contentTypes);
+ }
+ }
+
+ return validContentTypes;
+ }
+
+
+ /**
* Returns all the ContentAssistProcessor definition objects valid for partitionType
*
* @param partitionType
@@ -159,26 +218,29 @@
}
ContentAssistProcessorDefinition[] allDefs = getContentAssistProcessorDefinitions();
- List defs = new ArrayList();
- List lastDefs = new ArrayList();
+ List<ContentAssistProcessorDefinition> defs = new ArrayList<ContentAssistProcessorDefinition>();
+ List<ContentAssistProcessorDefinition> lastDefs = new ArrayList<ContentAssistProcessorDefinition>();
for (int i = 0; i < allDefs.length; ++i) {
- List partitions = (List) allDefs[i].getPartitionTypes();
- if (partitions != null) {
- if (partitions.isEmpty()) {
- lastDefs.add(allDefs[i]);
- }
- else {
- int j = 0;
- boolean added = false;
- while (j < partitions.size() && !added) {
- if (partitionType.equals(partitions.get(j))) {
- defs.add(allDefs[i]);
- added = true;
+ for (String contentType : allDefs[i].getContentTypes()) {
+ List<String> partitions = allDefs[i].getPartitionTypes(contentType);
+
+ if (partitions != null) {
+ if (partitions.isEmpty()) {
+ lastDefs.add(allDefs[i]);
+ }
+ else {
+ int j = 0;
+ boolean added = false;
+ while (j < partitions.size() && !added) {
+ if (partitionType.equals(partitions.get(j))) {
+ defs.add(allDefs[i]);
+ added = true;
+ }
+ else {
+ ++j;
+ }
}
- else {
- ++j;
- }
}
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorDefinition.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorDefinition.java 2008-10-13 16:37:31 UTC (rev 10800)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/ContentAssistProcessorDefinition.java 2008-10-13 17:46:26 UTC (rev 10801)
@@ -12,7 +12,10 @@
package org.jboss.tools.common.text.xml.contentassist;
import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
@@ -26,8 +29,8 @@
private String fId = null;
private String fClassName = null;
- // a list of partition types (String)
- private List fPartitionTypes = null;
+ // a list of content types (String)
+ private Map<String, List<String>> fContentTypes = null;
private IConfigurationElement fConfigurationElement = null;
@@ -41,12 +44,20 @@
fId = id;
fClassName = class1;
fConfigurationElement = configurationElement;
- fPartitionTypes = new ArrayList();
+ fContentTypes = new HashMap<String, List<String>>();
}
- public void addPartitionType(String partitionType) {
- if (!fPartitionTypes.contains(partitionType))
- fPartitionTypes.add(partitionType);
+ public void addPartitionType(String contentType, String partitionType) {
+ List<String> partitionTypes = new ArrayList<String>();
+
+ if (fContentTypes.containsKey(contentType)) {
+ partitionTypes = fContentTypes.get(contentType);
+ }
+
+ if (!partitionTypes.contains(partitionType)) {
+ partitionTypes.add(partitionType);
+ fContentTypes.put(contentType, partitionTypes);
+ }
}
/**
@@ -131,9 +142,18 @@
}
/**
- * @return Returns the fPartitionTypes.
+ * @return Returns the collection of ContentTypes.
*/
- public List getPartitionTypes() {
- return fPartitionTypes;
+ public Collection<String> getContentTypes() {
+ return fContentTypes.keySet();
}
+
+ /**
+ * @return Returns the list of Partition Types for the specified ContentType.
+ */
+ public List<String> getPartitionTypes(String contentType) {
+ return (fContentTypes == null || !fContentTypes.containsKey(contentType) ?
+ new ArrayList<String>(): fContentTypes.get(contentType));
+ }
+
}
Added: trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.text.xml/src/org/jboss/tools/common/text/xml/contentassist/SortingCompoundContentAssistProcessor.java 2008-10-13 17:46:26 UTC (rev 10801)
@@ -0,0 +1,543 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.common.text.xml.contentassist;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedHashSet;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.TextPresentation;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationExtension;
+import org.eclipse.jface.text.contentassist.IContextInformationPresenter;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.wst.sse.core.internal.provisional.IModelManager;
+import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
+import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
+
+/**
+ * Reads the plugin.xml file for the processors defined using the
+ * extention point
+ * "org.jboss.tools.common.text.xml.contentAssistProcessor"
+ *
+ * @author jeremy
+ *
+ */
+
+public class SortingCompoundContentAssistProcessor implements IContentAssistProcessor {
+ private ISourceViewer fSourceViewer;
+ private String fPartitionType;
+ private String fErrorMessage;
+
+
+ private static Map<String, Map<String, List<IContentAssistProcessor>>> fProcessorsMap;
+
+ public SortingCompoundContentAssistProcessor(ISourceViewer sourceViewer, String partitionType) {
+ this.fSourceViewer = sourceViewer;
+ this.fPartitionType = partitionType;
+ init();
+ }
+
+ public boolean supportsPartitionType(String partitionType) {
+ if (fProcessorsMap == null)
+ return false;
+
+ for (String contentType : fProcessorsMap.keySet()) {
+ Map<String, List<IContentAssistProcessor>> partitionTypes =
+ fProcessorsMap.get(contentType);
+ if (partitionTypes != null && partitionTypes.containsKey(partitionType))
+ return true;
+ }
+ return false;
+ }
+
+ void init () {
+ ContentAssistProcessorDefinition[] defs = ContentAssistProcessorBuilder.getInstance().getContentAssistProcessorDefinitions(fPartitionType);
+
+ if(defs==null || defs.length == 0) return;
+
+ if (fProcessorsMap == null)
+ fProcessorsMap = new HashMap<String, Map<String, List<IContentAssistProcessor>>>();
+
+ for(int i=0; i<defs.length; i++) {
+ IContentAssistProcessor processor = defs[i].createContentAssistProcessor();
+ Collection<String> contentTypes = defs[i].getContentTypes();
+ if (contentTypes != null) {
+ for (String contentType : contentTypes) {
+ Map<String, List<IContentAssistProcessor>> contentTypeProcessors =
+ fProcessorsMap.get(contentType);
+
+ if (contentTypeProcessors == null) {
+ contentTypeProcessors = new HashMap<String, List<IContentAssistProcessor>>();
+ }
+
+ List<String> partitionTypes = defs[i].getPartitionTypes(contentType);
+ for (String partitionType : partitionTypes) {
+ List<IContentAssistProcessor> partitionTypeProcessors =
+ contentTypeProcessors.get(partitionType);
+
+ if (partitionTypeProcessors == null) {
+ partitionTypeProcessors = new ArrayList<IContentAssistProcessor>();
+ }
+
+ if(!containsAnObjectOfTheSameType(partitionTypeProcessors,processor)) {
+ partitionTypeProcessors.add(processor);
+ }
+
+ if (!contentTypeProcessors.containsKey(partitionType)) {
+ contentTypeProcessors.put(partitionType, partitionTypeProcessors);
+ }
+ }
+
+ if (!fProcessorsMap.containsKey(contentType)) {
+ fProcessorsMap.put(contentType, contentTypeProcessors);
+ }
+ }
+ }
+ }
+
+ }
+
+ boolean containsAnObjectOfTheSameType(Collection collection, Object obj) {
+ if (collection == null || obj == null)
+ return false;
+
+ String objClassName = obj.getClass().getName();
+ for (Object o : collection) {
+ if (objClassName.equals(o.getClass().getName()))
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * Returns the content type of document
+ *
+ * @param document -
+ * assumes document is not null
+ * @return String content type of given document
+ */
+ protected String getContentType(ISourceViewer viewer) {
+ if (viewer == null || viewer.getDocument() == null)
+ return null;
+
+ String type = null;
+
+ IModelManager mgr = StructuredModelManager.getModelManager();
+ IStructuredModel model = null;
+ try {
+ model = mgr.getExistingModelForRead(viewer.getDocument());
+ if (model != null) {
+ type = model.getContentTypeIdentifier();
+ }
+ } finally {
+ if (model != null) {
+ model.releaseFromRead();
+ }
+ }
+ return type;
+ }
+
+ /**
+ * Returns a list of completion proposals based on the
+ * specified location within the document that corresponds
+ * to the current cursor position within the text viewer.
+ *
+ * @param viewer the viewer whose document is used to compute the proposals
+ * @param offset an offset within the document for which completions should be computed
+ * @return an array of completion proposals or <code>null</code> if no proposals are possible
+ */
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+ fErrorMessage = null;
+
+ String contentType = getContentType(fSourceViewer);
+ if (contentType == null)
+ return new ICompletionProposal[0];
+
+ List<ICompletionProposal> ret = new LinkedList<ICompletionProposal>();
+
+ if (fProcessorsMap.get(contentType) == null)
+ return new ICompletionProposal[0];
+
+ if (fProcessorsMap.get(contentType).get(fPartitionType) == null)
+ return new ICompletionProposal[0];
+
+ List<IContentAssistProcessor> processors = fProcessorsMap.get(contentType).get(fPartitionType);
+
+ for (IContentAssistProcessor p : processors) {
+ ICompletionProposal[] proposals = p.computeCompletionProposals(viewer, offset);
+ if (proposals != null && proposals.length > 0) {
+ ret.addAll(Arrays.asList(proposals));
+ fErrorMessage = null; // Hide previous errors
+ } else {
+ if (fErrorMessage == null && ret.isEmpty()) {
+ String errorMessage = p.getErrorMessage();
+ if (errorMessage != null) {
+ fErrorMessage = errorMessage;
+ }
+ }
+ }
+ }
+
+ ICompletionProposal[] resultArray = ret.toArray(new ICompletionProposal[ret.size()]);
+ // TODO: Need to improve the sorting algorithm
+/* Arrays.sort(resultArray, new Comparator<ICompletionProposal>() {
+ public int compare(ICompletionProposal arg0,
+ ICompletionProposal arg1) {
+ String str0 = (arg0 == null ? "" : arg0.getDisplayString()); //$NON-NLS-1$
+ String str1 = (arg1 == null ? "" : arg1.getDisplayString()); //$NON-NLS-1$
+ return str0.compareTo(str1);
+ }});
+*/
+
+ return resultArray;
+ }
+
+ /**
+ * Returns information about possible contexts based on the
+ * specified location within the document that corresponds
+ * to the current cursor position within the text viewer.
+ *
+ * @param viewer the viewer whose document is used to compute the possible contexts
+ * @param offset an offset within the document for which context information should be computed
+ * @return an array of context information objects or <code>null</code> if no context could be found
+ */
+ public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
+ fErrorMessage = null;
+
+ String contentType = getContentType(fSourceViewer);
+ if (contentType == null)
+ return new IContextInformation[0];
+
+ List<IContextInformation> ret = new LinkedList<IContextInformation>();
+
+ if (fProcessorsMap.get(contentType) == null)
+ return new IContextInformation[0];
+
+ if (fProcessorsMap.get(contentType).get(fPartitionType) == null)
+ return new IContextInformation[0];
+
+ for (IContentAssistProcessor p : fProcessorsMap.get(contentType).get(fPartitionType)) {
+ IContextInformation[] informations = p.computeContextInformation(viewer, offset);
+ if (informations != null && informations.length > 0) {
+ for (int i = 0; i < informations.length; i++)
+ ret.add(new ContextInformation(informations[i], p));
+ fErrorMessage = null; // Hide previous errors
+ } else {
+ if (fErrorMessage == null && ret.isEmpty()) {
+ String errorMessage = p.getErrorMessage();
+ if (errorMessage != null) {
+ fErrorMessage = errorMessage;
+ }
+ }
+ }
+ }
+ return (IContextInformation[]) ret.toArray(new IContextInformation[ret.size()]);
+ }
+
+ /**
+ * Returns the characters which when entered by the user should
+ * automatically trigger the presentation of possible completions.
+ *
+ * @return the auto activation characters for completion proposal or <code>null</code>
+ * if no auto activation is desired
+ */
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ String contentType = getContentType(fSourceViewer);
+ if (contentType == null)
+ return new char[0];
+
+ List<Character> ret = new LinkedList<Character>();
+
+ if (fProcessorsMap.get(contentType) == null)
+ return new char[0];
+
+ if (fProcessorsMap.get(contentType).get(fPartitionType) == null)
+ return new char[0];
+
+ for (IContentAssistProcessor p : fProcessorsMap.get(contentType).get(fPartitionType)) {
+ char[] chars = p.getCompletionProposalAutoActivationCharacters();
+ if (chars != null)
+ for (int i = 0; i < chars.length; i++)
+ ret.add(new Character(chars[i]));
+ }
+
+ char[] chars = new char[ret.size()];
+ int i = 0;
+ for (Iterator it = ret.iterator(); it.hasNext(); i++) {
+ Character ch = (Character) it.next();
+ chars[i] = ch.charValue();
+ }
+ return chars;
+ }
+
+ /**
+ * Returns the characters which when entered by the user should
+ * automatically trigger the presentation of context information.
+ *
+ * @return the auto activation characters for presenting context information
+ * or <code>null</code> if no auto activation is desired
+ */
+ public char[] getContextInformationAutoActivationCharacters() {
+ String contentType = getContentType(fSourceViewer);
+ if (contentType == null)
+ return new char[0];
+
+ List<Character> ret = new LinkedList<Character>();
+
+ if (fProcessorsMap.get(contentType) == null)
+ return new char[0];
+
+ if (fProcessorsMap.get(contentType).get(fPartitionType) == null)
+ return new char[0];
+
+ for (IContentAssistProcessor p : fProcessorsMap.get(contentType).get(fPartitionType)) {
+ char[] chars = p.getContextInformationAutoActivationCharacters();
+ if (chars != null)
+ for (int i = 0; i < chars.length; i++)
+ ret.add(new Character(chars[i]));
+ }
+
+ char[] chars = new char[ret.size()];
+ int i = 0;
+ for (Iterator it = ret.iterator(); it.hasNext(); i++) {
+ Character ch = (Character) it.next();
+ chars[i] = ch.charValue();
+ }
+ return chars;
+ }
+
+ /**
+ * Returns the reason why this content assist processor
+ * was unable to produce any completion proposals or context information.
+ *
+ * @return an error message or <code>null</code> if no error occurred
+ */
+ public String getErrorMessage() {
+ return fErrorMessage;
+ }
+
+ /**
+ * Returns a validator used to determine when displayed context information
+ * should be dismissed. May only return <code>null</code> if the processor is
+ * incapable of computing context information. <p>
+ *
+ * @return a context information validator, or <code>null</code> if the processor
+ * is incapable of computing context information
+ */
+ public IContextInformationValidator getContextInformationValidator() {
+ boolean hasValidator = false;
+ boolean hasPresenter = false;
+ boolean hasExtension = false;
+
+
+ String contentType = getContentType(fSourceViewer);
+ if (contentType == null)
+ return null;
+
+ List<Character> ret = new LinkedList<Character>();
+
+ if (fProcessorsMap.get(contentType) == null)
+ return null;
+
+ if (fProcessorsMap.get(contentType).get(fPartitionType) == null)
+ return null;
+
+ for (IContentAssistProcessor p : fProcessorsMap.get(contentType).get(fPartitionType)) {
+ IContextInformationValidator v = p.getContextInformationValidator();
+ if (v != null) {
+ hasValidator = true;
+ if (v instanceof IContextInformationPresenter) {
+ hasPresenter = true;
+ }
+ }
+ }
+
+ SortingCompoundContentAssistValidator validator = null;
+ if (hasPresenter)
+ validator = new SortingCompoundContentAssistValidatorPresenter();
+ else if (hasValidator)
+ validator = new SortingCompoundContentAssistValidator();
+
+ if (validator != null)
+ for (IContentAssistProcessor p : fProcessorsMap.get(contentType).get(fPartitionType)) {
+ IContextInformationValidator v = p.getContextInformationValidator();
+ if (v != null)
+ validator.add(v);
+ }
+
+ return validator;
+ }
+
+
+ static class ContextInformation implements IContextInformation, IContextInformationExtension {
+ private IContextInformation fInfo;
+ private IContentAssistProcessor fProcessor;
+
+ ContextInformation(IContextInformation info, IContentAssistProcessor processor) {
+ fInfo = info;
+ fProcessor = processor;
+ }
+
+ /*
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ return fInfo.equals(obj);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformation#getContextDisplayString()
+ */
+ public String getContextDisplayString() {
+ return fInfo.getContextDisplayString();
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformation#getImage()
+ */
+ public Image getImage() {
+ return fInfo.getImage();
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformation#getInformationDisplayString()
+ */
+ public String getInformationDisplayString() {
+ return fInfo.getInformationDisplayString();
+ }
+
+ /*
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return fInfo.hashCode();
+ }
+
+ /*
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return fInfo.toString();
+ }
+
+ IContentAssistProcessor getProcessor() {
+ return fProcessor;
+ }
+
+ IContextInformation getContextInformation() {
+ return fInfo;
+ }
+
+ public int getContextInformationPosition() {
+ int position = -1;
+ if (fInfo instanceof IContextInformationExtension)
+ position = ((IContextInformationExtension)fInfo).getContextInformationPosition();
+ return position;
+ }
+ }
+
+ private static class SortingCompoundContentAssistValidator implements IContextInformationValidator {
+ List fValidators = new ArrayList();
+ IContextInformationValidator fValidator;
+
+ void add(IContextInformationValidator validator) {
+ fValidators.add(validator);
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#install(org.eclipse.jface.text.contentassist.IContextInformation,
+ * org.eclipse.jface.text.ITextViewer, int)
+ */
+ public void install(IContextInformation info, ITextViewer viewer, int documentPosition) {
+ // install either the validator in the info, or all validators
+ fValidator = getValidator(info);
+ IContextInformation realInfo = getContextInformation(info);
+ if (fValidator != null)
+ fValidator.install(realInfo, viewer, documentPosition);
+ else {
+ for (Iterator it = fValidators.iterator(); it.hasNext();) {
+ IContextInformationValidator v = (IContextInformationValidator) it.next();
+ v.install(realInfo, viewer, documentPosition);
+ }
+ }
+ }
+
+ IContextInformationValidator getValidator(IContextInformation info) {
+ if (info instanceof ContextInformation) {
+ ContextInformation wrap = (ContextInformation) info;
+ return wrap.getProcessor().getContextInformationValidator();
+ }
+
+ return null;
+ }
+
+ IContextInformation getContextInformation(IContextInformation info) {
+ IContextInformation realInfo = info;
+ if (info instanceof ContextInformation) {
+ ContextInformation wrap = (ContextInformation) info;
+ realInfo = wrap.getContextInformation();
+ }
+
+ return realInfo;
+ }
+
+ /*
+ * @see org.eclipse.jface.text.contentassist.IContextInformationValidator#isContextInformationValid(int)
+ */
+ public boolean isContextInformationValid(int documentPosition) {
+ // use either the validator in the info, or all validators
+ boolean isValid = false;
+ if (fValidator != null)
+ isValid = fValidator.isContextInformationValid(documentPosition);
+ else {
+ for (Iterator it = fValidators.iterator(); it.hasNext();) {
+ IContextInformationValidator v = (IContextInformationValidator) it.next();
+ isValid |= v.isContextInformationValid(documentPosition);
+ }
+ }
+ return isValid;
+ }
+
+ }
+
+ private static class SortingCompoundContentAssistValidatorPresenter extends SortingCompoundContentAssistValidator implements IContextInformationPresenter {
+ public boolean updatePresentation(int offset, TextPresentation presentation) {
+ // use either the validator in the info, or all validators
+ boolean presentationUpdated = false;
+ if (fValidator instanceof IContextInformationPresenter)
+ presentationUpdated = ((IContextInformationPresenter) fValidator).updatePresentation(offset, presentation);
+ else {
+ for (Iterator it = fValidators.iterator(); it.hasNext();) {
+ IContextInformationValidator v = (IContextInformationValidator) it.next();
+ if (v instanceof IContextInformationPresenter)
+ presentationUpdated |= ((IContextInformationPresenter) v).updatePresentation(offset, presentation);
+ }
+ }
+ return presentationUpdated;
+ }
+ }
+}
17 years, 3 months
JBoss Tools SVN: r10800 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: resources/extendedDataTable and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-10-13 12:37:31 -0400 (Mon, 13 Oct 2008)
New Revision: 10800
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/sortable.gif
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2761
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/extendedDataTable.css 2008-10-13 16:37:31 UTC (rev 10800)
@@ -0,0 +1,117 @@
+.dr-table {
+ border-top: 1px solid;
+ border-left: 1px solid;
+ border-color: #C4C0B9;
+}
+
+.dr-table-cell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-cell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-header {
+ background-color: #D4CFC7;
+ background-position: top left;
+ background-repeat: repeat-x;
+}
+
+.dr-table-header-continue {
+ background-color: #D4CFC7;
+}
+
+.dr-table-headercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ color: #000000;
+ text-align: center;
+ font-weight: bold;
+ font-size: 11px;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-subheader {
+ background-color: #F1EEE9;
+}
+
+.dr-table-subheadercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: center;
+ font-size: 11px;
+ font-color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-footercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ color: #000000;
+ text-align: left;
+ font-weight: bold;
+ font-size: 11px;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-subfootercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: left;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-header {
+ background-color: #F1EEE9;
+}
+
+.dr-subtable-headercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: center;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-footercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: left;
+}
+
+.dr-spr {
+ display: block;
+}
+
+.dr-table-hidden {
+ overflow: hidden;
+ border: solid 1px #C4C0C9;
+}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/sortable.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/extendedDataTable/sortable.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java 2008-10-13 16:04:38 UTC (rev 10799)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java 2008-10-13 16:37:31 UTC (rev 10800)
@@ -34,18 +34,50 @@
*/
public class RichFacesExtendedDataTableTemplate extends VpeAbstractTemplate {
- final static String DEFAULT_HEIGHT = "500px";
- final static String DEFAULT_WIDTH = "100%";
- final static String HEADER = "header";
- final static String HEADER_CLASS = "headerClass";
- final static String FOOTER = "footer";
- final static String FOOTER_CLASS = "footerClass";
- final static String CAPTION_CLASS = "captionClass";
- final static String CAPTION_STYLE = "captionStyle";
- final static String SPACE = " ";
+ private static final String COLUMNS = "columns"; //$NON-NLS-1$
+ private static final String FALSE = "false"; //$NON-NLS-1$
+ private static final String SCOP = "scop"; //$NON-NLS-1$
+ private static final String COL = "col"; //$NON-NLS-1$
+ private static final String TABLE_CAPTION_RICH_TABLE_CAPTION = "dr-table-caption rich-table-caption"; //$NON-NLS-1$
+ private static final String DR_TABLE_CAPTION_RICH_TABLE_CAPTION = "dr-table-caption rich-table-caption "; //$NON-NLS-1$
+ private static final String SUB_TABLE = ":subTable"; //$NON-NLS-1$
+ private static final String COLUMN_GROUP = ":columnGroup"; //$NON-NLS-1$
+ private static final String DR_TABLE_ROW_RICH_TABLE_ROW = "dr-table-row rich-table-row"; //$NON-NLS-1$
+ private static final String DR_TABLE_FIRSTROW_RICH_TABLE_FIRSTROW = "dr-table-firstrow rich-table-firstrow"; //$NON-NLS-1$
+ private static final String TRUE = "true"; //$NON-NLS-1$
+ private static final String BREAK_BEFORE = "breakBefore"; //$NON-NLS-1$
+ private static final String DR_TABLE_FOOTERCELL_RICH_TABLE_FOOTERCELL = "dr-table-footercell rich-table-footercell"; //$NON-NLS-1$
+ private static final String DR_TABLE_FOOTER_CONTINUE_RICH_TABLE_FOOTER_CONTINUE = "dr-table-footer-continue rich-table-footer-continue"; //$NON-NLS-1$
+ private static final String DR_TABLE_FOOTER_RICH_TABLE_FOOTER = "dr-table-footer rich-table-footer"; //$NON-NLS-1$
+ private static final String DR_TABLE_SUBFOOTERCELL_RICH_TABLE_SUBFOOTERCELL = "dr-table-subfootercell rich-table-subfootercell"; //$NON-NLS-1$
+ private static final String DR_TABLE_SUBFOOTER_RICH_TABLE_SUBFOOTER = "dr-table-subfooter rich-table-subfooter"; //$NON-NLS-1$
+ private static final String DR_TABLE_SUBHEADERCELL_RICH_TABLE_SUBHEADERCELL = "dr-table-subheadercell rich-table-subheadercell"; //$NON-NLS-1$
+ private static final String DR_TABLE_SUBHEADER_RICH_TABLE_SUBHEADER = "dr-table-subheader rich-table-subheader"; //$NON-NLS-1$
+ private static final String DR_TABLE_HEADERCELL_RICH_TABLE_HEADERCELL = "dr-table-headercell rich-table-headercell"; //$NON-NLS-1$
+ private static final String DR_TABLE_HEADER_CONTINUE_RICH_TABLE_HEADER_CONTINUE = "dr-table-header-continue rich-table-header-continue"; //$NON-NLS-1$
+ private static final String DR_TABLE_HEADER_RICH_TABLE_HEADER = "dr-table-header rich-table-header"; //$NON-NLS-1$
+ private static final String EMPTY = ""; //$NON-NLS-1$
+ private static final String DR_TABLE_RICH_TABLE = "dr-table rich-table "; //$NON-NLS-1$
+ private static final String RICH_FACES_DATA_TABLE = "richFacesDataTable"; //$NON-NLS-1$
+ private static final String EXTENDED_DATA_TABLE_CSS = "extendedDataTable/extendedDataTable.css"; //$NON-NLS-1$
+ private static final String SEMICOLON = ";"; //$NON-NLS-1$
+ private static final String COLON = " : "; //$NON-NLS-1$
+ private static final String DR_TABLE_HIDDEN = "dr-table-hidden"; //$NON-NLS-1$
+ private static final String COLUMN = ":column"; //$NON-NLS-1$
+ final static String DEFAULT_HEIGHT = "500px"; //$NON-NLS-1$
+ final static String DEFAULT_WIDTH = "100%"; //$NON-NLS-1$
+ final static String HEADER = "header"; //$NON-NLS-1$
+ final static String HEADER_CLASS = "headerClass"; //$NON-NLS-1$
+ final static String FOOTER = "footer"; //$NON-NLS-1$
+ final static String FOOTER_CLASS = "footerClass"; //$NON-NLS-1$
+ final static String CAPTION_CLASS = "captionClass"; //$NON-NLS-1$
+ final static String CAPTION_STYLE = "captionStyle"; //$NON-NLS-1$
+ final static String ATTR_SORTABLE = "sortable"; //$NON-NLS-1$
+ final static String SPACE = " "; //$NON-NLS-1$
+ final static String ZERRO = "0"; //$NON-NLS-1$
+ final static String SORTABLE_PATH = "extendedDataTable/sortable.gif"; //$NON-NLS-1$
- private static String STYLE_FOR_LOW_SCROLL = "overflow: scroll; width: 100%; height: 17px;";
- private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px; height: 100%;";
+ private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px; height: 100%;"; //$NON-NLS-1$
private static final int NUM_ROW = 5;
@@ -77,22 +109,8 @@
VpeCreationData creationData = new VpeCreationData(tableCommon);
nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
-
- nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
-
tableCommon.appendChild(tr1);
- tableCommon.appendChild(tr2);
- // ---------tr2
- nsIDOMElement tr2_TD = visualDocument.createElement(HTML.TAG_TD);
- tr2.appendChild(tr2_TD);
-
- nsIDOMElement tr2_td_DIV = visualDocument.createElement(HTML.TAG_DIV);
- tr2_td_DIV.setAttribute(HTML.ATTR_STYLE, STYLE_FOR_LOW_SCROLL);
- tr2_TD.appendChild(tr2_td_DIV);
-
- // --------------------------------------------
-
// ---------------------tr1------------------------
nsIDOMElement tr1_TD1 = visualDocument.createElement(HTML.TAG_TD);
tr1.appendChild(tr1_TD1);
@@ -107,12 +125,12 @@
// -------------------------------------------------------
nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
tr1_TD1.appendChild(div);
- div.setAttribute(HTML.ATTR_CLASS, "dr-table-hidden");
+ div.setAttribute(HTML.ATTR_CLASS, DR_TABLE_HIDDEN);
- String divStyle = HTML.ATTR_WIDTH + " : "
- + (width == null ? DEFAULT_WIDTH : width) + ";"
- + HTML.ATTR_HEIGHT + " : "
- + (height == null ? DEFAULT_HEIGHT : height) + ";";
+ String divStyle = HTML.ATTR_WIDTH + COLON
+ + (width == null ? DEFAULT_WIDTH : width) + SEMICOLON
+ + HTML.ATTR_HEIGHT + COLON
+ + (height == null ? DEFAULT_HEIGHT : height) + SEMICOLON;
div.setAttribute(HTML.ATTR_STYLE, divStyle);
@@ -121,13 +139,14 @@
table.removeAttribute(HTML.ATTR_HEIGHT);
div.appendChild(table);
- ComponentUtil.setCSSLink(pageContext,
- "scrollableDataTable/scrollableDataTable.css",
- "richFacesDataTable");
+ ComponentUtil
+ .setCSSLink(pageContext,
+ EXTENDED_DATA_TABLE_CSS,
+ RICH_FACES_DATA_TABLE);
String tableClass = sourceElement
.getAttribute(RichFaces.ATTR_STYLE_CLASS);
- table.setAttribute(HTML.ATTR_CLASS, "dr-table rich-table "
- + (tableClass == null ? "" : tableClass));
+ table.setAttribute(HTML.ATTR_CLASS, DR_TABLE_RICH_TABLE
+ + (tableClass == null ? EMPTY : tableClass));
// Encode colgroup definition.
ArrayList<Element> columns = getColumns(sourceElement);
@@ -151,23 +170,23 @@
if (header != null) {
encodeTableHeaderOrFooterFacet(creationData, thead,
columnsLength, visualDocument, header,
- "dr-table-header rich-table-header",
- "dr-table-header-continue rich-table-header-continue",
- "dr-table-headercell rich-table-headercell",
+ DR_TABLE_HEADER_RICH_TABLE_HEADER,
+ DR_TABLE_HEADER_CONTINUE_RICH_TABLE_HEADER_CONTINUE,
+ DR_TABLE_HEADERCELL_RICH_TABLE_HEADERCELL,
headerClass, HTML.TAG_TD);
}
if (!columnsHeaders.isEmpty()) {
nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
thead.appendChild(tr);
String styleClass = encodeStyleClass(null,
- "dr-table-subheader rich-table-subheader", null,
+ DR_TABLE_SUBHEADER_RICH_TABLE_SUBHEADER, null,
headerClass);
if (styleClass != null) {
tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
columnsHeaders,
- "dr-table-subheadercell rich-table-subheadercell",
+ DR_TABLE_SUBHEADERCELL_RICH_TABLE_SUBHEADERCELL,
headerClass, HEADER, HTML.TAG_TD);
}
}
@@ -184,22 +203,22 @@
nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
tfoot.appendChild(tr);
String styleClass = encodeStyleClass(null,
- "dr-table-subfooter rich-table-subfooter", null,
+ DR_TABLE_SUBFOOTER_RICH_TABLE_SUBFOOTER, null,
footerClass);
if (styleClass != null) {
tr.setAttribute(HTML.ATTR_CLASS, styleClass);
}
encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
columnsFooters,
- "dr-table-subfootercell rich-table-subfootercell",
+ DR_TABLE_SUBFOOTERCELL_RICH_TABLE_SUBFOOTERCELL,
footerClass, FOOTER, HTML.TAG_TD);
}
if (footer != null) {
encodeTableHeaderOrFooterFacet(creationData, tfoot,
columnsLength, visualDocument, footer,
- "dr-table-footer rich-table-footer",
- "dr-table-footer-continue rich-table-footer-continue",
- "dr-table-footercell rich-table-footercell",
+ DR_TABLE_FOOTER_RICH_TABLE_FOOTER,
+ DR_TABLE_FOOTER_CONTINUE_RICH_TABLE_FOOTER_CONTINUE,
+ DR_TABLE_FOOTERCELL_RICH_TABLE_FOOTERCELL,
footerClass, HTML.TAG_TD);
}
}
@@ -214,34 +233,34 @@
nsIDOMElement tr = null;
VpeChildrenInfo trInfo = null;
for (Node child : children) {
- if (child.getNodeName().endsWith(":column")) {
+ if (child.getNodeName().endsWith(COLUMN)) {
String breakBefore = ((Element) child)
- .getAttribute("breakBefore");
+ .getAttribute(BREAK_BEFORE);
if (breakBefore != null
- && breakBefore.equalsIgnoreCase("true")) {
+ && breakBefore.equalsIgnoreCase(TRUE)) {
tr = null;
}
if (tr == null) {
tr = visualDocument.createElement(HTML.TAG_TR);
if (firstRow) {
tr.setAttribute(HTML.ATTR_CLASS,
- "dr-table-firstrow rich-table-firstrow");
+ DR_TABLE_FIRSTROW_RICH_TABLE_FIRSTROW);
firstRow = false;
} else {
tr.setAttribute(HTML.ATTR_CLASS,
- "dr-table-row rich-table-row");
+ DR_TABLE_ROW_RICH_TABLE_ROW);
}
trInfo = new VpeChildrenInfo(tr);
tbody.appendChild(tr);
creationData.addChildrenInfo(trInfo);
}
trInfo.addSourceChild(child);
- } else if (child.getNodeName().endsWith(":columnGroup")) {
+ } else if (child.getNodeName().endsWith(COLUMN_GROUP)) {
RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(
creationData, (Element) child, visualDocument,
tbody);
tr = null;
- } else if (child.getNodeName().endsWith(":subTable")) {
+ } else if (child.getNodeName().endsWith(SUB_TABLE)) {
RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(
creationData, (Element) child, visualDocument,
tbody);
@@ -279,10 +298,10 @@
.createElement(HTML.TAG_CAPTION);
table.appendChild(caption);
if (captionClass != null && captionClass.length() > 0) {
- captionClass = "dr-table-caption rich-table-caption "
+ captionClass = DR_TABLE_CAPTION_RICH_TABLE_CAPTION
+ captionClass;
} else {
- captionClass = "dr-table-caption rich-table-caption";
+ captionClass = TABLE_CAPTION_RICH_TABLE_CAPTION;
}
caption.setAttribute(HTML.ATTR_CLASS, captionClass);
if (captionStyle != null && captionStyle.length() > 0) {
@@ -311,24 +330,46 @@
nsIDOMElement parentTr, nsIDOMDocument visualDocument,
ArrayList<Element> headersOrFooters, String skinCellClass,
String headerClass, String facetName, String element) {
+ String extClass = "Class"; //$NON-NLS-1$
for (Element column : headersOrFooters) {
- String classAttribute = facetName + "Class";
+ String classAttribute = facetName + extClass;
String columnHeaderClass = column.getAttribute(classAttribute);
nsIDOMElement td = visualDocument.createElement(element);
+
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+ td.appendChild(table);
+ table.setAttribute(HTML.ATTR_BORDER, ZERRO);
+ table.setAttribute(HTML.ATTR_CELLPADDING, ZERRO);
+ table.setAttribute(HTML.ATTR_CELLSPACING, ZERRO);
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ nsIDOMElement trTd1 = visualDocument.createElement(HTML.TAG_TD);
+ nsIDOMElement trTd2 = visualDocument.createElement(HTML.TAG_TD);
+ table.appendChild(tr);
+ tr.appendChild(trTd1);
+ tr.appendChild(trTd2);
+
parentTr.appendChild(td);
String styleClass = encodeStyleClass(null, skinCellClass,
headerClass, columnHeaderClass);
td.setAttribute(HTML.ATTR_CLASS, styleClass);
- td.setAttribute("scop", "col");
+ td.setAttribute(SCOP, COL);
String colspan = column.getAttribute(HTML.ATTR_COLSPAN);
if (colspan != null && colspan.length() > 0) {
td.setAttribute(HTML.ATTR_COLSPAN, colspan);
}
Element facetBody = ComponentUtil.getFacet(column, facetName);
- VpeChildrenInfo child = new VpeChildrenInfo(td);
+ VpeChildrenInfo child = new VpeChildrenInfo(trTd1);
child.addSourceChild(facetBody);
creationData.addChildrenInfo(child);
+ // Add sortable attribute
+ String sortable = ComponentUtil.getAttribute(column, ATTR_SORTABLE);
+ if (sortable.equalsIgnoreCase(FALSE)) {
+ continue;
+ }
+ nsIDOMElement img = visualDocument.createElement(HTML.TAG_IMG);
+ ComponentUtil.setImg(img, SORTABLE_PATH);
+ trTd2.appendChild(img);
}
}
@@ -351,8 +392,8 @@
String skinFirstRowClass, String skinRowClass,
String skinCellClass, String facetBodyClass, String element) {
boolean isColumnGroup = facetBody.getNodeName()
- .endsWith(":columnGroup");
- boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
+ .endsWith(COLUMN_GROUP);
+ boolean isSubTable = facetBody.getNodeName().endsWith(SUB_TABLE);
if (isColumnGroup) {
RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData,
facetBody, visualDocument, parentTheadOrTfood);
@@ -402,7 +443,7 @@
for (int i = 0; i < children.getLength(); i++) {
Node child = children.item(i);
if ((child instanceof Element)
- && child.getNodeName().endsWith(":column")) {
+ && child.getNodeName().endsWith(COLUMN)) {
columns.add((Element) child);
}
}
@@ -468,7 +509,7 @@
int count = 0;
// check for exact value in component
try {
- int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ int span = Integer.parseInt(sourceElement.getAttribute(COLUMNS));
count = count > 0 ? span : calculateRowColumns(sourceElement,
columns);
} catch (NumberFormatException e) {
@@ -487,7 +528,7 @@
int currentLength = 0;
for (Element column : columns) {
if (ComponentUtil.isRendered(column)) {
- if (column.getNodeName().endsWith(":columnGroup")) {
+ if (column.getNodeName().endsWith(COLUMN_GROUP)) {
// Store max calculated value of previsous rows.
if (currentLength > count) {
count = currentLength;
@@ -501,8 +542,8 @@
}
currentLength = 0;
} else if (column.getNodeName().equals(
- sourceElement.getPrefix() + ":column")) {
- String breakBeforeStr = column.getAttribute("breakBefore");
+ sourceElement.getPrefix() + COLUMN)) {
+ String breakBeforeStr = column.getAttribute(BREAK_BEFORE);
// For new row, save length of previsous.
if (Boolean.getBoolean(breakBeforeStr)) {
if (currentLength > count) {
@@ -517,7 +558,7 @@
} catch (NumberFormatException e) {
currentLength++;
}
- } else if (column.getNodeName().endsWith(":column")) {
+ } else if (column.getNodeName().endsWith(COLUMN)) {
// UIColumn always have colspan == 1.
currentLength++;
}
17 years, 3 months
JBoss Tools SVN: r10799 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-13 12:04:38 -0400 (Mon, 13 Oct 2008)
New Revision: 10799
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
Log:
JBIDE-2497, creating nested items in menu and groups was updated.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-13 15:26:03 UTC (rev 10798)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-13 16:04:38 UTC (rev 10799)
@@ -39,7 +39,10 @@
*/
private final static String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
private final static String STYLE_PATH = "dropDownMenu/dropDownMenu.css"; //$NON-NLS-1$
+ private final static String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
+ private final static String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
private static final String LABEL_FACET_NAME = "label"; //$NON-NLS-1$
+ private static final String DEFAULT_DDM_TITLE = "ddm"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
private static final String SPACE = " "; //$NON-NLS-1$
@@ -140,13 +143,14 @@
* Nesting elements
*/
ddmLabelDiv.appendChild(ddmTextSpan);
- ddmTextSpan.appendChild(ddmLabelText);
+// ddmTextSpan.appendChild(ddmLabelText);
// ddmLabelDiv.appendChild(ddmListDiv);
ddmListDiv.appendChild(ddmListBorderDiv);
ddmListBorderDiv.appendChild(ddmListBgDiv);
ddmMainUL.appendChild(ddmMainLI);
ddmMainLI.appendChild(ddmLabelDiv);
+
/*
* Children <ul> will be added only if there are some of them.
*/
@@ -208,30 +212,36 @@
creationData.addChildrenInfo(childrenInfo);
} else {
Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
- String labelValue = valueAttr != null && valueAttr.getValue() != null
+ String labelValue = (valueAttr != null && valueAttr.getValue() != null)
? valueAttr.getValue()
- : EMPTY;
+ : DEFAULT_DDM_TITLE;
ddmLabelText.setNodeValue(labelValue);
+ ddmTextSpan.appendChild(ddmLabelText);
}
/*
- * Adding child nodes
+ * Adding child nodes:
+ * <rich:menuGroup> and <rich:menuItem> only.
*/
List<Node> children = ComponentUtil.getChildren(sourceElement);
- if (children.size() > 0) {
- /*
- * Add children <ul> and children in it.
- */
- ddmMainLI.appendChild(ddmChildrenUL);
- for (Node child : children) {
-// nsIDOMElement childDiv = visualDocument
-// .createElement(HTML.TAG_DIV);
-// ddmListBgDiv.appendChild(childDiv);
- VpeChildrenInfo childDivInfo = new VpeChildrenInfo(ddmChildrenUL);
+ boolean missingChildContainer = true;
+ for (Node child : children) {
+ if (child.getNodeType() == Node.ELEMENT_NODE
+ && (child.getNodeName().endsWith(CHILD_GROUP_NAME) || child
+ .getNodeName().endsWith(CHILD_ITEM_NAME))) {
+ if (missingChildContainer) {
+ /*
+ * Add children <ul> tag.
+ */
+ ddmMainLI.appendChild(ddmChildrenUL);
+ missingChildContainer = false;
+ }
+ VpeChildrenInfo childDivInfo = new VpeChildrenInfo(
+ ddmChildrenUL);
childDivInfo.addSourceChild(child);
creationData.addChildrenInfo(childDivInfo);
}
- }
+ }
return creationData;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-13 15:26:03 UTC (rev 10798)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-13 16:04:38 UTC (rev 10799)
@@ -37,6 +37,8 @@
private final static String COMPONENT_NAME = "menuGroup"; //$NON-NLS-1$
private final static String STYLE_PATH = "menuGroup/menuGroup.css"; //$NON-NLS-1$
private static final String SPACER_IMG_PATH = "menuGroup/spacer.gif"; //$NON-NLS-1$
+ private final static String CHILD_GROUP_NAME = ":menuGroup"; //$NON-NLS-1$
+ private final static String CHILD_ITEM_NAME = ":menuItem"; //$NON-NLS-1$
private static final String ICON_FACET_NAME = "icon"; //$NON-NLS-1$
private static final String ICON_DISABLED_FACET_NAME = "iconDisabled"; //$NON-NLS-1$
private static final String EMPTY = ""; //$NON-NLS-1$
@@ -152,6 +154,7 @@
// grFolderDiv.appendChild(grListBorderDiv);
// grListBorderDiv.appendChild(grListBgDiv);
grMainLI.appendChild(grTopDiv);
+
/*
* Children <ul> will be added only if there are some of them.
*/
@@ -248,27 +251,29 @@
}
-// String menuGroupId = (String) sourceNode.getUserData(MENU_GROUP_ID);
/*
- * Adding child nodes
+ * Adding child nodes:
+ * <rich:menuGroup> and <rich:menuItem> only.
*/
List<Node> children = ComponentUtil.getChildren(sourceElement);
- if (children.size() > 0) {
- /*
- * Add children <ul> and children in it.
- */
- grMainLI.appendChild(grChildrenUL);
- for (Node child : children) {
-// nsIDOMElement childDiv = visualDocument
-// .createElement(HTML.TAG_DIV);
-// grListBgDiv.appendChild(childDiv);
-// VpeChildrenInfo childDivInfo = new VpeChildrenInfo(childDiv);
+ boolean missingChildContainer = true;
+ for (Node child : children) {
+ if (child.getNodeType() == Node.ELEMENT_NODE
+ && (child.getNodeName().endsWith(CHILD_GROUP_NAME)
+ || child.getNodeName().endsWith(CHILD_ITEM_NAME))) {
+ if (missingChildContainer) {
+ /*
+ * Add children <ul> tag.
+ */
+ grMainLI.appendChild(grChildrenUL);
+ missingChildContainer = false;
+ }
VpeChildrenInfo childDivInfo = new VpeChildrenInfo(grChildrenUL);
childDivInfo.addSourceChild(child);
creationData.addChildrenInfo(childDivInfo);
}
}
-
+
return creationData;
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-13 15:26:03 UTC (rev 10798)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-13 16:04:38 UTC (rev 10799)
@@ -128,6 +128,7 @@
itemLabelSpan.appendChild(itemLabelText);
itemMainLI.appendChild(itemTopDiv);
+
/*
* Setting attributes for the drop-down mechanism
*/
@@ -173,14 +174,6 @@
itemMainLI.setAttribute(HTML.ATTR_STYLE, topDivStyle);
/*
- * Encode label and icon value
- */
- Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
- String labelValue = valueAttr != null
- && valueAttr.getValue() != null ? valueAttr.getValue() : EMPTY;
- itemLabelText.setNodeValue(labelValue);
-
- /*
* Encode icon facets
*/
Element iconFacet = ComponentUtil.getFacet(sourceElement, ICON_FACET_NAME);
@@ -209,11 +202,20 @@
itemIconImgSpan.appendChild(itemIconImg);
}
+
+ /*
+ * Encode label and icon value
+ */
+ Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
+ String labelValue = (valueAttr != null && valueAttr.getValue() != null)
+ ? valueAttr.getValue()
+ : EMPTY;
+ itemLabelText.setNodeValue(labelValue);
/*
- * Adding child nodes
+ * Adding child nodes, including text nodes.
*/
- List<Node> children = ComponentUtil.getChildren(sourceElement);
+ List<Node> children = ComponentUtil.getChildren(sourceElement, true);
for (Node child : children) {
VpeChildrenInfo childInfo = new VpeChildrenInfo(itemLabelSpan);
childInfo.addSourceChild(child);
17 years, 3 months
JBoss Tools SVN: r10798 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-13 11:26:03 -0400 (Mon, 13 Oct 2008)
New Revision: 10798
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
fix project deletion for vpe tests
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-13 14:21:09 UTC (rev 10797)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-10-13 15:26:03 UTC (rev 10798)
@@ -31,6 +31,7 @@
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.test.util.JobUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.tests.ImportBean;
import org.jboss.tools.vpe.editor.VpeController;
@@ -142,11 +143,17 @@
* @throws CoreException the core exception
*/
static public void removeProject(String projectName) throws CoreException {
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- projectName);
- if (project != null) {
- project.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT,
- new NullProgressMonitor());
+ boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ try {
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
+ projectName);
+ if (project != null) {
+ project.delete(IResource.ALWAYS_DELETE_PROJECT_CONTENT,
+ new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ }
+ } finally {
+ ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
}
17 years, 3 months
JBoss Tools SVN: r10797 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-13 10:21:09 -0400 (Mon, 13 Oct 2008)
New Revision: 10797
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - adding the link to Support Portal in the Support section;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-13 14:20:15 UTC (rev 10796)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/getting_started.xml 2008-10-13 14:21:09 UTC (rev 10797)
@@ -571,6 +571,9 @@
<para>Steps to reproduce the issue</para>
</listitem>
</orderedlist>
+
+ <para><property>JBDS</property> subscribers can get necessary support on our <ulink
+ url="https://network.jboss.com/jbossnetwork/login.html">Support Portal</ulink>.</para>
</section>
17 years, 3 months
JBoss Tools SVN: r10796 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-13 10:20:15 -0400 (Mon, 13 Oct 2008)
New Revision: 10796
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-446 - deleting the roles;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-10-13 13:54:12 UTC (rev 10795)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/further_reading.xml 2008-10-13 14:20:15 UTC (rev 10796)
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="further_reading" xreflabel="further_reading" role="updated">
+<chapter id="further_reading" xreflabel="further_reading">
<?dbhtml filename="further_reading.html"?>
<chapterinfo>
<keywordset>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml 2008-10-13 13:54:12 UTC (rev 10795)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/gsg_faq.xml 2008-10-13 14:20:15 UTC (rev 10796)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-<chapter id="gsg_faq" xreflabel="gsg_faq" role="new">
+<chapter id="gsg_faq" xreflabel="gsg_faq">
<?dbhtml filename="gsg_faq.html"?>
<chapterinfo>
<keywordset>
17 years, 3 months
JBoss Tools SVN: r10795 - in trunk: documentation/guides/Exadel-migration/en/modules and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-13 09:54:12 -0400 (Mon, 13 Oct 2008)
New Revision: 10795
Modified:
trunk/birt/docs/en/modules/introduction.xml
trunk/documentation/guides/Exadel-migration/en/modules/introduction.xml
trunk/portlet/docs/reference/en/modules/intro.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-418
links are fixed, as well as a table column text alignment
Modified: trunk/birt/docs/en/modules/introduction.xml
===================================================================
--- trunk/birt/docs/en/modules/introduction.xml 2008-10-13 13:46:05 UTC (rev 10794)
+++ trunk/birt/docs/en/modules/introduction.xml 2008-10-13 13:54:12 UTC (rev 10795)
@@ -37,7 +37,7 @@
<para>You can find detailed information on the BIRT report types and anatomy here:</para>
<ulink url="http://www.eclipse.org/birt/phoenix/intro/">JBoss BIRT</ulink>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools/">here</ulink>.</para>
<para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
Modified: trunk/documentation/guides/Exadel-migration/en/modules/introduction.xml
===================================================================
--- trunk/documentation/guides/Exadel-migration/en/modules/introduction.xml 2008-10-13 13:46:05 UTC (rev 10794)
+++ trunk/documentation/guides/Exadel-migration/en/modules/introduction.xml 2008-10-13 13:54:12 UTC (rev 10795)
@@ -15,7 +15,7 @@
</para>
<section>
<title>Other relevant resources on the topic</title>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools">here</ulink>.</para>
<para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
Modified: trunk/portlet/docs/reference/en/modules/intro.xml
===================================================================
--- trunk/portlet/docs/reference/en/modules/intro.xml 2008-10-13 13:46:05 UTC (rev 10794)
+++ trunk/portlet/docs/reference/en/modules/intro.xml 2008-10-13 13:54:12 UTC (rev 10795)
@@ -26,7 +26,7 @@
<colspec colnum="1" align="left" colwidth="1*"/>
<colspec colnum="2" colwidth="5*"/>
- <colspec colnum="3" colwidth="1*"/>
+ <colspec colnum="3" align="left" colwidth="1*"/>
<thead>
<row>
17 years, 3 months
JBoss Tools SVN: r10794 - in trunk: jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-13 09:46:05 -0400 (Mon, 13 Oct 2008)
New Revision: 10794
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
=JBIDE-2828, validation of taglibs was added
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-10-13 13:42:56 UTC (rev 10793)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/messages.properties 2008-10-13 13:46:05 UTC (rev 10794)
@@ -169,3 +169,4 @@
CHECK_JVM=Check JVM
CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER=Context root cannot contain character {0}.
WEB_RESOURCES=Web Resources
+INCORRECT_URI=Incorrect URI: {0}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2008-10-13 13:42:56 UTC (rev 10793)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/messages/xpl/WebUIMessages.java 2008-10-13 13:46:05 UTC (rev 10794)
@@ -187,4 +187,5 @@
public static String CHECK_JVM;
public static String CONTEXT_ROOT_CANNOT_CONTAIN_CHARACTER;
public static String WEB_RESOURCES;
+ public static String INCORRECT_URI;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 13:42:56 UTC (rev 10793)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 13:46:05 UTC (rev 10794)
@@ -411,7 +411,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -421,7 +421,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEImageReference">
<AttributeData AttributeName="location"/>
@@ -460,7 +460,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -470,7 +470,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEImageReferenceExt">
<AttributeData AttributeName="location"/>
@@ -510,7 +510,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Add Taglib Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -521,7 +521,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Edit Taglib Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -561,7 +561,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
displayName="Add TLD Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
@@ -572,7 +572,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.VpeTaglibReferenceSupport"
displayName="Edit TLD Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 13:42:56 UTC (rev 10793)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 13:46:05 UTC (rev 10794)
@@ -8,5 +8,7 @@
class="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"/>
<xclass id="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
class="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"/>
+ <xclass id="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ class="org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"/>
</extension>
</plugin>
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibReferenceSupport.java 2008-10-13 13:46:05 UTC (rev 10794)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+* Copyright (c) 2007 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeTaglibReferenceSupport extends VpeAddReferenceSupport {
+
+ private WizardDataValidator wizardDataValidator;
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
+ */
+ @Override
+ public WizardDataValidator getValidator(int step) {
+
+ if(this.wizardDataValidator == null) {
+
+ wizardDataValidator = new VpeTaglibValidator(this, step);
+ }
+
+ return this.wizardDataValidator;
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeTaglibValidator.java 2008-10-13 13:46:05 UTC (rev 10794)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+* Copyright (c) 2007 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeTaglibValidator extends DefaultWizardDataValidator {
+
+ /**
+ *
+ * @param support
+ * @param step
+ */
+ public VpeTaglibValidator(SpecialWizardSupport support, int step) {
+ super.setSupport(support, step);
+ }
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
+ */
+ @Override
+ public void validate(Properties data) {
+ super.validate(data);
+ if( (getErrorMessage()!=null) ||
+ (getWarningMessage()!=null)) {
+ return;
+ }
+ String uriStr = (String) data.get("location"); //$NON-NLS-1$
+ try {
+ new URI(uriStr);
+ }catch (URISyntaxException ex) {
+ message = NLS.bind(WebUIMessages.INCORRECT_URI,uriStr);
+ }
+ }
+}
17 years, 3 months
JBoss Tools SVN: r10793 - trunk/documentation/guides/GettingStartedGuide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-13 09:42:56 -0400 (Mon, 13 Oct 2008)
New Revision: 10793
Modified:
trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-443 - updating the chapters according to Shaun Appleton comments;
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2008-10-13 13:42:04 UTC (rev 10792)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/first_seam.xml 2008-10-13 13:42:56 UTC (rev 10793)
@@ -446,7 +446,7 @@
<property>Run As... > Run On Server</property>
</emphasis> which will show the appropriate url in the browser. Alternatively you can
manually enter <emphasis>
- <property>http://localhost/workshop/myAction.seam</property>
+ <property>http://localhost:8080/workshop/myAction.seam</property>
</emphasis> into a browser.</para>
<figure>
@@ -764,9 +764,9 @@
<section id="use_hibernate_tools">
<title>Use Hibernate Tools to Query Data via JPA</title>
- <para>Now, it’s time to write some JPA queries using the Hibernate Tools perspective in JBoss
- Developer Studio.</para>
- <para>In the upper right corner of the workbench there is a small <property>>></property>,
+ <para>Now, it's time to write some JPA queries using the Hibernate perspective in <property>JBoss
+ Developer Studio</property>.</para>
+ <para>In the upper right corner of the workbench there is a small icon (see the figure below),
click on it and choose <property>Hibernate</property>.</para>
<figure>
Modified: trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml
===================================================================
--- trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2008-10-13 13:42:04 UTC (rev 10792)
+++ trunk/documentation/guides/GettingStartedGuide/en/modules/jsp_application.xml 2008-10-13 13:42:56 UTC (rev 10793)
@@ -16,25 +16,29 @@
who for some reason cannot use Seam.</para>
</note>
- <para>In this chapter you'll find out how to create a simple <ulink url="http://java.sun.com/products/jsp/">JSP</ulink> application using the JBoss
- Developer Studio. The application will show a classic "Hello World!" on
- the page.</para>
- <para>We'll assume that you have already launched JBoss Developer Studio and also that
- the Web Development perspective is the current perspective. If not, make it active by
- selecting <emphasis>
+ <para>In this chapter you'll find out how to create a simple <ulink
+ url="http://java.sun.com/products/jsp/">JSP</ulink> application using the
+ <property>JBoss Developer Studio</property>. The application will show a classic
+ "Hello World!" on the page.</para>
+ <para>We'll assume that you have already launched <property>JBoss Developer
+ Studio</property> and also that the <property>Web Development</property> perspective is the
+ current perspective. If not, make it active by selecting <emphasis>
<property>Window > Open Perspective > Web Development</property>
</emphasis> from the menu bar or by selecting <emphasis>
<property>Window > Open Perspective > Other...</property>
</emphasis> from the menu bar and then selecting Web Development from the Select Perspective
dialog box.</para>
+
<section id="SettingUpTheProject">
<?dbhtml filename="SettingUpTheProject.html"?>
<title>Setting Up the Project</title>
- <para>The main purpose of this section is to tell you about creation a Dynamic Web Project.</para>
+ <para>We are going to start with the creating a Dynamic Web Project with a minimal
+ structure, i.e. with just required facets. Thus this section will perform you all
+ necessary steps on how to do this.</para>
<itemizedlist>
<listitem>
<para>Go to the menu bar and select <emphasis>
- <property>File > New > Project...</property>
+ <property>File > New > Other...</property>
</emphasis></para>
</listitem>
<listitem>
@@ -52,7 +56,9 @@
<para>Enter "jspHello" as a project name</para>
</listitem>
<listitem>
- <para>Leave everything else as is, and click <emphasis>
+ <para>Then select <emphasis>
+ <property>Minimal Configuration</property>
+ </emphasis> from the list of possible configurations and click <emphasis>
<property>Finish</property>
</emphasis></para>
</listitem>
@@ -65,7 +71,11 @@
</imageobject>
</mediaobject>
</figure>
- <para>A jspHello node should appear in the upper-left Package Explorer view.</para>
+
+ <para>The <emphasis>
+ <property>jspHello</property>
+ </emphasis> node should appear in the upper-left <property>Package Explorer</property>
+ view.</para>
<figure>
<title>New Web Project</title>
<mediaobject>
@@ -77,15 +87,15 @@
</section>
<section id="CreatingJSPPage">
- <?dbhtml filename="CreatingJSPPage.html"?>
- <title>Creating JSP Page</title>
+ <?dbhtml filename="CreatingJSPPage.html"?>
+ <title>Creating JSP Page</title>
<para>This section covers all the points how to create, edit and then preview JSP page.</para>
<para>In our simple application we need to create only one JSP page which displays a
- "Hello World!" message.</para>
+ <emphasis>"Hello World!"</emphasis> message.</para>
<itemizedlist>
<listitem>
- <para>Right click <emphasis><property>WebContent > New > JSP</property>.
- </emphasis></para>
+ <para>Right click <emphasis><property>WebContent > New >
+ JSP</property>. </emphasis></para>
</listitem>
<listitem>
<para>Type "hello.jsp" for a file name and click the <emphasis>
@@ -111,12 +121,14 @@
</imageobject>
</mediaobject>
</figure>
- <para>Our hello.jsp page will now appear in Project Explorer.</para>
+ <para>Our <emphasis>
+ <property>hello.jsp</property>
+ </emphasis> page will now appear in <property>Project Explorer</property>.</para>
<section id="EditingJSPPage">
<?dbhtml filename="EditingJSPPage.html"?>
<title>Editing a JSP Page</title>
<para>Let's now make a little change so that a jsp page displays
- "Hello World!" message.</para>
+ <emphasis>"Hello World!"</emphasis> message.</para>
<itemizedlist>
<listitem>
<para>Insert this line inside the <emphasis role="bold">
@@ -138,7 +150,9 @@
</imageobject>
</mediaobject>
</figure>
- <para>After changes made your hello.jsp page should look like this:</para>
+ <para>After changes made your <emphasis>
+ <property>hello.jsp</property>
+ </emphasis> page should look like this:</para>
<figure>
<title>Hello.jsp Page</title>
<mediaobject>
@@ -147,27 +161,38 @@
</imageobject>
</mediaobject>
</figure>
+
+ <para>This line will actually output <emphasis>"Hello
+ World!"</emphasis> message in the <property>Console</property>. To make the
+ message displayed in the Browser, just replace this line with the simple
+ <emphasis>Hello World!</emphasis>.</para>
</section>
<section id="WebXML">
<?dbhtml filename="WebXML.html"?>
<title>web.xml file</title>
- <para>When you are creating web project the wizard creates the web.xml for you
- automatically. The web.xml file editor provided by JBoss Developer Studio is
- available in two modes: <property>tree</property> and <property>source</property>.</para>
+ <para>When you are creating web project the wizard creates the <emphasis>
+ <property>web.xml</property>
+ </emphasis> for you automatically. The <property>web.xml file editor</property>
+ provided by <property>JBoss Developer Studio</property> is available in two modes:
+ <property>Tree</property> and <property>Source</property>.</para>
<figure>
<title>Web.xml in Design and Source Mode</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jsp_application/jsp_application_6.png" scale="90"/>
+ <imagedata fileref="images/jsp_application/jsp_application_6.png" scale="90"
+ />
</imageobject>
</mediaobject>
</figure>
- <para>Both modes are fully synchronized. Let's add mapping to our hello.jsp
- page in web.xml file.</para>
+ <para>Both modes are fully synchronized. Let's add mapping to our <emphasis>
+ <property>hello.jsp</property>
+ </emphasis> page in <emphasis>
+ <property>web.xml</property>
+ </emphasis> file.</para>
<itemizedlist>
<listitem>
- <para>Switch to <property>source</property> mode.</para>
+ <para>Switch to <property>Source</property> tab.</para>
</listitem>
<listitem>
<para>Add the next code into <emphasis role="bold">
@@ -177,8 +202,8 @@
</itemizedlist>
<programlisting role="XML"><![CDATA[<welcome-file>hello.jsp</welcome-file>
]]></programlisting>
- <para>If you come back to design mode you will see that the changes made are
- automatically reflected in that mode.</para>
+ <para>If you come back to <property>Tree</property> mode you will see that the changes
+ made are automatically reflected in that mode.</para>
<para>Actually you don't really need to do any configurations right now.</para>
</section>
@@ -186,16 +211,18 @@
<?dbhtml filename="DeployTheProject.html"?>
<title>Deploying the project</title>
<para>While creating any web project you could experience a pain writing ant scripts and
- managing the packaging even when writing the most trivial web
- applications. With JBoss Developer Studio you are saved from such a pain. All you
- need is to start JBoss server and launch your application in your favorite browser.</para>
- <para>You can also create a war archive with JBDS's Archive Tools and export it
- to any web server.</para>
+ managing the packaging even when writing the most trivial web applications. With
+ <property>JBoss Developer Studio</property> you are saved from such a pain. All
+ you need is to start <property>JBoss Server</property> and launch your application
+ in your favorite browser.</para>
+ <para>You can also create a war archive with <ulink
+ url="&aslink;#Project_archivesView">JBDS's Archive Tools</ulink>
+ and export it to any web server.</para>
<section id="WarConfig">
<?dbhtml filename="WarConfig.html"?>
<title>WAR Config</title>
- <para>Project archives managing is available through <property>Project
- archives</property> view.</para>
+ <para>Project archives managing is available through <ulink
+ url="&aslink;#Project_archivesView">Project Archives view</ulink>.</para>
<itemizedlist>
<listitem>
<para>Select <emphasis>
@@ -207,7 +234,8 @@
<para>Select a project in Package Explorer you want to be archived</para>
</listitem>
</itemizedlist>
- <para>In Project Archives you will see available archive types for the project:</para>
+ <para>In <property>Project Archives</property> you will see available archive types
+ for the project:</para>
<figure>
<title>Project Archives</title>
<mediaobject>
@@ -223,7 +251,8 @@
</emphasis> option to create war archive</para>
</listitem>
</itemizedlist>
- <para>In the dialog New WAR you can see automatically selected default values</para>
+ <para>In the <property>New WAR</property> dialog you can see automatically selected
+ default values.</para>
<figure>
<title>New WAR Archive</title>
<mediaobject>
@@ -250,9 +279,10 @@
</listitem>
<listitem>
<para>Click <emphasis>
- <property>Finish</property>.
- </emphasis> The <emphasis>.war</emphasis> file will appear in Package
- Explorer and in Project archives view as structure tree: <figure>
+ <property>Finish</property>. </emphasis> The
+ <emphasis>.war</emphasis> file will appear in <property>Package
+ Explorer</property> and also in <property>Project Archives</property>
+ view as structure tree: <figure>
<title>Archive is Created</title>
<mediaobject>
<imageobject>
@@ -268,21 +298,20 @@
<imageobject>
<imagedata
fileref="images/jsp_application/jsp_application_12.png"
- />
+ />
</imageobject>
</mediaobject>
</figure>
</para>
</listitem>
</itemizedlist>
- <para>Via Project archives view you could now edit your archive, add new folders,
- publish to server, and so on:</para>
+ <para>Via <property>Project Archives</property> view you could now edit your
+ archive, add new folders, publish to server, and so on:</para>
<figure>
<title>Configure Archive</title>
<mediaobject>
<imageobject>
- <imagedata fileref="images/jsp_application/jsp_application_13.png"
- />
+ <imagedata fileref="images/jsp_application/jsp_application_13.png"/>
</imageobject>
</mediaobject>
</figure>
@@ -291,10 +320,11 @@
<section id="AutoRedeploy">
<?dbhtml filename="AutoRedeploy.html"?>
<title>Auto redeploy</title>
- <para>When you are creating a web application and register it on JBoss server it is
- automatically deployed into <emphasis>/deploy</emphasis> directory of the
- server. JBDS comes with the feature of auto-redeploy. It means that you
- don't need to restart JBoss. Any changes made in the application in
+ <para>When you are creating a web application and register it on <property>JBoss
+ Server</property> it is automatically deployed into
+ <emphasis>/deploy</emphasis> directory of the server. JBDS comes with the
+ feature of auto-redeploy. It means that you don't need to restart
+ <property>JBoss Server</property>. Any changes made in the application in
exploded format will trigger a redeployment on the server.</para>
</section>
</section>
@@ -302,12 +332,15 @@
<section id="Previewtab">
<?dbhtml filename="Previewtab.html"?>
<title>JSP Page Preview</title>
- <para>JBDS comes with JSP design-time preview features. When designing JSP pages you can
- easily preview how they will look during runtime. You can even attach your
- stylesheet to the preview.</para>
+ <para><property>JBDS</property> comes with JSP design-time preview features. When
+ designing JSP pages you can easily preview how they will look during runtime. You
+ can even <ulink url="&jsflink;#el_exp_para">attach your stylesheet to the
+ Preview</ulink>.</para>
<itemizedlist>
<listitem>
- <para>Make a little change to hello.jsp page, e.g. put this code snippet:</para>
+ <para>Make a little change to <emphasis>
+ <property>hello.jsp</property>
+ </emphasis> page, e.g. put this code snippet:</para>
</listitem>
</itemizedlist>
<programlisting role="XML"><![CDATA[<%= new java.util.Date() %>
@@ -319,8 +352,8 @@
</emphasis> button.</para>
</listitem>
<listitem>
- <para>Switch to Preview page by clicking Preview tab at the bottom of the page.
- You will see how the page will look at runtime.</para>
+ <para>Switch to Preview page by clicking <property>Preview</property> tab at the
+ bottom of the page. You will see how the page will look at runtime.</para>
</listitem>
</itemizedlist>
<!-- <figure>
@@ -336,12 +369,13 @@
<section id="LaunchingTheProject">
<?dbhtml filename="LaunchingTheProject.html"?>
<title>Launch JSP Project</title>
- <para>Let's now launch our project on server. We'll use JBoss server
- that is shipped with JBoss Developer Studio.</para>
+ <para>Let's now launch our project on server. We'll use
+ <property>JBoss Server</property> that is shipped with <property>JBoss Developer
+ Studio</property>. You can do it by performing one of the following actions:</para>
<itemizedlist>
<listitem>
- <para>Start JBoss server from JBoss Server view by clicking the Start
- icon.</para>
+ <para>Start JBoss Server from <ulink url="&aslink;#JBossServerView">JBoss
+ Server view</ulink> by clicking the Start icon.</para>
</listitem>
</itemizedlist>
<figure>
@@ -355,12 +389,14 @@
<itemizedlist>
<listitem>
<para>Click the Run icon or right click your project folder and select <emphasis>
- <property>Run As > Run on Server</property>.
- </emphasis> If you haven't made any changes in web.xml file or
- cleared it out you can launch the application by right clicking the
- hello.jsp page and selecting <emphasis>
- <property>Run on the Server</property>.
- </emphasis></para>
+ <property>Run As > Run on Server</property>. </emphasis> If you
+ haven't made any changes in <emphasis>
+ <property>web.xml</property>
+ </emphasis> file or cleared it out you can launch the application by right
+ clicking the <emphasis>
+ <property>hello.jsp</property>
+ </emphasis> page and selecting <emphasis>
+ <property>Run on the Server</property>. </emphasis></para>
</listitem>
</itemizedlist>
<figure>
@@ -371,7 +407,7 @@
</imageobject>
</mediaobject>
</figure>
- <para>You should see the next page in a browser :</para>
+ <para>You should see the next page in a Browser :</para>
<figure>
<title>Running Project</title>
<mediaobject>
@@ -381,6 +417,10 @@
</mediaobject>
</figure>
</section>
+ <para>Thus with the help of this chapter you've learnt how to organize a Dynamic
+ Web Project with a minimal configuration, add any staff to it (in our case it's
+ just one jsp page) and deploy and run it on the <property>JBoss Server</property>
+ shipped with <property>JBDS</property>.</para>
</section>
</chapter>
17 years, 3 months
JBoss Tools SVN: r10792 - trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-10-13 09:42:04 -0400 (Mon, 13 Oct 2008)
New Revision: 10792
Modified:
trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_1.png
trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_17.png
Log:
https://jira.jboss.org/jira/browse/JBDS-443 - changing the screens to new ones;
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_1.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en/images/jsp_application/jsp_application_17.png
===================================================================
(Binary files differ)
17 years, 3 months
JBoss Tools SVN: r10790 - in trunk/vpe/plugins: org.jboss.tools.vpe.resref and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-13 08:55:28 -0400 (Mon, 13 Oct 2008)
New Revision: 10790
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
=JBIDE-2828, validation for css file was added
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 11:51:31 UTC (rev 10789)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-13 12:55:28 UTC (rev 10790)
@@ -35,7 +35,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -45,7 +45,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -85,7 +85,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
@@ -95,7 +95,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 11:51:31 UTC (rev 10789)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-13 12:55:28 UTC (rev 10790)
@@ -6,5 +6,7 @@
class="org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"/>
<xclass id="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
class="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"/>
+ <xclass id="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
+ class="org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"/>
</extension>
</plugin>
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSFileValidator.java 2008-10-13 12:55:28 UTC (rev 10790)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+* Copyright (c) 2007 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import java.io.File;
+import java.util.Properties;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.jst.web.messages.xpl.WebUIMessages;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeCSSFileValidator extends DefaultWizardDataValidator {
+
+ /**
+ *
+ * @param support
+ * @param step
+ */
+ public VpeCSSFileValidator(SpecialWizardSupport support, int step) {
+ super.setSupport(support, step);
+ }
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
+ */
+ @Override
+ public void validate(Properties data) {
+
+ super.validate(data);
+
+ if( (getErrorMessage()!=null) ||
+ (getWarningMessage()!=null)) {
+ return;
+ }
+ String location = (String) data.get("location"); //$NON-NLS-1$
+ if(!new File(location).isFile()) {
+ message = NLS.bind(WebUIMessages.FILE_DOESNOT_EXIST,location);
+ }
+
+ }
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeCSSReferenceSupport.java 2008-10-13 12:55:28 UTC (rev 10790)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+* Copyright (c) 2007 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeCSSReferenceSupport extends VpeAddReferenceSupport{
+
+ private WizardDataValidator wizardDataValidator;
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
+ */
+ @Override
+ public WizardDataValidator getValidator(int step) {
+ if(this.wizardDataValidator==null) {
+
+ this.wizardDataValidator = new VpeCSSFileValidator(this, step);
+ }
+ return this.wizardDataValidator;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java 2008-10-13 11:51:31 UTC (rev 10789)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java 2008-10-13 12:55:28 UTC (rev 10790)
@@ -23,9 +23,10 @@
*/
public class VpeElVariableValidator extends DefaultWizardDataValidator {
-
/**
*
+ * @param support
+ * @param step
*/
public VpeElVariableValidator(SpecialWizardSupport support, int step) {
super.setSupport(support, step);
17 years, 3 months
JBoss Tools SVN: r10789 - workspace/snjeza/seam-examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-13 07:51:31 -0400 (Mon, 13 Oct 2008)
New Revision: 10789
Added:
workspace/snjeza/seam-examples/.project
workspace/snjeza/seam-examples/dvdstore-ear.zip
workspace/snjeza/seam-examples/dvdstore-ejb.zip
workspace/snjeza/seam-examples/dvdstore.zip
Log:
Adding Seam dvdstore projects
Added: workspace/snjeza/seam-examples/.project
===================================================================
--- workspace/snjeza/seam-examples/.project (rev 0)
+++ workspace/snjeza/seam-examples/.project 2008-10-13 11:51:31 UTC (rev 10789)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>seam-examples</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Added: workspace/snjeza/seam-examples/dvdstore-ear.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/dvdstore-ear.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/seam-examples/dvdstore-ejb.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/dvdstore-ejb.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/snjeza/seam-examples/dvdstore.zip
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/seam-examples/dvdstore.zip
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 3 months
JBoss Tools SVN: r10788 - workspace/examples.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-10-13 07:38:54 -0400 (Mon, 13 Oct 2008)
New Revision: 10788
Modified:
workspace/examples/projectExamples.xml
Log:
Modified: workspace/examples/projectExamples.xml
===================================================================
--- workspace/examples/projectExamples.xml 2008-10-13 11:34:48 UTC (rev 10787)
+++ workspace/examples/projectExamples.xml 2008-10-13 11:38:54 UTC (rev 10788)
@@ -2,17 +2,43 @@
<project>
<category>Seam</category>
<name>dvdstore</name>
- <shortDescription>Seam DVD Store Example</shortDescription>
+ <shortDescription>Seam DVD Store Example - WAR</shortDescription>
<description>This example demonstrates the use of Seam with jBPM
pageflow and business process management. It runs on JBoss AS and
Tomcat.</description>
- <size>10000000</size>
+ <size>962000</size>
<url>
http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
</url>
</project>
<project>
+ <category>Seam</category>
+ <name>dvdstore-ejb</name>
+ <shortDescription>Seam DVD Store Example - EJB</shortDescription>
+ <description>This example demonstrates the use of Seam with jBPM
+ pageflow and business process management. It runs on JBoss AS and
+ Tomcat.</description>
+ <size>589000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
+ <category>Seam</category>
+ <name>dvdstore-ear</name>
+ <shortDescription>Seam DVD Store Example - EAR</shortDescription>
+ <description>This example demonstrates the use of Seam with jBPM
+ pageflow and business process management. It runs on JBoss AS and
+ Tomcat.</description>
+ <size>5700000</size>
+ <url>
+ http://anonsvn.jboss.org/repos/jbosstools/workspace/snjeza/seam-examples/...
+ </url>
+ </project>
+
+ <project>
<category>Portlet</category>
<name>TestJavaPortlet</name>
<shortDescription>JBoss Java Portlet Example</shortDescription>
17 years, 3 months
JBoss Tools SVN: r10786 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui: wizards and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-13 06:24:17 -0400 (Mon, 13 Oct 2008)
New Revision: 10786
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
Log:
JBIDE-2837
I add two linkbutton on the wizard page , they allow user to select the data model.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-13 10:16:38 UTC (rev 10785)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-13 10:24:17 UTC (rev 10786)
@@ -900,6 +900,8 @@
if (dialog.open() == org.eclipse.jface.dialogs.Dialog.OK) {
sourceDataTypeID = wizard.getSourceDataTypeID();
targetDataTypeID = wizard.getTargetDataTypeID();
+ sourceTreeViewerInputModel = wizard.getSourceTreeViewerInputContents();
+ targetTreeViewerInputModel = wizard.getTargetTreeViewerInputContents();
this.getSmooksConfigurationFileGenerateContext()
.setSourceDataTypeID(sourceDataTypeID);
this.getSmooksConfigurationFileGenerateContext()
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-13 10:16:38 UTC (rev 10785)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-13 10:24:17 UTC (rev 10786)
@@ -10,16 +10,22 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.editors;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
/**
* @author Dart Peng<br>
* Date : Sep 5, 2008
*/
-public class TypeIDSelectionWizard extends Wizard {
+public class TypeIDSelectionWizard extends Wizard implements INewWizard {
private String sourceDataTypeID = null;
private String targetDataTypeID = null;
+ private Object sourceTreeViewerInputContents;
+ private Object targetTreeViewerInputContents;
private TypeIDSelectionWizardPage page = null;
+ private IStructuredSelection selection;
public String getSourceDataTypeID() {
return sourceDataTypeID;
}
@@ -36,6 +42,7 @@
public void addPages(){
if(page == null){
page = new TypeIDSelectionWizardPage("TypeID Selection",false);
+ page.setSelection(selection);
this.addPage(page);
}
super.addPages();
@@ -51,7 +58,27 @@
if(sid == null || tid == null) return false;
this.sourceDataTypeID = sid;
this.targetDataTypeID = tid;
+ setSourceTreeViewerInputContents(page.getSourceTreeViewerInputContents());
+ setTargetTreeViewerInputContents(page.getTargetTreeViewerInputContents());
return true;
}
+ public Object getSourceTreeViewerInputContents() {
+ return sourceTreeViewerInputContents;
+ }
+ public void setSourceTreeViewerInputContents(
+ Object sourceTreeViewerInputContents) {
+ this.sourceTreeViewerInputContents = sourceTreeViewerInputContents;
+ }
+ public Object getTargetTreeViewerInputContents() {
+ return targetTreeViewerInputContents;
+ }
+ public void setTargetTreeViewerInputContents(
+ Object targetTreeViewerInputContents) {
+ this.targetTreeViewerInputContents = targetTreeViewerInputContents;
+ }
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ if(page != null) page.setSelection(selection);
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-13 10:16:38 UTC (rev 10785)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-13 10:24:17 UTC (rev 10786)
@@ -14,6 +14,8 @@
import java.util.Iterator;
import java.util.List;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
@@ -24,8 +26,7 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardSelectionPage;
+import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -34,10 +35,14 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.events.IHyperlinkListener;
+import org.eclipse.ui.forms.widgets.Hyperlink;
import org.jboss.tools.smooks.analyzer.AnalyzerFactory;
import org.jboss.tools.smooks.analyzer.DataTypeID;
import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
import org.jboss.tools.smooks.ui.IViewerInitor;
+import org.jboss.tools.smooks.ui.StructuredDataCreationWizardDailog;
import org.jboss.tools.smooks.ui.ViewerInitorStore;
import org.jboss.tools.smooks.ui.wizards.TransformSelectWizardNode;
@@ -45,11 +50,21 @@
* @author Dart Peng<br>
* Date : Sep 5, 2008
*/
-public class TypeIDSelectionWizardPage extends WizardSelectionPage {
+public class TypeIDSelectionWizardPage extends WizardPage {
+ /**
+ * @deprecated
+ */
protected IStrucutredDataCreationWizard sourceWizard;
+ /**
+ * @deprecated
+ */
protected IStrucutredDataCreationWizard targetWizard;
+ private Object sourceTreeViewerInputContents;
+
+ private Object targetTreeViewerInputContents;
+
protected CheckboxTableViewer source;
protected CheckboxTableViewer target;
private List sourceList;
@@ -58,6 +73,10 @@
private IStructuredSelection selection;
private boolean showDataSelectPage = false;
+ private Hyperlink sourceDataLink;
+
+ private Hyperlink targetDataLink;
+
public IStructuredSelection getSelection() {
return selection;
}
@@ -87,41 +106,53 @@
this.showDataSelectPage = showDataSelectPage;
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
- */
- public IWizardPage getNextPage() {
- if (this.getSelectedNode() == null) {
- return null;
- }
+ // public boolean canFlipToNextPage() {
+ // if (!showDataSelectPage) {
+ // return isPageComplete() && getNextPage() != null;
+ // }
+ // return super.canFlipToNextPage();
+ // }
- boolean isCreated = getSelectedNode().isContentCreated();
+ // /*
+ // * (non-Javadoc)
+ // *
+ // * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
+ // */
+ // public IWizardPage getNextPage() {
+ // if (!showDataSelectPage) {
+ // if (this.getWizard() != null) {
+ // return this.getWizard().getNextPage(this);
+ // }
+ // }
+ // if (this.getSelectedNode() == null) {
+ // return null;
+ // }
+ //
+ // boolean isCreated = getSelectedNode().isContentCreated();
+ //
+ // IWizard wizard = getSelectedNode().getWizard();
+ //
+ // if (wizard == null) {
+ // setSelectedNode(null);
+ // return null;
+ // }
+ // if (!isCreated) {
+ // if (wizard instanceof IStrucutredDataCreationWizard) {
+ // String targetID = getDataTypeID(target);
+ // if (targetID != null) {
+ // ((IStrucutredDataCreationWizard) wizard)
+ // .setNextDataCreationWizardNode(this
+ // .getSourceWizard(targetID));
+ // }
+ // }
+ // if (wizard instanceof INewWizard) {
+ // ((INewWizard) wizard).init(null, selection);
+ // }
+ // wizard.addPages();
+ // }
+ // return wizard.getStartingPage();
+ // }
- IWizard wizard = getSelectedNode().getWizard();
-
- if (wizard == null) {
- setSelectedNode(null);
- return null;
- }
- if (!isCreated) {
- if (wizard instanceof IStrucutredDataCreationWizard) {
- String targetID = getDataTypeID(target);
- if (targetID != null) {
- ((IStrucutredDataCreationWizard) wizard)
- .setNextDataCreationWizardNode(this
- .getSourceWizard(targetID));
- }
- }
- if (wizard instanceof INewWizard) {
- ((INewWizard) wizard).init(null, selection);
- }
- wizard.addPages();
- }
- return wizard.getStartingPage();
- }
-
/*
* (non-Javadoc)
*
@@ -150,9 +181,96 @@
target.setInput(sourceList);
initViewer();
+ sourceDataLink = new Hyperlink(mainComposite, SWT.NONE);
+ sourceDataLink.setText("Source Model Select:Empty");
+ sourceDataLink.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkActivated(HyperlinkEvent e) {
+ openSourceWizard();
+ }
+
+ public void linkEntered(HyperlinkEvent e) {
+
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+
+ }
+
+ });
+ targetDataLink = new Hyperlink(mainComposite, SWT.NONE);
+ targetDataLink.setText("Target Model Select:Empty");
+ targetDataLink.addHyperlinkListener(new IHyperlinkListener() {
+
+ public void linkActivated(HyperlinkEvent e) {
+ openTargetWizard();
+ }
+
+ public void linkEntered(HyperlinkEvent e) {
+
+ }
+
+ public void linkExited(HyperlinkEvent e) {
+
+ }
+
+ });
+
this.setControl(mainComposite);
}
+ protected void openTargetWizard() {
+ targetTreeViewerInputContents = getReturnObjectFromWizard(getTargetID());
+ resetLinkText();
+ }
+
+ protected IWizard getWizardViaDataID(String dataID) {
+ if (dataID == null)
+ return null;
+ IWizardNode wn = getSourceWizard(dataID);
+ // setSelectedNode(wn);
+ IWizard sw = wn.getWizard();
+ if (sw instanceof IStrucutredDataCreationWizard) {
+ // ((IStrucutredDataCreationWizard)sw).i
+ }
+ if (sw instanceof INewWizard) {
+ ((INewWizard) sw).init(null, this.getSelection());
+ }
+ return sw;
+ }
+
+ protected Object getReturnObjectFromWizard(String dataID) {
+ IWizard wizard = getWizardViaDataID(dataID);
+ if (wizard != null) {
+ StructuredDataCreationWizardDailog dialog = new StructuredDataCreationWizardDailog(
+ getShell(), wizard);
+ if (dialog.open() == Dialog.OK) {
+ return dialog.getCurrentCreationWizard()
+ .getTreeViewerInputContents();
+ }
+ } else {
+ MessageDialog.openInformation(getShell(), "Info",
+ "Please select the data type first");
+ }
+
+ return null;
+ }
+
+ protected void openSourceWizard() {
+ sourceTreeViewerInputContents = getReturnObjectFromWizard(getSourceID());
+ resetLinkText();
+ }
+
+ private void resetLinkText() {
+ if (sourceTreeViewerInputContents != null) {
+ sourceDataLink.setText("Source Model Select");
+ }
+
+ if (targetTreeViewerInputContents != null) {
+ targetDataLink.setText("Target Model Select");
+ }
+ }
+
protected String getDataTypeID(CheckboxTableViewer viewer) {
Object[] objs = viewer.getCheckedElements();
if (objs == null)
@@ -231,31 +349,35 @@
if (viewer == source) {
String sourceID = getDataTypeID(source);
- IWizardNode wn = getSourceWizard(sourceID);
- setSelectedNode(wn);
setSourceID(sourceID);
- IWizard sw = wn.getWizard();
- if (sw instanceof IStrucutredDataCreationWizard) {
- setSourceWizard((IStrucutredDataCreationWizard) sw);
- }
+ // TODO don't use that to display the source selection
+ // wizard page.
+ // IWizardNode wn = getSourceWizard(sourceID);
+ // setSelectedNode(wn);
+ // IWizard sw = wn.getWizard();
+ // if (sw instanceof IStrucutredDataCreationWizard) {
+ // setSourceWizard((IStrucutredDataCreationWizard) sw);
+ // }
}
if (viewer == target) {
- IWizardNode node = getSelectedNode();
+ // IWizardNode node = getSelectedNode();
String targetID = getDataTypeID(target);
- IWizardNode targetNode = getSourceWizard(targetID);
- IWizard tnw = targetNode.getWizard();
- if (tnw instanceof IStrucutredDataCreationWizard) {
- setTargetWizard((IStrucutredDataCreationWizard) tnw);
- }
- if (node != null) {
- IWizard wizard = node.getWizard();
- if (wizard != null
- && wizard instanceof IStrucutredDataCreationWizard) {
- ((IStrucutredDataCreationWizard) wizard)
- .setNextDataCreationWizardNode(targetNode);
- }
- }
+ // TODO don't use that to display the target selection
+ // wizard page.
+ // IWizardNode targetNode = getSourceWizard(targetID);
+ // IWizard tnw = targetNode.getWizard();
+ // if (tnw instanceof IStrucutredDataCreationWizard) {
+ // setTargetWizard((IStrucutredDataCreationWizard) tnw);
+ // }
+ // if (node != null) {
+ // IWizard wizard = node.getWizard();
+ // if (wizard != null
+ // && wizard instanceof IStrucutredDataCreationWizard) {
+ // ((IStrucutredDataCreationWizard) wizard)
+ // .setNextDataCreationWizardNode(targetNode);
+ // }
+ // }
setTargetID(targetID);
}
}
@@ -327,4 +449,22 @@
public void setTargetWizard(IStrucutredDataCreationWizard targetWizard) {
this.targetWizard = targetWizard;
}
+
+ public Object getSourceTreeViewerInputContents() {
+ return sourceTreeViewerInputContents;
+ }
+
+ public void setSourceTreeViewerInputContents(
+ Object sourceTreeViewerInputContents) {
+ this.sourceTreeViewerInputContents = sourceTreeViewerInputContents;
+ }
+
+ public Object getTargetTreeViewerInputContents() {
+ return targetTreeViewerInputContents;
+ }
+
+ public void setTargetTreeViewerInputContents(
+ Object targetTreeViewerInputContents) {
+ this.targetTreeViewerInputContents = targetTreeViewerInputContents;
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-13 10:16:38 UTC (rev 10785)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-13 10:24:17 UTC (rev 10786)
@@ -59,7 +59,8 @@
page = new SmooksConfigFileNewWizardPage("newSmooksFile1",
getSelection());
addPage(page);
- typeIDPage = new TypeIDSelectionWizardPage("", true);
+ // TODO don't use the WizardSelectionPage
+ typeIDPage = new TypeIDSelectionWizardPage("", false);
typeIDPage.setSelection(selection);
addPage(typeIDPage);
}
@@ -131,29 +132,9 @@
try {
SmooksFileEditorInput input = new SmooksFileEditorInput(
file);
- IStrucutredDataCreationWizard sourceWizard = typeIDPage
- .getSourceWizard();
+ input.setSourceTreeViewerInputContents(typeIDPage.getSourceTreeViewerInputContents());
+ input.setTargetTreeViewerInputContents(typeIDPage.getTargetTreeViewerInputContents());
- IStrucutredDataCreationWizard targetWizard = typeIDPage
- .getTargetWizard();
-
- if (sourceWizard != null) {
- if (((IWizard) sourceWizard).getPageCount() != 0) {
- if (((IWizard) sourceWizard).performFinish())
- input
- .setSourceTreeViewerInputContents(sourceWizard
- .getTreeViewerInputContents());
- }
- }
- if (targetWizard != null) {
- if (((IWizard) targetWizard).getPageCount() != 0) {
- if (((IWizard) targetWizard).performFinish())
- input
- .setTargetTreeViewerInputContents(targetWizard
- .getTreeViewerInputContents());
- }
- }
-
IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
true);// openEditor(page, file, true);
} catch (PartInitException e) {
17 years, 3 months
JBoss Tools SVN: r10785 - in trunk: struts/docs/struts_tools_ref_guide/en/modules and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-10-13 06:16:38 -0400 (Mon, 13 Oct 2008)
New Revision: 10785
Modified:
trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml
trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml
trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-418
links are fixed, as well as a table column text alignment
Modified: trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml
===================================================================
--- trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml 2008-10-13 08:01:29 UTC (rev 10784)
+++ trunk/jsf/docs/jsf_tools_ref_guide/en/modules/introduction.xml 2008-10-13 10:16:38 UTC (rev 10785)
@@ -106,7 +106,7 @@
</section>
<section>
<title>Other relevant resources on the topic</title>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools/">here</ulink>.</para>
<para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
</chapter>
Modified: trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml
===================================================================
--- trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml 2008-10-13 08:01:29 UTC (rev 10784)
+++ trunk/struts/docs/struts_tools_ref_guide/en/modules/introduction.xml 2008-10-13 10:16:38 UTC (rev 10785)
@@ -38,7 +38,7 @@
<colspec colnum="1" align="left" colwidth="2*"/>
<colspec colnum="2" colwidth="4*"/>
- <colspec colnum="3" colwidth="2*"/>
+ <colspec colnum="3" align="left" colwidth="2*"/>
<thead>
<row>
@@ -102,7 +102,7 @@
<section>
<title>Other relevant resources on the topic</title>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools/">here</ulink>.</para>
<para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
Modified: trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml
===================================================================
--- trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml 2008-10-13 08:01:29 UTC (rev 10784)
+++ trunk/struts/docs/struts_tools_tutorial/en/modules/introduction.xml 2008-10-13 10:16:38 UTC (rev 10785)
@@ -27,7 +27,7 @@
<section>
<title>Other relevant resources on the topic</title>
- <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://www.jboss.com/products/devstudio/docs">here</ulink>.</para>
+ <para>All JBoss Developer Studio/JBoss Tools documentation you can find <ulink url="http://docs.jboss.org/tools/">here</ulink>.</para>
<para>The latest documentation builds are available <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">here</ulink>.</para>
</section>
17 years, 3 months
JBoss Tools SVN: r10784 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-13 04:01:29 -0400 (Mon, 13 Oct 2008)
New Revision: 10784
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFileEditorInput.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformSelectWizardNode.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java
Log:
JBIDE-2837
Change the new wizard codes, but ... something seams that can't run well...
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/JavaBeanConfigWizardPage.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -11,25 +11,31 @@
package org.jboss.tools.smooks.javabean.ui;
import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardSelectionPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.INewWizard;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
+import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
/**
* @author Dart Peng
*
* @CreateTime Jul 21, 2008
*/
-public class JavaBeanConfigWizardPage extends WizardPage implements
+public class JavaBeanConfigWizardPage extends WizardSelectionPage implements
SelectionListener {
-
+
TreeViewer treeViewer;
Text classText = null;
@@ -47,8 +53,41 @@
public JavaBeanConfigWizardPage(IJavaProject selection) {
super("beansearchwizardpage");
this.project = selection;
+ setPageComplete(true);
}
+
+ public void activeNextWizardNode(IWizardNode node){
+ setSelectedNode(node);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
+ */
+ public IWizardPage getNextPage() {
+ if (this.getSelectedNode() == null) {
+ return null;
+ }
+ boolean isCreated = getSelectedNode().isContentCreated();
+
+ IWizard wizard = getSelectedNode().getWizard();
+
+ if (wizard == null) {
+ setSelectedNode(null);
+ return null;
+ }
+ if (!isCreated) {
+ if (wizard instanceof INewWizard) {
+ StructuredSelection selection = new StructuredSelection(project);
+ ((INewWizard) wizard).init(null, selection);
+ }
+ wizard.addPages();
+ }
+ return wizard.getStartingPage();
+ }
+
protected void initilize() {
}
@@ -109,13 +148,14 @@
if (project == null) {
error = "Please select a Java project.";
}
+ setPageComplete(error == null);
this.setErrorMessage(error);
}
- public JavaBeanConfigWizardPage(String pageName, String title,
- ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- }
+// public JavaBeanConfigWizardPage(String pageName, String title,
+// ImageDescriptor titleImage) {
+// super(pageName, title, titleImage);
+// }
public JavaBeanConfigWizardPage(String pageName) {
super(pageName);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.javabean/src/org/jboss/tools/smooks/javabean/ui/NewJavaBeanStrucutredDataWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -15,12 +15,18 @@
import java.util.Properties;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
import org.jboss.tools.smooks.javabean.JavaBeanActivator;
import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
@@ -28,11 +34,11 @@
* @author Dart Peng
* @Date Aug 5, 2008
*/
-public class NewJavaBeanStrucutredDataWizard extends Wizard implements IStrucutredDataCreationWizard{
+public class NewJavaBeanStrucutredDataWizard extends Wizard implements IStrucutredDataCreationWizard,INewWizard{
JavaBeanConfigWizardPage page = null;
IJavaProject project = null;
Object result = null;
-
+ IWizardNode wizard;
Properties properties = new Properties();
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#addPages()
@@ -42,6 +48,9 @@
super.addPages();
if(page == null){
page = new JavaBeanConfigWizardPage(project);
+ if(this.wizard != null){
+ page.activeNextWizardNode(wizard);
+ }
this.addPage(page);
}
}
@@ -81,4 +90,24 @@
return this.properties;
}
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ if(selection != null){
+ Object obj = selection.getFirstElement();
+ if(obj instanceof JavaProject){
+ this.project = (JavaProject)obj;
+ }
+ if(obj instanceof IResource){
+ IProject project = ((IResource)obj).getProject();
+ this.project = JavaCore.create(project);
+ }
+ }
+ }
+
+ public void setNextDataCreationWizardNode(IWizardNode wizard) {
+ this.wizard = wizard;
+ if(page != null){
+ page.activeNextWizardNode(this.wizard);
+ }
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/IStrucutredDataCreationWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -13,6 +13,7 @@
import java.util.Properties;
import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
@@ -30,4 +31,6 @@
public Properties getProperties();
+ public void setNextDataCreationWizardNode(IWizardNode wizardNode);
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFileEditorInput.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFileEditorInput.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFileEditorInput.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -27,6 +27,26 @@
private List targetModel = new ArrayList();
+ private Object sourceRoot = null;
+
+ private Object targetRoot = null;
+
+ public Object getSourceTreeViewerInputContents() {
+ return sourceRoot;
+ }
+
+ public void setSourceTreeViewerInputContents(Object sourceRoot) {
+ this.sourceRoot = sourceRoot;
+ }
+
+ public Object getTargetTreeViewerInputContents() {
+ return targetRoot;
+ }
+
+ public void setTargetTreeViewerInputContents(Object targetRoot) {
+ this.targetRoot = targetRoot;
+ }
+
public SmooksFileEditorInput(IFile file) {
super(file);
}
@@ -58,7 +78,5 @@
public void setTargetModel(List targetModel) {
this.targetModel = targetModel;
}
-
-
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -47,6 +47,7 @@
*/
public class SmooksFormEditor extends FormEditor implements
ITabbedPropertySheetPageContributor {
+
SmooksGraphicalFormPage graphicalPage = null;
private TabbedPropertySheetPage tabbedPropertySheetPage;
private SmooksNormalContentEditFormPage normalPage;
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -258,7 +258,8 @@
Composite rootMainControl = form.getBody();
form.setText("Data Mapping Page");
Section section = this.createPageSectionHeader(rootMainControl,
- Section.TITLE_BAR | Section.DESCRIPTION , "Mapping Graph Edit Panel",
+ Section.TITLE_BAR | Section.DESCRIPTION,
+ "Mapping Graph Edit Panel",
"Edit the source and target assosiation");
Composite mappingMainComposite = toolkit.createComposite(section);
GridLayout gly = new GridLayout();
@@ -453,9 +454,7 @@
protected void initTargetTreeViewer() {
if (this.targetTreeViewerInputModel != null) {
- List list = new ArrayList();
- list.add(targetTreeViewerInputModel);
- targetViewer.setInput(list);
+ targetViewer.setInput(targetTreeViewerInputModel);
}
}
@@ -475,9 +474,7 @@
protected void initSourceTreeViewer() {
if (this.sourceTreeViewerInputModel != null) {
- List list = new ArrayList();
- list.add(sourceTreeViewerInputModel);
- sourceViewer.setInput(list);
+ sourceViewer.setInput(sourceTreeViewerInputModel);
}
}
@@ -862,10 +859,10 @@
.getInstance().getTargetModelAnalyzer(targetDataTypeID);
IMappingAnalyzer connectionAnalyzer = AnalyzerFactory.getInstance()
.getMappingAnalyzer(sourceDataTypeID, targetDataTypeID);
- if (sourceModelAnalyzer != null)
+ if (sourceModelAnalyzer != null && sourceTreeViewerInputModel == null)
sourceTreeViewerInputModel = sourceModelAnalyzer
.buildSourceInputObjects(graph, listType, file);
- if (targetModelAnalyzer != null)
+ if (targetModelAnalyzer != null && targetTreeViewerInputModel == null)
targetTreeViewerInputModel = targetModelAnalyzer
.buildTargetInputObjects(graph, listType, file);
if (connectionAnalyzer != null) {
@@ -953,6 +950,13 @@
smooksResource = ((SmooksFormEditor) parentEditor)
.getSmooksResource();
}
+ if (input instanceof SmooksFileEditorInput) {
+ this.sourceTreeViewerInputModel = ((SmooksFileEditorInput) input)
+ .getSourceTreeViewerInputContents();
+
+ this.targetTreeViewerInputModel = ((SmooksFileEditorInput) input)
+ .getTargetTreeViewerInputContents();
+ }
// }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -35,7 +35,7 @@
public void addPages(){
if(page == null){
- page = new TypeIDSelectionWizardPage("TypeID Selection");
+ page = new TypeIDSelectionWizardPage("TypeID Selection",false);
this.addPage(page);
}
super.addPages();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/TypeIDSelectionWizardPage.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.smooks.ui.editors;
+import java.util.Collection;
import java.util.Iterator;
import java.util.List;
@@ -17,11 +18,14 @@
import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardSelectionPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -29,24 +33,39 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.INewWizard;
import org.jboss.tools.smooks.analyzer.AnalyzerFactory;
import org.jboss.tools.smooks.analyzer.DataTypeID;
+import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.IViewerInitor;
+import org.jboss.tools.smooks.ui.ViewerInitorStore;
+import org.jboss.tools.smooks.ui.wizards.TransformSelectWizardNode;
/**
* @author Dart Peng<br>
* Date : Sep 5, 2008
*/
-public class TypeIDSelectionWizardPage extends WizardPage {
+public class TypeIDSelectionWizardPage extends WizardSelectionPage {
+ protected IStrucutredDataCreationWizard sourceWizard;
+ protected IStrucutredDataCreationWizard targetWizard;
+
protected CheckboxTableViewer source;
protected CheckboxTableViewer target;
private List sourceList;
private String sourceID = null;
private String targetID = null;
-
-
-
+ private IStructuredSelection selection;
+ private boolean showDataSelectPage = false;
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
public String getSourceID() {
return sourceID;
}
@@ -63,13 +82,49 @@
this.targetID = targetID;
}
- public TypeIDSelectionWizardPage(String pageName) {
+ public TypeIDSelectionWizardPage(String pageName, boolean showDataSelectPage) {
super(pageName);
+ this.showDataSelectPage = showDataSelectPage;
}
/*
* (non-Javadoc)
*
+ * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
+ */
+ public IWizardPage getNextPage() {
+ if (this.getSelectedNode() == null) {
+ return null;
+ }
+
+ boolean isCreated = getSelectedNode().isContentCreated();
+
+ IWizard wizard = getSelectedNode().getWizard();
+
+ if (wizard == null) {
+ setSelectedNode(null);
+ return null;
+ }
+ if (!isCreated) {
+ if (wizard instanceof IStrucutredDataCreationWizard) {
+ String targetID = getDataTypeID(target);
+ if (targetID != null) {
+ ((IStrucutredDataCreationWizard) wizard)
+ .setNextDataCreationWizardNode(this
+ .getSourceWizard(targetID));
+ }
+ }
+ if (wizard instanceof INewWizard) {
+ ((INewWizard) wizard).init(null, selection);
+ }
+ wizard.addPages();
+ }
+ return wizard.getStartingPage();
+ }
+
+ /*
+ * (non-Javadoc)
+ *
* @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
*/
public void createControl(Composite parent) {
@@ -78,8 +133,7 @@
gl.numColumns = 2;
gl.makeColumnsEqualWidth = true;
mainComposite.setLayout(gl);
- sourceList = AnalyzerFactory.getInstance()
- .getRegistrySourceIDList();
+ sourceList = AnalyzerFactory.getInstance().getRegistrySourceIDList();
Label sl = new Label(mainComposite, SWT.NONE);
sl.setText("Source Data Type ID List : ");
@@ -95,7 +149,7 @@
source.setInput(sourceList);
target.setInput(sourceList);
initViewer();
-
+
this.setControl(mainComposite);
}
@@ -124,7 +178,8 @@
}
protected boolean initViewerCheckState(String id, CheckboxTableViewer viewer) {
- if(id == null) return false;
+ if (id == null)
+ return false;
List l = (List) viewer.getInput();
for (Iterator iterator = l.iterator(); iterator.hasNext();) {
DataTypeID dti = (DataTypeID) iterator.next();
@@ -136,6 +191,27 @@
return false;
}
+ private IWizardNode getSourceWizard(String id) {
+ Collection<IViewerInitor> viewers = ViewerInitorStore.getInstance()
+ .getViewerInitorCollection();
+ for (Iterator iterator = viewers.iterator(); iterator.hasNext();) {
+ IViewerInitor viewerInitor = (IViewerInitor) iterator.next();
+ if (viewerInitor.getTypeID().equals(id)) {
+ TransformSelectWizardNode wn = new TransformSelectWizardNode();
+ IStrucutredDataCreationWizard wizard = viewerInitor
+ .getStructuredDataLoadWizard();
+ if (wizard == null)
+ return null;
+ wn.setWizard(wizard);
+ wn.setName(viewerInitor.getName());
+ wn.setIconPath(viewerInitor.getWizardIconPath());
+ wn.setDescription(viewerInitor.getDescription());
+ return wn;
+ }
+ }
+ return null;
+ }
+
protected CheckboxTableViewer createTableViewer(Composite parent) {
final CheckboxTableViewer viewer = CheckboxTableViewer.newCheckList(
parent, SWT.FULL_SELECTION);
@@ -152,13 +228,35 @@
viewer.setChecked(event.getElement(), true);
fireEvent = true;
}
-
- if(viewer == source){
- setSourceID(getDataTypeID(source));
+
+ if (viewer == source) {
+ String sourceID = getDataTypeID(source);
+ IWizardNode wn = getSourceWizard(sourceID);
+ setSelectedNode(wn);
+ setSourceID(sourceID);
+ IWizard sw = wn.getWizard();
+ if (sw instanceof IStrucutredDataCreationWizard) {
+ setSourceWizard((IStrucutredDataCreationWizard) sw);
+ }
}
-
- if(viewer == target){
- setTargetID(getDataTypeID(target));
+
+ if (viewer == target) {
+ IWizardNode node = getSelectedNode();
+ String targetID = getDataTypeID(target);
+ IWizardNode targetNode = getSourceWizard(targetID);
+ IWizard tnw = targetNode.getWizard();
+ if (tnw instanceof IStrucutredDataCreationWizard) {
+ setTargetWizard((IStrucutredDataCreationWizard) tnw);
+ }
+ if (node != null) {
+ IWizard wizard = node.getWizard();
+ if (wizard != null
+ && wizard instanceof IStrucutredDataCreationWizard) {
+ ((IStrucutredDataCreationWizard) wizard)
+ .setNextDataCreationWizardNode(targetNode);
+ }
+ }
+ setTargetID(targetID);
}
}
@@ -166,9 +264,9 @@
TableColumn nameColumn = new TableColumn(viewer.getTable(), SWT.NONE);
nameColumn.setWidth(100);
nameColumn.setText("Name");
-// TableColumn idColumn = new TableColumn(viewer.getTable(), SWT.NONE);
-// idColumn.setWidth(100);
-// idColumn.setText("ID");
+ // TableColumn idColumn = new TableColumn(viewer.getTable(), SWT.NONE);
+ // idColumn.setWidth(100);
+ // idColumn.setText("ID");
viewer.setContentProvider(new TypeIDContentProvider());
viewer.setLabelProvider(new TypeIDLabelProvider());
return viewer;
@@ -205,12 +303,28 @@
switch (columnIndex) {
case 0:
return ((DataTypeID) element).getName();
-// case 1:
-// return ((DataTypeID) element).getId();
+ // case 1:
+ // return ((DataTypeID) element).getId();
}
}
return "";
}
}
+
+ public IStrucutredDataCreationWizard getSourceWizard() {
+ return sourceWizard;
+ }
+
+ public void setSourceWizard(IStrucutredDataCreationWizard sourceWizard) {
+ this.sourceWizard = sourceWizard;
+ }
+
+ public IStrucutredDataCreationWizard getTargetWizard() {
+ return targetWizard;
+ }
+
+ public void setTargetWizard(IStrucutredDataCreationWizard targetWizard) {
+ this.targetWizard = targetWizard;
+ }
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/SmooksConfigFileNewWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -13,6 +13,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.INewWizard;
import org.eclipse.ui.IWorkbench;
@@ -21,6 +22,9 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.jboss.tools.smooks.graphical.util.GraphicalInformationSaver;
+import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
+import org.jboss.tools.smooks.ui.editors.SmooksFileEditorInput;
+import org.jboss.tools.smooks.ui.editors.SmooksFormEditor;
import org.jboss.tools.smooks.ui.editors.TypeIDSelectionWizardPage;
/**
@@ -55,7 +59,8 @@
page = new SmooksConfigFileNewWizardPage("newSmooksFile1",
getSelection());
addPage(page);
- typeIDPage = new TypeIDSelectionWizardPage("");
+ typeIDPage = new TypeIDSelectionWizardPage("", true);
+ typeIDPage.setSelection(selection);
addPage(typeIDPage);
}
@@ -124,7 +129,33 @@
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
try {
- IDE.openEditor(page, file, true);
+ SmooksFileEditorInput input = new SmooksFileEditorInput(
+ file);
+ IStrucutredDataCreationWizard sourceWizard = typeIDPage
+ .getSourceWizard();
+
+ IStrucutredDataCreationWizard targetWizard = typeIDPage
+ .getTargetWizard();
+
+ if (sourceWizard != null) {
+ if (((IWizard) sourceWizard).getPageCount() != 0) {
+ if (((IWizard) sourceWizard).performFinish())
+ input
+ .setSourceTreeViewerInputContents(sourceWizard
+ .getTreeViewerInputContents());
+ }
+ }
+ if (targetWizard != null) {
+ if (((IWizard) targetWizard).getPageCount() != 0) {
+ if (((IWizard) targetWizard).performFinish())
+ input
+ .setTargetTreeViewerInputContents(targetWizard
+ .getTreeViewerInputContents());
+ }
+ }
+
+ IDE.openEditor(page, input, SmooksFormEditor.EDITOR_ID,
+ true);// openEditor(page, file, true);
} catch (PartInitException e) {
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformSelectWizardNode.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformSelectWizardNode.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/wizards/TransformSelectWizardNode.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -12,7 +12,6 @@
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardNode;
-import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.graphics.Point;
/**
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -8,12 +8,12 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.emf.common.ui.dialogs.WorkspaceResourceDialog;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.IWizardNode;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.WizardSelectionPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -28,16 +28,15 @@
import org.eclipse.swt.widgets.FileDialog;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
-import org.jboss.tools.smooks.xsd.model.XSDStructuredModelContentProvider;
-import org.jboss.tools.smooks.xsd.model.XSDStructuredModelLabelProvider;
+import org.eclipse.ui.INewWizard;
/**
*
* @author Dart Peng Date : 2008-8-13
*/
-public abstract class AbstractFileSelectionWizardPage extends WizardPage
+public abstract class AbstractFileSelectionWizardPage extends WizardSelectionPage
implements SelectionListener {
-
+ protected IStructuredSelection selection;
protected Object returnObject = null;
protected Text fileText;
protected Composite fileTextComposite;
@@ -46,12 +45,6 @@
protected boolean reasourceLoaded = false;
private Button workspaceBrowseButton;
- public AbstractFileSelectionWizardPage(String pageName, String title,
- ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- // TODO Auto-generated constructor stub
- }
-
public AbstractFileSelectionWizardPage(String pageName) {
super(pageName);
// TODO Auto-generated constructor stub
@@ -69,7 +62,33 @@
public String getFilePath(){
return fileText.getText();
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.jface.wizard.WizardSelectionPage#getNextPage()
+ */
+ public IWizardPage getNextPage() {
+ if (this.getSelectedNode() == null) {
+ return null;
+ }
+ boolean isCreated = getSelectedNode().isContentCreated();
+
+ IWizard wizard = getSelectedNode().getWizard();
+
+ if (wizard == null) {
+ setSelectedNode(null);
+ return null;
+ }
+ if (!isCreated) {
+ if (wizard instanceof INewWizard) {
+ ((INewWizard) wizard).init(null, getSelection());
+ }
+ wizard.addPages();
+ }
+ return wizard.getStartingPage();
+ }
+
/*
* (non-Javadoc)
*
@@ -245,6 +264,10 @@
return xsdComposite;
}
+
+ public void activeNextWizardNode(IWizardNode node){
+ setSelectedNode(node);
+ }
abstract protected Object loadedTheObject(String path) throws Exception;
@@ -324,4 +347,12 @@
this.tableViewer = tableViewer;
}
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ }
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractStructuredDdataWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -3,9 +3,13 @@
*/
package org.jboss.tools.smooks.xml;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardNode;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
import org.jboss.tools.smooks.ui.IStrucutredDataCreationWizard;
/**
@@ -13,9 +17,14 @@
*
*/
public abstract class AbstractStructuredDdataWizard extends Wizard implements
- IStrucutredDataCreationWizard {
+ IStrucutredDataCreationWizard ,INewWizard{
+ protected IWorkbench workbench;
+
+ protected IStructuredSelection selection;
+
protected AbstractFileSelectionWizardPage page = null;
protected Object xsdElement = null;
+ protected IWizardNode strucutredDataCreationWizardNode;
/**
*
*/
@@ -27,6 +36,8 @@
public void addPages() {
if(page == null){
page = createAbstractFileSelectionWizardPage();
+ page.setSelection(this.selection);
+ page.activeNextWizardNode(strucutredDataCreationWizardNode);
}
this.addPage(page);
}
@@ -50,5 +61,17 @@
public void init(IEditorSite site, IEditorInput input) {
}
+ public void setNextDataCreationWizardNode(IWizardNode wizardNode) {
+ strucutredDataCreationWizardNode = wizardNode;
+ if(page != null){
+ page.activeNextWizardNode(strucutredDataCreationWizardNode);
+ }
+ }
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.workbench = workbench;
+ this.selection = selection;
+ }
+
+
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -21,6 +21,8 @@
* @Date Aug 18, 2008
*/
public class XMLStructuredDataWizard extends AbstractStructuredDdataWizard {
+
+
Properties properties = new Properties();
String filePath = null;
@@ -49,5 +51,4 @@
public Properties getProperties() {
return properties;
}
-
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -3,7 +3,6 @@
*/
package org.jboss.tools.smooks.xml.ui;
-import org.eclipse.jface.resource.ImageDescriptor;
import org.jboss.tools.smooks.xml.AbstractFileSelectionWizardPage;
import org.jboss.tools.smooks.xml.model.DocumentObject;
import org.jboss.tools.smooks.xml.model.XMLObjectAnalyzer;
@@ -14,11 +13,6 @@
public class XMLStructuredDataWizardPage extends
AbstractFileSelectionWizardPage {
- public XMLStructuredDataWizardPage(String pageName, String title,
- ImageDescriptor titleImage) {
- super(pageName, title, titleImage);
- setPageText();
- }
public XMLStructuredDataWizardPage(String pageName) {
super(pageName);
@@ -38,10 +32,8 @@
*/
@Override
protected Object loadedTheObject(String path) throws Exception {
-
XMLObjectAnalyzer analyzer = new XMLObjectAnalyzer();
DocumentObject doc = analyzer.analyze(path);
-
return doc;
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java 2008-10-11 15:42:39 UTC (rev 10783)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xsd/ui/XSDStructuredDataWizard.java 2008-10-13 08:01:29 UTC (rev 10784)
@@ -12,6 +12,7 @@
import java.util.Properties;
+import org.eclipse.jface.wizard.IWizardNode;
import org.jboss.tools.smooks.xml.AbstractFileSelectionWizardPage;
import org.jboss.tools.smooks.xml.AbstractStructuredDdataWizard;
import org.jboss.tools.smooks.xml.XmlActivator;
@@ -21,6 +22,7 @@
* @Date Aug 18, 2008
*/
public class XSDStructuredDataWizard extends AbstractStructuredDdataWizard {
+ IWizardNode wizard;
Properties properties = new Properties();
/* (non-Javadoc)
* @see org.jboss.tools.smooks.xml.AbstractStructuredDdataWizard#createAbstractFileSelectionWizardPage()
@@ -39,5 +41,4 @@
public Properties getProperties() {
return this.properties;
}
-
}
17 years, 3 months
JBoss Tools SVN: r10783 - in trunk/vpe/plugins: org.jboss.tools.vpe.resref and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-11 11:42:39 -0400 (Sat, 11 Oct 2008)
New Revision: 10783
Added:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ResourceReferencesDialogView.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourceReferencesComposite.java
trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
=JBIDE-2828, validation for el expressions was added
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-10-11 15:42:39 UTC (rev 10783)
@@ -138,7 +138,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -149,7 +149,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -192,7 +192,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEElReferenceExt">
<AttributeData AttributeName="location"/>
@@ -203,7 +203,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEElReference">
<AttributeData AttributeName="location"/>
@@ -244,7 +244,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location" Mandatory="no"/>
@@ -255,7 +255,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEGlobalElReference">
<AttributeData AttributeName="location"/>
@@ -297,7 +297,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Add El Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPEGlobalElReferenceExt">
<AttributeData AttributeName="location"/>
@@ -308,7 +308,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
displayName="Edit El Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPEGlobalElReferenceExt">
<AttributeData AttributeName="location"/>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/plugin.xml 2008-10-11 15:42:39 UTC (rev 10783)
@@ -4,5 +4,7 @@
<extension point="org.jboss.tools.common.model.classes">
<xclass id="org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"
class="org.jboss.tools.vpe.resref.core.VpeAddReferenceSupport"/>
+ <xclass id="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"
+ class="org.jboss.tools.vpe.resref.core.VpeELReferenceSupport"/>
</extension>
</plugin>
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ElVariablesComposite.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -3,13 +3,10 @@
import java.util.List;
import org.jboss.tools.common.el.core.ELReferenceList;
-import org.jboss.tools.common.meta.XAttribute;
-import org.jboss.tools.common.meta.XModelEntity;
-import org.jboss.tools.common.meta.constraint.impl.XAttributeConstraintFileFilter;
-import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.resref.core.ResourceReferenceList;
import org.jboss.tools.common.resref.ui.AbstractResourceReferencesComposite;
+import org.jboss.tools.common.resref.ui.BaseAddReferenceSupport;
import org.jboss.tools.common.resref.ui.ResourceReferencesTableProvider;
/**
@@ -37,7 +34,7 @@
*/
@Override
protected String getEntity() {
- return (file != null) ? "VPEElReference" : "VPEElReferenceExt";
+ return (file != null) ? "VPEElReference" : "VPEElReferenceExt"; //$NON-NLS-1$//$NON-NLS-2$
}
/**c
@@ -64,7 +61,7 @@
ResourceReference css = getDefaultResourceReference();
initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(),
+ boolean ok = BaseAddReferenceSupport.add(file, css, getReferenceArray(),
getEntity());
if (!ok)
return;
@@ -82,7 +79,7 @@
}
ResourceReference css = getReferenceArray()[index];
initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.edit(file, css,
+ boolean ok = BaseAddReferenceSupport.edit(file, css,
getReferenceArray(), getEntity());
if (ok) {
update();
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/Messages.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -42,4 +42,5 @@
public static String INCLUDED_TAG_LIBS;
public static String SUBSTITUTED_EL_EXPRESSIONS;
public static String ACTUAL_RUN_TIME_ABSOLUTE_FOLDER;
+ public static String INVALID_EL_EXPRESSION;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ResourceReferencesDialogView.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ResourceReferencesDialogView.java 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/ResourceReferencesDialogView.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -29,6 +29,7 @@
import org.jboss.tools.common.model.ui.wizards.query.AbstractQueryWizardView;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.resref.core.ResourceReferenceList;
+import org.jboss.tools.common.resref.ui.BaseAddReferenceSupport;
import org.jboss.tools.common.resref.ui.ResourceReferencesTableProvider;
public abstract class ResourceReferencesDialogView extends AbstractQueryWizardView {
@@ -124,7 +125,7 @@
protected void add(int index) {
ResourceReference css = new ResourceReference("", ResourceReference.FOLDER_SCOPE);
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ boolean ok = BaseAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
if(!ok) return;
dataList.add(css);
update();
@@ -134,7 +135,7 @@
protected void edit(int index) {
if(index < 0) return;
ResourceReference css = getReferenceArray()[index];
- boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ boolean ok = BaseAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
if(!ok) return;
update();
}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeELReferenceSupport.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -0,0 +1,29 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeELReferenceSupport extends VpeAddReferenceSupport {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.SpecialWizardSupport#getValidator(int)
+ */
+ @Override
+ public WizardDataValidator getValidator(int step) {
+ return new VpeElVariableValidator(this ,getStepId());
+ }
+
+}
Added: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java (rev 0)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeElVariableValidator.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.vpe.resref.core;
+
+import java.util.Properties;
+
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class VpeElVariableValidator extends DefaultWizardDataValidator {
+
+
+ /**
+ *
+ */
+ public VpeElVariableValidator(SpecialWizardSupport support, int step) {
+ super.setSupport(support, step);
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.common.meta.action.impl.DefaultWizardDataValidator#validate(java.util.Properties)
+ */
+ @Override
+ public void validate(Properties data) {
+
+ super.validate(data);
+ if( (getErrorMessage()!=null) ||
+ (getWarningMessage()!=null)) {
+ return;
+ }
+ String location = (String) data.get("location"); //$NON-NLS-1$
+ ELParser elParser = ELParserUtil.getDefaultFactory().createParser();
+ elParser.parse("#{"+location+'}'); //$NON-NLS-1$
+ if(elParser.getSyntaxErrors().size()>0) {
+ message=Messages.INVALID_EL_EXPRESSION;
+ }
+
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourceReferencesComposite.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourceReferencesComposite.java 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/VpeResourceReferencesComposite.java 2008-10-11 15:42:39 UTC (rev 10783)
@@ -16,6 +16,7 @@
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.common.resref.core.ResourceReferenceList;
import org.jboss.tools.common.resref.ui.AbstractResourceReferencesComposite;
+import org.jboss.tools.common.resref.ui.BaseAddReferenceSupport;
import org.jboss.tools.common.resref.ui.ResourceReferencesTableProvider;
public abstract class VpeResourceReferencesComposite extends AbstractResourceReferencesComposite {
@@ -41,7 +42,7 @@
ResourceReference css = getDefaultResourceReference();
initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
+ boolean ok = BaseAddReferenceSupport.add(file, css, getReferenceArray(), getEntity());
if(!ok) return;
dataList.add(css);
update();
@@ -52,7 +53,7 @@
if(index < 0) return;
ResourceReference css = getReferenceArray()[index];
initFilterInFileChooser();
- boolean ok = VpeAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
+ boolean ok = BaseAddReferenceSupport.edit(file, css, getReferenceArray(), getEntity());
if(!ok) return;
update();
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties 2008-10-11 13:26:44 UTC (rev 10782)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.resref/src/org/jboss/tools/vpe/resref/core/messages.properties 2008-10-11 15:42:39 UTC (rev 10783)
@@ -1,4 +1,5 @@
INCLUDED_CSS_FILES=Included css files
INCLUDED_TAG_LIBS=Included tag libs
SUBSTITUTED_EL_EXPRESSIONS=Substituted El expressions
-ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
\ No newline at end of file
+ACTUAL_RUN_TIME_ABSOLUTE_FOLDER=Actual Run-Time Absolute Folder
+INVALID_EL_EXPRESSION=Invalid El Expression
17 years, 3 months
JBoss Tools SVN: r10782 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-11 09:26:44 -0400 (Sat, 11 Oct 2008)
New Revision: 10782
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
Log:
=JBIDE-2828
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-11 01:14:05 UTC (rev 10781)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-11 13:26:44 UTC (rev 10782)
@@ -30,8 +30,10 @@
public JBIDE2828Test(String name) {
super(name);
}
- public void testJBIDE2828JbossELParser() {
+ public void testJBIDE2828JbossELParser() throws Throwable {
+ setException(null);
+
ELParserFactory jbossParserFactory = ELParserUtil.getJbossFactory();
assertNotNull("Couldn't get jboss parser factory", jbossParserFactory); //$NON-NLS-1$
@@ -40,23 +42,20 @@
assertNotNull(elParser);
- ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- assertNotNull(elModel1);
+ checkELParser(elParser);
+
+ if(getException()!=null) {
+
+ throw getException();
+ }
}
/**
* Test for default parser
*/
- public void testJBIDE2828DefaultELParser() {
+ public void testJBIDE2828DefaultELParser() throws Throwable {
+ setException(null);
+
ELParserFactory defaultParserFactory = ELParserUtil.getDefaultFactory();
assertNotNull("Couldn't get jboss parser factory", defaultParserFactory); //$NON-NLS-1$
@@ -65,17 +64,29 @@
assertNotNull(elParser);
+ checkELParser(elParser);
+
+ if(getException()!=null) {
+
+ throw getException();
+ }
+ }
+ /**
+ * Checks el parser
+ */
+ private void checkELParser(ELParser elParser) {
ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
- ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
- assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
assertNotNull(elModel1);
+ assertEquals("There shouldn't be errors",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+
+ ELModel elModel2 = elParser.parse("#{org.richfaces.SKIN}"); //$NON-NLS-1$
+ assertNotNull(elModel2);
+ assertEquals("There shouldn't be errors",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+
+ ELModel elModel3 = elParser.parse("#{klsjdf lsaijf aslkjd; sikjfd}"); //$NON-NLS-1$
+ assertNotNull(elModel3);
+ assertTrue("There should be errorrs", elParser.getSyntaxErrors().size()>0); //$NON-NLS-1$
+
}
}
17 years, 3 months
JBoss Tools SVN: r10781 - in trunk: common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-10 21:14:05 -0400 (Fri, 10 Oct 2008)
New Revision: 10781
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/forwardHiperlinkPage2Tests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkPage1Tests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/includeHiperlinkPage2Tests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkPage1Tests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
Log:
add nJunit tests fro common.text.ext plugin
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1,5 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+<jsp:useBean id="b1" class="org.jboss.tools.test.TestBean1"></jsp:useBean>
+<jsp:getProperty property="property1" name="b1"/>
+
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/beanHyperlinkTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/forwardHiperlinkPage2Tests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/forwardHiperlinkPage2Tests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/forwardHiperlinkPage2Tests.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1 @@
+<!-- forward test page -->
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forward/forwardHiperlinkPage2Tests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkPage1Tests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkPage1Tests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkPage1Tests.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1 @@
+<!-- forward test page -->
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkPage1Tests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1,2 @@
+<jsp:forward page="forward/forwardHiperlinkPage2Tests.jsp"></jsp:forward>
+<jsp:forward page="forwardHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/forwardHiperlinkTests.page.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/includeHiperlinkPage2Tests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/includeHiperlinkPage2Tests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/includeHiperlinkPage2Tests.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1 @@
+<!-- include test page -->
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/include/includeHiperlinkPage2Tests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkPage1Tests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkPage1Tests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkPage1Tests.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1 @@
+<!-- include test page -->
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkPage1Tests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp 2008-10-11 01:14:05 UTC (rev 10781)
@@ -0,0 +1,2 @@
+<jsp:forward page="include/includeHiperlinkPage2Tests.jsp"></jsp:forward>
+<jsp:forward page="includeHiperlinkPage1Tests.jsp"></jsp:forward>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/includeHiperlinkTests.page.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-10 18:50:50 UTC (rev 10780)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-11 01:14:05 UTC (rev 10781)
@@ -35,14 +35,14 @@
public class OpenOnsTest extends TestCase {
- public static final String STYLE_OPENON_PROJECT = "HiperlinksTestProject";
+ public static final String OPENON_TEST_PROJECT = "HiperlinksTestProject";
public IProject project = null;
protected void setUp() {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(
- STYLE_OPENON_PROJECT);
+ OPENON_TEST_PROJECT);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
JobUtils.waitForIdle();
}
@@ -55,12 +55,10 @@
super("styleClass OpenOn tests");
}
- public static final String WEB_XML_FILE_PATH = "WebContent/WEB-INF/web.xml";
+ public static final String WEB_XML_FILE_PATH = OPENON_TEST_PROJECT+"/WebContent/WEB-INF/web.xml";
public void testFilterNameOpenOn() throws PartInitException, BadLocationException {
- IFile webXml = project.getFile(WEB_XML_FILE_PATH);
- IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
- IEditorPart editor = WorkbenchUtils.openEditor(webXml, descriptor.getId());
+ IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
@@ -84,9 +82,7 @@
}
public void testRoleNameOpenOn() throws PartInitException, BadLocationException {
- IFile webXml = project.getFile(WEB_XML_FILE_PATH);
- IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
- IEditorPart editor = WorkbenchUtils.openEditor(webXml, descriptor.getId());
+ IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
@@ -108,9 +104,7 @@
}
public void testServletNameOpenOn() throws PartInitException, BadLocationException {
- IFile webXml = project.getFile(WEB_XML_FILE_PATH);
- IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
- IEditorPart editor = WorkbenchUtils.openEditor(webXml, descriptor.getId());
+ IEditorPart editor = WorkbenchUtils.openEditor(WEB_XML_FILE_PATH);
editor = ((EditorPartWrapper)editor).getEditor();
JobUtils.waitForIdle();
DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
@@ -137,11 +131,10 @@
assertEquals("<servlet-name>", selection.getText());
}
- public static final String TAGLIB_URI_TEST_FILE = "WebContent/tldUriHyperlinkTests.jsp";
+ public static final String TAGLIB_URI_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/tldUriHyperlinkTests.jsp";
public void testTaglibUriFromJarOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(TAGLIB_URI_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
@@ -155,17 +148,17 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
System.out.println(fileName);
assertTrue("jsf_core.tld".equals(fileName));
}
- public static final String TAGLIB_URI_JSP_ROOT_TEST_FILE = "WebContent/jspTagsHyperlinkTests.jsp";
+ public static final String TAGLIB_URI_JSP_ROOT_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/jspTagsHyperlinkTests.jsp";
public void testTaglibUriFromJarinJspRootOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(TAGLIB_URI_JSP_ROOT_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(TAGLIB_URI_JSP_ROOT_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
@@ -179,6 +172,8 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
+
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -186,13 +181,12 @@
assertTrue("jsf_core.tld".equals(fileName));
}
- public static final String STYLE_TEST_FILE = "WebContent/styleHyperlinkTests.jsp";
- public static final String CSS1_TEST_FILE = "WebContent/stylesheet/style1.css";
- public static final String CSS2_TEST_FILE = "WebContent/stylesheet/style2.css";
+ public static final String STYLE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/styleHyperlinkTests.jsp";
+ public static final String CSS1_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/stylesheet/style1.css";
+ public static final String CSS2_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/stylesheet/style2.css";
public void testStylesheetOpenOn() throws BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(STYLE_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
@@ -206,6 +200,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -213,8 +208,7 @@
}
public void testStyleClassOpenOns() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(STYLE_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(STYLE_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
@@ -228,6 +222,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -241,6 +236,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
@@ -250,23 +246,24 @@
"style-class6", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
links[0].open();
+ JobUtils.waitForIdle();
assertNotNull(links);
assertTrue(links.length!=0);
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
assertTrue("style2.css".equals(fileName));
}
- public static final String CLASS_TEST_FILE = "WebContent/classHyperlinkTests.jsp";
- public static final String CLASS1_TEST_FILE = "JavaSource/org/jboss/test/ChangeListenerInstance.java";
+ public static final String CLASS_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/classHyperlinkTests.jsp";
+ public static final String CLASS1_TEST_FILE = OPENON_TEST_PROJECT + "/JavaSource/org/jboss/test/ChangeListenerInstance.java";
public void testClassNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(CLASS_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(CLASS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
@@ -279,6 +276,7 @@
//assertNotNull(links[0].getHyperlinkText());
assertNotNull(links[0].toString());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
@@ -286,8 +284,7 @@
}
public void testTaglibTagNameOpenOn() throws CoreException, BadLocationException {
- IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(CLASS_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ IEditorPart editor = WorkbenchUtils.openEditor(CLASS_TEST_FILE);
assertTrue(editor instanceof JSPMultiPageEditor);
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
@@ -301,11 +298,121 @@
assertNotNull(links[0].toString());
System.out.println(links[0].getClass().getName());
links[0].open();
+ JobUtils.waitForIdle();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
assertTrue("jsf_core.tld".equals(fileName));
}
+ public static final String USE_BEAN_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/beanHyperlinkTests.jsp";
+ public void testUseBeanClassOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(USE_BEAN_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "org.jboss.tools.test.TestBean1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("TestBean1.java".equals(fileName));
+
+ reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(reg.getOffset(),
+ "b1", true, true, false, false);
+ links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<jsp:useBean id=\"b1\" class=\"org.jboss.tools.test.TestBean1\">", selection.getText());
+ }
+
+ public static final String FORWARD_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/forwardHiperlinkTests.jsp";
+
+
+ public void testJspForwardOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(FORWARD_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(viewer.getDocument()).find(0,
+ "forward/forwardHiperlinkPage2Tests.jsp", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("forwardHiperlinkPage2Tests.jsp".equals(fileName));
+
+ reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "forwardHiperlinkPage1Tests.jsp", true, true, false, false);
+ links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ fileName = editor.getEditorInput().getName();
+ assertTrue("forwardHiperlinkPage1Tests.jsp".equals(fileName));
+ }
+
+ public static final String INCLUDE_TEST_FILE = OPENON_TEST_PROJECT + "/WebContent/includeHiperlinkTests.page.jsp";
+
+
+ public void testJspIncludeOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(INCLUDE_TEST_FILE);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "include/includeHiperlinkPage2Tests.jsp", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("includeHiperlinkPage2Tests.jsp".equals(fileName));
+
+ reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "includeHiperlinkPage1Tests.jsp", true, true, false, false);
+ links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ JobUtils.waitForIdle();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ fileName = editor.getEditorInput().getName();
+ assertTrue("includeHiperlinkPage1Tests.jsp".equals(fileName));
+ }
}
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-10 18:50:50 UTC (rev 10780)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-10-11 01:14:05 UTC (rev 10781)
@@ -62,23 +62,6 @@
tplPrjLcStr = FileLocator.resolve(bundle.getEntry(templLocation))
.getFile();
IProject importedPrj = importProjectIntoWorkspace(tplPrjLcStr, new Path(tplPrjLcStr).lastSegment());
-// IProject importedPrj = createEclipseProject(bundle,tplPrjLcStr,monitor);
-// ImportOperation op = new ImportOperation(importedPrj.getFullPath(),
-// new File(tplPrjLcStr),
-// FileSystemStructureProvider.INSTANCE,
-// new IOverwriteQuery() {
-// public String queryOverwrite(String pathString) {
-// return IOverwriteQuery.ALL;
-// }},
-// Arrays.asList(new File(tplPrjLcStr).listFiles()));
-//
-// op.setCreateContainerStructure(false);
-// if( Display.getCurrent() == null || Display.getCurrent().getActiveShell() == null ) {
-// op.setContext(new Shell());
-// } else {
-// op.setContext(Display.getCurrent().getActiveShell());
-// }
-// op.run(monitor);
return importedPrj;
}
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-10 18:50:50 UTC (rev 10780)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/WorkbenchUtils.java 2008-10-11 01:14:05 UTC (rev 10781)
@@ -18,10 +18,12 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferenceManager;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
@@ -29,6 +31,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
+import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.wizards.IWizardDescriptor;
@@ -88,10 +91,10 @@
.getActiveShell(), project, pageId, new String[] {pageId}, null);
}
- public static IEditorPart openEditor(IFile inputFile, String editorId) {
+ public static IEditorPart openEditor(String inputFile) {
IEditorPart part = null;
try {
- part = getWorkbenchActivePage().openEditor(new FileEditorInput(inputFile), editorId);
+ part = IDE.openEditor(getWorkbenchActivePage(),ResourcesPlugin.getWorkspace().getRoot().getFile(new Path(inputFile)));
} catch (PartInitException e) {
e.printStackTrace();
}
17 years, 3 months
JBoss Tools SVN: r10780 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-10 14:50:50 -0400 (Fri, 10 Oct 2008)
New Revision: 10780
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
Log:
fix results veb page errors
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2008-10-10 16:59:10 UTC (rev 10779)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-auto.xml 2008-10-10 18:50:50 UTC (rev 10780)
@@ -1,2 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
-<vpe:templates/>
+<vpe:templates>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any style="color:red" tag-for-display="tag-name1" value="tag-value"/>
+ </vpe:template>
+ </vpe:tag>
+ <vpe:tag case-sensitive="no" name="">
+ <vpe:template children="no" modify="no">
+ <vpe:any style="color:white" tag-for-display="tag-name2" value="tag-value"/>
+ </vpe:template>
+ </vpe:tag>
+</vpe:templates>
17 years, 3 months
JBoss Tools SVN: r10779 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-10 12:59:10 -0400 (Fri, 10 Oct 2008)
New Revision: 10779
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-388
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-10 16:18:15 UTC (rev 10778)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-10 16:59:10 UTC (rev 10779)
@@ -14,23 +14,41 @@
<para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will describe all its features to you.</para>
+ <section id="birt_designer_UI" xreflabel="birt_designer_UI">
+ <title>BIRT User Interface</title>
+
+ <para>The central part of the user interface is the Layout Editor. It displays the whole process of building a report and contains the following tabs:</para>
+
+ <itemizedlist>
+ <listitem><para><emphasis role="bold">Layout</emphasis> - this is an area where you can edit your report design;</para></listitem>
+ <listitem><para><emphasis role="bold">Preview</emphasis> - runs your report created and shows the output;</para></listitem>
+ <listitem><para><emphasis role="bold">Script</emphasis> - on this page you can add JavaScript to your report to customize its behavior;</para></listitem>
+ <listitem><para><emphasis role="bold">XML Source</emphasis> - this is an area where you can view and modify the XML source of your report;</para></listitem>
+ <listitem><para><emphasis role="bold">Master Page</emphasis> - use it to format page data.</para></listitem>
+
+
+
+
+ </itemizedlist>
+
+ </section>
+
<section id="birt_designer_features">
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
<itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
- <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
- <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
- <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
- <listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
- <listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
- <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT reports are organized as a tree structure with the overall report as the root, and separate categories for styles, report content, data sources, data sets, report parameters and more. The Outline view provides a compact overview of your entire report structure.</para></listitem>
- <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Learning a new tool is always a challenge, but Eclipse offers an innovative solution: cheat sheets. These are short bits of documentation that walk you through new tasks.</para></listitem>
- <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
- <listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
- <listitem><para><emphasis role="bold">Expression Builder </emphasis> - BIRT expressions are really just simple scripts that return a value. Expressions are used for assigning data values to report elements, building image locations, hyperlinks, parameter default values and many other places. Expressions are constructed within BIRT using the Expression Builder.</para></listitem>
-
- </itemizedlist>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
+ <listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
+ <listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
+ <listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
+ <listitem><para><emphasis role="bold">Expression Builder </emphasis> - BIRT expressions are really just simple scripts that return a value. Expressions are used for assigning data values to report elements, building image locations, hyperlinks, parameter default values and many other places. Expressions are constructed within BIRT using the Expression Builder.</para></listitem>
+ <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Learning a new tool is always a challenge, but Eclipse offers an innovative solution: cheat sheets. These are short bits of documentation that walk you through new tasks.</para></listitem>
+ <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT reports are organized as a tree structure with the overall report as the root, and separate categories for styles, report content, data sources, data sets, report parameters and more. The Outline view provides a compact overview of your entire report structure.</para></listitem>
+ </itemizedlist>
17 years, 3 months
JBoss Tools SVN: r10778 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces: template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-10 12:18:15 -0400 (Fri, 10 Oct 2008)
New Revision: 10778
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
Log:
Minor changes.
Class AttributeMap moved to org.jboss.tools.jsf.vpe.richfaces.template.util package
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java 2008-10-10 15:25:59 UTC (rev 10777)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java 2008-10-10 16:18:15 UTC (rev 10778)
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2008 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.vpe.richfaces;
-
-import org.w3c.dom.Element;
-
-/**
- * A wrapper of DOM Element that can extract its attributes as objects of different types.
- * The methods of the class never throw exceptions. In case if parsing is impossible they
- * always return a correct value.
- *
- * @author yradtsevich
- * @see Element
- */
-public class AttributeMap {
- private Element element;
-
- public AttributeMap(Element element) {
- this.element = element;
- }
-
- /**
- * A wrapper of <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
- *
- * @param attributeName attribute name
- * @return <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
- *
- * @see ComponentUtil
- */
- public String getString(String attributeName) {
- return ComponentUtil.getAttribute(element, attributeName);
- }
-
- /**
- * Returns Boolean representation of the attribute.
- *
- * @param attributeName attribute name
- * @return attribute value.
- * <code>Boolean.TRUE</code>, if the attribute equals "true",
- * <code>Boolean.False</code>, if the attribute equals "false",
- * <code>null</code> otherwise.
- */
- public Boolean getBoolean(String attributeName) {
- String attribute = element.getAttribute(attributeName);
-
- Boolean ret;
-
- if ("true".equals(attribute)) {
- ret = Boolean.TRUE;
- } else if ("false".equals(attribute)) {
- ret = Boolean.FALSE;
- } else {
- ret = null;
- }
-
- return ret;
- }
-
- public boolean isBlank(String attributeName) {
- String value = getString(attributeName);
- return ComponentUtil.isBlank(value);
- }
-}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10 15:25:59 UTC (rev 10777)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10 16:18:15 UTC (rev 10778)
@@ -17,8 +17,8 @@
import java.util.List;
import java.util.Map;
-import org.jboss.tools.jsf.vpe.richfaces.AttributeMap;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.AttributeMap;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.context.VpePageContext;
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java (from rev 10777, trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java 2008-10-10 16:18:15 UTC (rev 10778)
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template.util;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.w3c.dom.Element;
+
+/**
+ * A wrapper of DOM Element that can extract its attributes as objects of different types.
+ * The methods of the class never throw exceptions. In case if parsing is impossible they
+ * always return a correct value.
+ *
+ * @author yradtsevich
+ * @see Element
+ */
+public class AttributeMap {
+ private Element element;
+
+ public AttributeMap(Element element) {
+ this.element = element;
+ }
+
+ /**
+ * A wrapper of <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
+ *
+ * @param attributeName attribute name
+ * @return <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
+ *
+ * @see ComponentUtil
+ */
+ public String getString(String attributeName) {
+ return ComponentUtil.getAttribute(element, attributeName);
+ }
+
+ /**
+ * Returns Boolean representation of the attribute.
+ *
+ * @param attributeName attribute name
+ * @return attribute value.
+ * <code>Boolean.TRUE</code>, if the attribute equals "true",
+ * <code>Boolean.False</code>, if the attribute equals "false",
+ * <code>null</code> otherwise.
+ */
+ public Boolean getBoolean(String attributeName) {
+ String attribute = element.getAttribute(attributeName);
+
+ Boolean ret;
+
+ if ("true".equals(attribute)) {
+ ret = Boolean.TRUE;
+ } else if ("false".equals(attribute)) {
+ ret = Boolean.FALSE;
+ } else {
+ ret = null;
+ }
+
+ return ret;
+ }
+
+ public boolean isBlank(String attributeName) {
+ String value = getString(attributeName);
+ return ComponentUtil.isBlank(value);
+ }
+}
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/util/AttributeMap.java
___________________________________________________________________
Name: svn:mergeinfo
+
17 years, 3 months
JBoss Tools SVN: r10777 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-10-10 11:25:59 -0400 (Fri, 10 Oct 2008)
New Revision: 10777
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down-disabled.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
Log:
Bug fix https://jira.jboss.org/jira/browse/JBIDE-2856.
Part 2.
Added support of custom button icons and 'disabled' attribute in RichFaces Combo Box.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/comboBox.css 2008-10-10 15:25:59 UTC (rev 10777)
@@ -72,7 +72,7 @@
border-top-color: #C4C0B9;
}
-input.rich-combobox-button-icon-inactive {
+input.rich-combobox-button-icon-inactive, input.rich-combobox-button-icon-disabled {
background: transparent none no-repeat scroll center;
cursor: pointer;
}
@@ -81,6 +81,10 @@
background-image: url(down.gif);
}
+input.rich-combobox-button-icon-disabled {
+ background-image: url(down-disabled.gif);
+}
+
.rich-combobox-strut {
border: 1px solid #C0C0C0;
margin: 0pt;
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down-disabled.gif
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/comboBox/down-disabled.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/AttributeMap.java 2008-10-10 15:25:59 UTC (rev 10777)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces;
+
+import org.w3c.dom.Element;
+
+/**
+ * A wrapper of DOM Element that can extract its attributes as objects of different types.
+ * The methods of the class never throw exceptions. In case if parsing is impossible they
+ * always return a correct value.
+ *
+ * @author yradtsevich
+ * @see Element
+ */
+public class AttributeMap {
+ private Element element;
+
+ public AttributeMap(Element element) {
+ this.element = element;
+ }
+
+ /**
+ * A wrapper of <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
+ *
+ * @param attributeName attribute name
+ * @return <code>ComponentUtil.getAttribute(sourceElement, attributeName)</code>
+ *
+ * @see ComponentUtil
+ */
+ public String getString(String attributeName) {
+ return ComponentUtil.getAttribute(element, attributeName);
+ }
+
+ /**
+ * Returns Boolean representation of the attribute.
+ *
+ * @param attributeName attribute name
+ * @return attribute value.
+ * <code>Boolean.TRUE</code>, if the attribute equals "true",
+ * <code>Boolean.False</code>, if the attribute equals "false",
+ * <code>null</code> otherwise.
+ */
+ public Boolean getBoolean(String attributeName) {
+ String attribute = element.getAttribute(attributeName);
+
+ Boolean ret;
+
+ if ("true".equals(attribute)) {
+ ret = Boolean.TRUE;
+ } else if ("false".equals(attribute)) {
+ ret = Boolean.FALSE;
+ } else {
+ ret = null;
+ }
+
+ return ret;
+ }
+
+ public boolean isBlank(String attributeName) {
+ String value = getString(attributeName);
+ return ComponentUtil.isBlank(value);
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesComboBoxTemplate.java 2008-10-10 15:25:59 UTC (rev 10777)
@@ -12,12 +12,12 @@
package org.jboss.tools.jsf.vpe.richfaces.template;
-
import java.text.MessageFormat;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.jboss.tools.jsf.vpe.richfaces.AttributeMap;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
@@ -28,6 +28,7 @@
import org.jboss.tools.vpe.editor.template.VpeToggableTemplate;
import org.jboss.tools.vpe.editor.util.Constants;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMNode;
@@ -38,13 +39,21 @@
/**
- * The Class RichFacesComboBox2Template.
+ * The Class RichFacesComboBoxTemplate.
*
* @author Eugene Stherbin
*/
public class RichFacesComboBoxTemplate extends AbstractEditableRichFacesTemplate implements VpeToggableTemplate {
- /** CSS_FILE_NAME. */
+ private static final String BUTTON_ICON_CLASSES_DISABLED = "rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String BUTTON_ICON_CLASSES = "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"; //$NON-NLS-1$
+ private static final String SECOND_DIV = "secondDiv"; //$NON-NLS-1$
+ private static final String THIRD_DIV = "thirdDiv"; //$NON-NLS-1$
+ private static final String THIRD_EMPTY_DIV = "thirdEmptyDiv"; //$NON-NLS-1$
+ private static final String TEXT_FIELD = "textField"; //$NON-NLS-1$
+ private static final String BUTTON_ICON = "buttonIcon"; //$NON-NLS-1$
+
+ /** CSS_FILE_NAME. */
private static final String CSS_FILE_NAME = "comboBox/comboBox.css"; //$NON-NLS-1$
/** The Constant DEFAULT_ALIGN. */
@@ -74,8 +83,8 @@
/** The Constant RICH_COMBOBOX_INPUT_CELL_STYLE. */
private static final String RICH_COMBOBOX_INPUT_CELL_STYLE = "rich-combobox-inputCell"; //$NON-NLS-1$
- /** The Constant SECOND_INPUT. */
- private static final String SECOND_INPUT = "secondInput"; //$NON-NLS-1$
+ /** The Constant BUTTON_BACKGROUND. */
+ private static final String BUTTON_BACKGROUND = "buttonBackground"; //$NON-NLS-1$
/** The Constant STYLE_EXT. */
private static final String STYLE_EXT = "richFacesComboBox"; //$NON-NLS-1$
@@ -89,7 +98,8 @@
private static final String ZERO_STRING = "0"; //$NON-NLS-1$
/** The source align. */
- private String sourceAlign;
+ // Commented because of not working alignment in RichFaces implementation
+ // private String sourceAlign;
/** The source button style. */
private String sourceButtonStyle;
@@ -133,7 +143,13 @@
/** Source button icon **/
private String sourceButtonIcon;
+
+ private String sourceButtonIconInactive;
+
+ private String sourceButtonIconDisabled;
+ private boolean disabled;
+
/**
* The Constructor.
*/
@@ -186,11 +202,16 @@
rootDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+Constants.COLON+sourceWidth);
final nsIDOMElement comboBoxDiv = visualDocument.createElement(HTML.TAG_DIV);
final nsIDOMElement secondDiv = visualDocument.createElement(HTML.TAG_DIV);
- comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign); //$NON-NLS-1$
- secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+
+ // Commented because of not working alignment in RichFaces implementation
+ // comboBoxDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+ // secondDiv.setAttribute(HTML.ATTR_ALIGN, this.sourceAlign);
+
+
//comboBoxDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
- secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("secondDiv")); //$NON-NLS-1$
+ secondDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_DIV)); //$NON-NLS-1$
String secondDivSubStyle = "; position: {0}; z-index: {1} ;"; //$NON-NLS-1$
+
if (isToggle) {
secondDivSubStyle = MessageFormat.format(secondDivSubStyle, "relative", "2"); //$NON-NLS-1$ //$NON-NLS-2$
} else {
@@ -202,15 +223,15 @@
secondDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + this.sourceListWidth
+ Constants.SEMICOLON + secondDivSubStyle + sourceStyle);
final nsIDOMElement thirdDiv = visualDocument.createElement(HTML.TAG_DIV);
- thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("thirdDiv")); //$NON-NLS-1$
+ thirdDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_DIV));
thirdDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON + this.sourceWidth
+ "; z-index: 1;"); //$NON-NLS-1$
- final nsIDOMElement firstInput = visualDocument.createElement(HTML.TAG_INPUT);
- firstInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
- ;
- firstInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get("firstInput") + Constants.WHITE_SPACE + sourceInputClass); //$NON-NLS-1$
- firstInput.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
- firstInput.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+ Constants.COLON + calculateWithForDiv(this.sourceWidth, 17) + Constants.SEMICOLON
+ final nsIDOMElement textField = visualDocument.createElement(HTML.TAG_INPUT);
+ textField.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ textField.setAttribute(HTML.ATTR_CLASS, styleClasess.get(TEXT_FIELD) + Constants.WHITE_SPACE + sourceInputClass); //$NON-NLS-1$
+ textField.setAttribute("autocomplete", "off"); //$NON-NLS-1$ //$NON-NLS-2$
+ textField.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH+ Constants.COLON + calculateWithForDiv(this.sourceWidth, 17) + Constants.SEMICOLON
+ sourceInputStyle);
String value = null;
if (ComponentUtil.isNotBlank(this.sourceDefaultLabel)) {
@@ -220,33 +241,49 @@
}
if (value != null) {
- firstInput.setAttribute(RichFaces.ATTR_VALUE, value);
+ textField.setAttribute(RichFaces.ATTR_VALUE, value);
}
- final nsIDOMElement secondInput = visualDocument.createElement(HTML.TAG_INPUT);
- secondInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
- ;
- secondInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get(SECOND_INPUT));
- secondInput.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- secondInput.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ final nsIDOMElement buttonBackground = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonBackground.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+
+ if (disabled) {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES_DISABLED); //$NON-NLS-1$
+ } else {
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES); //$NON-NLS-1$
+ }
+
+ buttonBackground.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_BACKGROUND));
+ buttonBackground.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonBackground.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
if (this.sourceButtonStyle != null) {
- secondInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ buttonBackground.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
}
//
- final nsIDOMElement thirdInput = visualDocument.createElement(HTML.TAG_INPUT);
- thirdInput.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
+ final nsIDOMElement buttonIcon = visualDocument.createElement(HTML.TAG_INPUT);
+ buttonIcon.setAttribute(HTML.ATTR_TYPE, HTML.VALUE_TEXT_TYPE);
;
- thirdInput.setAttribute(HTML.ATTR_CLASS, styleClasess.get("thirdInput")); //$NON-NLS-1$
- thirdInput.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
- thirdInput.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
+ buttonIcon.setAttribute(HTML.ATTR_CLASS, styleClasess.get(BUTTON_ICON)); //$NON-NLS-1$
+ buttonIcon.setAttribute(HTML.ATTR_READONLY, Constants.TRUE);
+ buttonIcon.setAttribute(RichFacesAbstractInplaceTemplate.VPE_USER_TOGGLE_ID_ATTR, String.valueOf(0));
if (this.sourceButtonStyle != null) {
- thirdInput.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, sourceButtonStyle);
}
-
-// if (ComponentUtil.isNotBlank(this.sourceButtonIcon) && (this.sourceButtonIcon != IMAGE_NAME_DOWN)) {
-// thirdInput.setAttribute(HTML.ATTR_STYLE, thirdInput.getAttribute(HTML.ATTR_STYLE) + " ; background-image: url("
-// + this.sourceButtonIcon + ")");
-// }
+ String actualSourceButton;
+ if (disabled) {
+ actualSourceButton = sourceButtonIconDisabled;
+ } else if (isToggle) {
+ actualSourceButton = sourceButtonIcon;
+ } else {
+ actualSourceButton = sourceButtonIconInactive;
+ }
+
+ if (ComponentUtil.isNotBlank(actualSourceButton) && (actualSourceButton != IMAGE_NAME_DOWN)) {
+ String buttonIconPath = VpeStyleUtil.addFullPathToImgSrc(actualSourceButton, pageContext, true);
+ buttonIconPath = buttonIconPath.replace('\\', '/');
+ String style = "background-image: url(" + buttonIconPath + ")"; //$NON-NLS-1$ //$NON-NLS-2$
+ buttonIcon.setAttribute(HTML.ATTR_STYLE, buttonIcon.getAttribute(HTML.ATTR_STYLE) + style);
+ }
final nsIDOMElement forthEmptyDiv = visualDocument.createElement(HTML.TAG_DIV);
forthEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("forthEmptyDiv")); //$NON-NLS-1$
forthEmptyDiv.setAttribute(HTML.ATTR_STYLE, HTML.STYLE_PARAMETER_WIDTH + Constants.COLON
@@ -260,9 +297,9 @@
if (isToggle) {
comboBoxDiv.appendChild(createToogleDiv(pageContext, source, visualDocument));
}
- thirdDiv.appendChild(firstInput);
- thirdDiv.appendChild(secondInput);
- thirdDiv.appendChild(thirdInput);
+ thirdDiv.appendChild(textField);
+ thirdDiv.appendChild(buttonBackground);
+ thirdDiv.appendChild(buttonIcon);
thirdDiv.appendChild(forthEmptyDiv);
final VpeCreationData creationData = new VpeCreationData(rootDiv);
@@ -287,7 +324,7 @@
thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, this.sourceListStyle + Constants.SEMICOLON
+ " z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
- thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get("thirdEmptyDiv") + " " + this.sourceListClass); //$NON-NLS-1$ //$NON-NLS-2$
+ thirdEmptyDiv.setAttribute(HTML.ATTR_CLASS, styleClasess.get(THIRD_EMPTY_DIV) + " " + this.sourceListClass); //$NON-NLS-1$ //$NON-NLS-2$
thirdEmptyDiv.setAttribute(HTML.ATTR_STYLE, "z-index: 3; position: absolute; visibility: visible; top: 16px; left: 0px;"); //$NON-NLS-1$
final nsIDOMElement shadovDiv = visualDocument.createElement(HTML.TAG_DIV);
@@ -567,12 +604,12 @@
* Inits the default classes.
*/
private void initDefaultClasses() {
- styleClasess.put("secondDiv", "rich-combobox-font rich-combobox"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put("thirdDiv", "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put("thirdEmptyDiv", "rich-combobox-list-cord"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put("firstInput", "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$ //$NON-NLS-2$
- styleClasess.put(SECOND_INPUT, "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
- styleClasess.put("thirdInput", "rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"); //$NON-NLS-1$ //$NON-NLS-2$
+ styleClasess.put(SECOND_DIV, "rich-combobox-font rich-combobox"); //$NON-NLS-1$ //$NON-NLS-2$
+ styleClasess.put(THIRD_DIV, "rich-combobox-font rich-combobox-shell"); //$NON-NLS-1$ //$NON-NLS-2$
+ styleClasess.put(THIRD_EMPTY_DIV, "rich-combobox-list-cord"); //$NON-NLS-1$ //$NON-NLS-2$
+ styleClasess.put(TEXT_FIELD, "rich-combobox-font-disabled rich-combobox-input-inactive"); //$NON-NLS-1$ //$NON-NLS-2$
+ styleClasess.put(BUTTON_BACKGROUND, "rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"); //$NON-NLS-1$
+ styleClasess.put(BUTTON_ICON, BUTTON_ICON_CLASSES); //$NON-NLS-1$ //$NON-NLS-2$
styleClasess.put("forthEmptyDiv", "rich-combobox-strut rich-combobox-font"); //$NON-NLS-1$ //$NON-NLS-2$
}
@@ -602,24 +639,31 @@
* @param source the source
*/
private void prepareData(Element source) {
- this.sourceAlign = source.getAttribute(RichFaces.ATTR_ALIGN);
- if (ComponentUtil.isBlank(this.sourceAlign)) {
- this.sourceAlign = DEFAULT_ALIGN;
- }
- this.sourceListWidth = source.getAttribute(RichFaces.ATTR_LIST_WIDTH);
+ AttributeMap attributeMap = new AttributeMap(source);
- if (ComponentUtil.isBlank(this.sourceListWidth)) {
- this.sourceListWidth = DEFAULT_LIST_WIDTH;
+ // Commented because of not working alignment in RichFaces implementation
+ // if (attributeMap.isBlank(RichFaces.ATTR_ALIGN)) {
+ // this.sourceAlign = DEFAULT_ALIGN;
+ // } else {
+ // this.sourceAlign = attributeMap.getString(RichFaces.ATTR_ALIGN);
+ // }
+
+ if (attributeMap.isBlank(RichFaces.ATTR_LIST_WIDTH)) {
+ this.sourceListWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ this.sourceListWidth = attributeMap.getString(RichFaces.ATTR_LIST_WIDTH);
}
- this.sourceListHeight = source.getAttribute(RichFaces.ATTR_LIST_HEIGHT);
-
- this.sourceWidth = source.getAttribute(RichFaces.ATTR_WIDTH);
+ this.sourceListHeight = attributeMap.getString(RichFaces.ATTR_LIST_HEIGHT);
- if (ComponentUtil.isBlank(this.sourceWidth)) {
- this.sourceWidth = DEFAULT_LIST_WIDTH;
- }else if(ComponentUtil.isNotBlank(this.sourceWidth) && (this.sourceListWidth == DEFAULT_LIST_WIDTH)){
- this.sourceListWidth = this.sourceWidth;
+ if (attributeMap.isBlank(RichFaces.ATTR_WIDTH)) {
+ this.sourceWidth = DEFAULT_LIST_WIDTH;
+ } else {
+ this.sourceWidth = attributeMap.getString(RichFaces.ATTR_WIDTH);
+
+ if(this.sourceListWidth == DEFAULT_LIST_WIDTH) {
+ this.sourceListWidth = this.sourceWidth;
+ }
}
if (ComponentUtil.isNotBlank(this.sourceWidth) && (this.sourceWidth != DEFAULT_LIST_WIDTH)) {
@@ -633,26 +677,29 @@
}
}
- this.sourceDefaultLabel = ComponentUtil.getAttribute(source, "defaultLabel"); //$NON-NLS-1$
- this.sourceValue = ComponentUtil.getAttribute(source, RichFaces.ATTR_VALUE);
+ this.sourceDefaultLabel = attributeMap.getString("defaultLabel"); //$NON-NLS-1$
+ this.sourceValue = attributeMap.getString( RichFaces.ATTR_VALUE);
- this.sourceButtonStyle = ComponentUtil.getAttribute(source, "buttonStyle"); //$NON-NLS-1$
+ this.sourceButtonStyle = attributeMap.getString("buttonStyle"); //$NON-NLS-1$
- final String sourceStyleClasess = ComponentUtil.getAttribute(source, RichFaces.ATTR_STYLE_CLASS);
+ final String sourceStyleClasess = attributeMap.getString(RichFaces.ATTR_STYLE_CLASS);
if (ComponentUtil.isNotBlank(sourceStyleClasess)) {
- styleClasess.put("secondDiv", styleClasess.get("secondDiv") + " " + sourceStyleClasess); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ styleClasess.put(SECOND_DIV, styleClasess.get(SECOND_DIV) + " " + sourceStyleClasess); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
- this.sourceStyle = ComponentUtil.getAttribute(source, HTML.ATTR_STYLE);
- this.sourceInputStyle = ComponentUtil.getAttribute(source, "inputStyle"); //$NON-NLS-1$
- this.sourceInputClass = ComponentUtil.getAttribute(source, "inputClass"); //$NON-NLS-1$
- this.sourceListClass = ComponentUtil.getAttribute(source, "listClass"); //$NON-NLS-1$
- this.sourceListStyle = ComponentUtil.getAttribute(source, "listStyle"); //$NON-NLS-1$
- this.sourceItemClass = ComponentUtil.getAttribute(source, "itemClass"); //$NON-NLS-1$
+ this.sourceStyle = attributeMap.getString(HTML.ATTR_STYLE);
+ this.sourceInputStyle = attributeMap.getString("inputStyle"); //$NON-NLS-1$
+ this.sourceInputClass = attributeMap.getString("inputClass"); //$NON-NLS-1$
+ this.sourceListClass = attributeMap.getString("listClass"); //$NON-NLS-1$
+ this.sourceListStyle = attributeMap.getString("listStyle"); //$NON-NLS-1$
+ this.sourceItemClass = attributeMap.getString("itemClass"); //$NON-NLS-1$
- this.sourceButtonIcon = ComponentUtil.getAttribute(source, "buttonIcon"); //$NON-NLS-1$
-
+ this.sourceButtonIcon = attributeMap.getString(BUTTON_ICON); //$NON-NLS-1$
+ this.sourceButtonIconInactive = attributeMap.getString("buttonIconInactive"); //$NON-NLS-1$
+ this.sourceButtonIconDisabled = attributeMap.getString("buttonIconDisabled"); //$NON-NLS-1$
+ this.disabled = (attributeMap.getBoolean("disabled") == Boolean.TRUE); //$NON-NLS-1$
+
if(ComponentUtil.isBlank(this.sourceButtonIcon)){
this.sourceButtonIcon = IMAGE_NAME_DOWN;
}
@@ -764,7 +811,6 @@
*/
public void stopToggling(Node sourceNode) {
isToggle = false;
-
}
/**
@@ -775,8 +821,11 @@
* @param toggleId the toggle id
*/
public void toggle(VpeVisualDomBuilder builder, Node sourceNode, String toggleId) {
- isToggle = !isToggle;
+ if (disabled) {
+ isToggle = false;
+ } else {
+ isToggle = !isToggle;
+ }
}
-
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml 2008-10-10 15:25:59 UTC (rev 10777)
@@ -18,5 +18,35 @@
<f:selectItem itemValue="suggestion 4" />
<f:selectItem itemValue="suggestion 5" />
</rich:comboBox>
+
+<rich:comboBox value="#{bean.cbString}" defaultLabel="Select Any Value"
+ buttonIconInactive="../../pictures/clickme.gif"
+ style="width:250px" id="comboBox-JBIDE-2856-buttonIconInactive">
+ <f:selectItem itemValue="suggestion 1" />
+ <f:selectItem itemValue="suggestion 2" />
+ <f:selectItem itemValue="suggestion 3" />
+ <f:selectItem itemValue="suggestion 4" />
+ <f:selectItem itemValue="suggestion 5" />
+</rich:comboBox>
+
+<rich:comboBox value="#{bean.cbString}" defaultLabel="Select Any Value" disabled="true"
+ style="width:250px" id="comboBox-JBIDE-2856-disabled">
+ <f:selectItem itemValue="suggestion 1" />
+ <f:selectItem itemValue="suggestion 2" />
+ <f:selectItem itemValue="suggestion 3" />
+ <f:selectItem itemValue="suggestion 4" />
+ <f:selectItem itemValue="suggestion 5" />
+</rich:comboBox>
+
+<rich:comboBox value="#{bean.cbString}" defaultLabel="Select Any Value" disabled="true"
+ buttonIconDisabled="../../pictures/clickme.gif"
+ style="width:250px" id="comboBox-JBIDE-2856-buttonIconDisabled">
+ <f:selectItem itemValue="suggestion 1" />
+ <f:selectItem itemValue="suggestion 2" />
+ <f:selectItem itemValue="suggestion 3" />
+ <f:selectItem itemValue="suggestion 4" />
+ <f:selectItem itemValue="suggestion 5" />
+</rich:comboBox>
+
</body>
</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/resources/richFacesTest/WebContent/pages/components/comboBox.xhtml.xml 2008-10-10 15:25:59 UTC (rev 10777)
@@ -1,22 +1,86 @@
<tests>
<test id="comboBox">
<DIV STYLE="width: 150px;">
- <DIV ALIGN="left" CLASS="rich-combobox-font rich-combobox"
- STYLE="position: static; z-index: 0; width: 250px;">
- <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
- <INPUT TYPE="text"
- CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
- AUTOCOMPLETE="off" STYLE="width: 133px;" VALUE="Select Any Value" />
- <INPUT TYPE="text"
- CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
- READONLY="true" VPE-USER-TOGGLE-ID="0" />
- <INPUT TYPE="text"
- CLASS="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"
- READONLY="true" VPE-USER-TOGGLE-ID="0" />
- <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
- Struts</DIV>
+ <DIV STYLE="width: 150px; position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox" STYLE="position: static; z-index: 0; width: 250px;">
+ <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
+ AUTOCOMPLETE="off" STYLE="width: 133px;" VALUE="Select Any Value" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ Struts</DIV>
+ </DIV>
</DIV>
</DIV>
</DIV>
</test>
+ <test id="comboBox-JBIDE-2856-buttonIconInactive">
+ <DIV STYLE="width: 150px;">
+ <DIV STYLE="width: 150px; position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox" STYLE="position: static; z-index: 0; width: 250px;">
+ <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
+ AUTOCOMPLETE="off" STYLE="width: 133px;" VALUE="Select Any Value" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-icon-inactive rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" />
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ Struts</DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </test>
+ <test id="comboBox-JBIDE-2856-disabled">
+ <DIV STYLE="width: 150px;">
+ <DIV STYLE="width: 150px; position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox" STYLE="position: static; z-index: 0; width: 250px;">
+ <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
+ AUTOCOMPLETE="off" STYLE="width: 133px;" VALUE="Select Any Value" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" />
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ Struts</DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </test>
+ <test id="comboBox-JBIDE-2856-buttonIconDisabled">
+ <DIV STYLE="width: 150px;">
+ <DIV STYLE="width: 150px; position: static; z-index: 0;">
+ <DIV CLASS="rich-combobox-font rich-combobox" STYLE="position: static; z-index: 0; width: 250px;">
+ <DIV CLASS="rich-combobox-font rich-combobox-shell" STYLE="width: 150px; z-index: 1;">
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-disabled rich-combobox-input-inactive"
+ AUTOCOMPLETE="off" STYLE="width: 133px;" VALUE="Select Any Value" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-background rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" STYLE="" />
+ <INPUT TYPE="text"
+ CLASS="rich-combobox-font-inactive rich-combobox-button-icon-disabled rich-combobox-button-inactive"
+ READONLY="true" VPE-USER-TOGGLE-ID="0" />
+ <DIV CLASS="rich-combobox-strut rich-combobox-font" STYLE="width: 140px;">
+ Struts</DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </DIV>
+ </test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.richfaces.test/src/org/jboss/tools/jsf/vpe/richfaces/test/RichFacesComboBoxTemplateTestCase.java 2008-10-10 15:25:59 UTC (rev 10777)
@@ -95,12 +95,11 @@
TestUtil.findAllElementsByName(rst, elements, HTML.TAG_DIV);
- nsIDOMElement divOne = (nsIDOMElement) elements.get(4).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement divOne = (nsIDOMElement) elements.get(5).queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
assertTrue("Style classes should be contains ",divOne.getAttribute(HTML.ATTR_CLASS).contains("rich-combobox-font rich-combobox")); //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("Default style should be contains " + width, divOne.getAttribute(HTML.ATTR_STYLE).indexOf(width) > 1); //$NON-NLS-1$
assertTrue("Default style should be contains " + width, divOne.getAttribute(HTML.ATTR_STYLE).contains("width")); //$NON-NLS-1$ //$NON-NLS-2$
// Check input
-
return rst;
}
@@ -128,9 +127,8 @@
*/
public void testComboBoxWithAttributes() throws PartInitException, Throwable {
final nsIDOMElement rst = baseTableCheck(COMPONENTS_COMBO_WITH_ATTR_TEMPLATE, _250PX);
-
+
checkValueInInput(rst, SELECT_ANY_VALUE);
-
}
/**
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java 2008-10-10 14:37:12 UTC (rev 10776)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/DndUtil.java 2008-10-10 15:25:59 UTC (rev 10777)
@@ -137,5 +137,4 @@
iTransferable.getAnyTransferData(aFlavor, aData, aDataLen);
return aData[0];
}
-
}
17 years, 3 months
JBoss Tools SVN: r10776 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: templates and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2008-10-10 10:37:12 -0400 (Fri, 10 Oct 2008)
New Revision: 10776
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-2761
Added: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesExtendedDataTableTemplate.java 2008-10-10 14:37:12 UTC (rev 10776)
@@ -0,0 +1,559 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Displays template for extendedDataTable
+ *
+ * @author dsakovich(a)exadel.com
+ *
+ */
+public class RichFacesExtendedDataTableTemplate extends VpeAbstractTemplate {
+
+ final static String DEFAULT_HEIGHT = "500px";
+ final static String DEFAULT_WIDTH = "100%";
+ final static String HEADER = "header";
+ final static String HEADER_CLASS = "headerClass";
+ final static String FOOTER = "footer";
+ final static String FOOTER_CLASS = "footerClass";
+ final static String CAPTION_CLASS = "captionClass";
+ final static String CAPTION_STYLE = "captionStyle";
+ final static String SPACE = " ";
+
+ private static String STYLE_FOR_LOW_SCROLL = "overflow: scroll; width: 100%; height: 17px;";
+ private static String STYLE_FOR_RIGHT_SCROLL = "overflow: scroll; width: 17px; height: 100%;";
+
+ private static final int NUM_ROW = 5;
+
+ /**
+ * Creates a node of the visual tree on the node of the source tree. This
+ * visual node should not have the parent node This visual node can have
+ * child nodes.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @return The information on the created node of the visual tree.
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ Element sourceElement = (Element) sourceNode;
+
+ String width = sourceElement.getAttribute(HTML.ATTR_WIDTH);
+ String height = sourceElement.getAttribute(HTML.ATTR_HEIGHT);
+
+ // -----------CommonTable
+ nsIDOMElement tableCommon = visualDocument
+ .createElement(HTML.TAG_TABLE);
+
+ VpeCreationData creationData = new VpeCreationData(tableCommon);
+
+ nsIDOMElement tr1 = visualDocument.createElement(HTML.TAG_TR);
+
+ nsIDOMElement tr2 = visualDocument.createElement(HTML.TAG_TR);
+
+ tableCommon.appendChild(tr1);
+ tableCommon.appendChild(tr2);
+
+ // ---------tr2
+ nsIDOMElement tr2_TD = visualDocument.createElement(HTML.TAG_TD);
+ tr2.appendChild(tr2_TD);
+
+ nsIDOMElement tr2_td_DIV = visualDocument.createElement(HTML.TAG_DIV);
+ tr2_td_DIV.setAttribute(HTML.ATTR_STYLE, STYLE_FOR_LOW_SCROLL);
+ tr2_TD.appendChild(tr2_td_DIV);
+
+ // --------------------------------------------
+
+ // ---------------------tr1------------------------
+ nsIDOMElement tr1_TD1 = visualDocument.createElement(HTML.TAG_TD);
+ tr1.appendChild(tr1_TD1);
+
+ nsIDOMElement tr1_TD2 = visualDocument.createElement(HTML.TAG_TD);
+ tr1.appendChild(tr1_TD2);
+
+ nsIDOMElement tr1_td2_DIV = visualDocument.createElement(HTML.TAG_DIV);
+ tr1_td2_DIV.setAttribute(HTML.ATTR_STYLE, STYLE_FOR_RIGHT_SCROLL);
+ tr1_TD2.appendChild(tr1_td2_DIV);
+
+ // -------------------------------------------------------
+ nsIDOMElement div = visualDocument.createElement(HTML.TAG_DIV);
+ tr1_TD1.appendChild(div);
+ div.setAttribute(HTML.ATTR_CLASS, "dr-table-hidden");
+
+ String divStyle = HTML.ATTR_WIDTH + " : "
+ + (width == null ? DEFAULT_WIDTH : width) + ";"
+ + HTML.ATTR_HEIGHT + " : "
+ + (height == null ? DEFAULT_HEIGHT : height) + ";";
+
+ div.setAttribute(HTML.ATTR_STYLE, divStyle);
+
+ nsIDOMElement table = visualDocument.createElement(HTML.TAG_TABLE);
+ ComponentUtil.copyAttributes(sourceNode, table);
+ table.removeAttribute(HTML.ATTR_HEIGHT);
+ div.appendChild(table);
+
+ ComponentUtil.setCSSLink(pageContext,
+ "scrollableDataTable/scrollableDataTable.css",
+ "richFacesDataTable");
+ String tableClass = sourceElement
+ .getAttribute(RichFaces.ATTR_STYLE_CLASS);
+ table.setAttribute(HTML.ATTR_CLASS, "dr-table rich-table "
+ + (tableClass == null ? "" : tableClass));
+
+ // Encode colgroup definition.
+ ArrayList<Element> columns = getColumns(sourceElement);
+ int columnsLength = getColumnsCount(sourceElement, columns);
+ nsIDOMElement colgroup = visualDocument
+ .createElement(HTML.TAG_COLGROUP);
+ colgroup.setAttribute(HTML.TAG_SPAN, String.valueOf(columnsLength));
+ table.appendChild(colgroup);
+
+ // Encode Caption
+ encodeCaption(creationData, sourceElement, visualDocument, table);
+
+ // Encode Header
+ Element header = ComponentUtil.getFacet(sourceElement, HEADER);
+ ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns, HEADER);
+ if (header != null || !columnsHeaders.isEmpty()) {
+ nsIDOMElement thead = visualDocument.createElement(HTML.TAG_THEAD);
+ table.appendChild(thead);
+ String headerClass = (String) sourceElement
+ .getAttribute(HEADER_CLASS);
+ if (header != null) {
+ encodeTableHeaderOrFooterFacet(creationData, thead,
+ columnsLength, visualDocument, header,
+ "dr-table-header rich-table-header",
+ "dr-table-header-continue rich-table-header-continue",
+ "dr-table-headercell rich-table-headercell",
+ headerClass, HTML.TAG_TD);
+ }
+ if (!columnsHeaders.isEmpty()) {
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ thead.appendChild(tr);
+ String styleClass = encodeStyleClass(null,
+ "dr-table-subheader rich-table-subheader", null,
+ headerClass);
+ if (styleClass != null) {
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
+ }
+ encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ columnsHeaders,
+ "dr-table-subheadercell rich-table-subheadercell",
+ headerClass, HEADER, HTML.TAG_TD);
+ }
+ }
+
+ // Encode Footer
+ Element footer = ComponentUtil.getFacet(sourceElement, FOOTER);
+ ArrayList<Element> columnsFooters = getColumnsWithFacet(columns, FOOTER);
+ if (footer != null || !columnsFooters.isEmpty()) {
+ nsIDOMElement tfoot = visualDocument.createElement(HTML.TAG_TFOOT);
+ table.appendChild(tfoot);
+ String footerClass = (String) sourceElement
+ .getAttribute(FOOTER_CLASS);
+ if (!columnsFooters.isEmpty()) {
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ tfoot.appendChild(tr);
+ String styleClass = encodeStyleClass(null,
+ "dr-table-subfooter rich-table-subfooter", null,
+ footerClass);
+ if (styleClass != null) {
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
+ }
+ encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ columnsFooters,
+ "dr-table-subfootercell rich-table-subfootercell",
+ footerClass, FOOTER, HTML.TAG_TD);
+ }
+ if (footer != null) {
+ encodeTableHeaderOrFooterFacet(creationData, tfoot,
+ columnsLength, visualDocument, footer,
+ "dr-table-footer rich-table-footer",
+ "dr-table-footer-continue rich-table-footer-continue",
+ "dr-table-footercell rich-table-footercell",
+ footerClass, HTML.TAG_TD);
+ }
+ }
+
+ nsIDOMElement tbody = visualDocument.createElement(HTML.TAG_TBODY);
+ table.appendChild(tbody);
+
+ // Create mapping to Encode body
+ for (int i = 0; i < NUM_ROW; i++) {
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ boolean firstRow = true;
+ nsIDOMElement tr = null;
+ VpeChildrenInfo trInfo = null;
+ for (Node child : children) {
+ if (child.getNodeName().endsWith(":column")) {
+ String breakBefore = ((Element) child)
+ .getAttribute("breakBefore");
+ if (breakBefore != null
+ && breakBefore.equalsIgnoreCase("true")) {
+ tr = null;
+ }
+ if (tr == null) {
+ tr = visualDocument.createElement(HTML.TAG_TR);
+ if (firstRow) {
+ tr.setAttribute(HTML.ATTR_CLASS,
+ "dr-table-firstrow rich-table-firstrow");
+ firstRow = false;
+ } else {
+ tr.setAttribute(HTML.ATTR_CLASS,
+ "dr-table-row rich-table-row");
+ }
+ trInfo = new VpeChildrenInfo(tr);
+ tbody.appendChild(tr);
+ creationData.addChildrenInfo(trInfo);
+ }
+ trInfo.addSourceChild(child);
+ } else if (child.getNodeName().endsWith(":columnGroup")) {
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(
+ creationData, (Element) child, visualDocument,
+ tbody);
+ tr = null;
+ } else if (child.getNodeName().endsWith(":subTable")) {
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(
+ creationData, (Element) child, visualDocument,
+ tbody);
+ tr = null;
+ } else {
+ VpeChildrenInfo childInfo = new VpeChildrenInfo(tbody);
+ childInfo.addSourceChild(child);
+ creationData.addChildrenInfo(childInfo);
+ tr = null;
+ }
+ }
+ }
+
+ return creationData;
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param sourceElement
+ * @param visualDocument
+ * @param table
+ */
+ protected void encodeCaption(VpeCreationData creationData,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement table) {
+ // Encode caption
+ Element captionFromFacet = ComponentUtil.getFacet(sourceElement,
+ HTML.TAG_CAPTION);
+ if (captionFromFacet != null) {
+ String captionClass = (String) table.getAttribute(CAPTION_CLASS);
+ String captionStyle = (String) table.getAttribute(CAPTION_STYLE);
+
+ nsIDOMElement caption = visualDocument
+ .createElement(HTML.TAG_CAPTION);
+ table.appendChild(caption);
+ if (captionClass != null && captionClass.length() > 0) {
+ captionClass = "dr-table-caption rich-table-caption "
+ + captionClass;
+ } else {
+ captionClass = "dr-table-caption rich-table-caption";
+ }
+ caption.setAttribute(HTML.ATTR_CLASS, captionClass);
+ if (captionStyle != null && captionStyle.length() > 0) {
+ caption.setAttribute(HTML.ATTR_STYLE, captionStyle);
+ }
+
+ VpeChildrenInfo cap = new VpeChildrenInfo(caption);
+ cap.addSourceChild(captionFromFacet);
+ creationData.addChildrenInfo(cap);
+ }
+
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param parentTr
+ * @param visualDocument
+ * @param headersOrFooters
+ * @param skinCellClass
+ * @param headerClass
+ * @param facetName
+ * @param element
+ */
+ public static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
+ nsIDOMElement parentTr, nsIDOMDocument visualDocument,
+ ArrayList<Element> headersOrFooters, String skinCellClass,
+ String headerClass, String facetName, String element) {
+ for (Element column : headersOrFooters) {
+ String classAttribute = facetName + "Class";
+ String columnHeaderClass = column.getAttribute(classAttribute);
+ nsIDOMElement td = visualDocument.createElement(element);
+ parentTr.appendChild(td);
+ String styleClass = encodeStyleClass(null, skinCellClass,
+ headerClass, columnHeaderClass);
+ td.setAttribute(HTML.ATTR_CLASS, styleClass);
+ td.setAttribute("scop", "col");
+ String colspan = column.getAttribute(HTML.ATTR_COLSPAN);
+ if (colspan != null && colspan.length() > 0) {
+ td.setAttribute(HTML.ATTR_COLSPAN, colspan);
+ }
+ Element facetBody = ComponentUtil.getFacet(column, facetName);
+
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
+ child.addSourceChild(facetBody);
+ creationData.addChildrenInfo(child);
+ }
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param parentTheadOrTfood
+ * @param columns
+ * @param visualDocument
+ * @param facetBody
+ * @param skinFirstRowClass
+ * @param skinRowClass
+ * @param skinCellClass
+ * @param facetBodyClass
+ * @param element
+ */
+ protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
+ nsIDOMElement parentTheadOrTfood, int columns,
+ nsIDOMDocument visualDocument, Element facetBody,
+ String skinFirstRowClass, String skinRowClass,
+ String skinCellClass, String facetBodyClass, String element) {
+ boolean isColumnGroup = facetBody.getNodeName()
+ .endsWith(":columnGroup");
+ boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
+ if (isColumnGroup) {
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData,
+ facetBody, visualDocument, parentTheadOrTfood);
+ } else if (isSubTable) {
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData,
+ facetBody, visualDocument, parentTheadOrTfood);
+ } else {
+ nsIDOMElement tr = visualDocument.createElement(HTML.TAG_TR);
+ parentTheadOrTfood.appendChild(tr);
+
+ String styleClass = encodeStyleClass(null, skinFirstRowClass,
+ facetBodyClass, null);
+ if (styleClass != null) {
+ tr.setAttribute(HTML.ATTR_CLASS, styleClass);
+ }
+ String style = ComponentUtil.getHeaderBackgoundImgStyle();
+ tr.setAttribute(HTML.ATTR_STYLE, style);
+
+ nsIDOMElement td = visualDocument.createElement(element);
+ tr.appendChild(td);
+
+ styleClass = encodeStyleClass(null, skinCellClass, facetBodyClass,
+ null);
+ if (styleClass != null) {
+ td.setAttribute(HTML.ATTR_CLASS, styleClass);
+ }
+
+ if (columns > 0) {
+ td.setAttribute(HTML.ATTR_COLSPAN, String.valueOf(columns));
+ }
+ td.setAttribute(HTML.ATTR_SCOPE, HTML.TAG_COLGROUP);
+
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
+ child.addSourceChild(facetBody);
+ creationData.addChildrenInfo(child);
+ }
+ }
+
+ /**
+ *
+ * @param parentSourceElement
+ * @return list of columns
+ */
+ public static ArrayList<Element> getColumns(Element parentSourceElement) {
+ ArrayList<Element> columns = new ArrayList<Element>();
+ NodeList children = parentSourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if ((child instanceof Element)
+ && child.getNodeName().endsWith(":column")) {
+ columns.add((Element) child);
+ }
+ }
+ return columns;
+ }
+
+ /**
+ *
+ * @param columns
+ * @param facetName
+ * @return list of columns with facet
+ */
+ public static ArrayList<Element> getColumnsWithFacet(
+ ArrayList<Element> columns, String facetName) {
+ ArrayList<Element> columnsWithFacet = new ArrayList<Element>();
+ for (Element column : columns) {
+ Element body = ComponentUtil.getFacet(column, facetName);
+ if (body != null) {
+ columnsWithFacet.add(column);
+ }
+ }
+ return columnsWithFacet;
+ }
+
+ /**
+ *
+ * @param parentPredefined
+ * @param predefined
+ * @param parent
+ * @param custom
+ * @return
+ */
+ public static String encodeStyleClass(Object parentPredefined,
+ Object predefined, Object parent, Object custom) {
+ StringBuffer styleClass = new StringBuffer();
+ // Construct predefined classes
+ if (null != parentPredefined) {
+ styleClass.append(parentPredefined).append(SPACE);
+ } else if (null != predefined) {
+ styleClass.append(predefined).append(SPACE);
+ }
+ // Append class from parent component.
+ if (null != parent) {
+ styleClass.append(parent).append(SPACE);
+ }
+ if (null != custom) {
+ styleClass.append(custom);
+ }
+ if (styleClass.length() > 0) {
+ return styleClass.toString();
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param sourceElement
+ * @param columns
+ * @return
+ */
+ protected int getColumnsCount(Element sourceElement,
+ ArrayList<Element> columns) {
+ int count = 0;
+ // check for exact value in component
+ try {
+ int span = Integer.parseInt(sourceElement.getAttribute("columns"));
+ count = count > 0 ? span : calculateRowColumns(sourceElement,
+ columns);
+ } catch (NumberFormatException e) {
+ count = calculateRowColumns(sourceElement, columns);
+ }
+ return count;
+ }
+
+ /*
+ * Calculate max number of columns per row. For rows, recursive calculate
+ * max length.
+ */
+ private int calculateRowColumns(Element sourceElement,
+ ArrayList<Element> columns) {
+ int count = 0;
+ int currentLength = 0;
+ for (Element column : columns) {
+ if (ComponentUtil.isRendered(column)) {
+ if (column.getNodeName().endsWith(":columnGroup")) {
+ // Store max calculated value of previsous rows.
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ // Calculate number of columns in row.
+ currentLength = calculateRowColumns(sourceElement,
+ getColumns(column));
+ // Store max calculated value
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ } else if (column.getNodeName().equals(
+ sourceElement.getPrefix() + ":column")) {
+ String breakBeforeStr = column.getAttribute("breakBefore");
+ // For new row, save length of previsous.
+ if (Boolean.getBoolean(breakBeforeStr)) {
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ }
+ String colspanStr = column.getAttribute(HTML.ATTR_COLSPAN);
+ try {
+ int colspan = Integer.parseInt(colspanStr);
+ currentLength += colspan > 0 ? colspan : 1;
+ } catch (NumberFormatException e) {
+ currentLength++;
+ }
+ } else if (column.getNodeName().endsWith(":column")) {
+ // UIColumn always have colspan == 1.
+ currentLength++;
+ }
+
+ }
+ }
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ return count;
+ }
+
+ /**
+ * Checks, whether it is necessary to re-create an element at change of
+ * attribute
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceElement
+ * The current element of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @param visualNode
+ * The current node of the visual tree.
+ * @param data
+ * The arbitrary data, built by a method <code>create</code>
+ * @param name
+ * Attribute name
+ * @param value
+ * Attribute value
+ * @return <code>true</code> if it is required to re-create an element at a
+ * modification of attribute, <code>false</code> otherwise.
+ */
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
+ }
+}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-10-10 13:58:48 UTC (rev 10775)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2008-10-10 14:37:12 UTC (rev 10776)
@@ -358,6 +358,25 @@
</vpe:textFormatting>
<vpe:pseudoContent defaultText="yes"/>
</vpe:template>
+ </vpe:tag>
+
+ <vpe:tag name="rich:extendedDataTable" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesExtendedDataTableTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="column"/>
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormatting use-default-formats="yes">
+ <vpe:format type="BlockFormat" addChildren="deny"/>
+ </vpe:textFormatting>
+ <vpe:pseudoContent defaultText="yes"/>
+ </vpe:template>
</vpe:tag>
<vpe:tag name="rich:orderingList" case-sensitive="yes">
17 years, 3 months
JBoss Tools SVN: r10775 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-10 09:58:48 -0400 (Fri, 10 Oct 2008)
New Revision: 10775
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2345
https://jira.jboss.org/jira/browse/JBIDE-2344
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 13:52:31 UTC (rev 10774)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 13:58:48 UTC (rev 10775)
@@ -109,6 +109,9 @@
}
public void widgetSelected(SelectionEvent e) {
+ consoleConfigurationName.setEnabled(selectMethod.getSelection());
+ connectionProfileName.setEnabled(!selectMethod.getSelection());
+ schemaName.setEnabled(!selectMethod.getSelection());
dialogChanged();
}});
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -183,10 +186,7 @@
}
- protected void dialogChanged() {
- consoleConfigurationName.setEnabled(selectMethod.getSelection());
- connectionProfileName.setEnabled(!selectMethod.getSelection());
- schemaName.setEnabled(!selectMethod.getSelection());
+ protected void dialogChanged() {
if (selectMethod.getSelection() && (StringHelper.isEmpty(getConfigurationName()))){
setPageComplete(false);
17 years, 3 months
JBoss Tools SVN: r10774 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: resources/menuGroup and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-10-10 09:52:31 -0400 (Fri, 10 Oct 2008)
New Revision: 10774
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
Log:
JBIDE-2497, dropping down was implemented through css and html only, code style was reviewed.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/dropDownMenu/dropDownMenu.css 2008-10-10 13:52:31 UTC (rev 10774)
@@ -3,14 +3,12 @@
font-size:11px;
height:auto;
left:0pt;
- padding:2px 5px;
top:0pt;
white-space:nowrap;
width:auto;
}
.rich-ddmenu-label-unselect {
border:0pt solid transparent;
- padding:3px 6px;
}
.rich-ddmenu-label-select {
@@ -28,51 +26,34 @@
}
-.dr-menu-list-border {
- border : 1px solid #bfbfc0;
- background-color : #e7f2fb;
- float : left;
- position : absolute;
+[vpe-ddm-menu-ul] {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ width: 150px;
+ display: block;
}
-.dr-menu-list-bg {
- border-top : 1px solid #e7f2fb;
- border-left : 1px solid #e7f2fb;
- border-right : 1px solid #e7f2fb;
- background : url(menu_list_bg.gif) repeat-y left;
+[vpe-ddm-menu-li] {
+ position: relative;
+ height: 30px;
}
-.dr-menu-label {
- padding : 2px 5px 2px 5px;
- white-space : nowrap;
- position: relative;
- width : 75px;
- height : 18px;
+[vpe-ddm-menu-li] ul {
+ position: absolute;
+ left: 149px; /* Set 1px less than menu width */
+ top: 0;
+ display: none;
}
-.dr-menu-label-unselect {
- border : 1px solid transparent;
+[vpe-ddm-menu-li] div { /* ddm item/group div */
+
}
-.dr-menu-label-select {
- border : 1px solid #bfbfc0;
- cursor : pointer;
- background : #a9c5e7;
- color : #FFFFFF;
+[vpe-ddm-menu-li] div:hover {
+
}
-.dr-label-text-decor {
- font-weight : bold;
+[vpe-ddm-menu-ul]:hover {
+
}
-.underneath_iframe{
- position: absolute;
- z-index: 90;
- visibility:hidden;
- left:0px;
- top:0px;
- height:1px;
- width:1px;
+/*drop-down mechanism*/
+[vpe-ddm-menu-li]:hover > ul,
+[vpe-ddm-menu-li]:hover > li {
+ display: block;
}
-.dr-menu-list-border{
-border-color:#C4C0B9;background-color:#F1EEE9;}
-.dr-menu-list-bg{
-border-top-color:#F1EEE9;border-left-color:#F1EEE9;border-right-color:#F1EEE9;}
-.dr-menu-label{
-font-family:Arial, Verdana, sans-serif ;font-size:11px;}
-.dr-menu-label-select{
-border-color:#C4C0B9;background-color:#D4CFC7;color:#000000;}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuGroup/menuGroup.css 2008-10-10 13:52:31 UTC (rev 10774)
@@ -4,7 +4,7 @@
font-size:11px;
}
.rich-menu-group-label {
-
+ padding-left: 10px; /*padding for group icon*/
}
.rich-menu-group-folder {
@@ -32,7 +32,7 @@
}
.rich-menu-item-icon-enabled {
border:0pt solid transparent;
- padding:2px 10px 2px 2px;
+ /*padding:2px 10px 2px 2px;*/
}
.rich-menu-item-icon-selected {
@@ -40,13 +40,13 @@
.rich-menu-list-border {
font-family:Arial,Verdana,sans-serif;
background-color:#F1EEE9;
- background-color:#F1EEE9;
border-color:#C4C0B9;
border:1px solid;
}
.rich-menu-list-bg {
background:transparent none repeat-y scroll left center;
background-image:url(list-bg.png);
+ background-color:#F1EEE9;
border-left-color:#C4C0B9;
border-right-color:#C4C0B9;
border-top-color:#C4C0B9;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/menuItem/menuItem.css 2008-10-10 13:52:31 UTC (rev 10774)
@@ -1,12 +1,14 @@
.rich-menu-item {
-
+ font-family:Arial,Verdana,sans-serif;
+ border-color:#C4C0B9;
+ border:1px solid;
}
.rich-menu-item-label {
-
+ /*padding-left: 10px;*/ /*padding for item icon*/
}
.rich-menu-item-icon {
+ padding:2px 10px 2px 2px;
border:0pt solid transparent;
- padding:2px 10px 2px 2px;
}
.rich-menu-item-disabled {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesDropDownMenuTemplate.java 2008-10-10 13:52:31 UTC (rev 10774)
@@ -10,22 +10,18 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
-import java.util.ArrayList;
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
-import org.mozilla.interfaces.nsIDOMNode;
-import org.mozilla.interfaces.nsIDOMNodeList;
import org.mozilla.interfaces.nsIDOMText;
-import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
@@ -33,6 +29,12 @@
public class RichFacesDropDownMenuTemplate extends VpeAbstractTemplate {
/*
+ * Public constants for drop down mechanism.
+ */
+ public final static String MENU_PARENT_ID = "vpe-ddm-menu-ul"; //$NON-NLS-1$
+ public final static String MENU_CHILD_ID = "vpe-ddm-menu-li"; //$NON-NLS-1$
+
+ /*
* rich:dropDownMenu constants
*/
private final static String COMPONENT_NAME = "dropDownMenu"; //$NON-NLS-1$
@@ -51,9 +53,9 @@
private static final String CSS_RICH_LABEL_TEXT_DECOR = "rich-label-text-decor"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_LIST_BORDER = "rich-menu-list-border"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
- private static final String CSS_RICH_DDEMENU_LIST_DIV_STYLE = "position: relative; z-index: 100; display: table;"; //$NON-NLS-1$
- private static final String CSS_RICH_DDEMENU_BORDER_DIV_STYLE = "position: relative; z-index: 2; display: table;"; //$NON-NLS-1$
-
+ private static final String CSS_RICH_DDEMENU_LIST_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_RICH_DDEMENU_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
+
/*
* rich:dropDownMenu attributes names
*/
@@ -97,27 +99,21 @@
private String ddm_style;
private String ddm_styleClass;
- private nsIDOMElement storedVisualMenu = null;
- private int ddmId = 1;
-
public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
VpeCreationData creationData = null;
Element sourceElement = (Element)sourceNode;
- Element srcNode = null;
-
- if ((sourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) != null)
- && (sourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE) instanceof Element)) {
- srcNode = (Element) sourceElement.getUserData(VpeVisualDomBuilder.SRC_NODE);
- }
ComponentUtil.setCSSLink(pageContext, STYLE_PATH, COMPONENT_NAME);
readDropDownMenuAttributes(sourceElement);
-
/*
* DropDownMenu component structure.
* In order of nesting.
*/
+ nsIDOMElement ddmMainUL;
+ nsIDOMElement ddmMainLI;
+ nsIDOMElement ddmChildrenUL;
+
nsIDOMElement ddmLabelDiv;
nsIDOMElement ddmTextSpan;
nsIDOMText ddmLabelText;
@@ -128,25 +124,42 @@
/*
* Creating visual elements
*/
- ddmLabelDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- ddmTextSpan = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
- ddmLabelText = visualDocument.createTextNode(""); //$NON-NLS-1$
- ddmListDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- ddmListBorderDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- ddmListBgDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- creationData = new VpeCreationData(ddmLabelDiv);
- storedVisualMenu = ddmLabelDiv;
+
+ ddmMainUL = visualDocument.createElement(HTML.TAG_UL);
+ ddmMainLI = visualDocument.createElement(HTML.TAG_LI);
+ ddmChildrenUL = visualDocument.createElement(HTML.TAG_UL);
+ ddmLabelDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmTextSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ ddmLabelText = visualDocument.createTextNode(EMPTY);
+ ddmListDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
+ ddmListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
+ creationData = new VpeCreationData(ddmMainUL);
/*
* Nesting elements
*/
ddmLabelDiv.appendChild(ddmTextSpan);
ddmTextSpan.appendChild(ddmLabelText);
- ddmLabelDiv.appendChild(ddmListDiv);
+// ddmLabelDiv.appendChild(ddmListDiv);
ddmListDiv.appendChild(ddmListBorderDiv);
ddmListBorderDiv.appendChild(ddmListBgDiv);
+
+ ddmMainUL.appendChild(ddmMainLI);
+ ddmMainLI.appendChild(ddmLabelDiv);
+ /*
+ * Children <ul> will be added only if there are some of them.
+ */
+// ddmMainLI.appendChild(ddmChildrenUL);
/*
+ * Setting attributes for the drop-down mechanism
+ */
+ ddmMainUL.setAttribute(MENU_PARENT_ID, EMPTY);
+ ddmMainLI.setAttribute(MENU_CHILD_ID, EMPTY);
+ ddmChildrenUL.setAttribute(MENU_PARENT_ID, EMPTY);
+
+ /*
* Setting css classes
*/
String labelDivClass = EMPTY;
@@ -160,11 +173,12 @@
listBorderDivClass += SPACE + ddm_styleClass;
}
- ddmLabelDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, labelDivClass);
- ddmTextSpan.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_RICH_LABEL_TEXT_DECOR);
- ddmListBorderDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, listBorderDivClass);
- ddmListBgDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_RICH_MENU_LIST_BG);
-
+// ddmLabelDiv.setAttribute(HTML.CLASS_ATTR, labelDivClass);
+ ddmMainLI.setAttribute(HTML.ATTR_CLASS, labelDivClass);
+ ddmTextSpan.setAttribute(HTML.ATTR_CLASS, CSS_RICH_LABEL_TEXT_DECOR);
+// ddmListBorderDiv.setAttribute(HTML.ATTR_CLASS, listBorderDivClass);
+// ddmListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
+ ddmChildrenUL.setAttribute(HTML.ATTR_CLASS, listBorderDivClass + SPACE + CSS_RICH_MENU_LIST_BG);
/*
* Setting css styles
*/
@@ -179,107 +193,50 @@
cssLabelDivStyle += SPACE + ddm_style;
}
- ddmListDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, cssListDivStyle);
- ddmListBorderDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, cssListBorderDivStyle);
- ddmLabelDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, cssLabelDivStyle);
-
+// ddmListDiv.setAttribute(HTML.STYLE_ATTR, cssListDivStyle);
+// ddmListBorderDiv.setAttribute(HTML.STYLE_ATTR, cssListBorderDivStyle);
+// ddmLabelDiv.setAttribute(HTML.STYLE_ATTR, cssLabelDivStyle);
+ ddmMainLI.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
+ ddmChildrenUL.setAttribute(HTML.ATTR_STYLE, cssListDivStyle + SPACE + cssListBorderDivStyle + SPACE + cssLabelDivStyle);
/*
* Encoding label value
*/
- final Element passedElement = (srcNode != null ? srcNode : sourceElement);
- final Element labelFacet = ComponentUtil.getFacet(passedElement, LABEL_FACET_NAME);
+ Element labelFacet = ComponentUtil.getFacet(sourceElement, LABEL_FACET_NAME);
if (null != labelFacet) {
VpeChildrenInfo childrenInfo = new VpeChildrenInfo(ddmTextSpan);
childrenInfo.addSourceChild(labelFacet);
creationData.addChildrenInfo(childrenInfo);
} else {
- Attr valueAttr = sourceElement.getAttributeNode(HtmlComponentUtil.HTML_VALUE_ATTR);
+ Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
String labelValue = valueAttr != null && valueAttr.getValue() != null
? valueAttr.getValue()
: EMPTY;
ddmLabelText.setNodeValue(labelValue);
}
-
/*
* Adding child nodes
*/
- List<Node> children = ComponentUtil.getChildren(passedElement);
- int groupCount = 1;
- for (Node child : children) {
- if (child.getNodeType() == Node.ELEMENT_NODE
- && child.getNodeName().endsWith(":menuGroup")) { //$NON-NLS-1$
- child.setUserData(RichFacesMenuGroupTemplate.MENU_GROUP_ID,
- String.valueOf(groupCount), null);
- groupCount++;
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ if (children.size() > 0) {
+ /*
+ * Add children <ul> and children in it.
+ */
+ ddmMainLI.appendChild(ddmChildrenUL);
+ for (Node child : children) {
+// nsIDOMElement childDiv = visualDocument
+// .createElement(HTML.TAG_DIV);
+// ddmListBgDiv.appendChild(childDiv);
+ VpeChildrenInfo childDivInfo = new VpeChildrenInfo(ddmChildrenUL);
+ childDivInfo.addSourceChild(child);
+ creationData.addChildrenInfo(childDivInfo);
}
- nsIDOMElement childDiv = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- ddmListBgDiv.appendChild(childDiv);
- VpeChildrenInfo childDivInfo = new VpeChildrenInfo(childDiv);
- childDivInfo.addSourceChild(child);
- creationData.addChildrenInfo(childDivInfo);
- }
+ }
return creationData;
}
-
- @Override
- public void validate(VpePageContext pageContext, Node sourceNode,
- nsIDOMDocument visualDocument, VpeCreationData data) {
- super.validate(pageContext, sourceNode, visualDocument, data);
- List<nsIDOMElement> children = getChildren(storedVisualMenu);
-// storedVisualMenu.setAttribute(VpeVisualDomBuilder.VPE_USER_MOUSE_OVER_ID, String.valueOf(ddmId));
-// applyAttributeValueOnChildren(VpeVisualDomBuilder.VPE_USER_MOUSE_OVER_ID, String.valueOf(ddmId), children);
-// applyAttributeValueOnChildren(
-// VpeVisualDomBuilder.VPE_USER_MOUSE_OVER_LOOKUP_PARENT,
-// "true", children); //$NON-NLS-1$
- }
-
/**
- * Sets the attribute to element children
- * @param attrName attribute name
- * @param attrValue attribute value
- * @param children children
- */
- private void applyAttributeValueOnChildren(String attrName, String attrValue, List<nsIDOMElement> children) {
- if (children == null || attrName == null || attrValue == null) {
- return;
- }
- for (nsIDOMElement child : children) {
- child.setAttribute(attrName, attrValue);
- applyAttributeValueOnChildren(attrName, attrValue, getChildren(child));
- }
- }
-
- /**
- * Gets element children
- * @param element the element
- * @return children
- */
- private List<nsIDOMElement> getChildren(nsIDOMElement element) {
- List<nsIDOMElement> result = new ArrayList<nsIDOMElement>();
- if (element.hasChildNodes()) {
- nsIDOMNodeList children = element.getChildNodes();
- if (null != children) {
- long len = children.getLength();
- for (int i = 0; i < len; i++) {
- nsIDOMNode item = children.item(i);
- try {
- nsIDOMElement elem = (nsIDOMElement) item
- .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- result.add(elem);
- } catch (XPCOMException ex) {
- // just ignore this exception
- }
- }
- }
- }
- return result;
- }
-
- /**
* Read attributes from the source element.
*
* @param sourceNode the source node
@@ -290,7 +247,7 @@
}
ddm_direction = sourceElement.getAttribute(DIRECTION);
- ddm_disabled = sourceElement.getAttribute(HtmlComponentUtil.HTML_ATTR_DISABLED);
+ ddm_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
ddm_horizontalOffset = sourceElement.getAttribute(HORIZONTAL_OFFCET);
ddm_jointPoint = sourceElement.getAttribute(JOINT_POINT);
ddm_popupWidth = sourceElement.getAttribute(POPUP_WIDTH);
@@ -303,8 +260,8 @@
ddm_itemStyle = sourceElement.getAttribute(ITEM_STYLE);
ddm_selectedLabelClass = sourceElement.getAttribute(SELECED_LABEL_CLASS);
ddm_selectItemClass = sourceElement.getAttribute(SELECT_ITEM_CLASS);
- ddm_style = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- ddm_styleClass = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ ddm_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
+ ddm_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
}
/**
@@ -317,16 +274,11 @@
private static boolean attrPresents(String attr) {
return ((null != attr) && (!EMPTY.equalsIgnoreCase(attr)));
}
-
- public void onMouseOver(VpeVisualDomBuilder visualDomBuilder, Node sourceNode, String mouseOverId) {
- // TODO Auto-generated method stub
-// visualDomBuilder.updateNode(sourceNode);
+
+ @Override
+ public boolean isRecreateAtAttrChange(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement visualNode, Object data, String name, String value) {
+ return true;
}
-
- public void stopMouseOver(Node sourceNode) {
- // TODO Auto-generated method stub
-
- }
-
-
}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuGroupTemplate.java 2008-10-10 13:52:31 UTC (rev 10774)
@@ -13,12 +13,12 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -59,8 +59,8 @@
private static final String CSS_RICH_MENU_ITEM_ICON_SELECTED = "rich-menu-item-icon-selected"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_LIST_BORDER = "rich-menu-list-border"; //$NON-NLS-1$
private static final String CSS_RICH_MENU_LIST_BG = "rich-menu-list-bg"; //$NON-NLS-1$
- private static final String CSS_RICH_LIST_FOLDER_DIV_STYLE = "position: relative; z-index: 100; display: table;"; //$NON-NLS-1$
- private static final String CSS_RICH_LIST_BORDER_DIV_STYLE = "position: relative; z-index: 2; display: table;"; //$NON-NLS-1$
+ private static final String CSS_RICH_LIST_FOLDER_DIV_STYLE = ""; //$NON-NLS-1$
+ private static final String CSS_RICH_LIST_BORDER_DIV_STYLE = ""; //$NON-NLS-1$
/*
* rich:menuGroup attributes names
@@ -113,6 +113,11 @@
* MenuGroup component structure.
* In order of nesting.
*/
+ nsIDOMElement ddmMainUL;
+ nsIDOMElement grMainLI;
+ nsIDOMElement grChildrenUL;
+ nsIDOMElement ddmChildrenLI;
+
nsIDOMElement grTopDiv;
nsIDOMElement grImgSpan;
nsIDOMElement grImg;
@@ -125,15 +130,17 @@
/*
* Creating visual elements
*/
- grTopDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- grImgSpan = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
- grImg = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- grLabelSpan = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
+ grMainLI = visualDocument.createElement(HTML.TAG_LI);
+ grChildrenUL = visualDocument.createElement(HTML.TAG_UL);
+ grTopDiv = visualDocument.createElement(HTML.TAG_DIV);
+ grImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ grImg = visualDocument.createElement(HTML.TAG_IMG);
+ grLabelSpan = visualDocument.createElement(HTML.TAG_SPAN);
grLabelText = visualDocument.createTextNode(EMPTY);
- grFolderDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- grListBorderDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- grListBgDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- creationData = new VpeCreationData(grTopDiv);
+ grFolderDiv = visualDocument.createElement(HTML.TAG_DIV);
+ grListBorderDiv = visualDocument.createElement(HTML.TAG_DIV);
+ grListBgDiv = visualDocument.createElement(HTML.TAG_DIV);
+ creationData = new VpeCreationData(grMainLI);
/*
* Nesting elements
@@ -141,14 +148,24 @@
grTopDiv.appendChild(grImgSpan);
grTopDiv.appendChild(grLabelSpan);
grLabelSpan.appendChild(grLabelText);
- grTopDiv.appendChild(grFolderDiv);
- grFolderDiv.appendChild(grListBorderDiv);
- grListBorderDiv.appendChild(grListBgDiv);
+// grTopDiv.appendChild(grFolderDiv);
+// grFolderDiv.appendChild(grListBorderDiv);
+// grListBorderDiv.appendChild(grListBgDiv);
+ grMainLI.appendChild(grTopDiv);
+ /*
+ * Children <ul> will be added only if there are some of them.
+ */
+// grMainLI.appendChild(grChildrenUL);
/*
+ * Setting attributes for the drop-down mechanism
+ */
+ grMainLI.setAttribute(RichFacesDropDownMenuTemplate.MENU_CHILD_ID, EMPTY);
+ grChildrenUL.setAttribute(RichFacesDropDownMenuTemplate.MENU_PARENT_ID, EMPTY);
+
+ /*
* Setting css classes
*/
-
String topDivClass = EMPTY;
String imgSpanClass = EMPTY;
String labelSpanClass = EMPTY;
@@ -170,13 +187,14 @@
labelSpanClass += SPACE + mg_labelClass;
}
- grTopDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, topDivClass);
- grImgSpan.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, imgSpanClass);
- grLabelSpan.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, labelSpanClass);
- grFolderDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, folderDivClass);
- grListBorderDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_RICH_MENU_LIST_BORDER);
- grListBgDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, CSS_RICH_MENU_LIST_BG);
-
+// grTopDiv.setAttribute(HTML.CLASS_ATTR, topDivClass);
+ grMainLI.setAttribute(HTML.ATTR_CLASS, topDivClass);
+ grImgSpan.setAttribute(HTML.ATTR_CLASS, imgSpanClass);
+ grLabelSpan.setAttribute(HTML.ATTR_CLASS, labelSpanClass);
+// grFolderDiv.setAttribute(HTML.ATTR_CLASS, folderDivClass);
+// grListBorderDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BORDER);
+// grListBgDiv.setAttribute(HTML.ATTR_CLASS, CSS_RICH_MENU_LIST_BG);
+ grChildrenUL.setAttribute(HTML.ATTR_CLASS, folderDivClass + SPACE + CSS_RICH_MENU_LIST_BORDER + SPACE + CSS_RICH_MENU_LIST_BG);
/*
* Setting css styles
*/
@@ -186,14 +204,16 @@
topDivStyle += SPACE + mg_style;
}
- grTopDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, topDivStyle);
- grFolderDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, CSS_RICH_LIST_FOLDER_DIV_STYLE);
- grListBorderDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, CSS_RICH_LIST_BORDER_DIV_STYLE);
+// grTopDiv.setAttribute(HTML.STYLE_ATTR, topDivStyle);
+ grMainLI.setAttribute(HTML.ATTR_STYLE, topDivStyle);
+// grFolderDiv.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE);
+// grListBorderDiv.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_BORDER_DIV_STYLE);
+ grChildrenUL.setAttribute(HTML.ATTR_STYLE, CSS_RICH_LIST_FOLDER_DIV_STYLE + SPACE + CSS_RICH_LIST_BORDER_DIV_STYLE);
/*
* Encode label value
*/
- Attr valueAttr = sourceElement.getAttributeNode(HtmlComponentUtil.HTML_VALUE_ATTR);
+ Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
String labelValue = valueAttr != null
&& valueAttr.getValue() != null ? valueAttr.getValue() : EMPTY;
grLabelText.setNodeValue(labelValue);
@@ -202,7 +222,7 @@
* Encode icon facets
*/
Element iconFacet = ComponentUtil.getFacet(sourceElement, ICON_FACET_NAME);
- Element iconDisabledFacet = ComponentUtil.getFacet(sourceElement, ICON_DISABLED_FACET_NAME);
+// Element iconDisabledFacet = ComponentUtil.getFacet(sourceElement, ICON_DISABLED_FACET_NAME);
if (null != iconFacet) {
VpeChildrenInfo childInfo = new VpeChildrenInfo(grImgSpan);
childInfo.addSourceChild(iconFacet);
@@ -214,7 +234,7 @@
* Add path to specified image
*/
String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(iconPath, pageContext, true);
- grImg.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, imgFullPath);
+ grImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
* Create spacer image
@@ -228,20 +248,27 @@
}
- String menuGroupId = (String) sourceNode.getUserData(MENU_GROUP_ID);
+// String menuGroupId = (String) sourceNode.getUserData(MENU_GROUP_ID);
/*
* Adding child nodes
*/
List<Node> children = ComponentUtil.getChildren(sourceElement);
- for (Node child : children) {
- nsIDOMElement childDiv = visualDocument
- .createElement(HtmlComponentUtil.HTML_TAG_DIV);
- grListBgDiv.appendChild(childDiv);
- VpeChildrenInfo childDivInfo = new VpeChildrenInfo(childDiv);
- childDivInfo.addSourceChild(child);
- creationData.addChildrenInfo(childDivInfo);
+ if (children.size() > 0) {
+ /*
+ * Add children <ul> and children in it.
+ */
+ grMainLI.appendChild(grChildrenUL);
+ for (Node child : children) {
+// nsIDOMElement childDiv = visualDocument
+// .createElement(HTML.TAG_DIV);
+// grListBgDiv.appendChild(childDiv);
+// VpeChildrenInfo childDivInfo = new VpeChildrenInfo(childDiv);
+ VpeChildrenInfo childDivInfo = new VpeChildrenInfo(grChildrenUL);
+ childDivInfo.addSourceChild(child);
+ creationData.addChildrenInfo(childDivInfo);
+ }
}
-
+
return creationData;
}
@@ -255,20 +282,20 @@
return;
}
mg_direction = sourceElement.getAttribute(DIRECTION);
- mg_disabled = sourceElement.getAttribute(HtmlComponentUtil.HTML_ATTR_DISABLED);
+ mg_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
mg_icon = sourceElement.getAttribute(ICON);
mg_iconDisabled = sourceElement.getAttribute(ICON_DISABLED);
mg_iconFolder = sourceElement.getAttribute(ICON_FOLDER);
mg_iconFolderDisabled = sourceElement.getAttribute(ICON_FOLDER_DISABLED);
- mg_value = sourceElement.getAttribute(HtmlComponentUtil.HTML_VALUE_ATTR);
+ mg_value = sourceElement.getAttribute(HTML.ATTR_VALUE);
mg_iconClass = sourceElement.getAttribute(ICON_CLASS);
mg_iconStyle = sourceElement.getAttribute(ICON_STYLE);
mg_labelClass = sourceElement.getAttribute(LABEL_CLASS);
mg_selectClass = sourceElement.getAttribute(SELECT_CLASS);
mg_selectStyle = sourceElement.getAttribute(SELECT_STYLE);
- mg_style = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- mg_styleClass = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ mg_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
+ mg_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
}
/**
* Checks is attribute have some value.
@@ -287,15 +314,5 @@
nsIDOMElement visualNode, Object data, String name, String value) {
return true;
}
-
- public void onMouseOver(VpeVisualDomBuilder visualDomBuilder, Node sourceNode, String mouseOverId) {
- // TODO Auto-generated method stub
-// visualDomBuilder.updateNode(sourceNode);
- }
-
- public void stopMouseOver(Node sourceNode) {
- // TODO Auto-generated method stub
-
- }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-10 13:52:12 UTC (rev 10773)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesMenuItemTemplate.java 2008-10-10 13:52:31 UTC (rev 10774)
@@ -13,12 +13,12 @@
import java.util.List;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
-import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
-import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
+import org.jboss.tools.jsf.vpe.richfaces.template.util.RichFaces;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -101,6 +101,8 @@
* MenuItem component structure.
* In order of nesting.
*/
+ nsIDOMElement itemMainLI;
+
nsIDOMElement itemTopDiv;
nsIDOMElement itemIconImgSpan;
nsIDOMElement itemIconImg;
@@ -110,12 +112,13 @@
/*
* Creating visual elements
*/
- itemTopDiv = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_DIV);
- itemIconImgSpan = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
- itemIconImg = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
- itemLabelSpan = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_SPAN);
- itemLabelText = visualDocument.createTextNode(""); //$NON-NLS-1$
- creationData = new VpeCreationData(itemTopDiv);
+ itemMainLI = visualDocument.createElement(HTML.TAG_LI);
+ itemTopDiv = visualDocument.createElement(HTML.TAG_DIV);
+ itemIconImgSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ itemIconImg = visualDocument.createElement(HTML.TAG_IMG);
+ itemLabelSpan = visualDocument.createElement(HTML.TAG_SPAN);
+ itemLabelText = visualDocument.createTextNode(EMPTY);
+ creationData = new VpeCreationData(itemMainLI);
/*
* Nesting elements
@@ -123,8 +126,14 @@
itemTopDiv.appendChild(itemIconImgSpan);
itemTopDiv.appendChild(itemLabelSpan);
itemLabelSpan.appendChild(itemLabelText);
+ itemMainLI.appendChild(itemTopDiv);
/*
+ * Setting attributes for the drop-down mechanism
+ */
+ itemMainLI.setAttribute(RichFacesDropDownMenuTemplate.MENU_CHILD_ID, EMPTY);
+
+ /*
* Setting css classes
*/
String topDivClass = EMPTY;
@@ -145,9 +154,11 @@
labelSpanClass += SPACE + mi_labelClass;
}
- itemTopDiv.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, topDivClass);
- itemIconImgSpan.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, iconImgSpanClass);
- itemLabelSpan.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, labelSpanClass);
+// itemTopDiv.setAttribute(HTML.ATTR_CLASS, topDivClass);
+ itemMainLI.setAttribute(HTML.ATTR_CLASS, topDivClass);
+ itemIconImgSpan.setAttribute(HTML.ATTR_CLASS, iconImgSpanClass);
+ itemLabelSpan.setAttribute(HTML.ATTR_CLASS, labelSpanClass);
+
/*
* Setting css styles
@@ -158,21 +169,22 @@
topDivStyle += SPACE + mi_style;
}
- itemTopDiv.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, topDivStyle);
+// itemTopDiv.setAttribute(HTML.ATTR_STYLE, topDivStyle);
+ itemMainLI.setAttribute(HTML.ATTR_STYLE, topDivStyle);
/*
* Encode label and icon value
*/
- Attr valueAttr = sourceElement.getAttributeNode(HtmlComponentUtil.HTML_VALUE_ATTR);
+ Attr valueAttr = sourceElement.getAttributeNode(HTML.ATTR_VALUE);
String labelValue = valueAttr != null
- && valueAttr.getValue() != null ? valueAttr.getValue() : ""; //$NON-NLS-1$
+ && valueAttr.getValue() != null ? valueAttr.getValue() : EMPTY;
itemLabelText.setNodeValue(labelValue);
/*
* Encode icon facets
*/
Element iconFacet = ComponentUtil.getFacet(sourceElement, ICON_FACET_NAME);
- Element iconDisabledFacet = ComponentUtil.getFacet(sourceElement, ICON_DISABLED_FACET_NAME);
+// Element iconDisabledFacet = ComponentUtil.getFacet(sourceElement, ICON_DISABLED_FACET_NAME);
if (null != iconFacet) {
VpeChildrenInfo childInfo = new VpeChildrenInfo(itemIconImgSpan);
childInfo.addSourceChild(iconFacet);
@@ -184,7 +196,7 @@
* Add path to specified image
*/
String imgFullPath = VpeStyleUtil.addFullPathToImgSrc(iconPath, pageContext, true);
- itemIconImg.setAttribute(HtmlComponentUtil.HTML_ATR_SRC, imgFullPath);
+ itemIconImg.setAttribute(HTML.ATTR_SRC, imgFullPath);
} else {
/*
* Create spacer image
@@ -221,9 +233,9 @@
if (null == sourceElement) {
return;
}
- mi_disabled = sourceElement.getAttribute(HtmlComponentUtil.HTML_ATTR_DISABLED);
+ mi_disabled = sourceElement.getAttribute(HTML.ATTR_DISABLED);
mi_icon = sourceElement.getAttribute(ICON);
- mi_value = sourceElement.getAttribute(HtmlComponentUtil.HTML_VALUE_ATTR);
+ mi_value = sourceElement.getAttribute(HTML.ATTR_VALUE);
mi_iconClass = sourceElement.getAttribute(ICON_CLASS);
mi_iconDisabled = sourceElement.getAttribute(ICON_DISABLED);
@@ -231,8 +243,8 @@
mi_labelClass = sourceElement.getAttribute(LABEL_CLASS);
mi_selectClass = sourceElement.getAttribute(SELECT_CLASS);
mi_selectStyle = sourceElement.getAttribute(SELECT_STYLE);
- mi_style = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
- mi_styleClass = sourceElement.getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ mi_style = sourceElement.getAttribute(HTML.ATTR_STYLE);
+ mi_styleClass = sourceElement.getAttribute(RichFaces.ATTR_STYLE_CLASS);
}
/**
@@ -252,14 +264,5 @@
nsIDOMElement visualNode, Object data, String name, String value) {
return true;
}
-
- public void onMouseOver(VpeVisualDomBuilder visualDomBuilder, Node sourceNode, String mouseOverId) {
- // TODO Auto-generated method stub
-// visualDomBuilder.updateNode(sourceNode);
- }
- public void stopMouseOver(Node sourceNode) {
- // TODO Auto-generated method stub
-
- }
}
17 years, 3 months
JBoss Tools SVN: r10773 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-10-10 09:52:12 -0400 (Fri, 10 Oct 2008)
New Revision: 10773
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-2345
https://jira.jboss.org/jira/browse/JBIDE-2344
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2008-10-10 13:52:12 UTC (rev 10773)
@@ -79,7 +79,7 @@
};
public GenerateInitWizardPage(JpaProject jpaProject){
- super("", "", null);
+ super("", Messages.title, null);
this.jpaProject = jpaProject;
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2008-10-10 13:52:12 UTC (rev 10773)
@@ -19,9 +19,10 @@
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.ui.wizard.messages"; //$NON-NLS-1$
- public static String ccName;
- public static String connectionProfileError;
- public static String selectName;
+ public static String ccName;
+ public static String connectionProfileError;
+ public static String title;
+ public static String selectName;
public static String wizardMessage;
static {
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2008-10-10 10:30:55 UTC (rev 10772)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2008-10-10 13:52:12 UTC (rev 10773)
@@ -1,4 +1,5 @@
ccName=Console Configuration name
connectionProfileError=Connection profile should be selected.
selectName=Create default Console Configuration
+title=Use existing console configuration or connection profile for database connection
wizardMessage=Enter console configuration name if you want to create new one for selected project.
17 years, 3 months
JBoss Tools SVN: r10771 - in workspace/grid: org.jboss.tools.jbpm.convert and 36 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-10 06:29:15 -0400 (Fri, 10 Oct 2008)
New Revision: 10771
Added:
workspace/grid/org.jboss.tools.jbpm.convert/
workspace/grid/org.jboss.tools.jbpm.convert/.classpath
workspace/grid/org.jboss.tools.jbpm.convert/.project
workspace/grid/org.jboss.tools.jbpm.convert/.settings/
workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
workspace/grid/org.jboss.tools.jbpm.convert/META-INF/
workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
workspace/grid/org.jboss.tools.jbpm.convert/bin/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
workspace/grid/org.jboss.tools.jbpm.convert/build.properties
workspace/grid/org.jboss.tools.jbpm.convert/icons/
workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
workspace/grid/org.jboss.tools.jbpm.convert/lib/
workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties
workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml
workspace/grid/org.jboss.tools.jbpm.convert/src/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
change plugin name
Added: workspace/grid/org.jboss.tools.jbpm.convert/.classpath
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.classpath (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.classpath 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry exported="true" kind="lib" path="bin/" sourcepath="src/org/jboss/tools/jbpm/convert/b2j/messages"/>
+ <classpathentry exported="true" kind="lib" path="lib/dom4j-1.6.1.jar"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
Added: workspace/grid/org.jboss.tools.jbpm.convert/.project
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.project (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.project 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.jboss.tools.jbpm.convert</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Added: workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/.settings/org.eclipse.jdt.core.prefs 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,7 @@
+#Wed Jul 23 02:43:33 CST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Added: workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,22 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %PLUGIN_NAME
+Bundle-SymbolicName: org.jboss.tools.jbpm.convert.bpmnto;singleton:=true
+Bundle-Version: 1.0.0
+Bundle-Localization: plugin
+Bundle-Activator: org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.jboss.tools.common;bundle-version="2.0.0"
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ClassPath: .,
+ lib/dom4j-1.6.1.jar,
+ bin/
+Bundle-Vendor: %PLUGIN_PROVIDER
+Import-Package: org.eclipse.core.resources,
+ org.eclipse.ui.model
+Export-Package: org.jboss.tools.jbpm.convert.bpmnto,
+ org.jboss.tools.jbpm.convert.bpmnto.translate,
+ org.jboss.tools.jbpm.convert.bpmnto.util,
+ org.jboss.tools.jbpm.convert.bpmnto.wizard
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage$3.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$1.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage$2.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/bin/org/jboss/tools/jbpm/convert/bpmnto/wizard/ProjectFilter.class
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/build.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/build.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/build.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ lib/dom4j-1.6.1.jar,\
+ bin/
Added: workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/icons/sample.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
===================================================================
(Binary files differ)
Property changes on: workspace/grid/org.jboss.tools.jbpm.convert/lib/dom4j-1.6.1.jar
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/plugin.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,5 @@
+wizard.name=BPMN -> JPDL
+wizard.description = Export a BPMN file to JPDL
+category.name=BPMN Export
+PLUGIN_NAME=BPMNExport
+PLUGIN_PROVIDER=Red Hat, Inc.
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/plugin.xml 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension point="org.eclipse.ui.exportWizards">
+ <category name="%category.name"
+ id="org.jboss.tools.jbpm.convert.export.category"/>
+ <wizard name="%wizard.name"
+ icon="icons/sample.gif"
+ category="org.jboss.tools.jbpm.convert.export.category"
+ class="org.jboss.tools.jbpm.convert.b2j.wizard.B2JExportWizard"
+ id="org.jboss.tools.jbpm.convert.export.b2jexportwizard">
+ <description>%wizard.description</description>
+ <selection name="*.bpmn" class="org.eclipse.core.resources.IFile"/>
+ </wizard>
+ </extension>
+
+</plugin>
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,78 @@
+Loop_Decision=Loop_Decition
+To=to
+Space=
+Underline=_
+Folder_Name_Separator=.
+Dom_Element_Name=name
+Dom_Element_ID=id
+Width_Attribute_Name=width
+Height_Attribute_Name=height
+X_Attribute_Name=x
+Y_Attribute_Name=y
+Label_Select_All=Select All
+Label_Deselect_All=Deselect All
+Label_Button_Browse=Browse...
+Bpmn_Diagram_Name_Suffix=_diagram
+Bpmn_Pool_Element_Name=pools
+Bpmn_Vertice_Element_Name=vertices
+Bpmn_SequenceFlow_Element_Name=sequenceEdges
+Bpmn_Href_Attribute_Name=href
+Bpmn_XmiType_Attribute_Name=type
+Bpmn_ActivityType_Attribute_Name=activityType
+Bpmn_InFlow_Attribute_Name=incomingEdges
+Bpmn_Looping_Attribute_Name=looping
+Bpmn_FlowSource_Attribute_Name=source
+Bpmn_FlowTarget_Attribute_Name=target
+Bpmn_FlowDefault_Attribute_Name=isDefault
+Bpmn_Element_ID=iD
+Bpmn_Wizard_Title=BPMN to jPDL Conversion
+Bpmn_File_Choose_WizardPage_Name=FileChoosePage
+Bpmn_File_Choose_WizardPage_Title=BPMN Resources
+Bpmn_File_Choose_WizardPage_ViewerTitle=BPMN resources
+Bpmn_File_Choose_WizardPage_Message=Select BPMN resources to convert
+Bpmn_Pool_Choose_WizardPage_Name=PoolPage
+Bpmn_Pool_Choose_WizardPage_Message=Available BPMN Pools
+Bpmn_Pool_Choose_WizardPage_Title=Select BPMN pools to translate
+Bpmn_GeneratedFile_Location_WizardPage_Name=LocationPage
+Bpmn_GeneratedFile_Location_WizardPage_Message=Select the target location
+Bpmn_GeneratedFile_Location_WizardPage_Title=Target Location
+Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle=Target location
+Bpmn_GeneratedFile_Location_WizardPage_CheckBox=Overwrite existing resources
+Bpmn_Translate_Message_WizardPage_Name=MessagePage
+Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
+Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occured during conversion
+Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
+Bpmn_EAnnotations_Element_Name=eAnnotations
+Bpmn_Details_Element_Name=details
+Bpmn_Value_Attribute_Name=value
+Jpdl_Suffix=jpdl
+Jpdl_Element_Decision_Suffix=Decision
+Jpdl_Element_Complete_Suffix=Complete
+Jpdl_Element_Cancel_Suffix=Cancel
+Jpdl_Element_Successful_Name=Successful?
+Jpdl_Process_Definition_Name=processdefinition.xml
+Jpdl_32_Namespace_Url=urn:jbpm.org:jpdl-3.2
+Jpdl_Process_Definition_Element_Name=process-definition
+Jpdl_Transition_Element=transition
+Jpdl_ProcessState_Element_Name=process-state
+Jpdl_SubProcess_Element_Name=sub-process
+Jpdl_Decision_Element_Name=decision
+Jpdl_Fork_Element_Name=fork
+Jpdl_Join_Element_Name=join
+Jpdl_Start_Element_Name=start-state
+Jpdl_State_Element_Name=state
+Jpdl_End_Element_Name=end-state
+Jpdl_Node_Element_Name=node
+Gpd_Definition_Name=gpd.xml
+Gpd_Layout_Element_Name=layoutConstraint
+Gpd_Element_Name=element
+Gpd_Process_Diagram_Name=process-diagram
+Gpd_Label_Element_Name=label
+Translate_Error_GpdFile_CanNotGenerate=Errror: Couldn't write gpd.xml:
+Translate_Error_GpdFile_CanNotWrite=Errror: Couldn't write gpd definition to a gpd.xml:
+Translate_Error_JpdlProcess_Definition_Null=Errror: The JPDL process definition is null.
+Translate_Error_JpdlFile_CanNotGenerate=Errror: Couldn't write process definition xml:
+Translate_Error_JpdlFile_CanNotWrite=Errror: Couldn't write process definition to a jpdl file:
+Translate_Error_File_CanNotRead=Error: Couldn't read or parse {0} file to a DOM document:
+Translate_Warning_Bpmn_Element_Name=Warning: The bpmn element's name is null or same to another element's name:
+Translate_Warning_Bpmn_Element_Type=Warning: The type of this bpmn element is not translated to corresponding jpdl element:
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.messages;
+
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class B2JMessages {
+
+ private static final String BUNDLE_NAME = "org.jboss.tools.jbpm.convert.b2j.messages.B2J"; //$NON-NLS-1$
+
+ private B2JMessages() {
+ // Do not instantiate
+ }
+
+ public static String Loop_Decision;
+ public static String To;
+ public static String Folder_Name_Separator;
+ public static String Space;
+ public static String Underline;
+ public static String Width_Attribute_Name;
+ public static String Height_Attribute_Name;
+ public static String X_Attribute_Name;
+ public static String Y_Attribute_Name;
+ public static String Label_Select_All;
+ public static String Label_Deselect_All;
+ public static String Label_Button_Browse;
+ public static String Bpmn_Diagram_Name_Suffix;
+ public static String Bpmn_Pool_Element_Name;
+ public static String Bpmn_Element_ID;
+ public static String Bpmn_Vertice_Element_Name;
+ public static String Bpmn_SequenceFlow_Element_Name;
+ public static String Bpmn_Looping_Attribute_Name;
+ public static String Bpmn_InFlow_Attribute_Name;
+ public static String Bpmn_XmiType_Attribute_Name;
+ public static String Bpmn_Href_Attribute_Name;
+ public static String Bpmn_ActivityType_Attribute_Name;
+ public static String Bpmn_FlowSource_Attribute_Name;
+ public static String Bpmn_FlowTarget_Attribute_Name;
+ public static String Bpmn_FlowDefault_Attribute_Name;
+ public static String Bpmn_Wizard_Title;
+ public static String Bpmn_File_Choose_WizardPage_Name;
+ public static String Bpmn_File_Choose_WizardPage_Title;
+ public static String Bpmn_File_Choose_WizardPage_Message;
+ public static String Bpmn_File_Choose_WizardPage_ViewerTitle;
+ public static String Bpmn_Pool_Choose_WizardPage_Name;
+ public static String Bpmn_Pool_Choose_WizardPage_Message;
+ public static String Bpmn_Pool_Choose_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Name;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Message;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_Title;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle;
+ public static String Bpmn_GeneratedFile_Location_WizardPage_CheckBox;
+ public static String Bpmn_Translate_Message_WizardPage_Name;
+ public static String Bpmn_Translate_Message_WizardPage_Title;
+ public static String Bpmn_Translate_Message_WizardPage_Message;
+ public static String Bpmn_Translate_Message_WizardpageViewer_Title;
+ public static String Bpmn_EAnnotations_Element_Name;
+ public static String Bpmn_Details_Element_Name;
+ public static String Bpmn_Value_Attribute_Name;
+ public static String Jpdl_Element_Decision_Suffix;
+ public static String Jpdl_Element_Complete_Suffix;
+ public static String Jpdl_Element_Cancel_Suffix;
+ public static String Jpdl_Element_Successful_Name;
+ public static String Jpdl_Suffix;
+ public static String Jpdl_Process_Definition_Name;
+ public static String Jpdl_ProcessState_Element_Name;
+ public static String Jpdl_SubProcess_Element_Name;
+ public static String Jpdl_32_Namespace_Url;
+ public static String Jpdl_Process_Definition_Element_Name;
+ public static String Jpdl_Transition_Element;
+ public static String Jpdl_Decision_Element_Name;
+ public static String Jpdl_Fork_Element_Name;
+ public static String Jpdl_Join_Element_Name;
+ public static String Jpdl_Start_Element_Name;
+ public static String Jpdl_State_Element_Name;
+ public static String Jpdl_End_Element_Name;
+ public static String Jpdl_Node_Element_Name;
+ public static String Gpd_Definition_Name;
+ public static String Gpd_Layout_Element_Name;
+ public static String Gpd_Element_Name;
+ public static String Gpd_Process_Diagram_Name;
+ public static String Gpd_Label_Element_Name;
+ public static String Dom_Element_Name;
+ public static String Dom_Element_ID;
+ public static String Translate_Error_JpdlProcess_Definition_Null;
+ public static String Translate_Error_JpdlFile_CanNotWrite;
+ public static String Translate_Error_JpdlFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotGenerate;
+ public static String Translate_Error_GpdFile_CanNotWrite;
+ public static String Translate_Error_File_CanNotRead;
+ public static String Translate_Warning_Bpmn_Element_Name;
+ public static String Translate_Warning_Bpmn_Element_Type;
+
+ static {
+ NLS.initializeMessages(BUNDLE_NAME, B2JMessages.class);
+ }
+}
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,466 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn ->jpdl
+ */
+public class BPMN2JPDL extends BPMNTranslator {
+
+ Document bpmnDocument;
+ List<Document> processDefs = new ArrayList<Document>();
+
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public Map<String, Element> getMap() {
+ return map;
+ }
+
+ public void setMap(Map<String, Element> map) {
+ this.map = map;
+ }
+
+ public BPMN2JPDL() {
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ Document bpmnDocument) {
+ this(bpmnFileName, bpmnFilePath, null, bpmnDocument);
+ }
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList, Document bpmnDocument) {
+ super(bpmnFileName, bpmnFilePath, poolIDList);
+ this.bpmnDocument = bpmnDocument;
+ }
+
+ /*
+ * Translate a bpmn diagram to string[]. Every string is jpdl process
+ * definition
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[processDefs.size()];
+ int i = 0;
+ for (Document def : processDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_JpdlFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+
+ return strForProcessDefs;
+ }
+
+ /*
+ * Translate a bpmn diagram to file[]. Every file is a jpdl file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForProcessDefs = translateToStrings();
+ String[] jpdlFileNames = new String[processDefs.size()];
+
+ int i = 0;
+ for (Document def : processDefs) {
+ jpdlFileNames[i] = def.getName();
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForProcessDefs, jpdlFileNames,
+ B2JMessages.Jpdl_Process_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_JpdlFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn diagram Domument tree to some jpdl process Dom trees
+ */
+ public void translateDiagram() {
+
+ // set the namemap = null
+ TranslateHelper.setNameMap(new HashMap<String, Integer>());
+
+ Element diagram = bpmnDocument.getRootElement();
+ if (this.poolIDList == null || this.poolIDList.size() == 0) {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ translateGraph((Element) pool);
+ }
+ } else {
+ for (Object pool : diagram
+ .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (this.poolIDList.contains(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID))) {
+ translateGraph((Element) pool);
+ }
+ }
+ }
+ }
+
+ /*
+ * Translate a bpmn pool or subprocess to a jpdl process Dom tree
+ */
+ private Element translateGraph(Element graph) {
+ Document processDef = TranslateHelper.createJpdlDomTree(true);
+ Element processRoot = processDef.getRootElement();
+
+ DomXmlWriter.addAttribute(processRoot, B2JMessages.Dom_Element_Name,
+ TranslateHelper.generateProcessName(graph));
+ processDef.setName(processRoot
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ map.put(graph.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Pool_Element_Name, processRoot);
+
+ for (Object activity : graph.elements()) {
+ if (B2JMessages.Bpmn_Vertice_Element_Name
+ .equals(((Element) activity).getName())) {
+ translateActivity(((Element) activity), processRoot);
+ }
+ }
+ translateSequenceFlows(graph, processRoot);
+ processDefs.add(processDef);
+
+ return processRoot;
+ }
+
+ /*
+ * Translate a bpmn activity to a jpdl node according to activity type
+ */
+ private void translateActivity(Element activity, Element processRoot) {
+ String type = activity
+ .attributeValue(B2JMessages.Bpmn_XmiType_Attribute_Name);
+ Element element = null;
+
+ // According to bpmn activity type, map to different jpdl node
+ // Some type can not be supported by this translation, we give
+ // a warining message for it.
+ if ("bpmn:Activity".equals(type)) {
+ String activityType = activity
+ .attributeValue(B2JMessages.Bpmn_ActivityType_Attribute_Name);
+ if (activityType == null || "Task".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ } else if ("EventStartEmpty".equals(activityType)
+ || "EventStartMessage".equals(activityType)
+ || "EventStartRule".equals(activityType)
+ || "EventStartTimer".equals(activityType)
+ || "EventStartLink".equals(activityType)
+ || "EventStartMultiple".equals(activityType)
+ || "EventStartSignal".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Start_Element_Name);
+ if (!"EventStartEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventIntermediateEmpty".equals(activityType)
+ || "EventIntermediateMessage".equals(activityType)
+ || "EventIntermediateTimer".equals(activityType)
+ || "EventIntermediateError".equals(activityType)
+ || "EventIntermediateCompensation".equals(activityType)
+ || "EventIntermediateRule".equals(activityType)
+ || "EventIntermediateMultiple".equals(activityType)
+ || "EventIntermediateCancel".equals(activityType)
+ || "EventIntermediateLink".equals(activityType)
+ || "EventIntermediateSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_State_Element_Name);
+ if (!"EventIntermediateEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("EventEndEmpty".equals(activityType)
+ || "EventEndMessage".equals(activityType)
+ || "EventEndError".equals(activityType)
+ || "EventEndCompensation".equals(activityType)
+ || "EventEndTerminate".equals(activityType)
+ || "EventEndLink".equals(activityType)
+ || "EventEndMultiple".equals(activityType)
+ || "EventEndCancel".equals(activityType)
+ || "EventEndSignal".equals(activityType)) {
+
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_End_Element_Name);
+ if (!"EventEndEmpty".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayDataBasedExclusive".equals(activityType)
+ || "GatewayEventBasedExclusive".equals(activityType)
+ || "GatewayComplex".equals(activityType)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+ if (!"GatewayDataBasedExclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ } else if ("GatewayParallel".equals(activityType)
+ || "GatewayDataBasedInclusive".equals(activityType)) {
+ if (activity
+ .attributeValue(B2JMessages.Bpmn_InFlow_Attribute_Name) == null
+ || activity.attributeValue(
+ B2JMessages.Bpmn_InFlow_Attribute_Name).split(
+ B2JMessages.Space).length == 1) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Fork_Element_Name);
+ } else {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Join_Element_Name);
+ }
+ if (!"GatewayDataBasedInclusive".equals(activityType)) {
+ warnings
+ .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ + activityType);
+ }
+ }
+ } else if ("bpmn:SubProcess".equals(type)) {
+ element = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_ProcessState_Element_Name);
+ translateSubprocess(activity, element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(activity, element)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + activity.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), element);
+
+ // If bpmn activity is loop type, then create a structure to mock it.
+ if ("true".equals(activity
+ .attributeValue(B2JMessages.Bpmn_Looping_Attribute_Name))) {
+ createMockLoop(activity, element);
+ }
+ }
+
+ /*
+ * Translate a bpmn subprocess to a jpdl processstate and a new jpdl process
+ * difinition
+ */
+ private void translateSubprocess(Element subProcess, Element element) {
+ Element processRoot = translateGraph(subProcess);
+ Element ele = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_SubProcess_Element_Name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name,
+ processRoot);
+
+ // translate the transaction of subprocess
+ Element eAnnot = subProcess
+ .element(B2JMessages.Bpmn_EAnnotations_Element_Name);
+ if (eAnnot != null) {
+ Element details = eAnnot
+ .element(B2JMessages.Bpmn_Details_Element_Name);
+ if (details != null
+ && "true"
+ .equals(details
+ .attributeValue(B2JMessages.Bpmn_Value_Attribute_Name))) {
+ translateTransaction(processRoot);
+ }
+ }
+ }
+
+ /*
+ * translate a transaction of sub process
+ */
+ private void translateTransaction(Element processRoot) {
+ List<Element> lastEleList = TranslateHelper.locateLastElements(processRoot);
+
+ if (lastEleList.size() == 0) {
+ return;
+ }
+ // create a decision
+ Element decision = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Decision_Element_Name);
+
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Successful_Name);
+ // get bpmn id from map
+ String bpmnId = null;
+ for (String key : map.keySet()) {
+ if (map.get(key) == lastEleList.get(0)) {
+ bpmnId = key;
+ break;
+ }
+ }
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Decision_Suffix, decision);
+
+ // create a transition from element to decision
+ for (Element ele : lastEleList) {
+ Element transition = DomXmlWriter.addElement(ele,
+ B2JMessages.Jpdl_Transition_Element);
+ transition.addAttribute(B2JMessages.Dom_Element_Name, ele
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.To + B2JMessages.Jpdl_Decision_Element_Name);
+ transition.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ // create a complete element
+ Element complete = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(complete, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Complete_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Complete_Suffix, complete);
+
+ // create a cancel element
+ Element cancel = DomXmlWriter.addElement(processRoot,
+ B2JMessages.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(cancel, B2JMessages.Dom_Element_Name,
+ B2JMessages.Jpdl_Element_Cancel_Suffix);
+ map.put(bpmnId + B2JMessages.Jpdl_Element_Cancel_Suffix, cancel);
+
+ // create transition from decision to complete element
+ Element toComplete = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toComplete.addAttribute(B2JMessages.Dom_Element_Name, "true");
+ toComplete.addAttribute(B2JMessages.To, complete
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create transition from decision to cancel element
+ Element toCancel = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ toCancel.addAttribute(B2JMessages.Dom_Element_Name, "false");
+ toCancel.addAttribute(B2JMessages.To, cancel
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+
+ /*
+ * Translate bpmn sequenceflows to jpdl transitions
+ */
+ private void translateSequenceFlows(Element graph, Element processRoot) {
+ for (Object edge : graph
+ .elements(B2JMessages.Bpmn_SequenceFlow_Element_Name)) {
+ translateSequenceFlow((Element) edge, processRoot);
+ }
+ }
+
+ /*
+ * Translate a bpmn sequenceflow to a jpdl transition
+ */
+ private void translateSequenceFlow(Element edge, Element processRoot) {
+
+ Element source = map.get(edge
+ .attributeValue(B2JMessages.Bpmn_FlowSource_Attribute_Name));
+
+ Element transition = null;
+ if ("true".equals(edge
+ .attributeValue(B2JMessages.Bpmn_FlowDefault_Attribute_Name))
+ && source.element(B2JMessages.Jpdl_Transition_Element) != null) {
+ // move default transition to the first of transition list
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element, 0);
+ } else {
+ transition = DomXmlWriter.addElement(source,
+ B2JMessages.Jpdl_Transition_Element);
+ }
+
+ if (!TranslateHelper.check_mapElementName(edge, transition)) {
+ warnings.add(B2JMessages.Translate_Warning_Bpmn_Element_Name
+ + edge.attributeValue(B2JMessages.Bpmn_Element_ID));
+ }
+ transition
+ .addAttribute(
+ B2JMessages.To,
+ map
+ .get(
+ edge
+ .attributeValue(B2JMessages.Bpmn_FlowTarget_Attribute_Name))
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ /*
+ * create a jpdl decision structure to map bpmn loop activity
+ */
+ private void createMockLoop(Element activity, Element element) {
+
+ // create a decision
+ Element decision = DomXmlWriter.addElement(element.getParent(),
+ B2JMessages.Jpdl_Decision_Element_Name);
+ String name = activity.attributeValue(B2JMessages.Dom_Element_Name)
+ + B2JMessages.Underline + B2JMessages.Loop_Decision;
+ DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name, name);
+
+ // use the decision to replace the activity in the map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), decision);
+ // add the activity to map
+ map.put(activity.attributeValue(B2JMessages.Dom_Element_ID)
+ + B2JMessages.Bpmn_Vertice_Element_Name, element);
+
+ // create a transition from element to decision
+ Element first = DomXmlWriter.addElement(element,
+ B2JMessages.Jpdl_Transition_Element);
+ first.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline + name);
+ first.addAttribute(B2JMessages.To, decision
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ // create a transition from decision to element
+ Element second = DomXmlWriter.addElement(decision,
+ B2JMessages.Jpdl_Transition_Element);
+ second.addAttribute(B2JMessages.Dom_Element_Name, B2JMessages.To
+ + B2JMessages.Underline
+ + element.attributeValue(B2JMessages.Dom_Element_Name));
+ second.addAttribute(B2JMessages.To, element
+ .attributeValue(B2JMessages.Dom_Element_Name));
+
+ }
+
+ public List<Document> getProcessDefs() {
+ return processDefs;
+ }
+
+ public void setProcessDefs(List<Document> processDefs) {
+ this.processDefs = processDefs;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,245 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.bpmnto.translate.BPMNTranslator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a translator for bpmn_diagram to gpd of jpdl
+ */
+public class GraphicalFileGenerator extends BPMNTranslator {
+
+ Document document;
+
+ // gpd.xml documents list
+ List<Document> gpdDefs = new ArrayList<Document>();
+
+ // the pool of gpd.xml name
+ List<String> gpdPoolNames = new ArrayList<String>();
+ Map<String, Element> map = new HashMap<String, Element>();
+
+ public GraphicalFileGenerator(Document bpmnDiagramDocument,
+ Map<String, Element> map, String rootLocation, String bpmnFileName) {
+ this.rootLocation = rootLocation;
+ this.bpmnFileName = bpmnFileName;
+ this.document = bpmnDiagramDocument;
+ this.map = map;
+ }
+
+ /*
+ * translate a bpmn_diagram document to a gpd document string
+ */
+ public String[] translateToStrings() {
+ this.translateDiagram();
+ String[] strForProcessDefs = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ try {
+ strForProcessDefs[i] = DomXmlWriter.toString(def);
+ } catch (IOException e) {
+ this.errors
+ .add(B2JMessages.Translate_Error_GpdFile_CanNotGenerate
+ + e.getMessage());
+ }
+ i++;
+ }
+ return strForProcessDefs;
+ }
+
+ /*
+ * translate every gpd document string to a gpd file
+ */
+ public void translateToFiles(String fileLocation) {
+ String[] strForGpdDefs = translateToStrings();
+ String[] gpdFileNames = new String[gpdDefs.size()];
+ int i = 0;
+ for (Document def : gpdDefs) {
+ gpdFileNames[i] = def.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name);
+ i++;
+ }
+
+ try {
+ TranslateHelper.createFiles(fileLocation, bpmnFileName,
+ strForGpdDefs, gpdFileNames,
+ B2JMessages.Gpd_Definition_Name, false);
+ } catch (Exception e) {
+ errors.add(B2JMessages.Translate_Error_GpdFile_CanNotWrite
+ + e.getMessage());
+ }
+
+ if (errors.size() != 0) {
+ for (String str : errors) {
+ BpmnToPlugin.getDefault().logError(str);
+ }
+ }
+
+ if (warnings.size() != 0) {
+ for (String str : warnings) {
+ BpmnToPlugin.getDefault().logWarning(str);
+ }
+ }
+ }
+
+ /*
+ * translate the graphical bpmn_diagram document
+ */
+ public void translateDiagram() {
+ Element rootElement = document.getRootElement();
+ List<Element> eleList = DomXmlWriter.getElementsByName(rootElement,
+ B2JMessages.Gpd_Element_Name);
+
+ for (String bpmnID : map.keySet()) {
+ if (bpmnID != null) {
+ // when translate bpmn loop activity, we create a mock
+ // structure and when translate bpmn transaction, we create a
+ // mock structure too. For these reason, we need to give a (x,y)
+ // increment to avoid two element overlap
+ int xIncre = 0;
+ int yIncre = 0;
+ Element bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ bpmnID, eleList);
+ if (bpmnGpdEle == null) {
+ if (bpmnID.endsWith(B2JMessages.Bpmn_Vertice_Element_Name)) {
+ bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ TranslateHelper.getPureBpmnID(bpmnID,
+ B2JMessages.Bpmn_Vertice_Element_Name),
+ eleList);
+ xIncre = 150;
+ yIncre = 50;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Decision_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Decision_Suffix),
+ eleList);
+ xIncre = 150;
+ yIncre = 100;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Complete_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Complete_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 0;
+ } else if (bpmnID
+ .endsWith(B2JMessages.Jpdl_Element_Cancel_Suffix)) {
+ bpmnGpdEle = TranslateHelper
+ .getDiagramLayoutElement(
+ TranslateHelper
+ .getPureBpmnID(
+ bpmnID,
+ B2JMessages.Jpdl_Element_Cancel_Suffix),
+ eleList);
+ xIncre = 300;
+ yIncre = 200;
+ }
+ }
+ if (bpmnGpdEle == null) {
+ continue;
+ }
+ translateGraphicalElement(TranslateHelper.getXY(bpmnGpdEle,
+ xIncre, yIncre), map.get(bpmnID), eleList);
+ }
+ }
+
+ }
+
+ private void translateGraphicalElement(String[] xy, Element jpdlEle,
+ List<Element> eleList) {
+ if (jpdlEle == null) {
+ return;
+ }
+
+ // if not translate, then translate the pool of the element
+ if (!gpdPoolNames.contains(jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))
+ && B2JMessages.Jpdl_Process_Definition_Element_Name
+ .equals(jpdlEle.getParent().getName())) {
+ translatePool(eleList, jpdlEle);
+ }
+
+ // translate the bpmn graphical element
+ Element poolEle = null;
+ for (Document doc : gpdDefs) {
+ if (doc.getRootElement().attributeValue(
+ B2JMessages.Dom_Element_Name).equals(
+ jpdlEle.getParent().attributeValue(
+ B2JMessages.Dom_Element_Name))) {
+ poolEle = doc.getRootElement();
+ }
+ }
+ Element pgdEle = TranslateHelper.createNode(poolEle,
+ B2JMessages.Jpdl_Node_Element_Name, jpdlEle);
+
+ TranslateHelper.mapXY(pgdEle, xy[0], xy[1]);
+
+ // translate the sequence flow of the element
+ for (Object ele : jpdlEle.elements(B2JMessages.Jpdl_Transition_Element)) {
+ TranslateHelper.createTransition(pgdEle,
+ B2JMessages.Jpdl_Transition_Element, (Element) ele);
+ }
+ }
+
+ private void translatePool(List<Element> eleList, Element jpdlEle) {
+ // get the bpmn pool id
+ String poolBpmnID = null;
+ for (String id : map.keySet()) {
+ if (map.get(id) == jpdlEle.getParent()) {
+ poolBpmnID = TranslateHelper.getPureBpmnID(id,
+ B2JMessages.Bpmn_Pool_Element_Name);
+ break;
+ }
+ }
+ // get the bpmn pool graphical element
+ if (poolBpmnID != null) {
+ Element poolBpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
+ poolBpmnID, eleList);
+ Document processDiagramDef = DomXmlWriter.createDomTree(false,
+ null, B2JMessages.Gpd_Process_Diagram_Name);
+ Element poolEle = processDiagramDef.getRootElement();
+ DomXmlWriter.mapAttribute(poolEle, B2JMessages.Dom_Element_Name,
+ jpdlEle.getParent());
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Width_Attribute_Name, poolBpmnGpdEle);
+ DomXmlWriter.mapAttribute(poolEle,
+ B2JMessages.Height_Attribute_Name, poolBpmnGpdEle);
+
+ gpdDefs.add(processDiagramDef);
+ gpdPoolNames.add(poolEle
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,259 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.translate;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a helper class for bpmn ->jpdl
+ */
+public class TranslateHelper {
+
+ // the map for the bpmn element id : the corresponding generated element
+ static Map<String, Integer> nameMap = new HashMap<String, Integer>();
+
+ public static void setNameMap(Map<String, Integer> nameMap) {
+ TranslateHelper.nameMap = nameMap;
+ }
+
+ /*
+ * get the bpmn_diagram file name
+ */
+ public static String getBpmnDiagramName(String bpmnFileName) {
+ return bpmnFileName + B2JMessages.Bpmn_Diagram_Name_Suffix;
+ }
+
+ /*
+ * create a jpdl dom tree
+ */
+ public static Document createJpdlDomTree(boolean useNamespace) {
+ return DomXmlWriter.createDomTree(useNamespace,
+ B2JMessages.Jpdl_32_Namespace_Url,
+ B2JMessages.Jpdl_Process_Definition_Element_Name);
+
+ }
+
+ /*
+ * create translated files from dom strings
+ */
+ public static File[] createFiles(String parentFolder, String bpmnFileName,
+ String[] strsForGenerate, String[] fileFolders, String fileName,
+ boolean isOverWrite) throws IOException {
+ File jpdlFolder = BPMNToUtil.createFile(parentFolder,
+ B2JMessages.Jpdl_Suffix, null, isOverWrite);
+ File diagramFolder = BPMNToUtil.createFile(
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
+
+ File[] files = new File[strsForGenerate.length];
+ File processFolder = null;
+ int i = 0;
+ for (String str : strsForGenerate) {
+ processFolder = BPMNToUtil.createFile(diagramFolder
+ .getAbsolutePath(), fileFolders[i], null, isOverWrite);
+ files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
+ fileName, str, isOverWrite);
+ i++;
+ }
+ return files;
+ }
+
+ /*
+ * generate a process definition name. the name is composed of the names
+ * from bpmn diagram to the element
+ */
+ public static String generateProcessName(Element graph) {
+ if ("BpmnDiagram".equals(graph.getName())) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ String str = generateProcessName(graph.getParent());
+ if (str == null) {
+ return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ } else {
+ return str + B2JMessages.Folder_Name_Separator
+ + graph.attributeValue(B2JMessages.Dom_Element_Name);
+ }
+ }
+
+ }
+
+ /*
+ * check the bpmn element name is null or "" or same to another element name
+ * and generate a different name
+ */
+ public static boolean check_mapElementName(Element graph, Element graphEle) {
+
+ boolean isOk = true;
+ String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+
+ if (name == null || "".equals(name)) {
+ name = "jboss_autogen";
+ isOk = false;
+ }
+ Integer i = nameMap.get(name);
+ if (i == null) {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name);
+ nameMap.put(name, new Integer("1"));
+ } else {
+ DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ name + "_" + i);
+ nameMap.put(name, ++i);
+ isOk = false;
+ }
+
+ return isOk;
+
+ }
+
+ /*
+ * select the elements from process. These elements have no transitions sub
+ * element or have transtions to end-state.
+ */
+ public static List<Element> locateLastElements(Element processRoot) {
+ List<Element> list = new ArrayList<Element>();
+
+ if (processRoot.element(B2JMessages.Jpdl_End_Element_Name) != null) {
+ Element endState = processRoot
+ .element(B2JMessages.Jpdl_End_Element_Name);
+ for (Object ele : processRoot.elements()) {
+ Element subEle = ((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element);
+ if (subEle != null
+ && endState
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ .equals(subEle.attributeValue(B2JMessages.To))) {
+ list.add((Element) ele);
+ }
+ }
+ } else {
+ for (Object ele : processRoot.elements()) {
+ if (((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element) == null) {
+ list.add((Element) ele);
+ }
+ }
+ }
+
+ return list;
+ }
+
+ /*
+ * get the layout element from bpmn_diagram file by id
+ */
+ public static Element getDiagramLayoutElement(String bpmnID,
+ List<Element> eleList) {
+ Element element = null;
+ for (Element ele : eleList) {
+ String str = ele
+ .attributeValue(B2JMessages.Bpmn_Href_Attribute_Name);
+ if (str != null && str.contains(bpmnID)) {
+ element = ele;
+ break;
+ }
+ }
+
+ if (element != null
+ && element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name) != null) {
+ return element.getParent().element(
+ B2JMessages.Gpd_Layout_Element_Name);
+ }
+
+ return null;
+ }
+
+ /*
+ * create a graphical jpdl transition
+ */
+ public static Element createTransition(Element parentEle, String name,
+ Element jpdlEle) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+
+ Element label = DomXmlWriter.addElement(ele,
+ B2JMessages.Gpd_Label_Element_Name);
+ TranslateHelper.mapXY(label, "5", "-10");
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl element
+ */
+ private static Element createElement(Element parentEle, String name,
+ String width, String height) {
+ Element ele = DomXmlWriter.addElement(parentEle, name);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Width_Attribute_Name, width);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Height_Attribute_Name,
+ height);
+ return ele;
+ }
+
+ /*
+ * create graphical jpdl node
+ */
+ public static Element createNode(Element rootEle, String name,
+ Element jpdlEle) {
+ Element ele = TranslateHelper.createElement(rootEle, name, "100", "40");
+ DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+ return ele;
+ }
+
+ /*
+ * map bpmn x,y attribute to jpdl graphical element
+ */
+ public static void mapXY(Element pgdEle, String x, String y) {
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.X_Attribute_Name,
+ x == null ? "0" : x);
+ DomXmlWriter.addAttribute(pgdEle, B2JMessages.Y_Attribute_Name,
+ y == null ? "0" : y);
+
+ }
+
+ /*
+ * get a bpmn element id from a given string by subtract suffix for example
+ * bpmn pool has pools suffix a bpmn loop activity has vertices suffix
+ */
+ public static String getPureBpmnID(String bpmnID, String suffix) {
+ return bpmnID.substring(0, bpmnID.length() - suffix.length());
+ }
+
+ /*
+ * get (x,y) from a graphical element and add increments
+ */
+ public static String[] getXY(Element bpmnGpdEle, int xIncre, int yIncre) {
+ String xy[] = new String[2];
+ xy[0] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.X_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.X_Attribute_Name))
+ + xIncre);
+ xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
+ .attributeValue(B2JMessages.Y_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(B2JMessages.Y_Attribute_Name))
+ + yIncre);
+ return xy;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.b2j.wizard;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.osgi.util.NLS;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.b2j.translate.TranslateHelper;
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.jbpm.convert.b2j.translate.BPMN2JPDL;
+import org.jboss.tools.jbpm.convert.b2j.translate.GraphicalFileGenerator;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn to jpdl translation
+ */
+public class B2JExportWizard extends BpmnToWizard {
+
+ private List<String> strForProcessList = new ArrayList<String>();
+ private List<String> strForGpdList = new ArrayList<String>();
+ private List<String> generatedFoldersList = new ArrayList<String>();
+
+ public void createGeneratedFile(boolean isOverWrite) {
+ String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
+
+ int i = 0;
+ for (String name : this.generatedFoldersList) {
+ jpdlFolderNames[i] = name;
+ i++;
+ }
+
+ String location = super.getContainerPath((IContainer) super
+ .getTargetLocationSelection().getFirstElement());
+
+ if (this.strForProcessList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForProcessList.size()];
+ for (String pro : this.strForProcessList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames,
+ B2JMessages.Jpdl_Process_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ if (this.strForGpdList.size() > 0) {
+ i = 0;
+ String[] strs = new String[strForGpdList.size()];
+ for (String pro : this.strForGpdList) {
+ strs[i] = pro;
+ i++;
+ }
+ try {
+ TranslateHelper.createFiles(location, bpmnFileName, strs,
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
+ } catch (Exception e) {
+ BpmnToPlugin.getDefault().logError(e.getMessage());
+ }
+ }
+
+ }
+
+ public List<String> translateBpmnToStrings() {
+ List<String> warningList = new ArrayList<String>();
+ List<String> errorList = new ArrayList<String>();
+
+ Document bpmnDocument = null;
+ try {
+ bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ }
+
+ BPMN2JPDL translator = new BPMN2JPDL(bpmnFileName, bpmnFileParentPath,
+ poolIdList, bpmnDocument);
+
+ this.setStrForProcessList(Arrays
+ .asList(translator.translateToStrings()));
+
+ for (Document def : translator.getProcessDefs()) {
+ this.generatedFoldersList.add(def.getName());
+ }
+
+ warningList.addAll(translator.getWarnings());
+ errorList.addAll(translator.getErrors());
+
+ // generate jpdl gpd file from *.bpmn_diagram
+ Document bpmnDiagramDocument = null;
+ try {
+ bpmnDiagramDocument = getDocument(bpmnFileParentPath,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName));
+ } catch (Exception e) {
+ errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
+ TranslateHelper.getBpmnDiagramName(bpmnFileName)));
+ }
+ GraphicalFileGenerator generator = new GraphicalFileGenerator(
+ bpmnDiagramDocument, translator.getMap(), bpmnFileParentPath,
+ bpmnFileName);
+
+ this.setStrForGpdList(Arrays.asList(generator.translateToStrings()));
+
+ warningList.addAll(generator.getWarnings());
+ errorList.addAll(generator.getErrors());
+
+ List<String> list = new ArrayList<String>();
+ list.addAll(errorList);
+ list.addAll(warningList);
+
+ return list;
+ }
+
+ public List<String> getStrForProcessList() {
+ return strForProcessList;
+ }
+
+ public void setStrForProcessList(List<String> strForProcessList) {
+ this.strForProcessList = strForProcessList;
+ }
+
+ public List<String> getStrForGpdList() {
+ return strForGpdList;
+ }
+
+ public void setStrForGpdList(List<String> strForGpdList) {
+ this.strForGpdList = strForGpdList;
+ }
+
+ public List<String> getGeneratedFoldersList() {
+ return generatedFoldersList;
+ }
+
+ public void setGeneratedFoldersList(List<String> generatedFoldersList) {
+ this.generatedFoldersList = generatedFoldersList;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/BpmnToPlugin.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto;
+
+import org.jboss.tools.jbpm.convert.bpmnto.BpmnToPlugin;
+import org.jboss.tools.common.log.BaseUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * @author Grid Qian
+ *
+ * this a plugin class
+ */
+public class BpmnToPlugin extends BaseUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.jboss.tools.jbpm.convert.bpmnto";
+
+ // The shared instance
+ private static BpmnToPlugin plugin;
+
+ /**
+ * The constructor
+ */
+ public BpmnToPlugin() {
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static BpmnToPlugin getDefault() {
+ return plugin;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/translate/BPMNTranslator.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.translate;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author Grid Qian
+ *
+ * this is a root translator. You should extend it and realize the
+ * method: translateDiagram.
+ */
+public abstract class BPMNTranslator {
+
+ // the bpmn file name
+ public String bpmnFileName;
+
+ //the location of the folder containing the bpmn file
+ public String rootLocation;
+
+ // the bpmn pool's id list that are translated
+ public List<String> poolIDList;
+
+
+ // the warning messages when translate
+ public List<String> warnings = new ArrayList<String>();
+
+ // the error messages when translate
+ public List<String> errors = new ArrayList<String>();
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<String> errors) {
+ this.errors = errors;
+ }
+
+ public List<String> getWarnings() {
+ return warnings;
+ }
+
+ public void setWarnings(List<String> warnings) {
+ this.warnings = warnings;
+ }
+
+ public BPMNTranslator() {
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath) {
+ this(bpmnFileName, bpmnFilePath, null);
+ }
+
+ public BPMNTranslator(String bpmnFileName, String bpmnFilePath,
+ List<String> poolIDList) {
+ this.bpmnFileName = bpmnFileName;
+ this.rootLocation = bpmnFilePath;
+ this.poolIDList = poolIDList;
+ }
+
+ /*
+ * Translate a bpmn diagram to anything
+ */
+ public abstract void translateDiagram();
+}
\ No newline at end of file
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,195 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.parsers.SAXParser;
+import javax.xml.parsers.SAXParserFactory;
+
+import org.dom4j.Document;
+import org.dom4j.Element;
+import org.dom4j.io.SAXReader;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+
+/**
+ * @author Grid Qian
+ *
+ * this a util class
+ */
+public class BPMNToUtil {
+
+ /*
+ * create a file
+ */
+ public static File createFile(String parentFolder, String fileName,
+ String inputStr, boolean isOverWrite) throws IOException {
+ File child = new File(parentFolder, fileName);
+ if (inputStr == null) {
+ if (!child.exists() || isOverWrite) {
+ child.mkdir();
+ }
+ } else {
+ if (!child.exists() || isOverWrite) {
+ child.createNewFile();
+ }
+ FileWriter childWriter = new FileWriter(child);
+ PrintWriter printFile = new PrintWriter(childWriter);
+ printFile.println(inputStr);
+ printFile.close();
+ childWriter.close();
+
+ }
+ return child;
+ }
+
+ /*
+ * get a sax input source
+ */
+ public static InputSource getInputSource(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ return new InputSource(BPMNToUtil
+ .getInputStream(parentFolder, fileName));
+
+ }
+
+ /*
+ * get a input stream
+ */
+ public static InputStream getInputStream(String parentFolder,
+ String fileName) throws FileNotFoundException {
+ File file = new File(parentFolder, fileName);
+ InputStream input = new FileInputStream(file);
+ return input;
+
+ }
+
+ /*
+ * parse a file to a dom document
+ */
+ public static Document parse(String parentFolder, String fileName)
+ throws Exception {
+ Document document = null;
+ SAXReader saxReader = createSaxReader();
+ document = saxReader.read(BPMNToUtil.getInputSource(parentFolder,
+ fileName));
+ return document;
+ }
+
+ /*
+ * create a sax reader
+ */
+ public static SAXReader createSaxReader() throws Exception {
+ XMLReader xmlReader = createXmlReader();
+ SAXReader saxReader = new SAXReader(xmlReader);
+ return saxReader;
+ }
+
+ /*
+ * create a sax xml reader
+ */
+ public static XMLReader createXmlReader() throws Exception {
+
+ SAXParser saxParser = createSaxParserFactory().newSAXParser();
+ XMLReader xmlReader = saxParser.getXMLReader();
+
+ saxParser.setProperty(
+ "http://java.sun.com/xml/jaxp/properties/schemaLanguage",
+ "http://www.w3.org/2001/XMLSchema");
+
+ xmlReader.setFeature(
+ "http://apache.org/xml/features/validation/dynamic", true);
+
+ return xmlReader;
+ }
+
+ /*
+ * create a sax parser factory
+ */
+ private static SAXParserFactory createSaxParserFactory() {
+ SAXParserFactory saxParserFactory = SAXParserFactory.newInstance();
+ saxParserFactory.setValidating(true);
+ saxParserFactory.setNamespaceAware(true);
+ return saxParserFactory;
+ }
+
+ /*
+ * get bpmn pool id list from a dom document
+ */
+ public static Map<String, String> getPoolIDsFromDocument(Document document) {
+ Map<String, String> poolIDMap = new HashMap<String, String>();
+ Element diagram = document.getRootElement();
+ for (Object pool : diagram.elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ if (((Element) pool).attributeValue(B2JMessages.Bpmn_Element_ID) != null) {
+ poolIDMap.put(((Element) pool)
+ .attributeValue(B2JMessages.Bpmn_Element_ID),
+ ((Element) pool)
+ .attributeValue(B2JMessages.Dom_Element_Name));
+ }
+ }
+ return poolIDMap;
+ }
+
+ public static Composite createComposite(Composite parent, int numColumns) {
+ Composite composite = new Composite(parent, SWT.NULL);
+
+ GridLayout layout = new GridLayout();
+ layout.numColumns = numColumns;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ return composite;
+ }
+
+ @SuppressWarnings("unchecked")
+ public static boolean checkSelectedResources(ISelection selectedResources) {
+ boolean res = true;
+ if (selectedResources instanceof IStructuredSelection
+ && !selectedResources.isEmpty()) {
+ IStructuredSelection ss = (IStructuredSelection) selectedResources;
+ for (Iterator it = ss.iterator(); it.hasNext();) {
+ Object o = it.next();
+ if (o instanceof IFile) {
+ if (!((IFile) o).getFileExtension()
+ .equalsIgnoreCase("bpmn")) {
+ res = false;
+ break;
+ }
+ } else {
+ res = false;
+ break;
+ }
+ }
+ } else {
+ res = false;
+ }
+ return res;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,116 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.util;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.dom4j.*;
+import org.dom4j.io.*;
+import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
+
+/**
+ * @author Grid Qian
+ *
+ * this is for generating dom element or attribute
+ */
+public class DomXmlWriter {
+
+ /*
+ * map a dom document to a string
+ */
+ public static String toString(Document document) throws IOException {
+ OutputFormat outputFormat = new OutputFormat(" ", true);
+ Writer writer = new StringWriter();
+ XMLWriter xmlWriter = new XMLWriter(writer, outputFormat);
+ xmlWriter.write(document);
+ xmlWriter.flush();
+ writer.flush();
+ return writer.toString();
+ }
+
+ /*
+ * create a dom tree
+ */
+ public static Document createDomTree(boolean useNamespace, String url,
+ String rootElementName) {
+ Document document = DocumentHelper.createDocument();
+ Element root = null;
+
+ if (useNamespace) {
+ Namespace jbpmNamespace = new Namespace(null, url);
+ root = document.addElement(rootElementName, jbpmNamespace.getURI());
+ } else {
+ root = document.addElement(rootElementName);
+ }
+ root.addText(System.getProperty("line.separator"));
+
+ return document;
+ }
+
+ /*
+ * add a new element to a dom element
+ */
+ public static Element addElement(Element element, String elementName) {
+ Element newElement = element.addElement(elementName);
+ return newElement;
+ }
+
+ /*
+ * add a new element to the location of a dom element
+ */
+ @SuppressWarnings("unchecked")
+ public static Element addElement(Element element, String elementName,
+ int location) {
+ Element newElement = null;
+ if (element.elements(elementName) != null
+ && element.elements(elementName).size() > location
+ && location >= 0) {
+ newElement = DocumentHelper.createElement(elementName);
+ element.elements(elementName).add(location, newElement);
+ }
+ return newElement;
+ }
+
+ /*
+ * add a attribute to a dom element
+ */
+ public static void addAttribute(Element e, String attributeName,
+ String value) {
+ if (value != null) {
+ e.addAttribute(attributeName, value);
+ }
+ }
+
+ /*
+ * get a named element from a element (any depth)
+ */
+ public static List<Element> getElementsByName(Element element, String name) {
+ List<Element> list = new ArrayList<Element>();
+ for (Object ele : element.elements()) {
+ if (name.equals(((Element) ele).getName())) {
+ list.add((Element) ele);
+ }
+ list.addAll(getElementsByName((Element) ele, name));
+ }
+ return list;
+ }
+
+ /*
+ * set a element attribute using a same name attribute of other element
+ */
+ public static void mapAttribute(Element ele, String attrName, Element sourceEle){
+ DomXmlWriter.addAttribute(ele, attrName,sourceEle.attributeValue(attrName));
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProjectFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn file
+ */
+public class BPMNResourcesChoicePage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private IWizard wizard;
+
+ public BPMNResourcesChoicePage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setTitle(title);
+ this.setDescription(description);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ super.setControl(composite);
+
+ initializePage();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(B2JMessages.Bpmn_File_Choose_WizardPage_ViewerTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProjectFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ viewer.setSelection(currentSelection, true);
+ }
+ }
+
+ @Override
+ public boolean isPageComplete() {
+ if (viewer != null) {
+ return BPMNToUtil.checkSelectedResources(viewer.getSelection());
+ }
+ return super.isPageComplete();
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void setSelection(ISelection selection) {
+ this.currentSelection = selection;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+}
+
+class ProjectFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ boolean res = false;
+ if (element instanceof IFile) {
+ IFile file = (IFile) element;
+ if (file.getFileExtension().equalsIgnoreCase("bpmn")) {
+ res = true;
+ }
+ }
+ if (element instanceof IContainer) {
+ res = true;
+ }
+ return res;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnPoolsChoicePage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,213 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage used by user to choose the bpmn pool from a bpmn diagram
+ */
+public class BpmnPoolsChoicePage extends WizardPage {
+
+ CheckboxTableViewer listViewer;
+ String listTitle;
+ private Map<String, String> idMap;
+
+ private IWizard wizard;
+
+ public BpmnPoolsChoicePage(String pageName, String title, String listTitle) {
+ super(pageName);
+ this.listTitle = listTitle;
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ addSelectionButtons(composite);
+ setControl(composite);
+
+ initializePage();
+ initializeViewer();
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label.setText(listTitle);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = CheckboxTableViewer.newCheckList(composite, SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ listViewer.addCheckStateListener(new ICheckStateListener() {
+ @SuppressWarnings("unchecked")
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ if (event.getChecked()) {
+ (((BpmnToWizard) wizard)).getPoolIdList().add(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ } else {
+ (((BpmnToWizard) wizard)).getPoolIdList().remove(
+ ((Entry<String, String>) event.getElement())
+ .getKey());
+ }
+ changeComplete();
+ }
+ });
+ }
+
+ private void addSelectionButtons(Composite composite) {
+ Composite buttonComposite = new Composite(composite, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.numColumns = 0;
+ layout.marginWidth = 0;
+ layout.horizontalSpacing = 4;
+ buttonComposite.setLayout(layout);
+ buttonComposite.setLayoutData(new GridData(SWT.END, SWT.TOP, true,
+ false));
+
+ Button selectButton = createButton(buttonComposite,
+ B2JMessages.Label_Select_All, false);
+
+ SelectionListener listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(true);
+ (((BpmnToWizard) wizard)).getPoolIdList()
+ .addAll(idMap.keySet());
+ changeComplete();
+ }
+ };
+ selectButton.addSelectionListener(listener);
+
+ Button deselectButton = createButton(buttonComposite,
+ B2JMessages.Label_Deselect_All, false);
+
+ listener = new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent e) {
+ listViewer.setAllChecked(false);
+ (((BpmnToWizard) wizard)).getPoolIdList().clear();
+ changeComplete();
+ }
+ };
+ deselectButton.addSelectionListener(listener);
+ }
+
+ private Button createButton(Composite parent, String label,
+ boolean defaultButton) {
+ // increment the number of columns in the button bar
+ ((GridLayout) parent.getLayout()).numColumns++;
+ Button button = new Button(parent, SWT.PUSH);
+ button.setText(label);
+ if (defaultButton) {
+ Shell shell = parent.getShell();
+ if (shell != null) {
+ shell.setDefaultButton(button);
+ }
+ }
+ setButtonLayoutData(button);
+ return button;
+ }
+
+ private void initializePage() {
+ setPageComplete(false);
+ }
+
+ private void initializeViewer() {
+ if (listViewer == null) {
+ return;
+ }
+ listViewer.setInput(idMap.entrySet());
+ wizard = this.getWizard();
+ List<String> poolIdList = ((BpmnToWizard) wizard).getPoolIdList();
+ if (poolIdList.size() == 0) {
+ listViewer.setAllChecked(false);
+ } else {
+ for (String id : poolIdList) {
+ Set<Entry<String, String>> set = idMap.entrySet();
+ Entry<String, String> selectedEntry = null;
+ for (Entry<String, String> entry : set) {
+ if (entry.getKey().equals(id)) {
+ selectedEntry = entry;
+ break;
+ }
+ }
+ listViewer.setChecked(selectedEntry, true);
+ }
+ }
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public void changeComplete() {
+ if (listViewer.getCheckedElements().length != 0) {
+ setPageComplete(true);
+ } else {
+ setPageComplete(false);
+ }
+ }
+
+ public Map<String, String> getIdMap() {
+ return idMap;
+ }
+
+ public void setIdMap(Map<String, String> idMap) {
+ this.idMap = idMap;
+ initializeViewer();
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,242 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.dom4j.Document;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IExportWizard;
+import org.eclipse.ui.IWorkbench;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnPoolsChoicePage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ErrorMessagesPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.GeneratedFileLocationPage;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BPMNResourcesChoicePage;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizard for bpmn translation
+ */
+public abstract class BpmnToWizard extends Wizard implements IExportWizard {
+
+ private BPMNResourcesChoicePage bpmnResPage;
+ private BpmnPoolsChoicePage poolsPage;
+ private GeneratedFileLocationPage locationPage;
+ private ErrorMessagesPage errorPage;
+
+ // the selected *.bpmn file
+ private IStructuredSelection selection;
+ // the selected folder to save these generated files
+ private IStructuredSelection targetLocationSelection;
+ // bpmn pool id:name map
+ private Map<String, String> idMap;
+
+ protected String bpmnFileName;
+ protected String bpmnFileParentPath;
+ protected List<String> poolIdList = new ArrayList<String>();
+ // the list contains errors or warnings when generating
+ protected List<String> errorList = new ArrayList<String>();
+
+ public BpmnToWizard() {
+ super();
+ super.setWindowTitle(B2JMessages.Bpmn_Wizard_Title);
+ }
+
+ public void addPages() {
+ super.addPages();
+
+ bpmnResPage = new BPMNResourcesChoicePage(
+ B2JMessages.Bpmn_File_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_File_Choose_WizardPage_Message);
+ bpmnResPage.setSelection(selection);
+ poolsPage = new BpmnPoolsChoicePage(
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Name,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Title,
+ B2JMessages.Bpmn_Pool_Choose_WizardPage_Message);
+ errorPage = new ErrorMessagesPage(
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Name,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Title,
+ B2JMessages.Bpmn_Translate_Message_WizardPage_Message);
+ locationPage = new GeneratedFileLocationPage(
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Name,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Title,
+ B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_Message);
+ locationPage.setSelection(selection);
+ addPage(bpmnResPage);
+ addPage(poolsPage);
+ addPage(errorPage);
+ addPage(locationPage);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
+ * org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ /*
+ * do some initial tasks
+ */
+ private void initialize() {
+ if (selection.getFirstElement() instanceof IFile) {
+ IFile bpmnFile = (IFile) selection.getFirstElement();
+ bpmnFileName = bpmnFile.getName();
+ bpmnFileParentPath = bpmnFile.getParent().getLocation()
+ .toOSString();
+ try {
+ idMap = BPMNToUtil.getPoolIDsFromDocument(getDocument(
+ bpmnFileParentPath, bpmnFileName));
+ poolIdList.clear();
+ } catch (Exception e) {
+ errorList.add(0, NLS.bind(
+ B2JMessages.Translate_Error_File_CanNotRead,
+ bpmnFileName));
+ e.printStackTrace();
+ }
+ }
+ if (poolsPage != null) {
+ poolsPage.setIdMap(idMap);
+ }
+ }
+
+ public IWizardPage getNextPage(IWizardPage page) {
+ if (page.getName()
+ .equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
+ errorList = translateBpmnToStrings();
+ if (errorList.size() == 0) {
+ return locationPage;
+ }
+ errorPage.getListViewer().setInput(errorList);
+ return super.getNextPage(page);
+ } else {
+ return super.getNextPage(page);
+ }
+
+ }
+
+ public boolean performFinish() {
+
+ createGeneratedFile(locationPage.isOverWrite());
+ refreshWorkspace();
+ return true;
+ }
+
+ /*
+ * do the translation from bpmn to string list the sub class need to create
+ * a string list to reserve these strings
+ * the return list is error or warning messages
+ */
+ public abstract List<String> translateBpmnToStrings();
+
+ /*
+ * write the generated strings to the files
+ */
+ public abstract void createGeneratedFile(boolean b);
+
+ /*
+ * get the path of the eclipse workspace container
+ */
+ protected String getContainerPath(IContainer container) {
+ return container.getLocation().toOSString();
+ }
+
+ /*
+ * get the dom document from a given path and file name
+ */
+ public Document getDocument(String bpmnFileParentPath, String bpmnFileName)
+ throws Exception {
+ Document bpmnDocument = null;
+ bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
+ return bpmnDocument;
+ }
+
+ /*
+ * refresh eclipse workspace
+ */
+ public void refreshWorkspace() {
+ try {
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
+ IResource.DEPTH_INFINITE, null);
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+
+ public List<String> getPoolIdList() {
+ return poolIdList;
+ }
+
+ public void setPoolIdList(List<String> poolIdList) {
+ this.poolIdList = poolIdList;
+ }
+
+ public List<String> getErrorList() {
+ return errorList;
+ }
+
+ public void setErrorList(List<String> errorList) {
+ this.errorList = errorList;
+ }
+
+ public IStructuredSelection getSelection() {
+ return selection;
+ }
+
+ public void setSelection(IStructuredSelection selection) {
+ this.selection = selection;
+ initialize();
+ }
+
+ public String getBpmnFileName() {
+ return bpmnFileName;
+ }
+
+ public void setBpmnFileName(String bpmnFileName) {
+ this.bpmnFileName = bpmnFileName;
+ }
+
+ public String getBpmnFileParentPath() {
+ return bpmnFileParentPath;
+ }
+
+ public void setBpmnFileParentPath(String bpmnFileParentPath) {
+ this.bpmnFileParentPath = bpmnFileParentPath;
+ }
+
+ public IStructuredSelection getTargetLocationSelection() {
+ return targetLocationSelection;
+ }
+
+ public void setTargetLocationSelection(
+ IStructuredSelection targetLocationSelection) {
+ this.targetLocationSelection = targetLocationSelection;
+ }
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.jface.viewers.ArrayContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for showing the error and warning messages from translating
+ */
+public class ErrorMessagesPage extends WizardPage {
+
+ private TableViewer listViewer;
+
+ protected ErrorMessagesPage(String pageName, String title, String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ setControl(composite);
+
+ }
+
+ private Label createListTitleArea(Composite composite) {
+ Label label = new Label(composite, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_Translate_Message_WizardpageViewer_Title);
+ label.setFont(composite.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ listViewer = new TableViewer(composite, SWT.SINGLE | SWT.H_SCROLL
+ | SWT.V_SCROLL | SWT.BORDER);
+ GridData data = new GridData(GridData.FILL_BOTH);
+ data.heightHint = 250;
+ data.widthHint = 300;
+ listViewer.getTable().setLayoutData(data);
+
+ listViewer.setLabelProvider(new LabelProvider());
+ listViewer.setContentProvider(new ArrayContentProvider());
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ return true;
+ }
+
+
+ public TableViewer getListViewer() {
+ return listViewer;
+ }
+
+ public void setListViewer(TableViewer listViewer) {
+ this.listViewer = listViewer;
+ }
+
+}
Added: workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java (rev 0)
+++ workspace/grid/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-10 10:29:15 UTC (rev 10771)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.wizard.IWizard;
+import org.eclipse.jface.wizard.WizardPage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.ui.model.WorkbenchContentProvider;
+import org.eclipse.ui.model.WorkbenchLabelProvider;
+import org.jboss.tools.jbpm.convert.b2j.messages.B2JMessages;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
+import org.jboss.tools.jbpm.convert.bpmnto.wizard.ProFilter;
+
+/**
+ * @author Grid Qian
+ *
+ * the wizardpage for the generated file location
+ */
+public class GeneratedFileLocationPage extends WizardPage {
+
+ private TreeViewer viewer;
+ private ISelection currentSelection;
+ private Button button;
+ private IWizard wizard;
+ private boolean isOverWrite;
+
+
+ protected GeneratedFileLocationPage(String pageName, String title,
+ String description) {
+ super(pageName);
+ this.setDescription(description);
+ this.setTitle(title);
+ }
+
+ public void createControl(Composite parent) {
+ Composite composite = createDialogArea(parent);
+
+ createListTitleArea(composite);
+ createListViewer(composite);
+ createCheckbox(composite);
+ super.setControl(composite);
+
+ initializePage();
+
+ }
+
+ private Label createListTitleArea(Composite parent) {
+ Label label = new Label(parent, SWT.NONE);
+ label
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_ViewerTitle);
+ label.setFont(parent.getFont());
+ return label;
+ }
+
+ private void createListViewer(Composite composite) {
+ viewer = new TreeViewer(composite, SWT.BORDER | SWT.MULTI
+ | SWT.H_SCROLL | SWT.V_SCROLL);
+ viewer.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+ viewer.setLabelProvider(new WorkbenchLabelProvider());
+ WorkbenchContentProvider cp = new WorkbenchContentProvider();
+ viewer.setContentProvider(cp);
+ viewer.setFilters(new ViewerFilter[] { new ProFilter() });
+ viewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ updateControls();
+ currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard)
+ .setTargetLocationSelection((IStructuredSelection) currentSelection);
+
+ }
+ });
+ }
+
+ private Button createCheckbox(Composite parent) {
+ button = new Button(parent, SWT.CHECK | SWT.NONE);
+ button
+ .setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_CheckBox);
+ button.setFont(parent.getFont());
+ button.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ isOverWrite = button.getSelection();
+ }});
+ return button;
+ }
+
+ private void initializePage() {
+ wizard = this.getWizard();
+ viewer.setInput(ResourcesPlugin.getWorkspace());
+ if (this.currentSelection != null) {
+ if (currentSelection != null
+ && currentSelection instanceof ITreeSelection) {
+ // Select the parent project of this first bpmn file chosen
+ ITreeSelection node = (ITreeSelection) currentSelection;
+ TreePath[] paths = node.getPaths();
+ TreePath projPath = new TreePath(new Object[] { paths[0]
+ .getFirstSegment() });
+ TreeSelection projSel = new TreeSelection(projPath);
+ viewer.setSelection(projSel, true);
+ }
+ }
+ button.setSelection(true);
+ }
+
+ private void updateControls() {
+ super.getWizard().getContainer().updateButtons();
+ }
+
+ private Composite createDialogArea(Composite parent) {
+ // create a composite with standard margins and spacing
+ Composite composite = new Composite(parent, SWT.NONE);
+ GridLayout layout = new GridLayout();
+ layout.marginHeight = 7;
+ layout.marginWidth = 7;
+ layout.verticalSpacing = 4;
+ layout.horizontalSpacing = 4;
+ composite.setLayout(layout);
+ composite.setLayoutData(new GridData(GridData.FILL_BOTH));
+ return composite;
+ }
+
+ public boolean isPageComplete() {
+ if (viewer != null && viewer.getSelection() == null) {
+ return false;
+ }
+ return true;
+ }
+
+ public ISelection getSelection() {
+ return currentSelection;
+ }
+
+ public void setSelection(ISelection currentSelection) {
+ this.currentSelection = currentSelection;
+ }
+
+
+ public boolean isOverWrite() {
+ return isOverWrite;
+ }
+
+ public void setOverWrite(boolean isOverWrite) {
+ this.isOverWrite = isOverWrite;
+ }
+
+}
+
+class ProFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parent, Object element) {
+ return element instanceof IContainer;
+ }
+}
17 years, 3 months
JBoss Tools SVN: r10770 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-10 04:07:44 -0400 (Fri, 10 Oct 2008)
New Revision: 10770
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
Log:
JBIDE-2880:ESB project creation wizard can not continue when choose server supplied ESB runtime without specifying a user supplied esb runtime
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-10 05:43:16 UTC (rev 10769)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2008-10-10 08:07:44 UTC (rev 10770)
@@ -361,6 +361,9 @@
} catch (CoreException e) {
ESBProjectPlugin.getDefault().getLog().log(e.getStatus());
}
+ hasRuntime = true;
+ setPageComplete(isPageComplete());
+ setErrorMessage(null);
}
17 years, 3 months
JBoss Tools SVN: r10769 - in trunk/smooks/plugins: org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-10 01:43:16 -0400 (Fri, 10 Oct 2008)
New Revision: 10769
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
Log:
JBIDE-2847
fix the bug.
because some object will be NULL if the smooks file can't be parsed , so when user click the "AddButton" there will happen NPE.
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -59,6 +59,7 @@
if(true){
Shell shell = context.getShell();
MessageDialog.openWarning(shell, "Warning", "The java2xml can't be generate to config file currently.");
+ return;
}
GraphRootModel rootModel = context.getDataMappingRootModel();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksFormEditor.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -35,8 +35,11 @@
import org.jboss.tools.smooks.analyzer.NormalSmooksModelBuilder;
import org.jboss.tools.smooks.analyzer.NormalSmooksModelPackage;
import org.jboss.tools.smooks.model.DocumentRoot;
+import org.jboss.tools.smooks.model.SmooksFactory;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.model.provider.SmooksItemProviderAdapterFactory;
import org.jboss.tools.smooks.model.util.SmooksResourceFactoryImpl;
+import org.jboss.tools.smooks.utils.UIUtils;
/**
* @author Dart Peng
@@ -51,7 +54,7 @@
private ComposedAdapterFactory adapterFactory;
private AdapterFactoryEditingDomain editingDomain;
private Resource smooksResource;
-
+
private boolean forceDirty = false;
public SmooksFormEditor() {
@@ -69,8 +72,6 @@
protected CommandStack createCommandStack() {
return new BasicCommandStack();
}
-
-
@Override
public boolean isDirty() {
@@ -79,16 +80,20 @@
@Override
protected void addPages() {
- graphicalPage = new SmooksGraphicalFormPage(this, "graph", "Mapping");
try {
+ graphicalPage = new SmooksGraphicalFormPage(this, "graph",
+ "Mapping");
int index = this.addPage(this.graphicalPage);
this.setPageText(index, "Graph");
normalPage = new SmooksNormalContentEditFormPage(this, "normal",
- "Normal Edition",null);
+ "Normal Edition", null);
index = this.addPage(normalPage);
setPageText(index, "Normal");
- } catch (PartInitException e) {
- e.printStackTrace();
+ // Set a default NormalPacakge to Normal Page
+ this.refreshNormalPage(Collections.EMPTY_LIST);
+ } catch (Exception e) {
+ UIUtils.showErrorDialog(getSite().getShell(), UIUtils
+ .createErrorStatus(e));
}
}
@@ -103,7 +108,7 @@
throws PartInitException {
super.init(site, input);
IFile file = ((IFileEditorInput) input).getFile();
- String path =file.getLocation().toOSString();
+ String path = file.getLocation().toOSString();
if (this.getEditingDomain() != null && smooksResource == null) {
smooksResource = new SmooksResourceFactoryImpl().createResource(URI
.createFileURI(path));
@@ -114,13 +119,29 @@
e.printStackTrace();
}
}
+ DocumentRoot documentRoot = null;
+ if(smooksResource.getContents().isEmpty()){
+ documentRoot = SmooksFactory.eINSTANCE.createDocumentRoot();
+ smooksResource.getContents().add(documentRoot);
+ }else{
+ documentRoot = (DocumentRoot) smooksResource.getContents().get(0);
+ }
+
+ SmooksResourceListType resourceList = documentRoot.getSmooksResourceList();
+ if(resourceList == null){
+ resourceList = SmooksFactory.eINSTANCE.createSmooksResourceListType();
+ documentRoot.setSmooksResourceList(resourceList);
+ }
+
}
}
public void refreshNormalPage(List resourceHidenConfigs) {
NormalSmooksModelPackage modelPackage = createSmooksModelPackage();
+ if (modelPackage != null){
+ modelPackage.setHidenSmooksElements(resourceHidenConfigs);
+ }
if (this.normalPage != null) {
- modelPackage.setHidenSmooksElements(resourceHidenConfigs);
normalPage.setModelPackage(modelPackage);
}
}
@@ -142,8 +163,8 @@
graphicalPage.doSave(monitor);
fireEditorDirty(false);
}
-
- public void fireEditorDirty(boolean dirty){
+
+ public void fireEditorDirty(boolean dirty) {
this.forceDirty = dirty;
this.firePropertyChange(PROP_DIRTY);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-09 14:43:49 UTC (rev 10768)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-10 05:43:16 UTC (rev 10769)
@@ -13,22 +13,31 @@
/**
* @author dart
- *
+ *
*/
public class XML2XMLAnalyzer extends AbstractAnalyzer {
- /* (non-Javadoc)
+ /*
+ * (non-Javadoc)
+ *
* @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
*/
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
- Shell shell = context.getShell();
- MessageDialog.openWarning(shell, "Warning", "The xml2xml can't be generate to config file currently.");
+ if (true) {
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning",
+ "The xml2xml can't be generate to config file currently.");
+ return;
+ }
}
- /* (non-Javadoc)
- * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType, java.lang.Object, java.lang.Object)
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType,
+ * java.lang.Object, java.lang.Object)
*/
public MappingResourceConfigList analyzeMappingSmooksModel(
SmooksResourceListType listType, Object sourceObject,
17 years, 3 months
JBoss Tools SVN: r10768 - trunk/birt/docs/en/modules.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2008-10-09 10:43:49 -0400 (Thu, 09 Oct 2008)
New Revision: 10768
Modified:
trunk/birt/docs/en/modules/birt_designer.xml
trunk/birt/docs/en/modules/birt_support.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-388 - links adjusted, BIRT Designer chapter updated
Modified: trunk/birt/docs/en/modules/birt_designer.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_designer.xml 2008-10-09 13:35:22 UTC (rev 10767)
+++ trunk/birt/docs/en/modules/birt_designer.xml 2008-10-09 14:43:49 UTC (rev 10768)
@@ -1,5 +1,5 @@
<?xml version='1.0' encoding='UTF-8'?>
-<chapter id="birt_designer" xreflabel="birt_designer">
+<chapter id="Birt_Designer" xreflabel="Birt_Designer">
<?dbhtml filename="birtDesigner.html"?>
<chapterinfo>
<keywordset>
@@ -10,30 +10,26 @@
</keywordset>
</chapterinfo>
- <title>BIRT Designer</title>
-
-
+ <title>BIRT Report Designer</title>
-
-
-
- <section id="birt_designer_introduction">
-
- <title>BIRT Report Designer</title>
- <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will pass you through all its features.</para>
-
- </section>
-
-
-
+ <para>BIRT Designer is an intuitive and quite easy Eclipse-based set of plugins to make reports. We will describe all its features to you.</para>
+
<section id="birt_designer_features">
<title>BIRT Report Designer Features</title>
<para>Here are the main BIRT Report Designer features:</para>
- <itemizedlist><listitem><para><emphasis role="bold"></emphasis>Palette - Contains the standard BIRT report elements such as labels, tables, and charts and is used in conjunction with the Layout View to design reports.</para></listitem>
+ <itemizedlist><listitem><para><emphasis role="bold">Palette</emphasis> - contains tables, labels, and charts. It is used in conjunction with the Layout View to design reports.</para></listitem>
+ <listitem><para><emphasis role="bold">Layout View</emphasis> - WYSIWYG editor that provides drag and drop creation of the presentation portion of your report.</para></listitem>
+ <listitem><para><emphasis role="bold">Data Explorer</emphasis> - Organizes your data sources (connections) and data sets (queries). The data set editor allows you to test your data set to ensure the report receives the correct data. Within this view multi dimensional cubes can be created using existing data sets. Cubes are currently used when building dynamic cross tables. This view also is used to design report parameters.</para></listitem>
+ <listitem><para><emphasis role="bold">Property Editor</emphasis> - Presents the most commonly used properties in a convenient format that makes editing quick and easy. BIRT also integrates with the standard Eclipse property view to provide a detailed listing of all properties for an item.</para></listitem>
+ <listitem><para><emphasis role="bold">Report Preview</emphasis> - You can test your report at any time with real data. The preview is a window directly within Eclipse.</para></listitem>
+ <listitem><para><emphasis role="bold">Script Editor</emphasis> - Scripting adds business logic to reports during data access, during report generation, or during viewing. The code editor provides standard Eclipse features for editing your scripts: syntax coloring, auto-complete and more. An interesting new feature, for BIRT 2.3 is the ability to debug scripts while the report is running.</para></listitem>
+ <listitem><para><emphasis role="bold">Outline</emphasis> - BIRT reports are organized as a tree structure with the overall report as the root, and separate categories for styles, report content, data sources, data sets, report parameters and more. The Outline view provides a compact overview of your entire report structure.</para></listitem>
+ <listitem><para><emphasis role="bold">Cheat Sheets</emphasis> - Learning a new tool is always a challenge, but Eclipse offers an innovative solution: cheat sheets. These are short bits of documentation that walk you through new tasks.</para></listitem>
+ <listitem><para><emphasis role="bold">Resource Explorer</emphasis> - BIRT allows the reuse of report objects, such as tables, data sources and styles. Objects created for reuse are stored in a library file. To browse the contents of report libraries BIRT supplies a Resource Explorer view. This view list all libraries within the resource folder, in addition other shared content such as images and JavaScript files.</para></listitem>
+ <listitem><para><emphasis role="bold">Chart Builder</emphasis> - Adding Charts to BIRT designs is expedited with the Chart Builder. Chart creation is separated into three phases: Select Chart Type, Select Data, and Format Chart.</para></listitem>
+ <listitem><para><emphasis role="bold">Expression Builder </emphasis> - BIRT expressions are really just simple scripts that return a value. Expressions are used for assigning data values to report elements, building image locations, hyperlinks, parameter default values and many other places. Expressions are constructed within BIRT using the Expression Builder.</para></listitem>
-
-
</itemizedlist>
@@ -41,16 +37,14 @@
<para>There are a number of ways we can improve the report's appearance: </para>
- <itemizedlist><listitem><para>Add a title to the top of the report;</para></listitem>
-
-
-
- Add a title to the top of the report.
- Add some color to enhance the column headings.
- Shrink the size of the city and state columns.
- Add some color to make the state and city group headers stand out.
- Format the phone numbers.
- Sort customers by name.
- </itemizedlist>
+ <itemizedlist>
+ <listitem><para>Add a title to the top of the report;</para></listitem>
+ <listitem><para> Add a title to the top of the report. </para></listitem>
+ <listitem><para> Add some color to enhance the column headings. </para></listitem>
+ <listitem><para> Shrink the size of the city and state columns. </para></listitem>
+ <listitem><para>Add some color to make the state and city group headers stand out. </para></listitem>
+ <listitem><para>Format the phone numbers. </para></listitem>
+ <listitem><para>Sort customers by name.</para></listitem>
+ </itemizedlist>
</section>
</chapter>
Modified: trunk/birt/docs/en/modules/birt_support.xml
===================================================================
--- trunk/birt/docs/en/modules/birt_support.xml 2008-10-09 13:35:22 UTC (rev 10767)
+++ trunk/birt/docs/en/modules/birt_support.xml 2008-10-09 14:43:49 UTC (rev 10768)
@@ -255,7 +255,7 @@
<section><title>Create Report Layout</title>
- <para>After the Data source and Data set are specified you can continue with the report layout. Please see the <xref linkend="birt_designer"/> chapter to learn more about BIRT Report Designer.</para>
+ <para>After the Data source and Data set are specified you can continue with the report layout. Please see the <xref linkend="Birt_Designer"/> chapter to learn more about BIRT Report Designer.</para>
</section>
17 years, 3 months
JBoss Tools SVN: r10767 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 09:35:22 -0400 (Thu, 09 Oct 2008)
New Revision: 10767
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
Log:
Check the object if it's NULL
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-10-09 13:33:58 UTC (rev 10766)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksResourceConfigFormBlock.java 2008-10-09 13:35:22 UTC (rev 10767)
@@ -189,12 +189,13 @@
Object element) {
if (element == transformType)
return false;
- if(modelPackage != null){
+ if (modelPackage != null) {
List hidenList = modelPackage.getHidenSmooksElements();
for (Iterator iterator = hidenList.iterator(); iterator
.hasNext();) {
Object object = (Object) iterator.next();
- if(object == element) return false;
+ if (object == element)
+ return false;
}
}
return true;
@@ -298,6 +299,8 @@
}
protected void downButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
Object object = selection.getFirstElement();
@@ -316,6 +319,8 @@
}
protected void upButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
Object object = selection.getFirstElement();
@@ -333,6 +338,8 @@
}
protected void removeButtonSelected() {
+ if (modelPackage == null)
+ return;
IStructuredSelection selection = (IStructuredSelection) dateTypeViewer
.getSelection();
List selections = selection.toList();
@@ -354,6 +361,8 @@
}
protected void addButtonSelected() {
+ if (modelPackage == null)
+ return;
NewResourceConfigWizard wizard = new NewResourceConfigWizard();
WizardDialog dialog = new WizardDialog(parentEditor.getSite()
.getShell(), wizard);
17 years, 3 months
JBoss Tools SVN: r10766 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 09:33:58 -0400 (Thu, 09 Oct 2008)
New Revision: 10766
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java
Log:
disable the id browse button
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java 2008-10-09 12:19:45 UTC (rev 10765)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/BeanPopulatorDetailPage.java 2008-10-09 13:33:58 UTC (rev 10766)
@@ -101,25 +101,33 @@
formToolKit.paintBordersFor(beanClassComposite);
this.formToolKit.createLabel(parent, "Bean ID : ");
- Composite beanIDComposite = formToolKit.createComposite(parent);
- GridLayout bilg = new GridLayout();
- bilg.numColumns = 2;
- bilg.marginHeight = 0;
- bilg.marginWidth = 1;
- beanIDComposite.setLayout(bilg);
-
- beanIDText = formToolKit.createText(beanIDComposite, "");
+ beanIDText = formToolKit.createText(parent, "");
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.grabExcessHorizontalSpace = true;
beanIDText.setLayoutData(gd);
-
- idBrowseButton = formToolKit.createButton(beanIDComposite, "Browse",
- SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- beanIDComposite.setLayoutData(gd);
- formToolKit.paintBordersFor(beanIDComposite);
+
+// Composite beanIDComposite = formToolKit.createComposite(parent);
+// GridLayout bilg = new GridLayout();
+// bilg.numColumns = 1;
+// bilg.marginHeight = 1;
+// bilg.marginWidth = 1;
+// beanIDComposite.setLayout(bilg);
+//
+// beanIDText = formToolKit.createText(beanIDComposite, "");
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// gd.grabExcessHorizontalSpace = true;
+// beanIDText.setLayoutData(gd);
+//
+// idBrowseButton = formToolKit.createButton(beanIDComposite, "Browse",
+// SWT.NONE);
+// idBrowseButton.setEnabled(false);
+// gd = new GridData(GridData.FILL_HORIZONTAL);
+// gd.grabExcessHorizontalSpace = true;
+// beanIDComposite.setLayoutData(gd);
+// formToolKit.paintBordersFor(beanIDComposite);
formToolKit.paintBordersFor(parent);
+
+
configControls();
hookContorls();
}
@@ -199,13 +207,13 @@
}
});
- idBrowseButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- idBrowseButtonSelected();
- }
-
- });
+// idBrowseButton.addSelectionListener(new SelectionAdapter() {
+//
+// public void widgetSelected(SelectionEvent e) {
+// idBrowseButtonSelected();
+// }
+//
+// });
}
private void configControls() {
17 years, 3 months
JBoss Tools SVN: r10765 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test: jbide and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-10-09 08:19:45 -0400 (Thu, 09 Oct 2008)
New Revision: 10765
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
Log:
=junit test for JBIDE-2828
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-09 10:28:48 UTC (rev 10764)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-10-09 12:19:45 UTC (rev 10765)
@@ -38,6 +38,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2594Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2624Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2774Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2828Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -64,7 +65,7 @@
public static Test suite() {
- TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$
+ TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$ //$NON-NLS-1$
// $JUnit-BEGIN$
suite.addTestSuite(JsfComponentTest.class);
suite.addTestSuite(Jsf20ComponentContentTest.class);
@@ -101,6 +102,7 @@
suite.addTestSuite(JBIDE1805Test.class);
suite.addTestSuite(JsfComponentContentTest.class);
suite.addTestSuite(JBIDE2774Test.class);
+ suite.addTestSuite(JBIDE2828Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2828Test.java 2008-10-09 12:19:45 UTC (rev 10765)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserFactory;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+
+/**
+ * Test case for jbide-2828
+ *
+ * @author mareshkau
+ *
+ */
+public class JBIDE2828Test extends VpeTest {
+ /**
+ *
+ * @param name
+ */
+ public JBIDE2828Test(String name) {
+ super(name);
+ }
+ public void testJBIDE2828JbossELParser() {
+
+ ELParserFactory jbossParserFactory = ELParserUtil.getJbossFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", jbossParserFactory); //$NON-NLS-1$
+
+ ELParser elParser = jbossParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+ /**
+ * Test for default parser
+ */
+ public void testJBIDE2828DefaultELParser() {
+
+ ELParserFactory defaultParserFactory = ELParserUtil.getDefaultFactory();
+
+ assertNotNull("Couldn't get jboss parser factory", defaultParserFactory); //$NON-NLS-1$
+
+ ELParser elParser = defaultParserFactory.createParser();
+
+ assertNotNull(elParser);
+
+ ELModel elModel1 = elParser.parse("#{faces.context}"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel2 = elParser.parse("faces.context"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel3 = elParser.parse("");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel4 = elParser.parse("org.richfaces.SKIN"); //$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ ELModel elModel5 = elParser.parse(" jdsfh dskfj lksdjf asjfdsd; dsf; ");//$NON-NLS-1$
+ assertEquals("In which expression parser will found error?",elParser.getSyntaxErrors().size(),0); //$NON-NLS-1$
+ assertNotNull(elModel1);
+ }
+
+}
17 years, 3 months
JBoss Tools SVN: r10764 - in trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core: module and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-09 06:28:48 -0400 (Thu, 09 Oct 2008)
New Revision: 10764
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
Log:
JBIDE-2875: Pick up jboss-esb.xml and deployment.xml files to the correct path when packaging a deployable archives
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-09 10:27:52 UTC (rev 10763)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/ESBProjectConstant.java 2008-10-09 10:28:48 UTC (rev 10764)
@@ -7,7 +7,10 @@
public final static String BUILD_CLASSES = "build/classes";
public final static String META_INF = "META-INF";
- public final static String ESB_DEPLOYMENT_FILE_NAME = "META-INF/deployment.xml";
+ public final static String ESB_CONFIG_JBOSSESB = "jboss-esb.xml";
+ public final static String ESB_CONFIG_DEPLOYMENT = "deployment.xml";
+ public final static String ESB_CONFIG_QUEUE_SERVICE_JBM = "jbm-queue-service.xml";
+ public final static String ESB_CONFIG_QUEUE_SERVICE_JBMQ = "jbmq-queue-service.xml";
public final static String ESB_PROJECT_NATURE = "org.jboss.tools.esb.project.ESBNature";
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-09 10:27:52 UTC (rev 10763)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/module/JBossESBModuleDelegate.java 2008-10-09 10:28:48 UTC (rev 10764)
@@ -15,10 +15,12 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.model.IModuleFile;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.util.ModuleFile;
import org.eclipse.wst.server.core.util.ModuleFolder;
import org.eclipse.wst.server.core.util.ProjectModule;
+import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
public class JBossESBModuleDelegate extends ProjectModule {
@@ -37,11 +39,38 @@
IFolder configFolder = project.getFolder(esbFolder);
IJavaProject javaPrj = JavaCore.create(project);
IPath output = javaPrj.getOutputLocation();
+ // if the jboss-esb.xml file is not in META-INF folder, try to get it from other folder of the project
+ List<IModuleResource> mrs = new ArrayList<IModuleResource>();
+ IFolder metainf = configFolder.getFolder(ESBProjectConstant.META_INF);
+ IResource res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_JBOSSESB));
+ }
+
+ //check the deployment.xml just like jboss-esb.xml
+ res = metainf.findMember(ESBProjectConstant.ESB_CONFIG_DEPLOYMENT);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(new Path(ESBProjectConstant.META_INF), project, ESBProjectConstant.ESB_CONFIG_DEPLOYMENT));
+ }
+
+ res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBM));
+ }
+ res = configFolder.findMember(ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ);
+ if(res == null){
+ mrs.add(getModuleResourcesOutofESBContent(Path.EMPTY, project, ESBProjectConstant.ESB_CONFIG_QUEUE_SERVICE_JBMQ));
+ }
+
IModuleResource[] esbContent = getModuleResources(Path.EMPTY, configFolder);
IModuleResource[] classes = getModuleResources(Path.EMPTY, project.getWorkspace().getRoot().getFolder(output));
- IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length];
+ IModuleResource[] allResource = new IModuleResource[esbContent.length + classes.length + mrs.size()];
System.arraycopy(esbContent, 0, allResource, 0, esbContent.length);
System.arraycopy(classes, 0, allResource, esbContent.length, classes.length);
+ if(mrs.size() > 0){
+ IModuleResource[] mr = mrs.toArray(new IModuleResource[]{});
+ System.arraycopy(mr, 0, allResource, esbContent.length + classes.length, mr.length);
+ }
return allResource;
}
@@ -78,5 +107,30 @@
return new IModuleResource[0];
}
-
+ // create moduleresource for a name specified resource
+ protected IModuleFile getModuleResourcesOutofESBContent(IPath path, IContainer container, String fileName) throws CoreException {
+
+ IResource file = container.findMember(fileName, false);
+ if(file != null){
+ return new ModuleFile((IFile)file, file.getName(), path);
+ }
+
+ IResource[] resources = container.members();
+ if (resources != null) {
+ int size = resources.length;
+ for (int i = 0; i < size; i++) {
+ IResource resource = resources[i];
+ if (resource != null && resource.exists()) {
+ if (resource instanceof IContainer) {
+ IModuleFile mf = getModuleResourcesOutofESBContent(path, (IContainer)resource, fileName);
+
+ if(mf != null) return mf;
+ }
+ }
+ }
+
+ }
+
+ return null;
+ }
}
17 years, 3 months
JBoss Tools SVN: r10763 - trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-10-09 06:27:52 -0400 (Thu, 09 Oct 2008)
New Revision: 10763
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
Log:
JBIDE-2876: implement the feature
Modified: trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2008-10-09 07:36:13 UTC (rev 10762)
+++ trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/ESBProjectWizard.java 2008-10-09 10:27:52 UTC (rev 10763)
@@ -1,8 +1,19 @@
package org.jboss.tools.esb.project.ui.wizards;
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
@@ -10,6 +21,8 @@
import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
import org.jboss.tools.common.model.ui.ModelUIImages;
import org.jboss.tools.esb.core.ESBProjectConstant;
+import org.jboss.tools.esb.core.ESBProjectCorePlugin;
+import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
import org.jboss.tools.esb.project.ui.wizards.pages.ESBProjectFirstPage;
@@ -47,6 +60,26 @@
protected IFacetedProjectTemplate getTemplate() {
return ProjectFacetsManager.getTemplate(ESBProjectConstant.ESB_PROJECT_FACET_TEMPLATE);
}
+
+ @Override
+ protected void postPerformFinish() throws InvocationTargetException {
+ super.postPerformFinish();
+ String prjName = this.getProjectName();
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(prjName);
+ if(!project.exists()) return;
+
+ try {
+ String esbcontent = project.getPersistentProperty(IJBossESBFacetDataModelProperties.QNAME_ESB_CONTENT_FOLDER);
+ IPath esbPath = new Path(esbcontent).append(ESBProjectConstant.META_INF);
+ IFile esbFile = project.getFolder(esbPath).getFile(ESBProjectConstant.ESB_CONFIG_JBOSSESB);
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IDE.openEditor(page, esbFile);
+
+ } catch (CoreException e) {
+ ESBProjectCorePlugin.getDefault().getLog().log(e.getStatus());
+ }
+
+ }
17 years, 3 months
JBoss Tools SVN: r10762 - in workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools: b2j/wizard and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-10-09 03:36:13 -0400 (Thu, 09 Oct 2008)
New Revision: 10762
Modified:
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/BPMN2JPDL.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/TranslateHelper.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/wizard/B2JExportWizard.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/BpmnToWizard.java
workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/GeneratedFileLocationPage.java
Log:
JBIDE-2842: fix some ui bugs
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/BPMN2JPDL.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/BPMN2JPDL.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/BPMN2JPDL.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -96,7 +96,7 @@
try {
TranslateHelper.createFiles(fileLocation, bpmnFileName,
strForProcessDefs, jpdlFileNames,
- B2JMessages.Jpdl_Process_Definition_Name);
+ B2JMessages.Jpdl_Process_Definition_Name, false);
} catch (Exception e) {
errors.add(B2JMessages.Translate_Error_JpdlFile_CanNotWrite
+ e.getMessage());
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/GraphicalFileGenerator.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -84,7 +84,7 @@
try {
TranslateHelper.createFiles(fileLocation, bpmnFileName,
strForGpdDefs, gpdFileNames,
- B2JMessages.Gpd_Definition_Name);
+ B2JMessages.Gpd_Definition_Name, false);
} catch (Exception e) {
errors.add(B2JMessages.Translate_Error_GpdFile_CanNotWrite
+ e.getMessage());
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/TranslateHelper.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/TranslateHelper.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/translate/TranslateHelper.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -59,21 +59,21 @@
* create translated files from dom strings
*/
public static File[] createFiles(String parentFolder, String bpmnFileName,
- String[] strsForGenerate, String[] fileFolders, String fileName)
- throws IOException {
+ String[] strsForGenerate, String[] fileFolders, String fileName,
+ boolean isOverWrite) throws IOException {
File jpdlFolder = BPMNToUtil.createFile(parentFolder,
- B2JMessages.Jpdl_Suffix, null);
- File diagramFolder = BPMNToUtil.createFile(jpdlFolder.getAbsolutePath(),
- bpmnFileName, null);
+ B2JMessages.Jpdl_Suffix, null, isOverWrite);
+ File diagramFolder = BPMNToUtil.createFile(
+ jpdlFolder.getAbsolutePath(), bpmnFileName, null, isOverWrite);
File[] files = new File[strsForGenerate.length];
File processFolder = null;
int i = 0;
for (String str : strsForGenerate) {
- processFolder = BPMNToUtil.createFile(diagramFolder.getAbsolutePath(),
- fileFolders[i], null);
+ processFolder = BPMNToUtil.createFile(diagramFolder
+ .getAbsolutePath(), fileFolders[i], null, isOverWrite);
files[i] = BPMNToUtil.createFile(processFolder.getAbsolutePath(),
- fileName, str);
+ fileName, str, isOverWrite);
i++;
}
return files;
@@ -126,7 +126,7 @@
return isOk;
}
-
+
/*
* select the elements from process. These elements have no transitions sub
* element or have transtions to end-state.
@@ -135,18 +135,22 @@
List<Element> list = new ArrayList<Element>();
if (processRoot.element(B2JMessages.Jpdl_End_Element_Name) != null) {
- Element endState = processRoot.element(B2JMessages.Jpdl_End_Element_Name);
+ Element endState = processRoot
+ .element(B2JMessages.Jpdl_End_Element_Name);
for (Object ele : processRoot.elements()) {
- Element subEle = ((Element) ele).element(B2JMessages.Jpdl_Transition_Element);
+ Element subEle = ((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element);
if (subEle != null
- && endState.attributeValue(B2JMessages.Dom_Element_Name).equals(
- subEle.attributeValue(B2JMessages.To))) {
+ && endState
+ .attributeValue(B2JMessages.Dom_Element_Name)
+ .equals(subEle.attributeValue(B2JMessages.To))) {
list.add((Element) ele);
}
}
} else {
for (Object ele : processRoot.elements()) {
- if (((Element) ele).element(B2JMessages.Jpdl_Transition_Element) == null) {
+ if (((Element) ele)
+ .element(B2JMessages.Jpdl_Transition_Element) == null) {
list.add((Element) ele);
}
}
@@ -201,7 +205,8 @@
String width, String height) {
Element ele = DomXmlWriter.addElement(parentEle, name);
DomXmlWriter.addAttribute(ele, B2JMessages.Width_Attribute_Name, width);
- DomXmlWriter.addAttribute(ele, B2JMessages.Height_Attribute_Name, height);
+ DomXmlWriter.addAttribute(ele, B2JMessages.Height_Attribute_Name,
+ height);
return ele;
}
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/wizard/B2JExportWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/wizard/B2JExportWizard.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/b2j/wizard/B2JExportWizard.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -36,7 +36,7 @@
private List<String> strForGpdList = new ArrayList<String>();
private List<String> generatedFoldersList = new ArrayList<String>();
- public void createGeneratedFile() {
+ public void createGeneratedFile(boolean isOverWrite) {
String[] jpdlFolderNames = new String[this.generatedFoldersList.size()];
int i = 0;
@@ -58,7 +58,7 @@
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
jpdlFolderNames,
- B2JMessages.Jpdl_Process_Definition_Name);
+ B2JMessages.Jpdl_Process_Definition_Name, isOverWrite);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
@@ -73,7 +73,7 @@
}
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
- jpdlFolderNames, B2JMessages.Gpd_Definition_Name);
+ jpdlFolderNames, B2JMessages.Gpd_Definition_Name, isOverWrite);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/util/BPMNToUtil.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -50,14 +50,14 @@
* create a file
*/
public static File createFile(String parentFolder, String fileName,
- String inputStr) throws IOException {
+ String inputStr, boolean isOverWrite) throws IOException {
File child = new File(parentFolder, fileName);
if (inputStr == null) {
- if (!child.exists()) {
+ if (!child.exists() || isOverWrite) {
child.mkdir();
}
} else {
- if (!child.exists()) {
+ if (!child.exists() || isOverWrite) {
child.createNewFile();
}
FileWriter childWriter = new FileWriter(child);
@@ -143,8 +143,7 @@
/*
* get bpmn pool id list from a dom document
*/
- public static Map<String, String> getPoolIDsFromDocument(
- Document document) {
+ public static Map<String, String> getPoolIDsFromDocument(Document document) {
Map<String, String> poolIDMap = new HashMap<String, String>();
Element diagram = document.getRootElement();
for (Object pool : diagram.elements(B2JMessages.Bpmn_Pool_Element_Name)) {
@@ -157,28 +156,28 @@
}
return poolIDMap;
}
-
-
+
public static Composite createComposite(Composite parent, int numColumns) {
Composite composite = new Composite(parent, SWT.NULL);
-
+
GridLayout layout = new GridLayout();
layout.numColumns = numColumns;
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
return composite;
}
-
+
@SuppressWarnings("unchecked")
public static boolean checkSelectedResources(ISelection selectedResources) {
boolean res = true;
if (selectedResources instanceof IStructuredSelection
- && !selectedResources.isEmpty()) {
- IStructuredSelection ss = (IStructuredSelection)selectedResources;
- for (Iterator it = ss.iterator(); it.hasNext(); ){
+ && !selectedResources.isEmpty()) {
+ IStructuredSelection ss = (IStructuredSelection) selectedResources;
+ for (Iterator it = ss.iterator(); it.hasNext();) {
Object o = it.next();
if (o instanceof IFile) {
- if (!((IFile)o).getFileExtension().equalsIgnoreCase("bpmn")) {
+ if (!((IFile) o).getFileExtension()
+ .equalsIgnoreCase("bpmn")) {
res = false;
break;
}
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/BpmnToWizard.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/BpmnToWizard.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -111,6 +111,7 @@
try {
idMap = BPMNToUtil.getPoolIDsFromDocument(getDocument(
bpmnFileParentPath, bpmnFileName));
+ poolIdList.clear();
} catch (Exception e) {
errorList.add(0, NLS.bind(
B2JMessages.Translate_Error_File_CanNotRead,
@@ -139,7 +140,8 @@
}
public boolean performFinish() {
- createGeneratedFile();
+
+ createGeneratedFile(locationPage.isOverWrite());
refreshWorkspace();
return true;
}
@@ -154,7 +156,7 @@
/*
* write the generated strings to the files
*/
- public abstract void createGeneratedFile();
+ public abstract void createGeneratedFile(boolean b);
/*
* get the path of the eclipse workspace container
Modified: workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/GeneratedFileLocationPage.java
===================================================================
--- workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-09 06:41:40 UTC (rev 10761)
+++ workspace/grid/org.jboss.tools.bpmnTo/src/org/jboss/tools/bpmnto/wizard/GeneratedFileLocationPage.java 2008-10-09 07:36:13 UTC (rev 10762)
@@ -26,6 +26,8 @@
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -46,7 +48,9 @@
private ISelection currentSelection;
private Button button;
private IWizard wizard;
+ private boolean isOverWrite;
+
protected GeneratedFileLocationPage(String pageName, String title,
String description) {
super(pageName);
@@ -98,6 +102,12 @@
button
.setText(B2JMessages.Bpmn_GeneratedFile_Location_WizardPage_CheckBox);
button.setFont(parent.getFont());
+ button.addSelectionListener(new SelectionListener(){
+ public void widgetDefaultSelected(SelectionEvent arg0) {
+ }
+ public void widgetSelected(SelectionEvent arg0) {
+ isOverWrite = button.getSelection();
+ }});
return button;
}
@@ -150,7 +160,16 @@
public void setSelection(ISelection currentSelection) {
this.currentSelection = currentSelection;
}
+
+ public boolean isOverWrite() {
+ return isOverWrite;
+ }
+
+ public void setOverWrite(boolean isOverWrite) {
+ this.isOverWrite = isOverWrite;
+ }
+
}
class ProFilter extends ViewerFilter {
17 years, 3 months
JBoss Tools SVN: r10761 - trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor.
by jbosstools-commits@lists.jboss.org
Author: svasilyev
Date: 2008-10-09 02:41:40 -0400 (Thu, 09 Oct 2008)
New Revision: 10761
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java
Log:
JBIDE-2871
Fixed by Slava Kabanovich, while in Minsk
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java 2008-10-09 05:55:47 UTC (rev 10760)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/attribute/editor/ExtendedFieldEditor.java 2008-10-09 06:41:40 UTC (rev 10761)
@@ -209,7 +209,7 @@
public void setErrorProvider(IAttributeErrorProvider errorProvider) {
this.errorProvider = errorProvider;
- if(this instanceof PropertyChangeListener) {
+ if(this instanceof PropertyChangeListener && errorProvider != null) {
errorProvider.addErrorStateListener((PropertyChangeListener)this);
}
}
17 years, 3 months
JBoss Tools SVN: r10760 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 01:55:47 -0400 (Thu, 09 Oct 2008)
New Revision: 10760
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
Log:
JBIDE-2838
disable the collapse button of the graphical section
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-09 05:53:15 UTC (rev 10759)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/ui/editors/SmooksGraphicalFormPage.java 2008-10-09 05:55:47 UTC (rev 10760)
@@ -258,8 +258,7 @@
Composite rootMainControl = form.getBody();
form.setText("Data Mapping Page");
Section section = this.createPageSectionHeader(rootMainControl,
- Section.TITLE_BAR | Section.DESCRIPTION | Section.TWISTIE
- | Section.EXPANDED, "Mapping Graph Edit Panel",
+ Section.TITLE_BAR | Section.DESCRIPTION , "Mapping Graph Edit Panel",
"Edit the source and target assosiation");
Composite mappingMainComposite = toolkit.createComposite(section);
GridLayout gly = new GridLayout();
17 years, 3 months
JBoss Tools SVN: r10759 - in trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml: ui and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 01:53:15 -0400 (Thu, 09 Oct 2008)
New Revision: 10759
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java
Log:
JBIDE-2841
1.Remove the load button
2.Change the file browse button location
3.Add title and description for the wizard page
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-09 04:58:44 UTC (rev 10758)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/AbstractFileSelectionWizardPage.java 2008-10-09 05:53:15 UTC (rev 10759)
@@ -58,6 +58,11 @@
}
public Object getReturnValue() {
+ try {
+ returnObject = this.loadedTheObject(fileText.getText());
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
return returnObject;
}
@@ -106,7 +111,6 @@
// registe the listener for controls
hookBrowseButtonSelectionAdapter();
hookFileTextModifyListener();
- hookRadioButtonSelectionAdapter();
this.setControl(mainComposite);
}
@@ -176,6 +180,43 @@
xsdLayout.marginWidth = 0;
xsdComposite.setLayout(xsdLayout);
+ Label nfileLanel = new Label(xsdComposite, SWT.NONE);
+ nfileLanel.setText("XML File Path :");
+ fileTextComposite = new Composite(xsdComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.grabExcessHorizontalSpace = true;
+ fileTextComposite.setLayoutData(gd);
+ GridLayout xsdtgl = new GridLayout();
+ xsdtgl.marginWidth = 0;
+ xsdtgl.marginHeight = 0;
+ xsdtgl.numColumns = 1;
+ fileTextComposite.setLayout(xsdtgl);
+
+ fileText = new Text(fileTextComposite, SWT.BORDER);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ fileText.setLayoutData(gd);
+ gd.grabExcessHorizontalSpace = true;
+
+// final Button loadXSDButton = new Button(fileTextComposite, SWT.NONE);
+// loadXSDButton.setText("Load");
+// loadXSDButton.addSelectionListener(new SelectionAdapter() {
+//
+// @Override
+// public void widgetSelected(SelectionEvent e) {
+// super.widgetSelected(e);
+// reasourceLoaded = false;
+// try {
+// returnObject = loadedTheObject(fileText.getText());
+// reasourceLoaded = true;
+// } catch (Throwable e2) {
+// // ignore
+// e2.printStackTrace();
+// }
+// changeWizardPageStatus();
+// }
+//
+// });
+
Composite browseButtonComposite = new Composite(xsdComposite, SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
@@ -202,75 +243,29 @@
gd.horizontalAlignment = GridData.END;
fileSystemBrowseButton.setLayoutData(gd);
- Label nfileLanel = new Label(xsdComposite, SWT.NONE);
- nfileLanel.setText("XSD File Path :");
- fileTextComposite = new Composite(xsdComposite, SWT.NONE);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessHorizontalSpace = true;
- fileTextComposite.setLayoutData(gd);
- GridLayout xsdtgl = new GridLayout();
- xsdtgl.marginWidth = 0;
- xsdtgl.marginHeight = 0;
- xsdtgl.numColumns = 2;
- fileTextComposite.setLayout(xsdtgl);
-
- fileText = new Text(fileTextComposite, SWT.BORDER);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- fileText.setLayoutData(gd);
- gd.grabExcessHorizontalSpace = true;
-
- final Button loadXSDButton = new Button(fileTextComposite, SWT.NONE);
- loadXSDButton.setText("Load");
- loadXSDButton.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- reasourceLoaded = false;
- try {
- returnObject = loadedTheObject(fileText.getText());
- reasourceLoaded = true;
- } catch (Throwable e2) {
- // ignore
- e2.printStackTrace();
- }
- changeWizardPageStatus();
- }
-
- });
-
- // tableViewer = CheckboxTableViewer.newCheckList(xsdComposite,
- // SWT.FULL_SELECTION | SWT.BORDER);
- // gd = new GridData(GridData.FILL_BOTH);
- // gd.heightHint = 200;
- // gd.horizontalSpan = 2;
- // tableViewer.getControl().setLayoutData(gd);
- //
- // initTableViewer();
-
return xsdComposite;
}
abstract protected Object loadedTheObject(String path) throws Exception;
protected void initTableViewer() {
- tableViewer.addCheckStateListener(new ICheckStateListener() {
- boolean flag = true;
-
- public void checkStateChanged(CheckStateChangedEvent event) {
- if (flag) {
- Object checkObject = event.getElement();
- boolean check = event.getChecked();
- flag = false;
- tableViewer.setAllChecked(false);
- tableViewer.setChecked(checkObject, check);
- flag = true;
- changeWizardPageStatus();
- }
- }
- });
- tableViewer.setContentProvider(new XSDStructuredModelContentProvider());
- tableViewer.setLabelProvider(new XSDStructuredModelLabelProvider());
+// tableViewer.addCheckStateListener(new ICheckStateListener() {
+// boolean flag = true;
+//
+// public void checkStateChanged(CheckStateChangedEvent event) {
+// if (flag) {
+// Object checkObject = event.getElement();
+// boolean check = event.getChecked();
+// flag = false;
+// tableViewer.setAllChecked(false);
+// tableViewer.setChecked(checkObject, check);
+// flag = true;
+// changeWizardPageStatus();
+// }
+// }
+// });
+// tableViewer.setContentProvider(new XSDStructuredModelContentProvider());
+// tableViewer.setLabelProvider(new XSDStructuredModelLabelProvider());
}
protected void setCompositeChildrenEnabled(Composite composite,
@@ -305,9 +300,9 @@
String error = null;
if (text == null || "".equals(text))
error = "Please Select a file";
- if (!reasourceLoaded) {
- error = "Resource must be loaded";
- }
+// if (!reasourceLoaded) {
+// error = "Resource must be loaded";
+// }
this.setErrorMessage(error);
this.setPageComplete(error == null);
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java 2008-10-09 04:58:44 UTC (rev 10758)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml/ui/XMLStructuredDataWizardPage.java 2008-10-09 05:53:15 UTC (rev 10759)
@@ -17,14 +17,20 @@
public XMLStructuredDataWizardPage(String pageName, String title,
ImageDescriptor titleImage) {
super(pageName, title, titleImage);
- // TODO Auto-generated constructor stub
+ setPageText();
}
public XMLStructuredDataWizardPage(String pageName) {
super(pageName);
- // TODO Auto-generated constructor stub
+ setPageText();
}
+ private void setPageText() {
+ this.setTitle("Select xml file");
+ this.setDescription("Select a .xml file to be the source/target data");
+
+ }
+
/*
* (non-Javadoc)
*
17 years, 3 months
JBoss Tools SVN: r10758 - in trunk/smooks/plugins: org.jboss.tools.smooks.xml and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2008-10-09 00:58:44 -0400 (Thu, 09 Oct 2008)
New Revision: 10758
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/
trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
trunk/smooks/plugins/org.jboss.tools.smooks.xml/plugin.xml
trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
Log:
JBIDE-2840
The smooks editor can't generate/parse XSL/Freemarker file contents currently , so if user want to use the graphical to generate the contents , there will open a dialog to tell them it's nonsupport
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-09 00:49:08 UTC (rev 10757)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.java2xml/src/org/jboss/tools/smooks/java2xml/analyzer/Java2XMLAnalyzer.java 2008-10-09 04:58:44 UTC (rev 10758)
@@ -16,6 +16,8 @@
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
@@ -52,6 +54,13 @@
public void analyzeMappingGraphModel(
SmooksConfigurationFileGenerateContext context)
throws SmooksAnalyzerException {
+ // TODO will modify soon
+
+ if(true){
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning", "The java2xml can't be generate to config file currently.");
+ }
+
GraphRootModel rootModel = context.getDataMappingRootModel();
List<SourceModel> sourceModelList = rootModel.loadSourceModelList();
List<TargetModel> targetModelList = rootModel.loadTargetModelList();
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml/plugin.xml
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/plugin.xml 2008-10-09 00:49:08 UTC (rev 10757)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/plugin.xml 2008-10-09 04:58:44 UTC (rev 10758)
@@ -11,6 +11,18 @@
name="XML Data Type"
typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
</viewerInitor>
+ </extension>
+ <extension
+ point="org.jboss.tools.smooks.ui.analyzer">
+ <mappingAnalyzer
+ class="org.jboss.tools.smooks.xml2xml.XML2XMLAnalyzer"
+ name="XML2XML Analyzer"
+ typeID="org.jboss.tools.smooks.xml.viewerInitor.xml">
+ <targetSourceType
+ id="org.jboss.tools.smooks.xml.viewerInitor.xml"
+ name="XML">
+ </targetSourceType>
+ </mappingAnalyzer>
</extension>
</plugin>
Added: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java 2008-10-09 04:58:44 UTC (rev 10758)
@@ -0,0 +1,39 @@
+/**
+ *
+ */
+package org.jboss.tools.smooks.xml2xml;
+
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.jboss.tools.smooks.analyzer.AbstractAnalyzer;
+import org.jboss.tools.smooks.analyzer.MappingResourceConfigList;
+import org.jboss.tools.smooks.analyzer.SmooksAnalyzerException;
+import org.jboss.tools.smooks.model.SmooksResourceListType;
+import org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext;
+
+/**
+ * @author dart
+ *
+ */
+public class XML2XMLAnalyzer extends AbstractAnalyzer {
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingGraphModel(org.jboss.tools.smooks.ui.modelparser.SmooksConfigurationFileGenerateContext)
+ */
+ public void analyzeMappingGraphModel(
+ SmooksConfigurationFileGenerateContext context)
+ throws SmooksAnalyzerException {
+ Shell shell = context.getShell();
+ MessageDialog.openWarning(shell, "Warning", "The xml2xml can't be generate to config file currently.");
+ }
+
+ /* (non-Javadoc)
+ * @see org.jboss.tools.smooks.analyzer.IMappingAnalyzer#analyzeMappingSmooksModel(org.jboss.tools.smooks.model.SmooksResourceListType, java.lang.Object, java.lang.Object)
+ */
+ public MappingResourceConfigList analyzeMappingSmooksModel(
+ SmooksResourceListType listType, Object sourceObject,
+ Object targetObject) {
+ return null;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.xml/src/org/jboss/tools/smooks/xml2xml/XML2XMLAnalyzer.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-09 00:49:08 UTC (rev 10757)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.xml2java/src/org/jboss/tools/smooks/xml2java/analyzer/XMLSourceModelAnalyzer.java 2008-10-09 04:58:44 UTC (rev 10758)
@@ -22,6 +22,7 @@
import org.jboss.tools.smooks.analyzer.ISourceModelAnalyzer;
import org.jboss.tools.smooks.graphical.GraphInformations;
import org.jboss.tools.smooks.graphical.Param;
+import org.jboss.tools.smooks.graphical.Params;
import org.jboss.tools.smooks.model.SmooksResourceListType;
import org.jboss.tools.smooks.xml.model.AbstractXMLObject;
import org.jboss.tools.smooks.xml.model.DocumentObject;
@@ -38,19 +39,24 @@
public Object buildSourceInputObjects(GraphInformations graphInfo,
SmooksResourceListType listType, IFile sourceFile)
throws InvocationTargetException {
- List<Param> paramList = graphInfo.getParams().getParam();
+ Params params = graphInfo.getParams();
String path = null;
- for (Iterator<Param> iterator = paramList.iterator(); iterator
- .hasNext();) {
- Param param = (Param) iterator.next();
- if (param.getName().equals(XML_FILE)) {
- path = param.getValue();
- break;
+ if (params != null) {
+ List<Param> paramList = graphInfo.getParams().getParam();
+ for (Iterator<Param> iterator = paramList.iterator(); iterator
+ .hasNext();) {
+ Param param = (Param) iterator.next();
+ if (param.getName().equals(XML_FILE)) {
+ path = param.getValue();
+ break;
+ }
}
}
if (path == null) {
- throw new InvocationTargetException(new Exception(
- "xml file path can't find in the graphInfo file"));
+ // TODO tell user the filepath can't find or not ?
+ return null;
+// throw new InvocationTargetException(new Exception(
+// "xml file path can't find in the graphInfo file"));
}
XMLObjectAnalyzer objectBuilder = new XMLObjectAnalyzer();
try {
17 years, 3 months
JBoss Tools SVN: r10756 - in trunk/common: tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-08 18:39:11 -0400 (Wed, 08 Oct 2008)
New Revision: 10756
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
fix junit tests errors
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java 2008-10-08 21:30:05 UTC (rev 10755)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/select/SelectObjectWizard.java 2008-10-08 22:39:11 UTC (rev 10756)
@@ -46,7 +46,7 @@
if(of == null) return 1;
final IEditorPart p = openEditor(getObjectToOpen((XModelObject)object));
if(p != null && p.getSite().getSelectionProvider() != null && (object instanceof XModelObject)) {
- Display.getDefault().asyncExec(new Runnable() {
+ Display.getDefault().syncExec(new Runnable() {
public void run() {
if(preferredPage != null && p instanceof EditorPartWrapper) {
EditorPartWrapper w = (EditorPartWrapper)p;
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-08 21:30:05 UTC (rev 10755)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-08 22:39:11 UTC (rev 10756)
@@ -43,8 +43,13 @@
protected void setUp() {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(
STYLE_OPENON_PROJECT);
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
JobUtils.waitForIdle();
}
+
+ protected void tearDown() {
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
+ }
public OpenOnsTest() {
super("styleClass OpenOn tests");
17 years, 3 months
JBoss Tools SVN: r10755 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-08 17:30:05 -0400 (Wed, 08 Oct 2008)
New Revision: 10755
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
Log:
fix junit test errors
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-08 20:01:45 UTC (rev 10754)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ProjectImportTestSetup.java 2008-10-08 21:30:05 UTC (rev 10755)
@@ -83,9 +83,10 @@
@Override
protected void tearDown() throws Exception {
boolean saveAutoBuild = ResourcesUtils.setBuildAutomatically(false);
+ JobUtils.waitForIdle();
for (int i = 0; i < projectNames.length; i++) {
ResourcesUtils.deleteProject(projectNames[i]);
- EditorTestHelper.joinBackgroundActivities();
+ JobUtils.waitForIdle();
}
ResourcesUtils.setBuildAutomatically(saveAutoBuild);
}
17 years, 3 months
JBoss Tools SVN: r10754 - in trunk/common/tests/org.jboss.tools.common.text.ext.test: projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-10-08 16:01:45 -0400 (Wed, 08 Oct 2008)
New Revision: 10754
Added:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/FilterTest.java
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspTagsHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/tldUriHyperlinkTests.jsp
Modified:
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/web.xml
trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/classHyperlinkTests.jsp
trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
Log:
add open-on tests common.ext.test
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-08 18:37:02 UTC (rev 10753)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/.project 2008-10-08 20:01:45 UTC (rev 10754)
@@ -15,6 +15,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.jboss.tools.common.verification.verifybuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
@@ -22,5 +27,6 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
+ <nature>org.jboss.tools.jsf.jsfnature</nature>
</natures>
</projectDescription>
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/FilterTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/FilterTest.java (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/FilterTest.java 2008-10-08 20:01:45 UTC (rev 10754)
@@ -0,0 +1,9 @@
+package org.jboss.tools.test;
+
+public class FilterTest {
+
+ public FilterTest() {
+ // TODO Auto-generated constructor stub
+ }
+
+}
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/JavaSource/org/jboss/tools/test/FilterTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/web.xml
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/web.xml 2008-10-08 18:37:02 UTC (rev 10753)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/WEB-INF/web.xml 2008-10-08 20:01:45 UTC (rev 10754)
@@ -6,6 +6,16 @@
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
+ <filter>
+ <description>JUnit Test Filter</description>
+ <display-name>JUnit Test Filter Display Name</display-name>
+ <filter-name>Filter1</filter-name>
+ <filter-class>org.jboss.tools.test.FilterTest</filter-class>
+ </filter>
+ <filter-mapping>
+ <filter-name>Filter1</filter-name>
+ <url-pattern>*</url-pattern>
+ </filter-mapping>
<listener>
<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
</listener>
@@ -20,7 +30,36 @@
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
+ <security-constraint>
+ <display-name>Accessible For Role1</display-name>
+ <web-resource-collection>
+ <web-resource-name>stylesheets</web-resource-name>
+ <url-pattern>/stylesheet*</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Designer</role-name>
+ </auth-constraint>
+ </security-constraint>
+ <security-constraint>
+ <display-name>Accessible For Role1</display-name>
+ <web-resource-collection>
+ <web-resource-name>stylesheets</web-resource-name>
+ <url-pattern>*.jsp</url-pattern>
+ </web-resource-collection>
+ <auth-constraint>
+ <role-name>Developer</role-name>
+ </auth-constraint>
+ </security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
</login-config>
+ <security-role>
+ <role-name>Administrator</role-name>
+ </security-role>
+ <security-role>
+ <role-name>Designer</role-name>
+ </security-role>
+ <security-role>
+ <role-name>Developer</role-name>
+ </security-role>
</web-app>
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/classHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/classHyperlinkTests.jsp 2008-10-08 18:37:02 UTC (rev 10753)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/classHyperlinkTests.jsp 2008-10-08 20:01:45 UTC (rev 10754)
@@ -29,7 +29,7 @@
<f:view>
<h1 class="style-class1">
<f:valueChangeListener type="org.jboss.tools.test.ChangeListenerInstance"/>
- </h1>
+ </h1>
</f:view>
</body>
</html>
\ No newline at end of file
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspTagsHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspTagsHyperlinkTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspTagsHyperlinkTests.jsp 2008-10-08 20:01:45 UTC (rev 10754)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" version="2.0">
+ <jsp:directive.page language="java"
+ contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1" />
+ <jsp:text>
+ <![CDATA[ <?xml version="1.0" encoding="ISO-8859-1" ?> ]]>
+ </jsp:text>
+ <jsp:text>
+ <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ]]>
+ </jsp:text>
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
+<title>Insert title here</title>
+</head>
+<body>
+<f:view>
+
+</f:view>
+</body>
+</html>
+</jsp:root>
\ No newline at end of file
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/jspTagsHyperlinkTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/tldUriHyperlinkTests.jsp
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/tldUriHyperlinkTests.jsp (rev 0)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/tldUriHyperlinkTests.jsp 2008-10-08 20:01:45 UTC (rev 10754)
@@ -0,0 +1,2 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
Property changes on: trunk/common/tests/org.jboss.tools.common.text.ext.test/projects/HiperlinksTestProject/WebContent/tldUriHyperlinkTests.jsp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java
===================================================================
--- trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-08 18:37:02 UTC (rev 10753)
+++ trunk/common/tests/org.jboss.tools.common.text.ext.test/src/org/jboss/tools/common/text/ext/test/OpenOnsTest.java 2008-10-08 20:01:45 UTC (rev 10754)
@@ -10,6 +10,7 @@
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.hyperlink.IHyperlink;
import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.ui.IEditorDescriptor;
@@ -42,6 +43,7 @@
protected void setUp() {
project = ResourcesPlugin.getWorkspace().getRoot().getProject(
STYLE_OPENON_PROJECT);
+ JobUtils.waitForIdle();
}
public OpenOnsTest() {
@@ -50,6 +52,56 @@
public static final String WEB_XML_FILE_PATH = "WebContent/WEB-INF/web.xml";
+ public void testFilterNameOpenOn() throws PartInitException, BadLocationException {
+ IFile webXml = project.getFile(WEB_XML_FILE_PATH);
+ IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
+ IEditorPart editor = WorkbenchUtils.openEditor(webXml, descriptor.getId());
+ editor = ((EditorPartWrapper)editor).getEditor();
+ JobUtils.waitForIdle();
+ DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
+ xmlMultyPageEditor.selectPageByName("Source");
+ ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IDocument document = viewer.getDocument();
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ "Filter1", true, true, false, false);
+ reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
+ "Filter1", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<filter-name>", selection.getText());
+ }
+
+ public void testRoleNameOpenOn() throws PartInitException, BadLocationException {
+ IFile webXml = project.getFile(WEB_XML_FILE_PATH);
+ IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
+ IEditorPart editor = WorkbenchUtils.openEditor(webXml, descriptor.getId());
+ editor = ((EditorPartWrapper)editor).getEditor();
+ JobUtils.waitForIdle();
+ DefaultMultipageEditor xmlMultyPageEditor = (DefaultMultipageEditor) editor;
+ xmlMultyPageEditor.selectPageByName("Source");
+ ISourceViewer viewer = xmlMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IDocument document = viewer.getDocument();
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ "Designer", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<role-name>", selection.getText());
+ }
+
public void testServletNameOpenOn() throws PartInitException, BadLocationException {
IFile webXml = project.getFile(WEB_XML_FILE_PATH);
IEditorDescriptor descriptor = IDE.getEditorDescriptor(webXml);
@@ -70,30 +122,65 @@
reg = new FindReplaceDocumentAdapter(document).find(reg.getOffset()+reg.getLength()+1,
"Faces Servlet", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
- System.out.println(editor.getSite().getSelectionProvider().getSelection().toString());
+ ITextSelection selection = (ITextSelection)viewer.getSelectionProvider().getSelection();
+ assertEquals("<servlet-name>", selection.getText());
}
+
+ public static final String TAGLIB_URI_TEST_FILE = "WebContent/tldUriHyperlinkTests.jsp";
- public void testTagAttributeOpenOn() throws BadLocationException {
+ public void testTaglibUriFromJarOpenOn() throws BadLocationException {
IEditorPart editor = WorkbenchUtils.openEditor(project
- .getFile(STYLE_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ .getFile(TAGLIB_URI_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
assertTrue(editor instanceof JSPMultiPageEditor);
JobUtils.waitForIdle();
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
- "value", true, true, false, false);
+ "jsf/core", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
System.out.println(fileName);
- assertTrue("style1.css".equals(fileName));
+ assertTrue("jsf_core.tld".equals(fileName));
}
+ public static final String TAGLIB_URI_JSP_ROOT_TEST_FILE = "WebContent/jspTagsHyperlinkTests.jsp";
+ public void testTaglibUriFromJarinJspRootOpenOn() throws BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(project
+ .getFile(TAGLIB_URI_JSP_ROOT_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JobUtils.waitForIdle();
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+ IDocument document = jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument();
+ IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
+ "jsf/core", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ System.out.println(fileName);
+ assertTrue("jsf_core.tld".equals(fileName));
+ }
+
public static final String STYLE_TEST_FILE = "WebContent/styleHyperlinkTests.jsp";
public static final String CSS1_TEST_FILE = "WebContent/stylesheet/style1.css";
public static final String CSS2_TEST_FILE = "WebContent/stylesheet/style2.css";
@@ -109,6 +196,10 @@
IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
"stylesheet/style1.css", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -127,6 +218,10 @@
IRegion reg = new FindReplaceDocumentAdapter(document).find(0,
"style-class9\"", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -136,6 +231,10 @@
reg = new FindReplaceDocumentAdapter(document).find(0,
"style-class3", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
@@ -146,16 +245,17 @@
"style-class6", true, true, false, false);
links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
links[0].open();
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
fileName = editor.getEditorInput().getName();
assertTrue("style2.css".equals(fileName));
}
- public void testFilterNameOpenOn() {
-
- }
-
public static final String CLASS_TEST_FILE = "WebContent/classHyperlinkTests.jsp";
public static final String CLASS1_TEST_FILE = "JavaSource/org/jboss/test/ChangeListenerInstance.java";
@@ -166,24 +266,41 @@
JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
-// IEditorInput fileInput = new FileEditorInput(project
-// .getFile(CLASS_TEST_FILE));
-// IDocumentProvider documentProvider = DocumentProviderRegistry
-// .getDefault().getDocumentProvider(fileInput);
-//
-// documentProvider.connect(fileInput);
-// IDocument document = documentProvider.getDocument(fileInput);
IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
"org.jboss.tools.test.ChangeListenerInstance", true, true, false, false);
IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
-// ClassHyperlink classHyper = new ClassHyperlink();
-// classHyper.setOffset(reg.getOffset());
-// classHyper.setDocument(document);
-// classHyper.open();
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
links[0].open();
editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
String fileName = editor.getEditorInput().getName();
assertTrue("ChangeListenerInstance.java".equals(fileName));
}
+
+ public void testTaglibTagNameOpenOn() throws CoreException, BadLocationException {
+ IEditorPart editor = WorkbenchUtils.openEditor(project
+ .getFile(CLASS_TEST_FILE), JSPMultiPageEditor.EDITOR_ID);
+ assertTrue(editor instanceof JSPMultiPageEditor);
+ JSPMultiPageEditor jspMultyPageEditor = (JSPMultiPageEditor) editor;
+ ISourceViewer viewer = jspMultyPageEditor.getSourceEditor().getTextViewer();
+
+ IRegion reg = new FindReplaceDocumentAdapter(jspMultyPageEditor.getSourceEditor().getTextViewer().getDocument()).find(0,
+ "view", true, true, false, false);
+ IHyperlink[] links = HyperlinkDetector.getInstance().detectHyperlinks(viewer, reg, false);
+ assertNotNull(links);
+ assertTrue(links.length!=0);
+ //assertNotNull(links[0].getHyperlinkText());
+ assertNotNull(links[0].toString());
+ System.out.println(links[0].getClass().getName());
+ links[0].open();
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+
+ String fileName = editor.getEditorInput().getName();
+ assertTrue("jsf_core.tld".equals(fileName));
+ }
+
+
}
17 years, 3 months