Skip to content

Commit 1072890

Browse files
akurtakovMailaender
authored andcommitted
Do not needlessly inject and pass IEclipseContext
ChromatogramEditor doesn't use the constructor passed IEclipseContext so save the injection in children. Furthermore, it can be retrieved via MPart.getContext if needed at some point.
1 parent cc0d634 commit 1072890

File tree

7 files changed

+25
-32
lines changed

7 files changed

+25
-32
lines changed

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditor.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018, 2025 Lablicate GmbH.
2+
* Copyright (c) 2018, 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
*******************************************************************************/
1313
package org.eclipse.chemclipse.ux.extension.xxd.ui.editors;
1414

1515
import org.eclipse.chemclipse.model.types.DataType;
1616
import org.eclipse.chemclipse.processing.supplier.IProcessSupplierContext;
17-
import org.eclipse.e4.core.contexts.IEclipseContext;
1817
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
1918
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2019
import org.eclipse.swt.widgets.Composite;
@@ -24,7 +23,7 @@ public class ChromatogramEditor extends AbstractChromatogramEditor {
2423

2524
private final Composite parent;
2625

27-
public ChromatogramEditor(DataType dataType, Composite parent, MPart part, MDirtyable dirtyable, Shell shell, IProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
26+
public ChromatogramEditor(DataType dataType, Composite parent, MPart part, MDirtyable dirtyable, Shell shell, IProcessSupplierContext processSupplierContext) {
2827

2928
super(dataType, parent, part, dirtyable, processSupplierContext, shell);
3029
this.parent = parent;

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditor3x.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
* Christoph Läubrich - changes for PartSupport
@@ -28,7 +28,6 @@
2828
import org.eclipse.chemclipse.support.ui.workbench.EditorSupport;
2929
import org.eclipse.chemclipse.swt.ui.notifier.UpdateNotifierUI;
3030
import org.eclipse.chemclipse.ux.extension.ui.editors.IChromatogramEditor;
31-
import org.eclipse.chemclipse.ux.extension.xxd.ui.Activator;
3231
import org.eclipse.chemclipse.ux.extension.xxd.ui.l10n.ExtensionMessages;
3332
import org.eclipse.chemclipse.xxd.process.files.SupplierFileIdentifier;
3433
import org.eclipse.chemclipse.xxd.process.support.ProcessTypeSupport;
@@ -84,7 +83,7 @@ public void createPartControl(Composite parent) {
8483
parent.setLayout(new FillLayout());
8584
DataType dataType = getDataType();
8685
if(dataType != null) {
87-
chromatogramEditor = new ChromatogramEditor(dataType, parent, part, dirtyable, DisplayUtils.getShell(), new ProcessTypeSupport(), Activator.getDefault().getEclipseContext());
86+
chromatogramEditor = new ChromatogramEditor(dataType, parent, part, dirtyable, DisplayUtils.getShell(), new ProcessTypeSupport());
8887
} else {
8988
IProcessingInfo<?> processingInfo = new ProcessingInfo<>();
9089
processingInfo.addErrorMessage("Chromatogram Editor", "Unknown data type.");

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditorCSD.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*******************************************************************************
2-
* e Copyright (c) 2018, 2025 Lablicate GmbH.
2+
* e Copyright (c) 2018, 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
*******************************************************************************/
@@ -17,7 +17,6 @@
1717
import org.eclipse.chemclipse.rcp.ui.icons.core.ApplicationImageFactory;
1818
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
1919
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImageProvider;
20-
import org.eclipse.e4.core.contexts.IEclipseContext;
2120
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
2221
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2322
import org.eclipse.swt.widgets.Composite;
@@ -32,8 +31,8 @@ public class ChromatogramEditorCSD extends ChromatogramEditor {
3231
public static final String ICON_URI = ApplicationImageFactory.getInstance().getURI(IApplicationImage.IMAGE_CHROMATOGRAM_CSD, IApplicationImageProvider.SIZE_16x16);
3332

3433
@Inject
35-
public ChromatogramEditorCSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
34+
public ChromatogramEditorCSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext) {
3635

37-
super(DataType.CSD, parent, part, dirtyable, shell, processSupplierContext, eclipseContext);
36+
super(DataType.CSD, parent, part, dirtyable, shell, processSupplierContext);
3837
}
3938
}

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditorFSD.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*******************************************************************************
2-
* Copyright (c) 2025 Lablicate GmbH.
2+
* Copyright (c) 2025, 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
* Matthias Mailänder - initial API and implementation
1212
*******************************************************************************/
@@ -17,7 +17,6 @@
1717
import org.eclipse.chemclipse.rcp.ui.icons.core.ApplicationImageFactory;
1818
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
1919
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImageProvider;
20-
import org.eclipse.e4.core.contexts.IEclipseContext;
2120
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
2221
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2322
import org.eclipse.swt.widgets.Composite;
@@ -32,8 +31,8 @@ public class ChromatogramEditorFSD extends ChromatogramEditor {
3231
public static final String ICON_URI = ApplicationImageFactory.getInstance().getURI(IApplicationImage.IMAGE_CHROMATOGRAM_WSD, IApplicationImageProvider.SIZE_16x16); // TODO
3332

3433
@Inject
35-
public ChromatogramEditorFSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
34+
public ChromatogramEditorFSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext) {
3635

37-
super(DataType.FSD, parent, part, dirtyable, shell, processSupplierContext, eclipseContext);
36+
super(DataType.FSD, parent, part, dirtyable, shell, processSupplierContext);
3837
}
3938
}

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditorMSD.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018, 2025 Lablicate GmbH.
2+
* Copyright (c) 2018, 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
*******************************************************************************/
@@ -17,7 +17,6 @@
1717
import org.eclipse.chemclipse.rcp.ui.icons.core.ApplicationImageFactory;
1818
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
1919
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImageProvider;
20-
import org.eclipse.e4.core.contexts.IEclipseContext;
2120
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
2221
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2322
import org.eclipse.swt.widgets.Composite;
@@ -32,8 +31,8 @@ public class ChromatogramEditorMSD extends ChromatogramEditor {
3231
public static final String ICON_URI = ApplicationImageFactory.getInstance().getURI(IApplicationImage.IMAGE_CHROMATOGRAM_MSD, IApplicationImageProvider.SIZE_16x16);
3332

3433
@Inject
35-
public ChromatogramEditorMSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
34+
public ChromatogramEditorMSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext) {
3635

37-
super(DataType.MSD, parent, part, dirtyable, shell, processSupplierContext, eclipseContext);
36+
super(DataType.MSD, parent, part, dirtyable, shell, processSupplierContext);
3837
}
3938
}

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditorVSD.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
/*******************************************************************************
2-
* Copyright (c) 2023, 2025 Lablicate GmbH.
2+
* Copyright (c) 2023, 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
*******************************************************************************/
1313
package org.eclipse.chemclipse.ux.extension.xxd.ui.editors;
1414

1515
import org.eclipse.chemclipse.model.types.DataType;
1616
import org.eclipse.chemclipse.processing.ui.E4ProcessSupplierContext;
17-
import org.eclipse.e4.core.contexts.IEclipseContext;
1817
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
1918
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2019
import org.eclipse.swt.widgets.Composite;
@@ -28,8 +27,8 @@ public class ChromatogramEditorVSD extends ChromatogramEditor {
2827
public static final String CONTRIBUTION_URI = "bundleclass://org.eclipse.chemclipse.ux.extension.xxd.ui/org.eclipse.chemclipse.ux.extension.xxd.ui.editors.ChromatogramEditorVSD";
2928

3029
@Inject
31-
public ChromatogramEditorVSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
30+
public ChromatogramEditorVSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext) {
3231

33-
super(DataType.VSD, parent, part, dirtyable, shell, processSupplierContext, eclipseContext);
32+
super(DataType.VSD, parent, part, dirtyable, shell, processSupplierContext);
3433
}
3534
}

chemclipse/plugins/org.eclipse.chemclipse.ux.extension.xxd.ui/src/org/eclipse/chemclipse/ux/extension/xxd/ui/editors/ChromatogramEditorWSD.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018, 2025 Lablicate GmbH.
2+
* Copyright (c) 2018, 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
*******************************************************************************/
@@ -17,7 +17,6 @@
1717
import org.eclipse.chemclipse.rcp.ui.icons.core.ApplicationImageFactory;
1818
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImage;
1919
import org.eclipse.chemclipse.rcp.ui.icons.core.IApplicationImageProvider;
20-
import org.eclipse.e4.core.contexts.IEclipseContext;
2120
import org.eclipse.e4.ui.model.application.ui.MDirtyable;
2221
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
2322
import org.eclipse.swt.widgets.Composite;
@@ -32,8 +31,8 @@ public class ChromatogramEditorWSD extends ChromatogramEditor {
3231
public static final String ICON_URI = ApplicationImageFactory.getInstance().getURI(IApplicationImage.IMAGE_CHROMATOGRAM_WSD, IApplicationImageProvider.SIZE_16x16);
3332

3433
@Inject
35-
public ChromatogramEditorWSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext, IEclipseContext eclipseContext) {
34+
public ChromatogramEditorWSD(Composite parent, MPart part, MDirtyable dirtyable, Shell shell, E4ProcessSupplierContext processSupplierContext) {
3635

37-
super(DataType.WSD, parent, part, dirtyable, shell, processSupplierContext, eclipseContext);
36+
super(DataType.WSD, parent, part, dirtyable, shell, processSupplierContext);
3837
}
3938
}

0 commit comments

Comments
 (0)