Author: Grid.Qian
Date: 2009-09-25 04:17:28 -0400 (Fri, 25 Sep 2009)
New Revision: 17725
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/preferences/WSILPreferencePage.java
Log:
JBIDE-4910: BPEL->'WSIL Browser' Preference page cannot load WSIL xml
Modified: trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-09-25
07:38:05 UTC (rev 17724)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/Messages.java 2009-09-25
08:17:28 UTC (rev 17725)
@@ -225,6 +225,7 @@
public static String BPELPreferencePage_WSIL_MoveUp;
public static String BPELPreferencePage_WSIL_OpenInBrowser;
public static String BPELPreferencePage_WSIL_DocumentNotLoaded;
+ public static String BPELPreferencePage_WSIL_NameLimit;
public static String BPELPreferencePage_WSIL_EnterLocation;
public static String BPELPreferencePage_WSIL_EnterDescription;
public static String
BPELUIRegistry_Expression_language_editors_must_provide_expressionLanguage_and_class__8;
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-09-25
07:38:05 UTC (rev 17724)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/messages.properties 2009-09-25
08:17:28 UTC (rev 17725)
@@ -119,6 +119,7 @@
BPELPreferencePage_WSIL_Remove = Remove
BPELPreferencePage_WSIL_Index = #
BPELPreferencePage_WSIL_DocumentNotLoaded = WSIL Document not loaded.
+BPELPreferencePage_WSIL_NameLimit = WSIL Document's name should be ended with .wsil
BPELPreferencePage_WSIL_MoveDown = Move Down
BPELPreferencePage_WSIL_MoveUp = Move Up
BPELPreferencePage_WSIL_OpenInBrowser = Open in Browser
Modified:
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/preferences/WSILPreferencePage.java
===================================================================
---
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/preferences/WSILPreferencePage.java 2009-09-25
07:38:05 UTC (rev 17724)
+++
trunk/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/preferences/WSILPreferencePage.java 2009-09-25
08:17:28 UTC (rev 17725)
@@ -102,6 +102,8 @@
Button moveDownButton;
Button openInBrowserButton;
+ private static String WSIL = "wsil";
+
// Track the modification of any element in the WSIL model.
// we don't use commands and stacks here.
EContentAdapter fContentAdapter = new EContentAdapter() {
@@ -177,6 +179,7 @@
@Override
public void widgetSelected(SelectionEvent e) {
FileDialog fd = new FileDialog(getShell(), SWT.OPEN);
+ fd.setFilterExtensions(new String[]{"*."+WSIL});
String fileName = fd.open();
if ((fileName != null) && (fileName.length() > 0)) {
// parse to file url
@@ -500,6 +503,10 @@
if (url.length() < 1) {
return ;
}
+ if(!url.endsWith(WSIL)){
+ setMessage(Messages.BPELPreferencePage_WSIL_NameLimit, ERROR);
+ return;
+ }
if (fWsilDocument != null) {
fWsilDocument.eResource().eAdapters().remove( fContentAdapter );
@@ -511,7 +518,7 @@
Resource resource = null;
try {
- resource = resourceSet.getResource(uri, true, "wsil");
+ resource = resourceSet.getResource(uri, true, WSIL);
List contents = resource.getContents();
Show replies by date