Skip to content

Commit 3dbb58f

Browse files
committed
Added Condition service to describe the processor contribution order
1 parent 4ecb136 commit 3dbb58f

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/BindingToModelProcessor.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,20 @@
4040
import org.eclipse.ui.internal.keys.BindingPersistence;
4141
import org.eclipse.ui.internal.keys.BindingService;
4242
import org.osgi.service.component.annotations.Component;
43+
import org.osgi.service.component.annotations.Reference;
44+
import org.osgi.service.condition.Condition;
4345

44-
@Component
46+
@Component(service = IModelProcessorContribution.class)
4547
public class BindingToModelProcessor implements IModelProcessorContribution {
4648

4749
private Map<String, MBindingContext> contexts = new HashMap<>();
4850
private Map<String, MCommand> commands = new HashMap<>();
4951
private Map<String, MBindingTable> tables = new HashMap<>();
5052
private Set<MKeyBinding> keys = new HashSet<>();
5153

54+
@Reference(target = "(osgi.condition.id=commandAndContext)")
55+
Condition commandAndContextCondition;
56+
5257
@Execute
5358
void process(final MApplication application, IEclipseContext context) {
5459
gatherContexts(application.getRootContext());
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package org.eclipse.ui.internal;
2+
3+
import org.osgi.service.component.annotations.Component;
4+
import org.osgi.service.component.annotations.Reference;
5+
import org.osgi.service.condition.Condition;
6+
7+
/**
8+
* @since 3.5
9+
*
10+
*/
11+
@Component(service = Condition.class, property = "osgi.condition.id=commandAndContext")
12+
public class CommandAndContextCondition implements Condition {
13+
14+
@Reference
15+
CommandToModelProcessor commandToModelProcessor;
16+
17+
@Reference
18+
ContextToModelProcessor contextToModelProcessor;
19+
}

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/CommandToModelProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
/**
3838
* @since 3.5
3939
*/
40-
@Component
40+
@Component(service = { IModelProcessorContribution.class, CommandToModelProcessor.class })
4141
public class CommandToModelProcessor implements IModelProcessorContribution {
4242

4343
private Map<String, MCategory> categories = new HashMap<>();

bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ContextToModelProcessor.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
/**
3434
* @since 3.5
3535
*/
36-
@Component
36+
@Component(service = { IModelProcessorContribution.class, ContextToModelProcessor.class })
3737
public class ContextToModelProcessor implements IModelProcessorContribution {
3838
private Map<String, MBindingContext> contexts = new HashMap<>();
3939

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Require-Capability: osgi.extender;
137137
filter:="(&(osgi.extender=osgi.component)(version>=1.2)(!(version>=2.0)))"
138138
Automatic-Module-Name: org.eclipse.ui.workbench
139139
Service-Component: OSGI-INF/org.eclipse.ui.internal.BindingToModelProcessor.xml,
140+
OSGI-INF/org.eclipse.ui.internal.CommandAndContextCondition.xml,
140141
OSGI-INF/org.eclipse.ui.internal.CommandToModelProcessor.xml,
141142
OSGI-INF/org.eclipse.ui.internal.ContextToModelProcessor.xml,
142143
OSGI-INF/org.eclipse.ui.internal.WindowsDefenderConfigurator.xml,

0 commit comments

Comments
 (0)