Skip to content

Commit 7da8595

Browse files
authored
Merge pull request #2752 from akurtakov/develop
Create MPart via EModelService
2 parents f14bb25 + 8bc4a69 commit 7da8595

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.ui/src/org/eclipse/chemclipse/ux/extension/ui/provider/ISupplierFileEditorSupport.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*******************************************************************************
2-
* Copyright (c) 2017, 2025 Lablicate GmbH.
2+
* Copyright (c) 2017, 2026 Lablicate GmbH.
33
*
44
* This program and the accompanying materials are made
55
* available under the terms of the Eclipse Public License 2.0
66
* which is available at https://www.eclipse.org/legal/epl-2.0/
77
*
88
* SPDX-License-Identifier: EPL-2.0
9-
*
9+
*
1010
* Contributors:
1111
* Philip Wenig - initial API and implementation
1212
* Christoph Läubrich - migrate from InputPart to Part
@@ -37,7 +37,6 @@
3737
import org.eclipse.chemclipse.vsd.model.core.ISpectrumVSD;
3838
import org.eclipse.chemclipse.wsd.model.core.IChromatogramWSD;
3939
import org.eclipse.e4.ui.model.application.MApplication;
40-
import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory;
4140
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
4241
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
4342
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
@@ -141,7 +140,7 @@ default void openEditor(File file, Object object, String elementId, String contr
141140
/*
142141
* Create the input part and prepare it.
143142
*/
144-
MPart part = MBasicFactory.INSTANCE.createPart();
143+
MPart part = modelService.createModelElement(MPart.class);
145144
part.getTags().add(EPartService.REMOVE_ON_HIDE_TAG);
146145
part.setElementId(elementId);
147146
part.setContributionURI(contributionURI);

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedChromatogramOverlayUI.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* which is available at https://www.eclipse.org/legal/epl-2.0/
77
*
88
* SPDX-License-Identifier: EPL-2.0
9-
*
9+
*
1010
* Contributors:
1111
* Philip Wenig - initial API and implementation
1212
* Christoph Läubrich - support for configuration, zoom lock
@@ -84,7 +84,6 @@
8484
import org.eclipse.chemclipse.wsd.model.xwc.IExtractedWavelengthSignal;
8585
import org.eclipse.core.runtime.IStatus;
8686
import org.eclipse.e4.ui.model.application.MApplication;
87-
import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory;
8887
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
8988
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
9089
import org.eclipse.e4.ui.workbench.modeling.EModelService;
@@ -467,7 +466,7 @@ private void createNewPart(String bundle, String classPath, String name) {
467466
EPartService partService = Activator.getDefault().getPartService();
468467

469468
if(modelService != null && application != null && partService != null) {
470-
MPart part = MBasicFactory.INSTANCE.createPart();
469+
MPart part = modelService.createModelElement(MPart.class);
471470
part.setLabel(name);
472471
part.setCloseable(true);
473472
part.setContributionURI("bundleclass://" + bundle + "/" + classPath);
@@ -1350,7 +1349,7 @@ private Color getColorTIC(Color colorDefault) {
13501349

13511350
/**
13521351
* Return the selected derivative or NONE as a default.
1353-
*
1352+
*
13541353
* @return {@link Derivative}
13551354
*/
13561355
private Derivative getSelectedDerivative() {

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/swt/ExtendedMassSpectrumOverlayUI.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* which is available at https://www.eclipse.org/legal/epl-2.0/
77
*
88
* SPDX-License-Identifier: EPL-2.0
9-
*
9+
*
1010
* Contributors:
1111
* Philip Wenig - initial API and implementation
1212
* Matthias Mailänder - adapted for MALDI
@@ -36,7 +36,6 @@
3636
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferencePageOverlay;
3737
import org.eclipse.chemclipse.ux.extension.xxd.ui.preferences.PreferenceSupplier;
3838
import org.eclipse.e4.ui.model.application.MApplication;
39-
import org.eclipse.e4.ui.model.application.ui.basic.MBasicFactory;
4039
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
4140
import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
4241
import org.eclipse.e4.ui.workbench.modeling.EModelService;
@@ -316,7 +315,7 @@ private void createNewPart(String bundle, String classPath, String name) {
316315
EPartService partService = Activator.getDefault().getPartService();
317316

318317
if(modelService != null && application != null && partService != null) {
319-
MPart part = MBasicFactory.INSTANCE.createPart();
318+
MPart part = modelService.createModelElement(MPart.class);
320319
part.setLabel(name);
321320
part.setCloseable(true);
322321
part.setContributionURI("bundleclass://" + bundle + "/" + classPath);

0 commit comments

Comments
 (0)