]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.ui/src/org/simantics/ui/workbench/e4/E4WorkbenchUtils.java
E4WorkbenchUtils.getMPartById to create the part if not already created
[simantics/platform.git] / bundles / org.simantics.ui / src / org / simantics / ui / workbench / e4 / E4WorkbenchUtils.java
index a7db1e2aa930e8dd0974aed267a941687309e95f..3c1888a0112c2c2f382e82c05915372ce51d440d 100644 (file)
@@ -161,7 +161,10 @@ public class E4WorkbenchUtils {
     public static MPart getMPartById(String partId) {
         IEclipseContext context = PlatformUI.getWorkbench().getService(IEclipseContext.class);
         EPartService partService = context.get(EPartService.class);
     public static MPart getMPartById(String partId) {
         IEclipseContext context = PlatformUI.getWorkbench().getService(IEclipseContext.class);
         EPartService partService = context.get(EPartService.class);
-        return partService.findPart(partId);
+        MPart part = partService.findPart(partId);
+        if (part == null)
+            part = partService.createPart(partId);
+        return part;
     }
 
 }
     }
 
 }