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;
}
}