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>
16 years, 3 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>
16 years, 3 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);
}
16 years, 3 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
16 years, 3 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
16 years, 3 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";
// }
16 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;
+ }
+}
16 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
16 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>
16 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;
}
}
16 years, 3 months