Author: Grid.Qian
Date: 2011-07-05 01:58:39 -0400 (Tue, 05 Jul 2011)
New Revision: 32595
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/wizard/B2JExportWizard.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
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
Log:
JBIDE-9293:commit to trunk
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 2011-07-04
20:37:22 UTC (rev 32594)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/messages/B2J.properties 2011-07-05
05:58:39 UTC (rev 32595)
@@ -19,4 +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
-Translate_Error_File_CanNotRead=Error\: Couldn''t read or parse {0} file to a DOM
document\:
\ 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/wizard/B2JExportWizard.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2011-07-04
20:37:22 UTC (rev 32594)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/b2j/wizard/B2JExportWizard.java 2011-07-05
05:58:39 UTC (rev 32595)
@@ -91,9 +91,7 @@
}
- public List<String> translateBpmnToStrings() {
- List<String> warningList = new ArrayList<String>();
- List<String> errorList = new ArrayList<String>();
+ public void translateBpmnToStrings() {
Document bpmnDocument = null;
try {
@@ -142,12 +140,6 @@
warningList.addAll(generator.getWarnings());
errorList.addAll(generator.getErrors());
}
-
- List<String> list = new ArrayList<String>();
- list.addAll(errorList);
- list.addAll(warningList);
-
- return list;
}
public List<String> getStrForProcessList() {
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 2011-07-04
20:37:22 UTC (rev 32594)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BPMNResourcesChoicePage.java 2011-07-05
05:58:39 UTC (rev 32595)
@@ -60,9 +60,10 @@
public void selectionChanged(SelectionChangedEvent event) {
updateControls();
currentSelection = viewer.getSelection();
+ ((BpmnToWizard) wizard).getErrorList().clear();
+ ((BpmnToWizard) wizard).getWarningList().clear();
((BpmnToWizard) wizard)
.setSelection((IStructuredSelection) currentSelection);
-
}
});
}
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 2011-07-04
20:37:22 UTC (rev 32594)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/BpmnToWizard.java 2011-07-05
05:58:39 UTC (rev 32595)
@@ -59,6 +59,7 @@
protected List<String> poolIdList = new ArrayList<String>();
// the list contains errors or warnings when generating
protected List<String> errorList = new ArrayList<String>();
+ protected List<String> warningList = new ArrayList<String>();
public BpmnToWizard() {
super();
@@ -113,18 +114,18 @@
private void initialize() {
if (selection.getFirstElement() instanceof IFile) {
IFile bpmnFile = (IFile) selection.getFirstElement();
- bpmnFileName = bpmnFile.getName();
- bpmnFileParentPath = bpmnFile.getParent().getLocation()
- .toOSString();
- try {
- idMap = BPMNToUtil.getPoolIDsFromDocument(BPMNToUtil.parse(
- bpmnFileParentPath, bpmnFileName));
- poolIdList.clear();
- } catch (Exception e) {
- errorList.add(0, NLS.bind(
- B2JMessages.Translate_Error_File_CanNotRead,
- bpmnFileName));
- e.printStackTrace();
+ if ("bpmn".equals(bpmnFile.getFileExtension())) {
+ bpmnFileName = bpmnFile.getName();
+ bpmnFileParentPath = bpmnFile.getParent().getLocation()
+ .toOSString();
+ try {
+ idMap = BPMNToUtil.getPoolIDsFromDocument(BPMNToUtil.parse(
+ bpmnFileParentPath, bpmnFileName));
+ poolIdList.clear();
+ } catch (Exception e) {
+ errorList.add(0, NLS.bind(
+ B2JMessages.Translate_Error_File_CanNotRead, bpmnFileName));
+ }
}
}
if (poolsPage != null) {
@@ -133,13 +134,22 @@
}
public IWizardPage getNextPage(IWizardPage page) {
+ if (page.getName().equals(B2JMessages.Bpmn_File_Choose_WizardPage_Name)) {
+ if (errorList.size() > 0) {
+ errorPage.getListViewer().setInput(errorList);
+ return errorPage;
+ }
+ }
if (page.getName().equals(B2JMessages.Bpmn_Pool_Choose_WizardPage_Name)) {
- errorList = translateBpmnToStrings();
+ translateBpmnToStrings();
isDoTranslation = true;
- if (errorList.size() == 0) {
+ if (errorList.size() == 0 && warningList.size() == 0) {
return locationPage;
}
- errorPage.getListViewer().setInput(errorList);
+ List<String> list = new ArrayList<String>();
+ list.addAll(errorList);
+ list.addAll(warningList);
+ errorPage.getListViewer().setInput(list);
return super.getNextPage(page);
} else {
return super.getNextPage(page);
@@ -148,7 +158,7 @@
}
public boolean performFinish() {
- if(!isDoTranslation){
+ if (!isDoTranslation) {
translateBpmnToStrings();
}
createGeneratedFile(this.isOverWrite());
@@ -161,7 +171,7 @@
* a string list to reserve these strings the return list is error or
* warning messages
*/
- public abstract List<String> translateBpmnToStrings();
+ public abstract void translateBpmnToStrings();
/*
* write the generated strings to the files
@@ -175,14 +185,12 @@
return container.getLocation().toOSString();
}
-
/*
* refresh eclipse workspace
*/
public void refreshWorkspace() {
try {
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(
- IResource.DEPTH_INFINITE, null);
+ ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE,
null);
} catch (CoreException e) {
e.printStackTrace();
}
@@ -204,6 +212,14 @@
this.errorList = errorList;
}
+ public List<String> getWarningList() {
+ return warningList;
+ }
+
+ public void setWarningList(List<String> warningList) {
+ this.warningList = warningList;
+ }
+
public IStructuredSelection getSelection() {
return selection;
}
@@ -237,7 +253,7 @@
IStructuredSelection targetLocationSelection) {
this.targetLocationSelection = targetLocationSelection;
}
-
+
public boolean isOverWrite() {
return isOverWrite;
}
Modified:
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java
===================================================================
---
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2011-07-04
20:37:22 UTC (rev 32594)
+++
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/src/org/jboss/tools/jbpm/convert/bpmnto/wizard/ErrorMessagesPage.java 2011-07-05
05:58:39 UTC (rev 32595)
@@ -58,6 +58,9 @@
}
public boolean isPageComplete() {
+ if (((BpmnToWizard)this.getWizard()).getErrorList().size() >0) {
+ return false;
+ }
return true;
}
Show replies by date