return stack;\r
}\r
\r
+ public static void openAndShowPart(MPart part) {\r
+ IEclipseContext context = PlatformUI.getWorkbench().getService(IEclipseContext.class);\r
+ EPartService partService = context.get(EPartService.class);\r
+ if (!partService.isPartVisible(part))\r
+ partService.showPart(part, PartState.ACTIVATE);\r
+ else\r
+ partService.activate(part);\r
+ }\r
+\r
+ \r
+ public static void openAndShowPart(String partId) {\r
+ IEclipseContext context = PlatformUI.getWorkbench().getService(IEclipseContext.class);\r
+ EPartService partService = context.get(EPartService.class);\r
+ partService.showPart(partId, PartState.ACTIVATE);\r
+ }\r
+\r
+ public static MPart getMPartById(String partId) {\r
+ IEclipseContext context = PlatformUI.getWorkbench().getService(IEclipseContext.class);\r
+ EPartService partService = context.get(EPartService.class);\r
+ return partService.findPart(partId);\r
+ }\r
+\r
}\r