JBoss Tools SVN: r12830 - Pricing and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-26 02:45:19 -0500 (Fri, 26 Dec 2008)
New Revision: 12830
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/gpd.xml
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/processdefinition.xml
Log:
JBIDE-3399: Add jBPM convert tests in build
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/gpd.xml
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/gpd.xml 2008-12-26 07:38:48 UTC (rev 12829)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/gpd.xml 2008-12-26 07:45:19 UTC (rev 12830)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<root-container name="Policy Pricing" width="1500" height="214">
- <node width="100" height="40" name="Price Policy" x="144" y="0"> <edge name="to_nodename_3"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="Review Pricing" x="555" y="141"> <edge name="to_nodename_4"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name=" Price Calculated ?" x="373" y="16"> <edge name="false"> <label x="5" y="-10"/> </edge> <edge name="true"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="to_nodename" x="16" y="80"> <edge name="to_nodename_2"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="to_nodename_1" x="832" y="80"/></root-container>
+ <node width="100" height="40" name="Price Policy" x="144" y="0"> <edge name="to_ Price Calculated ?"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="Review Pricing" x="555" y="141"> <edge name="to_eleName_1"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name=" Price Calculated ?" x="373" y="16"> <edge name="false"> <label x="5" y="-10"/> </edge> <edge name="true"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="eleName" x="16" y="80"> <edge name="to_Price Policy"> <label x="5" y="-10"/> </edge> </node> <node width="100" height="40" name="eleName_1" x="832" y="80"/></root-container>
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/processdefinition.xml
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/processdefinition.xml 2008-12-26 07:38:48 UTC (rev 12829)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/resultfile/PolicyPricingProcess.bpmn/Policy Pricing/processdefinition.xml 2008-12-26 07:45:19 UTC (rev 12830)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.2" name="Policy Pricing">
- <node name="Price Policy"> <edge name="to_nodename_3" to=" Price Calculated ?"/> </node> <start-state name="to_nodename"> <edge name="to_nodename_2" to="Price Policy"/> </start-state> <decision name=" Price Calculated ?"> <edge name="false" to="to_nodename_1"/> <edge name="true" to="Review Pricing"/> </decision> <node name="Review Pricing"> <edge name="to_nodename_4" to="to_nodename_1"/> </node> <end-state name="to_nodename_1"/></process-definition>
+ <node name="Price Policy"> <transition to=" Price Calculated ?" name="to_ Price Calculated ?"/> </node> <start-state name="eleName"> <transition to="Price Policy" name="to_Price Policy"/> </start-state> <decision name=" Price Calculated ?"> <transition to="eleName_1" name="false"/> <transition to="Review Pricing" name="true"/> </decision> <node name="Review Pricing"> <transition to="eleName_1" name="to_eleName_1"/> </node> <end-state name="eleName_1"/></process-definition>
14 years, 3 months
JBoss Tools SVN: r12829 - in trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test: src/org/jboss/tools/jbpm/convert/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-26 02:38:48 -0500 (Fri, 26 Dec 2008)
New Revision: 12829
Modified:
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties
trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/src/org/jboss/tools/jbpm/convert/test/BpmnConvertTest.java
Log:
JBIDE-3399: Add jBPM convert tests in build
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties 2008-12-26 07:38:06 UTC (rev 12828)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/build.properties 2008-12-26 07:38:48 UTC (rev 12829)
@@ -1,7 +1,7 @@
source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- .,\
- resultfile/,\
- testfile/,\
+bin.includes = META-INF/,\
+ .,\
+ resultfile/,\
+ testfile/,\
plugin.properties
Modified: trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/src/org/jboss/tools/jbpm/convert/test/BpmnConvertTest.java
===================================================================
--- trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/src/org/jboss/tools/jbpm/convert/test/BpmnConvertTest.java 2008-12-26 07:38:06 UTC (rev 12828)
+++ trunk/jbpm/tests/org.jboss.tools.jbpm.convert.test/src/org/jboss/tools/jbpm/convert/test/BpmnConvertTest.java 2008-12-26 07:38:48 UTC (rev 12829)
@@ -8,10 +8,8 @@
import java.io.InputStream;
import java.util.ArrayList;
-import org.dom4j.Document;
import org.eclipse.core.runtime.Platform;
import org.jboss.tools.jbpm.convert.b2j.translate.*;
-import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
public class BpmnConvertTest extends TestCase {
@@ -37,22 +35,14 @@
for (int i = 0; i < bpmnFiles.length; i++) {
String name = bpmnFiles[i].getName();
String path = bpmnFiles[i].getParentFile().getAbsolutePath();
- Document bpmnDocument = null;
- Document bpmnDiagramDocument = null;
- try {
- bpmnDocument = getDocument(path, name);
- bpmnDiagramDocument = getDocument(path, TranslateHelper
- .getBpmnDiagramName(name));
- } catch (Exception e1) {
- e1.printStackTrace();
- }
+
String tmpLocation = getTempDir().getAbsolutePath();
- jpdltranformer = new BPMN2JPDL(name, path, bpmnDocument);
+ jpdltranformer = new BPMN2JPDL(name, path);
jpdltranformer.translateToFiles(tmpLocation);
- gpdtranformer = new GraphicalFileGenerator(bpmnDiagramDocument,
- jpdltranformer.getMap(), path, name);
+ gpdtranformer = new GraphicalFileGenerator(jpdltranformer.getMap(),
+ path, TranslateHelper.getBpmnDiagramName(name));
gpdtranformer.translateToFiles(tmpLocation);
try {
@@ -177,16 +167,6 @@
}
}
- /*
- * 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;
- }
-
public File getTempDir() {
File tempdir = new File(System.getProperty("java.io.tmpdir"));
File tmpdir = new File(tempdir, "tmp" + System.currentTimeMillis());
14 years, 3 months
JBoss Tools SVN: r12828 - in trunk/jbpm/plugins/org.jboss.tools.jbpm.convert: .settings and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-12-26 02:38:06 -0500 (Fri, 26 Dec 2008)
New Revision: 12828
Added:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/Constants.java
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
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/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/B2JExportWizard.java
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/BPMNResourcesChoicePage.java
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
Log:
JBIDE-3447: change the default value of jpdl node name during bpmn -> jpdl
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/.settings/attachedFile.properties 2008-12-26 07:38:06 UTC (rev 12828)
@@ -0,0 +1,2 @@
+## index of importer -> set(imports)
+#Fri Dec 26 15:31:28 CST 2008
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/META-INF/MANIFEST.MF 2008-12-26 07:38:06 UTC (rev 12828)
@@ -16,8 +16,7 @@
Bundle-Vendor: %PLUGIN_PROVIDER
Import-Package: org.eclipse.core.resources,
org.eclipse.ui.model
-Export-Package: org.dom4j,
- org.jboss.tools.jbpm.convert.b2j.translate,
+Export-Package: org.jboss.tools.jbpm.convert.b2j.translate,
org.jboss.tools.jbpm.convert.bpmnto,
org.jboss.tools.jbpm.convert.bpmnto.translate,
org.jboss.tools.jbpm.convert.bpmnto.util,
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/build.properties 2008-12-26 07:38:06 UTC (rev 12828)
@@ -1,13 +1,13 @@
source.. = src/
output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- plugin.properties,\
- lib/dom4j-1.6.1.jar,\
- icons/,\
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
+bin.includes = META-INF/,\
+ .,\
+ plugin.xml,\
+ plugin.properties,\
+ lib/dom4j-1.6.1.jar,\
+ icons/,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
jboss_about.png
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2008-12-26 07:38:06 UTC (rev 12828)
@@ -1,32 +1,6 @@
-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_FlowOutgoings_Attribute_Name=outgoingEdges
-Bpmn_FlowIncomings_Attribute_Name=incomingEdges
-Bpmn_Element_ID=iD
Bpmn_Wizard_Title=BPMN to jPDL Conversion
Bpmn_File_Choose_WizardPage_Name=FileChoosePage
Bpmn_File_Choose_WizardPage_Title=BPMN Resources
@@ -45,37 +19,4 @@
Bpmn_Translate_Message_WizardPage_Title=Conversion Warnings and Errors
Bpmn_Translate_Message_WizardpageViewer_Title=Warnings and Errors
Bpmn_Translate_Message_WizardPage_Message=Warnings and Errors that occurred during conversion
-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=edge
-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=root-container
-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
+Translate_Error_File_CanNotRead=Error\: Couldn't read or parse {0} file to a DOM document\:
\ No newline at end of file
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2JMessages.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -12,7 +12,6 @@
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
@@ -21,37 +20,9 @@
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_FlowOutgoings_Attribute_Name;
- public static String Bpmn_FlowIncomings_Attribute_Name;
public static String Bpmn_Wizard_Title;
public static String Bpmn_File_Choose_WizardPage_Name;
public static String Bpmn_File_Choose_WizardPage_Title;
@@ -70,42 +41,7 @@
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);
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/BPMN2JPDL.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -19,10 +19,9 @@
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.BPMNToUtil;
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;
/**
@@ -44,6 +43,10 @@
public BPMN2JPDL() {
}
+
+ public BPMN2JPDL(String bpmnFileName, String bpmnFilePath){
+ super(bpmnFileName, bpmnFilePath, null);
+ }
public BPMN2JPDL(String bpmnFileName, String bpmnFilePath,
Document bpmnDocument) {
@@ -69,7 +72,7 @@
strForProcessDefs[i] = DomXmlWriter.toString(def);
} catch (IOException e) {
this.errors
- .add(B2JMessages.Translate_Error_JpdlFile_CanNotGenerate
+ .add(Constants.Translate_Error_JpdlFile_CanNotGenerate
+ e.getMessage());
}
i++;
@@ -94,23 +97,11 @@
try {
TranslateHelper.createFiles(fileLocation, bpmnFileName,
strForProcessDefs, jpdlFileNames,
- B2JMessages.Jpdl_Process_Definition_Name, false);
+ Constants.Jpdl_Process_Definition_Name, false);
} catch (Exception e) {
- errors.add(B2JMessages.Translate_Error_JpdlFile_CanNotWrite
+ errors.add(Constants.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);
- }
- }
}
/*
@@ -120,18 +111,27 @@
// set the namemap = null
TranslateHelper.setNameMap(new HashMap<String, Integer>());
-
+
+ if(bpmnDocument == null) {
+ try {
+ bpmnDocument = BPMNToUtil.parse(rootLocation, bpmnFileName);
+ } catch (Exception e) {
+ errors.add(Constants.Translate_Error_File_CanNotRead
+ + e.getMessage());
+ }
+ }
+
Element diagram = bpmnDocument.getRootElement();
if (this.poolIDList == null || this.poolIDList.size() == 0) {
for (Object pool : diagram
- .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ .elements(Constants.Bpmn_Pool_Element_Name)) {
translateGraph((Element) pool);
}
} else {
for (Object pool : diagram
- .elements(B2JMessages.Bpmn_Pool_Element_Name)) {
+ .elements(Constants.Bpmn_Pool_Element_Name)) {
if (this.poolIDList.contains(((Element) pool)
- .attributeValue(B2JMessages.Bpmn_Element_ID))) {
+ .attributeValue(Constants.Bpmn_Element_ID))) {
translateGraph((Element) pool);
}
}
@@ -145,16 +145,16 @@
Document processDef = TranslateHelper.createJpdlDomTree(true);
Element processRoot = processDef.getRootElement();
- DomXmlWriter.addAttribute(processRoot, B2JMessages.Dom_Element_Name,
+ DomXmlWriter.addAttribute(processRoot, Constants.Dom_Element_Name,
TranslateHelper.generateProcessName(graph));
processDef.setName(processRoot
- .attributeValue(B2JMessages.Dom_Element_Name));
+ .attributeValue(Constants.Dom_Element_Name));
- map.put(graph.attributeValue(B2JMessages.Dom_Element_ID)
- + B2JMessages.Bpmn_Pool_Element_Name, processRoot);
+ map.put(graph.attributeValue(Constants.Dom_Element_ID)
+ + Constants.Bpmn_Pool_Element_Name, processRoot);
for (Object activity : graph.elements()) {
- if (B2JMessages.Bpmn_Vertice_Element_Name
+ if (Constants.Bpmn_Vertice_Element_Name
.equals(((Element) activity).getName())) {
translateActivity((Element) activity, processRoot);
getSequenceFlowInfo((Element)activity);
@@ -170,9 +170,9 @@
* get Incomingedges and Outgoingedges Map from the activity element
*/
private void getSequenceFlowInfo(Element activity) {
- String id = activity.attributeValue(B2JMessages.Dom_Element_ID);
- String ins = activity.attributeValue(B2JMessages.Bpmn_FlowIncomings_Attribute_Name);
- String outs = activity.attributeValue(B2JMessages.Bpmn_FlowOutgoings_Attribute_Name);
+ String id = activity.attributeValue(Constants.Dom_Element_ID);
+ String ins = activity.attributeValue(Constants.Bpmn_FlowIncomings_Attribute_Name);
+ String outs = activity.attributeValue(Constants.Bpmn_FlowOutgoings_Attribute_Name);
String[] inArray = null;
String[] outArray = null;
if(ins != null){
@@ -194,7 +194,7 @@
*/
private void translateActivity(Element activity, Element processRoot) {
String type = activity
- .attributeValue(B2JMessages.Bpmn_XmiType_Attribute_Name);
+ .attributeValue(Constants.Bpmn_XmiType_Attribute_Name);
Element element = null;
// According to bpmn activity type, map to different jpdl node
@@ -202,10 +202,10 @@
// a warining message for it.
if ("bpmn:Activity".equals(type)) {
String activityType = activity
- .attributeValue(B2JMessages.Bpmn_ActivityType_Attribute_Name);
+ .attributeValue(Constants.Bpmn_ActivityType_Attribute_Name);
if (activityType == null || "Task".equals(activityType)) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_Node_Element_Name);
+ Constants.Jpdl_Node_Element_Name);
} else if ("EventStartEmpty".equals(activityType)
|| "EventStartMessage".equals(activityType)
|| "EventStartRule".equals(activityType)
@@ -214,10 +214,10 @@
|| "EventStartMultiple".equals(activityType)
|| "EventStartSignal".equals(activityType)) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_Start_Element_Name);
+ Constants.Jpdl_Start_Element_Name);
if (!"EventStartEmpty".equals(activityType)) {
warnings
- .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ .add(Constants.Translate_Warning_Bpmn_Element_Type
+ activityType);
}
} else if ("EventIntermediateEmpty".equals(activityType)
@@ -232,10 +232,10 @@
|| "EventIntermediateSignal".equals(activityType)) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_State_Element_Name);
+ Constants.Jpdl_State_Element_Name);
if (!"EventIntermediateEmpty".equals(activityType)) {
warnings
- .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ .add(Constants.Translate_Warning_Bpmn_Element_Type
+ activityType);
}
} else if ("EventEndEmpty".equals(activityType)
@@ -249,56 +249,56 @@
|| "EventEndSignal".equals(activityType)) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_End_Element_Name);
+ Constants.Jpdl_End_Element_Name);
if (!"EventEndEmpty".equals(activityType)) {
warnings
- .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ .add(Constants.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);
+ Constants.Jpdl_Decision_Element_Name);
if (!"GatewayDataBasedExclusive".equals(activityType)) {
warnings
- .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ .add(Constants.Translate_Warning_Bpmn_Element_Type
+ activityType);
}
} else if ("GatewayParallel".equals(activityType)
|| "GatewayDataBasedInclusive".equals(activityType)) {
if (activity
- .attributeValue(B2JMessages.Bpmn_InFlow_Attribute_Name) == null
+ .attributeValue(Constants.Bpmn_InFlow_Attribute_Name) == null
|| activity.attributeValue(
- B2JMessages.Bpmn_InFlow_Attribute_Name).split(
- B2JMessages.Space).length == 1) {
+ Constants.Bpmn_InFlow_Attribute_Name).split(
+ Constants.Space).length == 1) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_Fork_Element_Name);
+ Constants.Jpdl_Fork_Element_Name);
} else {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_Join_Element_Name);
+ Constants.Jpdl_Join_Element_Name);
}
if (!"GatewayDataBasedInclusive".equals(activityType)) {
warnings
- .add(B2JMessages.Translate_Warning_Bpmn_Element_Type
+ .add(Constants.Translate_Warning_Bpmn_Element_Type
+ activityType);
}
}
} else if ("bpmn:SubProcess".equals(type)) {
element = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_ProcessState_Element_Name);
+ Constants.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));
+ if (!TranslateHelper.check_mapElementName(activity, element, false)) {
+ warnings.add(Constants.Translate_Warning_Bpmn_Element_Name
+ + activity.attributeValue(Constants.Bpmn_Element_ID));
}
- map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), element);
+ map.put(activity.attributeValue(Constants.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))) {
+ .attributeValue(Constants.Bpmn_Looping_Attribute_Name))) {
createMockLoop(activity, element);
}
}
@@ -310,20 +310,20 @@
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,
+ Constants.Jpdl_SubProcess_Element_Name);
+ DomXmlWriter.mapAttribute(ele, Constants.Dom_Element_Name,
processRoot);
// translate the transaction of subprocess
Element eAnnot = subProcess
- .element(B2JMessages.Bpmn_EAnnotations_Element_Name);
+ .element(Constants.Bpmn_EAnnotations_Element_Name);
if (eAnnot != null) {
Element details = eAnnot
- .element(B2JMessages.Bpmn_Details_Element_Name);
+ .element(Constants.Bpmn_Details_Element_Name);
if (details != null
&& "true"
.equals(details
- .attributeValue(B2JMessages.Bpmn_Value_Attribute_Name))) {
+ .attributeValue(Constants.Bpmn_Value_Attribute_Name))) {
translateTransaction(processRoot);
}
}
@@ -340,10 +340,10 @@
}
// create a decision
Element decision = DomXmlWriter.addElement(processRoot,
- B2JMessages.Jpdl_Decision_Element_Name);
+ Constants.Jpdl_Decision_Element_Name);
- DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name,
- B2JMessages.Jpdl_Element_Successful_Name);
+ DomXmlWriter.addAttribute(decision, Constants.Dom_Element_Name,
+ Constants.Jpdl_Element_Successful_Name);
// get bpmn id from map
String bpmnId = null;
for (String key : map.keySet()) {
@@ -352,46 +352,46 @@
break;
}
}
- map.put(bpmnId + B2JMessages.Jpdl_Element_Decision_Suffix, decision);
+ map.put(bpmnId + Constants.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));
+ Constants.Jpdl_Transition_Element);
+ transition.addAttribute(Constants.Dom_Element_Name, ele
+ .attributeValue(Constants.Dom_Element_Name)
+ + Constants.To + Constants.Jpdl_Decision_Element_Name);
+ transition.addAttribute(Constants.To, decision
+ .attributeValue(Constants.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);
+ Constants.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(complete, Constants.Dom_Element_Name,
+ Constants.Jpdl_Element_Complete_Suffix);
+ map.put(bpmnId + Constants.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);
+ Constants.Jpdl_Node_Element_Name);
+ DomXmlWriter.addAttribute(cancel, Constants.Dom_Element_Name,
+ Constants.Jpdl_Element_Cancel_Suffix);
+ map.put(bpmnId + Constants.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));
+ Constants.Jpdl_Transition_Element);
+ toComplete.addAttribute(Constants.Dom_Element_Name, "true");
+ toComplete.addAttribute(Constants.To, complete
+ .attributeValue(Constants.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));
+ Constants.Jpdl_Transition_Element);
+ toCancel.addAttribute(Constants.Dom_Element_Name, "false");
+ toCancel.addAttribute(Constants.To, cancel
+ .attributeValue(Constants.Dom_Element_Name));
}
@@ -400,7 +400,7 @@
*/
private void translateSequenceFlows(Element graph, Element processRoot) {
for (Object edge : graph
- .elements(B2JMessages.Bpmn_SequenceFlow_Element_Name)) {
+ .elements(Constants.Bpmn_SequenceFlow_Element_Name)) {
translateSequenceFlow((Element) edge, processRoot);
}
}
@@ -410,25 +410,26 @@
*/
private void translateSequenceFlow(Element edge, Element processRoot) {
- Element source = map.get(sourceMap.get(edge.attributeValue(B2JMessages.Dom_Element_ID)));
+ Element source = map.get(sourceMap.get(edge.attributeValue(Constants.Dom_Element_ID)));
Element transition = null;
if ("true".equals(edge
- .attributeValue(B2JMessages.Bpmn_FlowDefault_Attribute_Name))
- && source.element(B2JMessages.Jpdl_Transition_Element) != null) {
+ .attributeValue(Constants.Bpmn_FlowDefault_Attribute_Name))
+ && source.element(Constants.Jpdl_Transition_Element) != null) {
// move default transition to the first of transition list
transition = DomXmlWriter.addElement(source,
- B2JMessages.Jpdl_Transition_Element, 0);
+ Constants.Jpdl_Transition_Element, 0);
} else {
transition = DomXmlWriter.addElement(source,
- B2JMessages.Jpdl_Transition_Element);
+ Constants.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(Constants.To,map.get(targetMap.get(edge.attributeValue(Constants.Dom_Element_ID))).attributeValue(Constants.Dom_Element_Name));
+
+ if (!TranslateHelper.check_mapElementName(edge, transition, true)) {
+ warnings.add(Constants.Translate_Warning_Bpmn_Element_Name
+ + edge.attributeValue(Constants.Bpmn_Element_ID));
}
- transition.addAttribute(B2JMessages.To,map.get(targetMap.get(edge.attributeValue(B2JMessages.Dom_Element_ID))).attributeValue(B2JMessages.Dom_Element_Name));
}
/*
@@ -438,33 +439,33 @@
// create a decision
Element decision = DomXmlWriter.addElement(element.getParent(),
- B2JMessages.Jpdl_Decision_Element_Name);
+ Constants.Jpdl_Decision_Element_Name);
String name = TranslateHelper.generateElementName(activity)
- + B2JMessages.Underline + B2JMessages.Loop_Decision;
- DomXmlWriter.addAttribute(decision, B2JMessages.Dom_Element_Name, name);
+ + Constants.Underline + Constants.Loop_Decision;
+ DomXmlWriter.addAttribute(decision, Constants.Dom_Element_Name, name);
// use the decision to replace the activity in the map
- map.put(activity.attributeValue(B2JMessages.Dom_Element_ID), decision);
+ map.put(activity.attributeValue(Constants.Dom_Element_ID), decision);
// add the activity to map
- map.put(activity.attributeValue(B2JMessages.Dom_Element_ID)
- + B2JMessages.Bpmn_Vertice_Element_Name, element);
+ map.put(activity.attributeValue(Constants.Dom_Element_ID)
+ + Constants.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));
+ Constants.Jpdl_Transition_Element);
+ first.addAttribute(Constants.Dom_Element_Name, Constants.To
+ + Constants.Underline + name);
+ first.addAttribute(Constants.To, decision
+ .attributeValue(Constants.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));
+ Constants.Jpdl_Transition_Element);
+ second.addAttribute(Constants.Dom_Element_Name, Constants.To
+ + Constants.Underline
+ + element.attributeValue(Constants.Dom_Element_Name));
+ second.addAttribute(Constants.To, element
+ .attributeValue(Constants.Dom_Element_Name));
}
Added: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/Constants.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/Constants.java (rev 0)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/Constants.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * 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;
+
+/**
+ * @author Grid Qian
+ */
+public class Constants {
+
+ public static final String Loop_Decision = "Loop_Decition";
+ public static final String To = "to";
+ public static final String Space = " ";
+ public static final String Underline = "_";
+ public static final String Folder_Name_Separator = ".";
+ public static final String Dom_Element_Name = "name";
+ public static final String Dom_Element_ID = "id";
+ public static final String Width_Attribute_Name = "width";
+ public static final String Height_Attribute_Name = "height";
+ public static final String X_Attribute_Name = "x";
+ public static final String Y_Attribute_Name = "y";
+ public static final String Bpmn_Diagram_Name_Suffix = "_diagram";
+ public static final String Bpmn_Pool_Element_Name = "pools";
+ public static final String Bpmn_Vertice_Element_Name = "vertices";
+ public static final String Bpmn_SequenceFlow_Element_Name = "sequenceEdges";
+ public static final String Bpmn_Href_Attribute_Name = "href";
+ public static final String Bpmn_XmiType_Attribute_Name = "type";
+ public static final String Bpmn_ActivityType_Attribute_Name = "activityType";
+ public static final String Bpmn_InFlow_Attribute_Name = "incomingEdges";
+ public static final String Bpmn_Looping_Attribute_Name = "looping";
+ public static final String Bpmn_FlowSource_Attribute_Name = "source";
+ public static final String Bpmn_FlowTarget_Attribute_Name = "target";
+ public static final String Bpmn_FlowDefault_Attribute_Name = "isDefault";
+ public static final String Bpmn_FlowOutgoings_Attribute_Name = "outgoingEdges";
+ public static final String Bpmn_FlowIncomings_Attribute_Name = "incomingEdges";
+ public static final String Bpmn_Element_ID = "iD";
+ public static final String Bpmn_EAnnotations_Element_Name = "eAnnotations";
+ public static final String Bpmn_Details_Element_Name = "details";
+ public static final String Bpmn_Value_Attribute_Name = "value";
+ public static final String Jpdl_Suffix = "jpdl";
+ public static final String Jpdl_Element_Decision_Suffix = "Decision";
+ public static final String Jpdl_Element_Complete_Suffix = "Complete";
+ public static final String Jpdl_Element_Cancel_Suffix = "Cancel";
+ public static final String Jpdl_Element_Successful_Name = "Successful?";
+ public static final String Jpdl_Process_Definition_Name = "processdefinition.xml";
+ public static final String Jpdl_32_Namespace_Url = "urn:jbpm.org:jpdl-3.2";
+ public static final String Jpdl_Process_Definition_Element_Name = "process-definition";
+ public static final String Jpdl_Transition_Element = "transition";
+ public static final String Jpdl_ProcessState_Element_Name = "process-state";
+ public static final String Jpdl_SubProcess_Element_Name = "sub-process";
+ public static final String Jpdl_Decision_Element_Name = "decision";
+ public static final String Jpdl_Fork_Element_Name = "fork";
+ public static final String Jpdl_Join_Element_Name = "join";
+ public static final String Jpdl_Start_Element_Name = "start-state";
+ public static final String Jpdl_State_Element_Name = "state";
+ public static final String Jpdl_End_Element_Name = "end-state";
+ public static final String Jpdl_Node_Element_Name = "node";
+ public static final String Gpd_Transition_Element = "edge";
+ public static final String Gpd_Definition_Name = "gpd.xml";
+ public static final String Gpd_Layout_Element_Name = "layoutConstraint";
+ public static final String Gpd_Element_Name = "element";
+ public static final String Gpd_Process_Diagram_Name = "root-container";
+ public static final String Gpd_Label_Element_Name = "label";
+ public static final String Translate_Error_File_CanNotRead = "Error: Couldn't read or parse the file to a DOM document:";
+ public static final String Translate_Error_JpdlFile_CanNotGenerate = "Error: Couldn't write process definition xml: ";
+ public static final String Translate_Error_JpdlFile_CanNotWrite = "Error: Couldn't write process definition to a jpdl file: ";
+ public static final String Translate_Warning_Bpmn_Element_Type = "Warning: The type of this bpmn element is not translated to corresponding jpdl element: ";
+ public static final String Translate_Warning_Bpmn_Element_Name = "Warning: The bpmn element's name is null or same to another element's name:";
+ public static final String Translate_Error_GpdFile_CanNotGenerate = "Error: Couldn't write gpd.xml:";
+ public static final String Translate_Error_JpdlProcess_Definition_Null= "Error: The JPDL process definition is null.";
+ public static final String Translate_Error_GpdFile_CanNotWrite="Error: Couldn't write gpd definition to a gpd.xml:";
+
+}
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/GraphicalFileGenerator.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -19,10 +19,9 @@
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.BPMNToUtil;
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;
/**
@@ -41,11 +40,14 @@
public GraphicalFileGenerator(Document bpmnDiagramDocument,
Map<String, Element> map, String rootLocation, String bpmnFileName) {
- this.rootLocation = rootLocation;
- this.bpmnFileName = bpmnFileName;
+ super(bpmnFileName, rootLocation, null);
this.document = bpmnDiagramDocument;
this.map = map;
}
+
+ public GraphicalFileGenerator(Map<String, Element> map, String rootLocation, String bpmnFileName) {
+ this(null, map, rootLocation, bpmnFileName);
+ }
/*
* translate a bpmn_diagram document to a gpd document string
@@ -59,7 +61,7 @@
strForProcessDefs[i] = DomXmlWriter.toString(def);
} catch (IOException e) {
this.errors
- .add(B2JMessages.Translate_Error_GpdFile_CanNotGenerate
+ .add(Constants.Translate_Error_GpdFile_CanNotGenerate
+ e.getMessage());
}
i++;
@@ -76,39 +78,37 @@
int i = 0;
for (Document def : gpdDefs) {
gpdFileNames[i] = def.getRootElement().attributeValue(
- B2JMessages.Dom_Element_Name);
+ Constants.Dom_Element_Name);
i++;
}
try {
TranslateHelper.createFiles(fileLocation, bpmnFileName,
strForGpdDefs, gpdFileNames,
- B2JMessages.Gpd_Definition_Name, false);
+ Constants.Gpd_Definition_Name, false);
} catch (Exception e) {
- errors.add(B2JMessages.Translate_Error_GpdFile_CanNotWrite
+ errors.add(Constants.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() {
+
+ if(document == null) {
+ try {
+ document = BPMNToUtil.parse(rootLocation, bpmnFileName);
+ } catch (Exception e) {
+ errors.add(Constants.Translate_Error_File_CanNotRead
+ + e.getMessage());
+ }
+ }
+
Element rootElement = document.getRootElement();
List<Element> eleList = DomXmlWriter.getElementsByName(rootElement,
- B2JMessages.Gpd_Element_Name);
+ Constants.Gpd_Element_Name);
for (String bpmnID : map.keySet()) {
if (bpmnID != null) {
@@ -121,43 +121,43 @@
Element bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
bpmnID, eleList);
if (bpmnGpdEle == null) {
- if (bpmnID.endsWith(B2JMessages.Bpmn_Vertice_Element_Name)) {
+ if (bpmnID.endsWith(Constants.Bpmn_Vertice_Element_Name)) {
bpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
TranslateHelper.getPureBpmnID(bpmnID,
- B2JMessages.Bpmn_Vertice_Element_Name),
+ Constants.Bpmn_Vertice_Element_Name),
eleList);
xIncre = 150;
yIncre = 50;
} else if (bpmnID
- .endsWith(B2JMessages.Jpdl_Element_Decision_Suffix)) {
+ .endsWith(Constants.Jpdl_Element_Decision_Suffix)) {
bpmnGpdEle = TranslateHelper
.getDiagramLayoutElement(
TranslateHelper
.getPureBpmnID(
bpmnID,
- B2JMessages.Jpdl_Element_Decision_Suffix),
+ Constants.Jpdl_Element_Decision_Suffix),
eleList);
xIncre = 150;
yIncre = 100;
} else if (bpmnID
- .endsWith(B2JMessages.Jpdl_Element_Complete_Suffix)) {
+ .endsWith(Constants.Jpdl_Element_Complete_Suffix)) {
bpmnGpdEle = TranslateHelper
.getDiagramLayoutElement(
TranslateHelper
.getPureBpmnID(
bpmnID,
- B2JMessages.Jpdl_Element_Complete_Suffix),
+ Constants.Jpdl_Element_Complete_Suffix),
eleList);
xIncre = 300;
yIncre = 0;
} else if (bpmnID
- .endsWith(B2JMessages.Jpdl_Element_Cancel_Suffix)) {
+ .endsWith(Constants.Jpdl_Element_Cancel_Suffix)) {
bpmnGpdEle = TranslateHelper
.getDiagramLayoutElement(
TranslateHelper
.getPureBpmnID(
bpmnID,
- B2JMessages.Jpdl_Element_Cancel_Suffix),
+ Constants.Jpdl_Element_Cancel_Suffix),
eleList);
xIncre = 300;
yIncre = 200;
@@ -181,8 +181,8 @@
// 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
+ Constants.Dom_Element_Name))
+ && Constants.Jpdl_Process_Definition_Element_Name
.equals(jpdlEle.getParent().getName())) {
translatePool(eleList, jpdlEle);
}
@@ -191,21 +191,21 @@
Element poolEle = null;
for (Document doc : gpdDefs) {
if (doc.getRootElement().attributeValue(
- B2JMessages.Dom_Element_Name).equals(
+ Constants.Dom_Element_Name).equals(
jpdlEle.getParent().attributeValue(
- B2JMessages.Dom_Element_Name))) {
+ Constants.Dom_Element_Name))) {
poolEle = doc.getRootElement();
}
}
Element pgdEle = TranslateHelper.createNode(poolEle,
- B2JMessages.Jpdl_Node_Element_Name, jpdlEle);
+ Constants.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)) {
+ for (Object ele : jpdlEle.elements(Constants.Jpdl_Transition_Element)) {
TranslateHelper.createTransition(pgdEle,
- B2JMessages.Jpdl_Transition_Element, (Element) ele);
+ Constants.Gpd_Transition_Element, (Element) ele);
}
}
@@ -215,7 +215,7 @@
for (String id : map.keySet()) {
if (map.get(id) == jpdlEle.getParent()) {
poolBpmnID = TranslateHelper.getPureBpmnID(id,
- B2JMessages.Bpmn_Pool_Element_Name);
+ Constants.Bpmn_Pool_Element_Name);
break;
}
}
@@ -224,18 +224,18 @@
Element poolBpmnGpdEle = TranslateHelper.getDiagramLayoutElement(
poolBpmnID, eleList);
Document processDiagramDef = DomXmlWriter.createDomTree(false,
- null, B2JMessages.Gpd_Process_Diagram_Name);
+ null, Constants.Gpd_Process_Diagram_Name);
Element poolEle = processDiagramDef.getRootElement();
- DomXmlWriter.mapAttribute(poolEle, B2JMessages.Dom_Element_Name,
+ DomXmlWriter.mapAttribute(poolEle, Constants.Dom_Element_Name,
jpdlEle.getParent());
DomXmlWriter.mapAttribute(poolEle,
- B2JMessages.Width_Attribute_Name, poolBpmnGpdEle);
+ Constants.Width_Attribute_Name, poolBpmnGpdEle);
DomXmlWriter.mapAttribute(poolEle,
- B2JMessages.Height_Attribute_Name, poolBpmnGpdEle);
+ Constants.Height_Attribute_Name, poolBpmnGpdEle);
gpdDefs.add(processDiagramDef);
gpdPoolNames.add(poolEle
- .attributeValue(B2JMessages.Dom_Element_Name));
+ .attributeValue(Constants.Dom_Element_Name));
}
}
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/translate/TranslateHelper.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -20,8 +20,6 @@
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;
@@ -43,7 +41,7 @@
* get the bpmn_diagram file name
*/
public static String getBpmnDiagramName(String bpmnFileName) {
- return bpmnFileName + B2JMessages.Bpmn_Diagram_Name_Suffix;
+ return bpmnFileName + Constants.Bpmn_Diagram_Name_Suffix;
}
/*
@@ -51,8 +49,8 @@
*/
public static Document createJpdlDomTree(boolean useNamespace) {
return DomXmlWriter.createDomTree(useNamespace,
- B2JMessages.Jpdl_32_Namespace_Url,
- B2JMessages.Jpdl_Process_Definition_Element_Name);
+ Constants.Jpdl_32_Namespace_Url,
+ Constants.Jpdl_Process_Definition_Element_Name);
}
@@ -63,7 +61,7 @@
String[] strsForGenerate, String[] fileFolders, String fileName,
boolean isOverWrite) throws IOException {
File jpdlFolder = BPMNToUtil.createFile(parentFolder,
- B2JMessages.Jpdl_Suffix, null, isOverWrite);
+ Constants.Jpdl_Suffix, null, isOverWrite);
File diagramFolder = BPMNToUtil.createFile(
jpdlFolder.getAbsolutePath(), bpmnFileName, null, false);
@@ -86,26 +84,26 @@
*/
public static String generateProcessName(Element graph) {
if ("BpmnDiagram".equals(graph.getName())) {
- return graph.attributeValue(B2JMessages.Dom_Element_Name);
+ return graph.attributeValue(Constants.Dom_Element_Name);
} else {
String str = generateProcessName(graph.getParent());
if (str == null) {
return generateElementName(graph);
} else {
- return str + B2JMessages.Folder_Name_Separator
+ return str + Constants.Folder_Name_Separator
+ generateElementName(graph);
}
}
}
-
+
/*
* generate a element name
*/
- public static String generateElementName(Element graph){
- String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+ public static String generateElementName(Element graph) {
+ String name = graph.attributeValue(Constants.Dom_Element_Name);
if (name == null || "".equals(name)) {
- name = "au_gen";
+ name = "eleName";
}
Integer i = nameMap.get(name);
if (i == null) {
@@ -120,22 +118,29 @@
* 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) {
+ public static boolean check_mapElementName(Element graph, Element graphEle,
+ boolean isTransition) {
boolean isOk = true;
- String name = graph.attributeValue(B2JMessages.Dom_Element_Name);
+ String name = graph.attributeValue(Constants.Dom_Element_Name);
if (name == null || "".equals(name)) {
- name = "to_nodename";
+ if (isTransition) {
+ name = Constants.To + Constants.Underline
+ + graphEle.attributeValue(Constants.To);
+ } else {
+ name = "eleName";
+ }
+
isOk = false;
}
Integer i = nameMap.get(name);
if (i == null) {
- DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ DomXmlWriter.addAttribute(graphEle, Constants.Dom_Element_Name,
name);
nameMap.put(name, new Integer("1"));
} else {
- DomXmlWriter.addAttribute(graphEle, B2JMessages.Dom_Element_Name,
+ DomXmlWriter.addAttribute(graphEle, Constants.Dom_Element_Name,
name + "_" + i);
nameMap.put(name, ++i);
isOk = false;
@@ -152,23 +157,23 @@
public static List<Element> locateLastElements(Element processRoot) {
List<Element> list = new ArrayList<Element>();
- if (processRoot.element(B2JMessages.Jpdl_End_Element_Name) != null) {
+ if (processRoot.element(Constants.Jpdl_End_Element_Name) != null) {
Element endState = processRoot
- .element(B2JMessages.Jpdl_End_Element_Name);
+ .element(Constants.Jpdl_End_Element_Name);
for (Object ele : processRoot.elements()) {
Element subEle = ((Element) ele)
- .element(B2JMessages.Jpdl_Transition_Element);
+ .element(Constants.Jpdl_Transition_Element);
if (subEle != null
&& endState
- .attributeValue(B2JMessages.Dom_Element_Name)
- .equals(subEle.attributeValue(B2JMessages.To))) {
+ .attributeValue(Constants.Dom_Element_Name)
+ .equals(subEle.attributeValue(Constants.To))) {
list.add((Element) ele);
}
}
} else {
for (Object ele : processRoot.elements()) {
if (((Element) ele)
- .element(B2JMessages.Jpdl_Transition_Element) == null) {
+ .element(Constants.Jpdl_Transition_Element) == null) {
list.add((Element) ele);
}
}
@@ -185,7 +190,7 @@
Element element = null;
for (Element ele : eleList) {
String str = ele
- .attributeValue(B2JMessages.Bpmn_Href_Attribute_Name);
+ .attributeValue(Constants.Bpmn_Href_Attribute_Name);
if (str != null && str.contains(bpmnID)) {
element = ele;
break;
@@ -194,9 +199,9 @@
if (element != null
&& element.getParent().element(
- B2JMessages.Gpd_Layout_Element_Name) != null) {
+ Constants.Gpd_Layout_Element_Name) != null) {
return element.getParent().element(
- B2JMessages.Gpd_Layout_Element_Name);
+ Constants.Gpd_Layout_Element_Name);
}
return null;
@@ -208,10 +213,10 @@
public static Element createTransition(Element parentEle, String name,
Element jpdlEle) {
Element ele = DomXmlWriter.addElement(parentEle, name);
- DomXmlWriter.mapAttribute(ele, B2JMessages.Dom_Element_Name, jpdlEle);
+ DomXmlWriter.mapAttribute(ele, Constants.Dom_Element_Name, jpdlEle);
Element label = DomXmlWriter.addElement(ele,
- B2JMessages.Gpd_Label_Element_Name);
+ Constants.Gpd_Label_Element_Name);
TranslateHelper.mapXY(label, "5", "-10");
return ele;
}
@@ -222,8 +227,8 @@
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,
+ DomXmlWriter.addAttribute(ele, Constants.Width_Attribute_Name, width);
+ DomXmlWriter.addAttribute(ele, Constants.Height_Attribute_Name,
height);
return ele;
}
@@ -234,7 +239,7 @@
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);
+ DomXmlWriter.mapAttribute(ele, Constants.Dom_Element_Name, jpdlEle);
return ele;
}
@@ -242,9 +247,9 @@
* 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,
+ DomXmlWriter.addAttribute(pgdEle, Constants.X_Attribute_Name,
x == null ? "0" : x);
- DomXmlWriter.addAttribute(pgdEle, B2JMessages.Y_Attribute_Name,
+ DomXmlWriter.addAttribute(pgdEle, Constants.Y_Attribute_Name,
y == null ? "0" : y);
}
@@ -263,12 +268,12 @@
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))
+ .attributeValue(Constants.X_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(Constants.X_Attribute_Name))
+ xIncre);
xy[1] = String.valueOf(Integer.parseInt(bpmnGpdEle
- .attributeValue(B2JMessages.Y_Attribute_Name) == null ? "0"
- : bpmnGpdEle.attributeValue(B2JMessages.Y_Attribute_Name))
+ .attributeValue(Constants.Y_Attribute_Name) == null ? "0"
+ : bpmnGpdEle.attributeValue(Constants.Y_Attribute_Name))
+ yIncre);
return xy;
}
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -22,7 +22,9 @@
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.Constants;
import org.jboss.tools.jbpm.convert.b2j.translate.GraphicalFileGenerator;
+import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
import org.jboss.tools.jbpm.convert.bpmnto.wizard.BpmnToWizard;
/**
@@ -60,7 +62,7 @@
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
jpdlFolderNames,
- B2JMessages.Jpdl_Process_Definition_Name, isOverWrite);
+ Constants.Jpdl_Process_Definition_Name, isOverWrite);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
@@ -81,7 +83,7 @@
}
try {
TranslateHelper.createFiles(location, bpmnFileName, strs,
- jpdlFolderNames, B2JMessages.Gpd_Definition_Name, false);
+ jpdlFolderNames, Constants.Gpd_Definition_Name, false);
} catch (Exception e) {
BpmnToPlugin.getDefault().logError(e.getMessage());
}
@@ -95,7 +97,7 @@
Document bpmnDocument = null;
try {
- bpmnDocument = getDocument(bpmnFileParentPath, bpmnFileName);
+ bpmnDocument = BPMNToUtil.parse(bpmnFileParentPath, bpmnFileName);
} catch (Exception e) {
errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
bpmnFileName));
@@ -119,7 +121,7 @@
// generate jpdl gpd file from *.bpmn_diagram
Document bpmnDiagramDocument = null;
try {
- bpmnDiagramDocument = getDocument(bpmnFileParentPath,
+ bpmnDiagramDocument = BPMNToUtil.parse(bpmnFileParentPath,
TranslateHelper.getBpmnDiagramName(bpmnFileName));
} catch (Exception e) {
errorList.add(NLS.bind(B2JMessages.Translate_Error_File_CanNotRead,
@@ -132,7 +134,7 @@
this.setStrForGpdList(Arrays.asList(generator.translateToStrings()));
for (Document def : generator.getGpdDefs()) {
- this.generatedGpdFoldersList.add(def.getRootElement().attributeValue(B2JMessages.Dom_Element_Name));
+ this.generatedGpdFoldersList.add(def.getRootElement().attributeValue(Constants.Dom_Element_Name));
}
warningList.addAll(generator.getWarnings());
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/BPMNToUtil.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -19,7 +19,6 @@
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;
@@ -28,15 +27,7 @@
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.jboss.tools.jbpm.convert.b2j.translate.Constants;
import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;
@@ -164,49 +155,14 @@
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) {
+ for (Object pool : diagram.elements(Constants.Bpmn_Pool_Element_Name)) {
+ if (((Element) pool).attributeValue(Constants.Bpmn_Element_ID) != null) {
poolIDMap.put(((Element) pool)
- .attributeValue(B2JMessages.Bpmn_Element_ID),
+ .attributeValue(Constants.Bpmn_Element_ID),
((Element) pool)
- .attributeValue(B2JMessages.Dom_Element_Name));
+ .attributeValue(Constants.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;
- }
}
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/util/DomXmlWriter.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -17,7 +17,6 @@
import org.dom4j.*;
import org.dom4j.io.*;
-import org.jboss.tools.jbpm.convert.bpmnto.util.DomXmlWriter;
/**
* @author Grid Qian
Modified: 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 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -11,6 +11,8 @@
package org.jboss.tools.jbpm.convert.bpmnto.wizard;
+import java.util.Iterator;
+
import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
@@ -29,7 +31,6 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.ui.model.WorkbenchContentProvider;
import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.jboss.tools.jbpm.convert.bpmnto.util.BPMNToUtil;
/**
* @author Grid Qian
@@ -77,7 +78,7 @@
@Override
public boolean isPageComplete() {
if (viewer != null) {
- return BPMNToUtil.checkSelectedResources(viewer.getSelection());
+ return this.checkSelectedResources(viewer.getSelection());
}
return super.isPageComplete();
}
@@ -89,6 +90,31 @@
public ISelection getSelection() {
return currentSelection;
}
+
+ @SuppressWarnings("unchecked")
+ public 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;
+ }
}
class ProjectFilter extends ViewerFilter {
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-12-25 00:22:03 UTC (rev 12827)
+++ trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2008-12-26 07:38:06 UTC (rev 12828)
@@ -15,7 +15,6 @@
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;
@@ -117,7 +116,7 @@
bpmnFileParentPath = bpmnFile.getParent().getLocation()
.toOSString();
try {
- idMap = BPMNToUtil.getPoolIDsFromDocument(getDocument(
+ idMap = BPMNToUtil.getPoolIDsFromDocument(BPMNToUtil.parse(
bpmnFileParentPath, bpmnFileName));
poolIdList.clear();
} catch (Exception e) {
@@ -173,15 +172,6 @@
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
14 years, 3 months
JBoss Tools SVN: r12827 - in trunk: common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-12-24 19:22:03 -0500 (Wed, 24 Dec 2008)
New Revision: 12827
Removed:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/ActionDeclinedException.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/XModelObjectAction.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java
trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
Log:
Exception catch blocks were removed from vpe component. RuntimeException ancestor class was removed and replaced to Exception ancestor.
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/DefaultCreateHandler.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -10,20 +10,25 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
-import java.util.*;
+import java.util.Properties;
import org.eclipse.swt.widgets.Display;
-
-import org.jboss.tools.common.meta.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.constraint.*;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.action.XAttributeData;
+import org.jboss.tools.common.meta.action.XEntityData;
+import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.meta.constraint.XAttributeConstraint;
import org.jboss.tools.common.meta.key.WizardKeys;
-import org.jboss.tools.common.meta.action.impl.AbstractHandler;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.impl.RegularObjectImpl;
-import org.jboss.tools.common.model.undo.*;
-import org.jboss.tools.common.model.util.*;
+import org.jboss.tools.common.model.undo.XCreateUndo;
+import org.jboss.tools.common.model.undo.XUndoManager;
+import org.jboss.tools.common.model.util.FindObjectHelper;
+import org.jboss.tools.common.model.util.XBundle;
+import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
public class DefaultCreateHandler extends AbstractHandler {
@@ -179,7 +184,7 @@
mes = title(parent, true) + " can contain only " + max +
((max == 1) ? " child " : " children ") +
"with entity " + ce + ".";
- throw new ActionDeclinedException(mes);
+ throw new XModelException(mes);
}
boolean b = parent.addChild(child);
if(!b && child.getModelEntity().getAttribute(XModelObjectLoaderUtil.ATTR_ID_NAME) != null) {
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/meta/action/impl/handlers/PasteHandler.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -10,13 +10,24 @@
******************************************************************************/
package org.jboss.tools.common.meta.action.impl.handlers;
-import java.util.*;
-import org.jboss.tools.common.meta.*;
-import org.jboss.tools.common.model.*;
-import org.jboss.tools.common.meta.action.*;
-import org.jboss.tools.common.meta.action.impl.*;
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.jboss.tools.common.meta.XAdoptManager;
+import org.jboss.tools.common.meta.XAttribute;
+import org.jboss.tools.common.meta.XChild;
+import org.jboss.tools.common.meta.XModelEntity;
+import org.jboss.tools.common.meta.action.XAttributeData;
+import org.jboss.tools.common.meta.action.XEntityData;
+import org.jboss.tools.common.meta.action.impl.AbstractHandler;
+import org.jboss.tools.common.meta.action.impl.SpecialWizardSupport;
+import org.jboss.tools.common.meta.action.impl.XEntityDataImpl;
import org.jboss.tools.common.meta.impl.XModelMetaDataImpl;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
+import org.jboss.tools.common.model.ServiceDialog;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelBuffer;
+import org.jboss.tools.common.model.XModelException;
+import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.util.XModelObjectLoaderUtil;
public class PasteHandler extends AbstractHandler {
@@ -98,7 +109,7 @@
boolean mustGenerate = (found != null && mustGenerate(entity));
if(!mustGenerate) {
int i = (found == null) ? 0 : PasteEnterNewNameSupport.run(parent, source, copy, data[0]);
- if(i != 0) throw new ActionDeclinedException("Paste declined.");
+ if(i != 0) throw new XModelException("Paste declined.");
}
for (int j = 0; j < ad.length; j++)
copy.setAttributeValue(ad[j].getAttribute().getName(), ad[j].getValue());
Deleted: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/ActionDeclinedException.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/ActionDeclinedException.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/event/ActionDeclinedException.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.common.model.event;
-
-public class ActionDeclinedException extends RuntimeException {
- private static final long serialVersionUID = 1L;
-
- public ActionDeclinedException(String message) {
- super(message);
- }
-
-}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/XModelObjectAction.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/XModelObjectAction.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/action/XModelObjectAction.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.common.model.ui.action;
-import java.util.*;
-import org.jboss.tools.common.model.ui.wizards.OneStepWizard;
+import java.util.Properties;
+
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
@@ -27,8 +27,7 @@
import org.jboss.tools.common.meta.action.XRedirect;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
-import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.wizards.OneStepWizard;
public class XModelObjectAction extends XModelObjectActionItem {
protected XAction action;
@@ -53,60 +52,55 @@
}
}
+
public void actionPerformed() {
- try {
- XAction runAction = action;
- XModelObject runObject = object;
+ XAction runAction = action;
+ XModelObject runObject = object;
- XRedirect redirect = action.getRedirect();
- XAction redirectAction = null;
- XModelObject redirectObject = null;
- while(redirect != null) {
- redirectAction = redirect.getRedirectAction(runObject);
- redirectObject = redirect.getRedirectSource(runObject);
- redirect = redirectAction == null ? null : redirectAction.getRedirect();
- if(redirect != null) {
- runObject = redirectObject;
- }
- }
- if(redirectAction != null && redirectObject != null) {
- runAction = redirectAction;
+ XRedirect redirect = action.getRedirect();
+ XAction redirectAction = null;
+ XModelObject redirectObject = null;
+ while(redirect != null) {
+ redirectAction = redirect.getRedirectAction(runObject);
+ redirectObject = redirect.getRedirectSource(runObject);
+ redirect = redirectAction == null ? null : redirectAction.getRedirect();
+ if(redirect != null) {
runObject = redirectObject;
}
- if(action.getSignificantFlag(object)) {
- String message = SignificanceMessageFactory.getInstance().getMessage(action, object, targets) + "?";
- MessageDialog d = new MessageDialog(getShell(), "Confirmation", null, message, MessageDialog.QUESTION, new String[]{"OK", "Cancel"}, 0);
- int m = d.open();
- if(m != 0) return;
- }
- String wizardName = runAction.getWizardClassName();
- if(wizardName == null || wizardName.equals("")) {
- action.getEntityData(object);
- try {
- Properties p = prepareProperties();
- if(p == null) p = new Properties();
- if(getShell() != null) p.put("shell", getShell());
- if(targets == null) action.executeHandler(object, p);
- else action.executeHandler(object, targets, p);
- } catch (ActionDeclinedException e) {
- return;
- }
- } else {
- runAction.getEntityData(runObject);
- OneStepWizard w = new OneStepWizard();
+ }
+ if(redirectAction != null && redirectObject != null) {
+ runAction = redirectAction;
+ runObject = redirectObject;
+ }
+ if(action.getSignificantFlag(object)) {
+ String message = SignificanceMessageFactory.getInstance().getMessage(action, object, targets) + "?";
+ MessageDialog d = new MessageDialog(getShell(), "Confirmation", null, message, MessageDialog.QUESTION, new String[]{"OK", "Cancel"}, 0);
+ int m = d.open();
+ if(m != 0) return;
+ }
+ String wizardName = runAction.getWizardClassName();
+ if(wizardName == null || wizardName.equals("")) {
+ action.getEntityData(object);
+ try {
Properties p = prepareProperties();
if(p == null) p = new Properties();
- p.put("action", runAction);
- p.put("object", runObject);
if(getShell() != null) p.put("shell", getShell());
- w.setObject(p);
- w.execute();
- }
- } catch (ActionDeclinedException de) {
- //ignore
- } catch(XModelException e) {
- ModelUIPlugin.getPluginLog().logError(e);
- }
+ if(targets == null) action.executeHandler(object, p);
+ else action.executeHandler(object, targets, p);
+ } catch (XModelException e) {
+ return;
+ }
+ } else {
+ runAction.getEntityData(runObject);
+ OneStepWizard w = new OneStepWizard();
+ Properties p = prepareProperties();
+ if(p == null) p = new Properties();
+ p.put("action", runAction);
+ p.put("object", runObject);
+ if(getShell() != null) p.put("shell", getShell());
+ w.setObject(p);
+ w.execute();
+ }
}
protected Properties prepareProperties() {
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/dnd/ControlDragDrop.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -334,8 +334,6 @@
if(draggedObject != null) p.put("draggedObject", draggedObject);
((IControlDropListener)provider).drop(p);
}
- } catch (ActionDeclinedException de) {
- ignore();
} catch (XModelException e) {
ModelUIPlugin.getPluginLog().logError(e);
}
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/views/palette/PaletteAdapter.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -16,6 +16,11 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.ActionContributionItem;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionItem;
+import org.eclipse.jface.action.IMenuManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.ScrolledComposite;
import org.eclipse.swt.dnd.DND;
@@ -37,24 +42,20 @@
import org.eclipse.swt.widgets.ToolBar;
import org.eclipse.swt.widgets.ToolItem;
import org.eclipse.ui.IActionBars;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuManager;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.event.XModelTreeListener;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.model.util.IconUtil;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
-import org.jboss.tools.common.model.ui.views.palette.model.*;
import org.jboss.tools.common.model.ui.util.StringUtilities;
+import org.jboss.tools.common.model.ui.views.palette.model.IPaletteNode;
+import org.jboss.tools.common.model.ui.views.palette.model.PaletteElement;
+import org.jboss.tools.common.model.ui.views.palette.model.PaletteModel;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.model.util.IconUtil;
public class PaletteAdapter implements IPaletteAdapter {
private static final int TEXT_MARGIN = 4;
@@ -404,9 +405,6 @@
try {
DnDUtil.paste(o, new Properties());
model.getXModel().saveOptions();
- } catch (ActionDeclinedException de) {
- //ignore - this exception is thrown to inform that user
- //selected cancel option in dialog.
} catch (XModelException e) {
message(e);
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/navigator/XDropAdapterAssistant.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -22,12 +22,11 @@
import org.eclipse.ui.navigator.CommonDropAdapterAssistant;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
import org.jboss.tools.common.model.XModelBuffer;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
import org.jboss.tools.common.model.ui.ModelUIPlugin;
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
-import org.jboss.tools.jst.web.ui.WebUiPlugin;
public class XDropAdapterAssistant extends CommonDropAdapterAssistant {
@@ -48,10 +47,7 @@
if(DnDUtil.isPasteEnabled(targetObject)) {
try {
DnDUtil.paste(targetObject, p);
- } catch (ActionDeclinedException de) {
- WebUiPlugin.getPluginLog().logError(de);
- return null;
- } catch (Exception e) {
+ } catch (XModelException e) {
ProblemReportingHelper.reportProblem(ModelUIPlugin.PLUGIN_ID, e);
}
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -763,11 +763,7 @@
VpeEditorPart.this));
selectionBar.setVpeController(visualEditor.getController());
visualEditor.getController().setSelectionBarController(selectionBar);
- try {
- visualEditor.getController().init(sourceEditor, visualEditor);
- } catch (Exception e) {
- VpePlugin.getDefault().logError(e);
- }
+ visualEditor.getController().init(sourceEditor, visualEditor);
}
});
visualEditor.createPartControl(visualContent);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/dnd/context/JSPViewerDropAdapter.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -62,13 +62,7 @@
dropContext.setDropTargetEvent(event);
if (ObjectTransfer.getInstance().isSupportedType(event.currentDataType)) {
Object object = null;
- try {
- object = ObjectTransfer.getInstance().nativeToJava(event.currentDataType);
- } catch (Exception e) {
- //null pointer in Linux
- VpePlugin.getPluginLog().logError(e);
- return null;
- }
+ object = ObjectTransfer.getInstance().nativeToJava(event.currentDataType);
if (object == null) return null;
return extractDragSource(object);
} else if(ModelTransfer.getInstance().isSupportedType(event.currentDataType)) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/DropTargetManager.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -12,6 +12,15 @@
import java.io.File;
import java.util.Properties;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IStorage;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.DropTarget;
import org.eclipse.swt.dnd.DropTargetAdapter;
@@ -21,22 +30,12 @@
import org.eclipse.swt.dnd.TransferData;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.views.navigator.LocalSelectionTransfer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IStorage;
-import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.GraphicalEditPart;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
-import org.jboss.tools.common.model.event.ActionDeclinedException;
import org.jboss.tools.common.model.project.IModelNature;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-
import org.jboss.tools.common.model.ui.dnd.DnDUtil;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
import org.jboss.tools.vpe.ui.palette.model.PaletteModel;
import org.jboss.tools.vpe.ui.palette.model.PaletteXModelObject;
@@ -128,9 +127,7 @@
try {
DnDUtil.paste(o, new Properties());
model.getXModel().saveOptions();
- } catch (ActionDeclinedException de) {
- PalettePlugin.getPluginLog().logError(de);
- } catch (Exception e) {
+ } catch (XModelException e) {
message(e);
}
} else {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2008-12-24 18:11:51 UTC (rev 12826)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.ui.palette/src/org/jboss/tools/vpe/ui/palette/PaletteDragSourceListener.java 2008-12-25 00:22:03 UTC (rev 12827)
@@ -38,7 +38,6 @@
}
public void dragStart(DragSourceEvent event) {
- try {
XModelTransferBuffer.getInstance().enable();
List list = ((PaletteViewer)viewer).getSelectedEditParts();
XModelObject object = (list.size() == 0) ? null : getObject(list.get(0));
@@ -49,10 +48,7 @@
Properties p = new Properties();
p.setProperty("isDrag", "true"); //$NON-NLS-1$ //$NON-NLS-2$
XActionInvoker.invoke("CopyActions.Copy", object, p); //$NON-NLS-1$
- } catch (Exception e) {
- PalettePlugin.getPluginLog().logError(e);
- }
- isDragging = true;
+ isDragging = true;
}
public void dragSetData(DragSourceEvent event) {
if (TextTransfer.getInstance().isSupportedType(event.dataType)) {
14 years, 3 months
JBoss Tools SVN: r12825 - trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor.
by jbosstools-commits@lists.jboss.org
Author: koen.aers(a)jboss.com
Date: 2008-12-24 11:38:31 -0500 (Wed, 24 Dec 2008)
New Revision: 12825
Modified:
trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
Log:
update the palette labels
Modified: trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java
===================================================================
--- trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-12-24 16:29:23 UTC (rev 12824)
+++ trunk/jbpm/plugins/org.jboss.tools.flow.jpdl4/src/org/jboss/tools/flow/jpdl4/editor/JpdlPaletteFactory.java 2008-12-24 16:38:31 UTC (rev 12825)
@@ -66,7 +66,7 @@
protected List<PaletteEntry> createEventEntries() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
- "Start",
+ "start",
"Create a new Start Event",
"org.jboss.tools.flow.jpdl4.startEvent",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.startEvent"),
@@ -75,7 +75,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Terminate",
+ "end",
"Create a new terminating end event",
"org.jboss.tools.flow.jpdl4.terminateEndEvent",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.terminateEndEvent"),
@@ -84,7 +84,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Cancel",
+ "cancel",
"Create a new cancel end event",
"org.jboss.tools.flow.jpdl4.cancelEndEvent",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.cancelEndEvent"),
@@ -93,7 +93,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Error",
+ "error",
"Create a new error end event",
"org.jboss.tools.flow.jpdl4.errorEndEvent",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.errorEndEvent"),
@@ -107,7 +107,7 @@
protected List<PaletteEntry> createTaskEntries() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
- "Wait",
+ "wait",
"Create a new Wait State Task",
"org.jboss.tools.flow.jpdl4.waitTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.waitTask"),
@@ -116,7 +116,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "HQL",
+ "hql",
"Create a new HQL Task",
"org.jboss.tools.flow.jpdl4.hqlTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.hqlTask"),
@@ -125,7 +125,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "SQL",
+ "sql",
"Create a new SQL Task",
"org.jboss.tools.flow.jpdl4.sqlTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.sqlTask"),
@@ -134,7 +134,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Java",
+ "java",
"Create a new Java Task",
"org.jboss.tools.flow.jpdl4.javaTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.javaTask"),
@@ -143,7 +143,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Script",
+ "script",
"Create a new Script Task",
"org.jboss.tools.flow.jpdl4.scriptTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.scriptTask"),
@@ -152,7 +152,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "ESB",
+ "esb",
"Create a new Service Task",
"org.jboss.tools.flow.jpdl4.serviceTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.serviceTask"),
@@ -161,7 +161,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Task",
+ "task",
"Create a new Human Task",
"org.jboss.tools.flow.jpdl4.humanTask",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.humanTask"),
@@ -175,7 +175,7 @@
protected List<PaletteEntry> createGatewayEntries() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
CombinedTemplateCreationEntry combined = new CombinedTemplateCreationEntry(
- "Exclusive Gateway",
+ "exclusive",
"Create a new Exclusive Gateway",
"org.jboss.tools.flow.jpdl4.exclusiveGateway",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.exclusiveGateway"),
@@ -184,7 +184,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Fork Parallel Gateway",
+ "fork",
"Create a new Parallel Fork Gateway",
"org.jboss.tools.flow.jpdl4.parallelForkGateway",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.parallelForkGateway"),
@@ -193,7 +193,7 @@
);
entries.add(combined);
combined = new CombinedTemplateCreationEntry(
- "Join Parallel Gateway",
+ "join",
"Create a new Parallel Join Gateway",
"org.jboss.tools.flow.jpdl4.parallelJoinGateway",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.parallelJoinGateway"),
@@ -207,7 +207,7 @@
protected List<PaletteEntry> createFlowEntries() {
List<PaletteEntry> entries = new ArrayList<PaletteEntry>();
ToolEntry tool = new ConnectionCreationToolEntry(
- "Sequence Flow",
+ "flow",
"Creating a new Sequence Flow",
ElementRegistry.getCreationFactory("org.jboss.tools.flow.jpdl4.sequenceFlow"),
ImageDescriptor.createFromURL(Activator.getDefault().getBundle().getEntry("icons/16/flow_sequence.png")),
14 years, 3 months
JBoss Tools SVN: r12823 - trunk/portlet/docs/reference/en/images/starting_project.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-12-24 11:26:20 -0500 (Wed, 24 Dec 2008)
New Revision: 12823
Modified:
trunk/portlet/docs/reference/en/images/starting_project/starting_project_3.png
trunk/portlet/docs/reference/en/images/starting_project/starting_project_6.png
Log:
https://jira.jboss.org/jira/browse/JBDS-417 - updating the screens;
Modified: trunk/portlet/docs/reference/en/images/starting_project/starting_project_3.png
===================================================================
(Binary files differ)
Modified: trunk/portlet/docs/reference/en/images/starting_project/starting_project_6.png
===================================================================
(Binary files differ)
14 years, 3 months
JBoss Tools SVN: r12822 - trunk/jsf/docs/userguide/en/images/preferences.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-12-24 11:25:45 -0500 (Wed, 24 Dec 2008)
New Revision: 12822
Modified:
trunk/jsf/docs/userguide/en/images/preferences/preferences_13.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_19.png
trunk/jsf/docs/userguide/en/images/preferences/preferences_27.png
Log:
https://jira.jboss.org/jira/browse/JBDS-417 - updating the screens;
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_13.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_19.png
===================================================================
(Binary files differ)
Modified: trunk/jsf/docs/userguide/en/images/preferences/preferences_27.png
===================================================================
(Binary files differ)
14 years, 3 months