|
32 | 32 | import org.eclipse.chemclipse.ux.extension.ui.definitions.IWelcomeTileDefinition; |
33 | 33 | import org.eclipse.e4.core.di.annotations.Execute; |
34 | 34 | import org.eclipse.e4.ui.model.application.MApplication; |
35 | | -import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory; |
36 | 35 | import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
37 | 36 | import org.eclipse.e4.ui.model.application.ui.basic.MPartStack; |
38 | 37 | import org.eclipse.e4.ui.workbench.modeling.EModelService; |
@@ -72,7 +71,7 @@ public void handleEvent(EModelService modelService, MApplication application, EP |
72 | 71 |
|
73 | 72 | try { |
74 | 73 | if(chromatogramFile != null && chromatogramFile.exists()) { |
75 | | - MPart part = createChromatogramPart(); |
| 74 | + MPart part = createChromatogramPart(modelService); |
76 | 75 | part.setLabel("DemoChromatogram.ocb"); |
77 | 76 | Map<String, Object> map = new HashMap<>(); |
78 | 77 | map.put(EditorSupport.MAP_FILE, chromatogramFile.getAbsolutePath()); |
@@ -103,12 +102,12 @@ void showEditorPart(MPart part, EModelService modelService, MApplication applica |
103 | 102 | partService.showPart(part, PartState.ACTIVATE); |
104 | 103 | } |
105 | 104 |
|
106 | | - MPart createChromatogramPart() { |
| 105 | + MPart createChromatogramPart(EModelService modelService) { |
107 | 106 |
|
108 | 107 | /* |
109 | 108 | * Create the input part and prepare it. |
110 | 109 | */ |
111 | | - MPart part = MBasicFactory.INSTANCE.createPart(); |
| 110 | + MPart part = modelService.createModelElement(MPart.class); |
112 | 111 | part.setElementId("org.eclipse.chemclipse.ux.extension.xxd.ui.part.chromatogramEditorMSD"); |
113 | 112 | part.setContributionURI("bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.editors.ChromatogramEditorMSD"); |
114 | 113 | part.setIconURI(ApplicationImageFactory.getInstance().getURI(IApplicationImage.IMAGE_CHROMATOGRAM, IApplicationImageProvider.SIZE_16x16)); |
|
0 commit comments