diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java index 2feb068..e0d15fc 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/E4LifeCycle.java @@ -86,7 +86,7 @@ public class E4LifeCycle { ContextInjectionFactory.inject(openViewHandler, ctx); eventBroker.unsubscribe(this); for(String name:opt.getSet().getData()){ - if(new File(name).exists()) openViewHandler.openViewForFile(name); + openViewHandler.openViewForFile(name); } } } @@ -159,6 +159,8 @@ public class E4LifeCycle { */ public void openViewForFile(String name){ File file = new File(getFirstFileName(name)); + if(!file.exists()) + return; MPart part = partService.createPart("com.minres.scviewer.e4.application.partdescriptor.waveformviewer"); //$NON-NLS-1$ part.setLabel(file.getName()); MPartStack partStack = (MPartStack)modelService.find("org.eclipse.editorss", app); //$NON-NLS-1$ @@ -172,7 +174,7 @@ public class E4LifeCycle { } private String getFirstFileName(String name) { - if(name.contains(":")) { + if(name.contains(",")) { String[] tokens = name.split(","); return tokens[0]; } else diff --git a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java index 42288c2..48dbb7b 100644 --- a/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java +++ b/com.minres.scviewer.e4.application/src/com/minres/scviewer/e4/application/handlers/OpenHandler.java @@ -32,7 +32,9 @@ public class OpenHandler { public void execute(Shell shell, MApplication app, EModelService modelService, EPartService partService){ FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI); dialog.setFilterExtensions (new String []{Messages.OpenHandler_0}); - dialog.open(); + String ret = dialog.open(); + if(ret==null) + return; String path = dialog.getFilterPath(); ArrayList files = new ArrayList(); for(String fileName: dialog.getFileNames()){