Skip to content

Commit c934d05

Browse files
fipro78HannesWell
authored andcommitted
Impl #2402 - Migrate model processors from extension point to OSGi DS
Signed-off-by: Dirk Fauth <[email protected]>
1 parent 908db0f commit c934d05

File tree

15 files changed

+74
-66
lines changed

15 files changed

+74
-66
lines changed

bundles/org.eclipse.e4.ui.workbench.addons.swt/.project

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
<arguments>
3131
</arguments>
3232
</buildCommand>
33+
<buildCommand>
34+
<name>org.eclipse.pde.ds.core.builder</name>
35+
<arguments>
36+
</arguments>
37+
</buildCommand>
3338
</buildSpec>
3439
<natures>
3540
<nature>org.eclipse.m2e.core.maven2Nature</nature>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
dsVersion=V1_4
2+
eclipse.preferences.version=1
3+
enabled=true
4+
generateBundleActivationPolicyLazy=true
5+
path=OSGI-INF
6+
validationErrorLevel=error
7+
validationErrorLevel.missingImplicitUnbindMethod=error

bundles/org.eclipse.e4.ui.workbench.addons.swt/META-INF/MANIFEST.MF

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="1.0.0",
1818
org.eclipse.e4.ui.di;bundle-version="0.10.0",
1919
org.eclipse.e4.ui.services;bundle-version="1.0.0",
2020
org.eclipse.emf.ecore.xmi;bundle-version="2.7.0"
21+
Service-Component: OSGI-INF/org.eclipse.e4.ui.workbench.addons.swt.CleanupProcessor.xml,
22+
OSGI-INF/org.eclipse.e4.ui.workbench.addons.swt.DnDProcessor.xml,
23+
OSGI-INF/org.eclipse.e4.ui.workbench.addons.swt.MinMaxProcessor.xml,
24+
OSGI-INF/org.eclipse.e4.ui.workbench.addons.swt.SplitterProcessor.xml
2125
Bundle-RequiredExecutionEnvironment: JavaSE-17
2226
Bundle-ActivationPolicy: lazy
2327
Import-Package: jakarta.annotation;version="[2.1.0,3.0.0)",

bundles/org.eclipse.e4.ui.workbench.addons.swt/build.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ bin.includes = META-INF/,\
1717
.,\
1818
about.html,\
1919
plugin.properties,\
20-
plugin.xml,\
21-
icons/
20+
icons/,\
21+
OSGI-INF/
2222
src.includes = icons/,\
2323
about.html

bundles/org.eclipse.e4.ui.workbench.addons.swt/plugin.xml

Lines changed: 0 additions & 26 deletions
This file was deleted.

bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/CleanupProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2013, 2014 IBM Corporation and others.
2+
* Copyright (c) 2013, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,11 +19,14 @@
1919
import org.eclipse.e4.ui.model.application.MAddon;
2020
import org.eclipse.e4.ui.model.application.MApplication;
2121
import org.eclipse.e4.ui.workbench.modeling.EModelService;
22+
import org.eclipse.e4.ui.workbench.modeling.IModelProcessorContribution;
23+
import org.osgi.service.component.annotations.Component;
2224

2325
/**
2426
* Model processors which adds the cleanup add-on to the application model
2527
*/
26-
public class CleanupProcessor {
28+
@Component
29+
public class CleanupProcessor implements IModelProcessorContribution {
2730
@Execute
2831
void addCleanupAddon(MApplication app, EModelService modelService) {
2932
List<MAddon> addons = app.getAddons();

bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/DnDProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2013, 2014 IBM Corporation and others.
2+
* Copyright (c) 2013, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,11 +19,14 @@
1919
import org.eclipse.e4.ui.model.application.MAddon;
2020
import org.eclipse.e4.ui.model.application.MApplication;
2121
import org.eclipse.e4.ui.workbench.modeling.EModelService;
22+
import org.eclipse.e4.ui.workbench.modeling.IModelProcessorContribution;
23+
import org.osgi.service.component.annotations.Component;
2224

2325
/**
2426
* Model processors which adds the DnD add-on to the application model
2527
*/
26-
public class DnDProcessor {
28+
@Component
29+
public class DnDProcessor implements IModelProcessorContribution {
2730
@Execute
2831
void addDnDAddon(MApplication app, EModelService modelService) {
2932
List<MAddon> addons = app.getAddons();

bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/MinMaxProcessor.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2013, 2014 IBM Corporation and others.
2+
* Copyright (c) 2013, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,11 +19,14 @@
1919
import org.eclipse.e4.ui.model.application.MAddon;
2020
import org.eclipse.e4.ui.model.application.MApplication;
2121
import org.eclipse.e4.ui.workbench.modeling.EModelService;
22+
import org.eclipse.e4.ui.workbench.modeling.IModelProcessorContribution;
23+
import org.osgi.service.component.annotations.Component;
2224

2325
/**
2426
* Model processors which adds the MinMax add-on to the application model
2527
*/
26-
public class MinMaxProcessor {
28+
@Component
29+
public class MinMaxProcessor implements IModelProcessorContribution {
2730
@Execute
2831
void addMinMaxAddon(MApplication app, EModelService modelService) {
2932
List<MAddon> addons = app.getAddons();

bundles/org.eclipse.e4.ui.workbench.addons.swt/src/org/eclipse/e4/ui/workbench/addons/swt/SplitterProcessor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2013, 2014 IBM Corporation and others.
2+
* Copyright (c) 2013, 2024 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -19,12 +19,14 @@
1919
import org.eclipse.e4.ui.model.application.MAddon;
2020
import org.eclipse.e4.ui.model.application.MApplication;
2121
import org.eclipse.e4.ui.workbench.modeling.EModelService;
22+
import org.eclipse.e4.ui.workbench.modeling.IModelProcessorContribution;
23+
import org.osgi.service.component.annotations.Component;
2224

2325
/**
2426
* Model processors which adds the Splitter add-on to the application model
2527
*/
26-
27-
public class SplitterProcessor {
28+
@Component
29+
public class SplitterProcessor implements IModelProcessorContribution {
2830
@Execute
2931
void addSplitterAddon(MApplication app, EModelService modelService) {
3032
List<MAddon> addons = app.getAddons();

bundles/org.eclipse.ui.workbench/META-INF/MANIFEST.MF

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,8 @@ Bundle-RequiredExecutionEnvironment: JavaSE-17
136136
Require-Capability: osgi.extender;
137137
filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
138138
Automatic-Module-Name: org.eclipse.ui.workbench
139-
Service-Component: OSGI-INF/org.eclipse.ui.internal.WindowsDefenderConfigurator.xml,
139+
Service-Component: OSGI-INF/org.eclipse.ui.internal.BindingToModelProcessor.xml,
140+
OSGI-INF/org.eclipse.ui.internal.CommandToModelProcessor.xml,
141+
OSGI-INF/org.eclipse.ui.internal.ContextToModelProcessor.xml,
142+
OSGI-INF/org.eclipse.ui.internal.WindowsDefenderConfigurator.xml,
140143
OSGI-INF/org.eclipse.ui.internal.themes.ColorAndFontProviderImpl.xml

0 commit comments

Comments
 (0)