Skip to content

Commit 662929b

Browse files
committed
Use new @IContextFunction.ServiceContextKey component property type
and @org.osgi.service.event.propertytypes.EventTopics where applicable.
1 parent 946e3b3 commit 662929b

File tree

17 files changed

+43
-36
lines changed

17 files changed

+43
-36
lines changed

bundles/org.eclipse.e4.core.commands/.settings/org.eclipse.pde.ds.annotations.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dsVersion=V1_3
1+
dsVersion=V1_4
22
eclipse.preferences.version=1
33
enabled=true
44
generateBundleActivationPolicyLazy=true

bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/CommandServiceCreationFunction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2014 IBM Corporation and others.
2+
* Copyright (c) 2009, 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
@@ -21,7 +21,8 @@
2121
import org.eclipse.e4.core.contexts.IEclipseContext;
2222
import org.osgi.service.component.annotations.Component;
2323

24-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.commands.ECommandService")
24+
@Component(service = IContextFunction.class )
25+
@IContextFunction.ServiceContextKey(org.eclipse.e4.core.commands.ECommandService.class)
2526
public class CommandServiceCreationFunction extends ContextFunction {
2627
/**
2728
* A context key (value "rootContext") that identifies the root of this context chain. It does

bundles/org.eclipse.e4.core.commands/src/org/eclipse/e4/core/commands/internal/HandlerServiceCreationFunction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2013 IBM Corporation and others.
2+
* Copyright (c) 2009, 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
@@ -20,7 +20,8 @@
2020
import org.eclipse.e4.core.contexts.IEclipseContext;
2121
import org.osgi.service.component.annotations.Component;
2222

23-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.commands.EHandlerService")
23+
@Component(service = IContextFunction.class)
24+
@IContextFunction.ServiceContextKey(org.eclipse.e4.core.commands.EHandlerService.class)
2425
public class HandlerServiceCreationFunction extends ContextFunction {
2526

2627
@Override

bundles/org.eclipse.e4.ui.bindings/.settings/org.eclipse.pde.ds.annotations.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dsVersion=V1_3
1+
dsVersion=V1_4
22
eclipse.preferences.version=1
33
enabled=true
44
generateBundleActivationPolicyLazy=true

bundles/org.eclipse.e4.ui.bindings/src/org/eclipse/e4/ui/bindings/internal/BindingServiceCreationFunction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2014 IBM Corporation and others.
2+
* Copyright (c) 2009, 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
@@ -20,7 +20,8 @@
2020
import org.eclipse.e4.core.contexts.IEclipseContext;
2121
import org.osgi.service.component.annotations.Component;
2222

23-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.ui.bindings.EBindingService")
23+
@Component(service = IContextFunction.class)
24+
@IContextFunction.ServiceContextKey(org.eclipse.e4.ui.bindings.EBindingService.class)
2425
public class BindingServiceCreationFunction extends ContextFunction {
2526

2627
@Override

bundles/org.eclipse.e4.ui.services/.settings/org.eclipse.pde.ds.annotations.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
dsVersion=V1_3
1+
dsVersion=V1_4
22
eclipse.preferences.version=1
33
enabled=true
44
generateBundleActivationPolicyLazy=true

bundles/org.eclipse.e4.ui.services/src/org/eclipse/e4/ui/services/events/EventBrokerFactory.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2009, 2016 IBM Corporation and others.
2+
* Copyright (c) 2009, 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
@@ -23,12 +23,11 @@
2323
import org.osgi.service.component.annotations.Reference;
2424
import org.osgi.service.event.EventAdmin;
2525

26-
27-
2826
/**
2927
* Use this class to obtain an instance of {@link IEventBroker}.
3028
*/
31-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.services.events.IEventBroker")
29+
@Component(service = IContextFunction.class)
30+
@IContextFunction.ServiceContextKey(IEventBroker.class)
3231
public class EventBrokerFactory extends ContextFunction {
3332

3433
// mandatory static reference to EventAdmin to ensure it is available before
@@ -50,4 +49,3 @@ public Object compute(IEclipseContext context, String contextKey) {
5049
return broker;
5150
}
5251
}
53-

bundles/org.eclipse.e4.ui.workbench.swt/.settings/org.eclipse.pde.ds.annotations.prefs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classpath=true
2-
dsVersion=V1_3
2+
dsVersion=V1_4
33
eclipse.preferences.version=1
44
enabled=true
55
generateBundleActivationPolicyLazy=true

bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/MenuServiceCreationFunction.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2016 IBM Corporation and others.
2+
* Copyright (c) 2010, 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
@@ -20,7 +20,8 @@
2020
import org.eclipse.e4.core.di.InjectionException;
2121
import org.osgi.service.component.annotations.Component;
2222

23-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.ui.services.EMenuService")
23+
@Component(service = IContextFunction.class)
24+
@IContextFunction.ServiceContextKey(org.eclipse.e4.ui.services.EMenuService.class)
2425
public class MenuServiceCreationFunction extends ContextFunction {
2526

2627
@Override

bundles/org.eclipse.e4.ui.workbench.swt/src/org/eclipse/e4/ui/internal/workbench/swt/StatusReporterCreationFunction.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2010, 2016 IBM Corporation and others.
2+
* Copyright (c) 2010, 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,13 +19,13 @@
1919
import org.eclipse.e4.core.contexts.IEclipseContext;
2020
import org.osgi.service.component.annotations.Component;
2121

22-
@Component(service = IContextFunction.class, property = "service.context.key=org.eclipse.e4.core.services.statusreporter.StatusReporter")
22+
@Component(service = IContextFunction.class)
23+
@IContextFunction.ServiceContextKey(org.eclipse.e4.core.services.statusreporter.StatusReporter.class)
2324
public class StatusReporterCreationFunction extends ContextFunction {
2425

2526
@Override
2627
public Object compute(IEclipseContext context, String contextKey) {
27-
return ContextInjectionFactory.make(WorkbenchStatusReporter.class,
28-
context);
28+
return ContextInjectionFactory.make(WorkbenchStatusReporter.class, context);
2929
}
3030

3131
}

0 commit comments

Comments
 (0)