Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2013-07-10 12:38:47 -0400
committerTom Schindl2013-07-10 12:38:47 -0400
commit366a3a6c6423c8edd6903ad03c6fd28560f7355d (patch)
tree368ad41eb1887c3ae0ffcc899e5a322e6505306a
parentb8a74442c5fb0a62d04722cb9164299fa4445af2 (diff)
downloadorg.eclipse.efxclipse-366a3a6c6423c8edd6903ad03c6fd28560f7355d.tar.gz
org.eclipse.efxclipse-366a3a6c6423c8edd6903ad03c6fd28560f7355d.tar.xz
org.eclipse.efxclipse-366a3a6c6423c8edd6903ad03c6fd28560f7355d.zip
Bug 410172 - [e4] add general lifecycle support for model elements
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.project5
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml2
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java (renamed from bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleCF.java)2
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java4
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java8
5 files changed, 12 insertions, 9 deletions
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project
index 5cb0f8e03..7b38d57b1 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project
@@ -20,6 +20,11 @@
<arguments>
</arguments>
</buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml b/bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml
index 75e44abbf..86219f015 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.ui.lifecycle">
- <implementation class="org.eclipse.fx.ui.internal.lifecycle.LifecycleCF"/>
+ <implementation class="org.eclipse.fx.ui.internal.lifecycle.LifecycleContextFunction"/>
<service>
<provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
</service>
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleCF.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java
index 263c76811..a646b7da6 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleCF.java
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java
@@ -4,7 +4,7 @@ import org.eclipse.e4.core.contexts.ContextFunction;
import org.eclipse.e4.core.contexts.ContextInjectionFactory;
import org.eclipse.e4.core.contexts.IEclipseContext;
-public class LifecycleCF extends ContextFunction {
+public class LifecycleContextFunction extends ContextFunction {
@Override
public Object compute(IEclipseContext context, String contextKey) {
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java
index 995de686d..cd1611b69 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java
@@ -1,5 +1,7 @@
package org.eclipse.fx.ui.lifecycle;
+import java.lang.annotation.Annotation;
+
import org.eclipse.e4.ui.model.application.ui.MUIElement;
public interface ELifecycleService {
@@ -8,6 +10,6 @@ public interface ELifecycleService {
public void unregisterLifecycleContribution(MUIElement element, Object contribution);
- public boolean validateAnnotation(Class annotationClass, MUIElement element);
+ public boolean validateAnnotation(Class<? extends Annotation> annotationClass, MUIElement element);
} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java
index fb3fb88f3..caa269d7f 100644
--- a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java
@@ -1,14 +1,10 @@
package org.eclipse.fx.ui.lifecycle;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import javax.annotation.PostConstruct;
import javax.inject.Inject;
-import org.eclipse.e4.core.contexts.ContextInjectionFactory;
-import org.eclipse.e4.core.services.contributions.IContributionFactory;
import org.eclipse.e4.ui.model.application.MApplication;
import org.eclipse.e4.ui.model.application.MApplicationElement;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
@@ -44,8 +40,8 @@ public class LifecycleAddon {
}
- private void process(Class<? extends MApplicationElement> clazz, MUIElement root) {
- List<MUIElement> elements = (List<MUIElement>) modelService.findElements(root, null, clazz, null);
+ private void process(Class<? extends MUIElement> clazz, MUIElement root) {
+ List<? extends MUIElement> elements = modelService.findElements(root, null, clazz, null);
for (MUIElement element : elements) {
//build lifecycle uris set (because no duplicates allowed)
List<String> tags = element.getTags();

Back to the top