Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'bundles/runtime')
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core.log4j/OSGI-INF/log4jlogger.xml3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF36
-rw-r--r--bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java32
-rw-r--r--bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/FXMLDocument.java17
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.classpath7
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.gitignore1
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.project33
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.pde.core.prefs4
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/META-INF/MANIFEST.MF18
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml8
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/build.properties5
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/pom.xml34
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java14
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java78
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java16
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java47
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreClose.java14
-rw-r--r--bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreShow.java14
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/META-INF/MANIFEST.MF3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseMenuRenderer.java127
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseStackRenderer.java30
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWorkbenchRendererFactory.java3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WMenu.java2
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/META-INF/MANIFEST.MF3
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefMenuRenderer.java13
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefPartMenuRenderer.java12
-rwxr-xr-xbundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefToolItemMenuRenderer.java7
28 files changed, 576 insertions, 12 deletions
diff --git a/bundles/runtime/org.eclipse.fx.core.log4j/OSGI-INF/log4jlogger.xml b/bundles/runtime/org.eclipse.fx.core.log4j/OSGI-INF/log4jlogger.xml
index e8edcb407..7f3d347dc 100755
--- a/bundles/runtime/org.eclipse.fx.core.log4j/OSGI-INF/log4jlogger.xml
+++ b/bundles/runtime/org.eclipse.fx.core.log4j/OSGI-INF/log4jlogger.xml
@@ -2,4 +2,7 @@
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="org.eclipse.fx.core.log4j.log4jlogger">
<implementation class="org.eclipse.fx.core.log4j.Log4JLoggerFactory"/>
<property name="service.ranking" type="Integer" value="1"/>
+ <service>
+ <provide interface="org.eclipse.fx.core.log.LoggerFactory"/>
+ </service>
</scr:component>
diff --git a/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF
index 79e797d63..6ab24ec8e 100755
--- a/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.core/META-INF/MANIFEST.MF
@@ -4,8 +4,42 @@ Bundle-Name: %Bundle-Name
Bundle-SymbolicName: org.eclipse.fx.core
Bundle-Version: 0.8.1.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
-Import-Package: javax.inject;version="1.0.0"
+Import-Package: javafx.animation;version="2.2.0",
+ javafx.application;version="2.2.0",
+ javafx.beans;version="2.2.0",
+ javafx.beans.binding;version="2.2.0",
+ javafx.beans.property;version="2.2.0",
+ javafx.beans.property.adapter;version="2.2.0",
+ javafx.beans.value;version="2.2.0",
+ javafx.collections;version="2.2.0",
+ javafx.concurrent;version="2.2.0",
+ javafx.css;version="8.0.0",
+ javafx.embed.swing;version="2.2.0",
+ javafx.embed.swt;version="2.2.0",
+ javafx.event;version="2.2.0",
+ javafx.fxml;version="2.2.0",
+ javafx.geometry;version="2.2.0",
+ javafx.scene;version="2.2.0",
+ javafx.scene.canvas;version="2.2.0",
+ javafx.scene.chart;version="2.2.0",
+ javafx.scene.control;version="2.2.0",
+ javafx.scene.control.cell;version="2.2.0",
+ javafx.scene.effect;version="2.2.0",
+ javafx.scene.image;version="2.2.0",
+ javafx.scene.input;version="2.2.0",
+ javafx.scene.layout;version="2.2.0",
+ javafx.scene.media;version="2.2.0",
+ javafx.scene.paint;version="2.2.0",
+ javafx.scene.shape;version="2.2.0",
+ javafx.scene.text;version="2.2.0",
+ javafx.scene.transform;version="2.2.0",
+ javafx.scene.web;version="2.2.0",
+ javafx.stage;version="2.2.0",
+ javafx.util;version="2.2.0",
+ javafx.util.converter;version="2.2.0",
+ javax.inject;version="1.0.0"
Export-Package: org.eclipse.fx.core,
+ org.eclipse.fx.core.fxml,
org.eclipse.fx.core.log,
org.eclipse.fx.core.update
Bundle-Vendor: %Bundle-Vendor
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java
new file mode 100644
index 000000000..835bc7880
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/ExtendedFXMLLoader.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.fxml;
+
+import java.io.IOException;
+
+import javafx.fxml.FXMLLoader;
+
+
+public class ExtendedFXMLLoader {
+ public <T> T load(ClassLoader cl, String path) throws IOException {
+ try {
+ Class<?> clazz = cl.loadClass(path.replace('/', '.'));
+ FXMLDocument<T> d = (FXMLDocument<T>) clazz.newInstance();
+ return d.load(null);
+ } catch (ClassNotFoundException e) {
+ return FXMLLoader.load(cl.getResource(path));
+ } catch (InstantiationException e) {
+ throw new IOException(e);
+ } catch (IllegalAccessException e) {
+ throw new IOException(e);
+ }
+ }
+}
diff --git a/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/FXMLDocument.java b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/FXMLDocument.java
new file mode 100644
index 000000000..5c11234be
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.core/src/org/eclipse/fx/core/fxml/FXMLDocument.java
@@ -0,0 +1,17 @@
+/*******************************************************************************
+ * Copyright (c) 2013 BestSolution.at and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.fx.core.fxml;
+
+import java.util.ResourceBundle;
+
+public abstract class FXMLDocument<T> {
+ public abstract T load(ResourceBundle bundle);
+}
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.classpath b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.classpath
new file mode 100644
index 000000000..098194ca4
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.gitignore b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.gitignore
new file mode 100644
index 000000000..5e56e040e
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project
new file mode 100644
index 000000000..7b38d57b1
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.fx.ui.lifecycle</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ds.core.builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.jdt.core.prefs b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 000000000..f42de363a
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.7
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.pde.core.prefs b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.pde.core.prefs
new file mode 100644
index 000000000..e8ff8be0b
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/.settings/org.eclipse.pde.core.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false
+resolve.requirebundle=false
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.ui.lifecycle/META-INF/MANIFEST.MF
new file mode 100644
index 000000000..795322649
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/META-INF/MANIFEST.MF
@@ -0,0 +1,18 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Lifecycle
+Bundle-SymbolicName: org.eclipse.fx.ui.lifecycle
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Require-Bundle: org.eclipse.e4.ui.model.workbench,
+ org.eclipse.e4.core.di,
+ org.eclipse.e4.core.contexts,
+ org.eclipse.e4.core.services,
+ org.eclipse.e4.ui.workbench,
+ org.eclipse.emf.ecore;bundle-version="2.9.0"
+Export-Package: org.eclipse.fx.ui.lifecycle,
+ org.eclipse.fx.ui.lifecycle.annotations
+Import-Package: javax.annotation;version="1.1.0",
+ javax.inject;version="1.0.0"
+Service-Component: OSGI-INF/component.xml
+Bundle-ActivationPolicy: lazy
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
new file mode 100644
index 000000000..86219f015
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/OSGI-INF/component.xml
@@ -0,0 +1,8 @@
+<?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.LifecycleContextFunction"/>
+ <service>
+ <provide interface="org.eclipse.e4.core.contexts.IContextFunction"/>
+ </service>
+ <property name="service.context.key" type="String" value="org.eclipse.fx.ui.lifecycle.ELifecycleService"/>
+</scr:component> \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/build.properties b/bundles/runtime/org.eclipse.fx.ui.lifecycle/build.properties
new file mode 100644
index 000000000..c58ea2178
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/pom.xml b/bundles/runtime/org.eclipse.fx.ui.lifecycle/pom.xml
new file mode 100644
index 000000000..a807df10d
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/pom.xml
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <name>e(fx)clipse - Runtime - e4 - Lifecycle Service API</name>
+ <groupId>org.eclipse.fx</groupId>
+ <artifactId>org.eclipse.fx.ui.lifecycle</artifactId>
+ <packaging>eclipse-plugin</packaging>
+
+ <parent>
+ <groupId>org.eclipse.fx</groupId>
+ <artifactId>releng</artifactId>
+ <relativePath>../../../releng/org.eclipse.fx.releng/pom.xml</relativePath>
+ <version>0.8.1-SNAPSHOT</version>
+ </parent>
+
+ <build>
+ <resources>
+ <!-- to ensure that the feature lookup of the ui test works -->
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>META-INF/</include>
+ </includes>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-source-plugin</artifactId>
+ </plugin>
+ </plugins>
+ </build>
+
+</project> \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java
new file mode 100644
index 000000000..a646b7da6
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleContextFunction.java
@@ -0,0 +1,14 @@
+package org.eclipse.fx.ui.internal.lifecycle;
+
+import org.eclipse.e4.core.contexts.ContextFunction;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+
+public class LifecycleContextFunction extends ContextFunction {
+
+ @Override
+ public Object compute(IEclipseContext context, String contextKey) {
+ return ContextInjectionFactory.make(LifecycleServiceImpl.class, context);
+ }
+
+} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java
new file mode 100644
index 000000000..54316919d
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/internal/lifecycle/LifecycleServiceImpl.java
@@ -0,0 +1,78 @@
+package org.eclipse.fx.ui.internal.lifecycle;
+
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import javax.inject.Inject;
+
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.services.contributions.IContributionFactory;
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.MContext;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.workbench.modeling.EModelService;
+import org.eclipse.fx.ui.lifecycle.ELifecycleService;
+import org.eclipse.fx.ui.lifecycle.LifecycleAddon;
+
+public class LifecycleServiceImpl implements ELifecycleService{
+
+ @Inject
+ private EModelService modelService;
+
+ @Inject
+ private MApplication app;
+
+ @Inject
+ private IContributionFactory factory;
+
+ public void registerLifecycleURI(MUIElement element, String lifecycleURI) {
+ Set<Object> contributions = (Set<Object>) element.getTransientData().get(LifecycleAddon.LIFECYCLE_TRANSIENT_KEY);
+ if (contributions == null) {
+ contributions = new HashSet<Object>();
+ element.getTransientData().put(LifecycleAddon.LIFECYCLE_TRANSIENT_KEY, contributions);
+ }
+
+ Object object = factory.create(lifecycleURI, app.getContext());
+ contributions.add(object);
+
+ }
+
+ public boolean validateAnnotation(Class annotationClass, MUIElement element, IEclipseContext context) {
+ return validateLifecycleAnnotation(annotationClass, getContextForParent(element), context, element);
+ }
+
+ private boolean validateLifecycleAnnotation(Class clazz, IEclipseContext parentContext,
+ IEclipseContext partContext, MUIElement part) {
+ Set<Object> set = (Set<Object>) part.getTransientData().get(LifecycleAddon.LIFECYCLE_TRANSIENT_KEY);
+ if (set!=null){
+ for (Object object : set) {
+ Object invokeResult = ContextInjectionFactory.invoke(object, clazz, parentContext, partContext,true);
+ if (invokeResult!=null){//supports void methods
+ return (boolean)invokeResult;
+ }
+ else return true;
+ }
+ }
+ return true;
+ }
+ private IEclipseContext getContextForParent(MUIElement element) {
+ return modelService.getContainingContext(element);
+ }
+
+ private IEclipseContext getModelContext(MUIElement part) {
+ if (part instanceof MContext) {
+ return ((MContext) part).getContext();
+ }
+ return getContextForParent(part);
+ }
+
+ @Override
+ public void unregisterLifecycleContribution(MUIElement element,
+ Object contribution) {
+ Set<Object> objects = (Set<Object>) element.getTransientData().get(LifecycleAddon.LIFECYCLE_TRANSIENT_KEY);
+ if (objects!=null) objects.remove(contribution);
+ }
+
+} \ No newline at end of file
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
new file mode 100644
index 000000000..fd1afe872
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/ELifecycleService.java
@@ -0,0 +1,16 @@
+package org.eclipse.fx.ui.lifecycle;
+
+import java.lang.annotation.Annotation;
+
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+
+public interface ELifecycleService {
+
+ public void registerLifecycleURI(MUIElement element, String lifecycleURI);
+
+ public void unregisterLifecycleContribution(MUIElement element, Object contribution);
+
+ public boolean validateAnnotation(Class<? extends Annotation> annotationClass, MUIElement element, IEclipseContext context);
+
+} \ 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
new file mode 100644
index 000000000..fc07466aa
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/LifecycleAddon.java
@@ -0,0 +1,47 @@
+package org.eclipse.fx.ui.lifecycle;
+
+import java.util.List;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.eclipse.e4.ui.model.application.MApplication;
+import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+
+//when we are ready to ditch the tag-based stuff we simply swap the addon
+public class LifecycleAddon {
+
+ @Inject
+ MApplication app;
+
+// @Inject
+// EModelService modelService;
+
+ @Inject
+ ELifecycleService lifecycleService;
+
+ public static final String LIFECYCLE_TRANSIENT_KEY="EFX_LIFECYCLE";
+
+ public static final String LIFECYCLE_TAG_PREFIX = "EFX_LC:";
+
+ @PostConstruct
+ public void postConstruct(){
+ TreeIterator<EObject> it = EcoreUtil.getAllContents((EObject)app, true);
+ while( it.hasNext() ) {
+ EObject e = it.next();
+ if( e instanceof MUIElement ) {
+ MUIElement element = (MUIElement) e;
+ List<String> tags = element.getTags();
+ for (String tag: tags) {
+ if (tag.startsWith(LIFECYCLE_TAG_PREFIX)) {
+ lifecycleService.registerLifecycleURI(element,tag.substring(LIFECYCLE_TAG_PREFIX.length()));
+ }
+ }
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreClose.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreClose.java
new file mode 100644
index 000000000..5e4960ac8
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreClose.java
@@ -0,0 +1,14 @@
+package org.eclipse.fx.ui.lifecycle.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Documented
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PreClose {
+
+} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreShow.java b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreShow.java
new file mode 100644
index 000000000..4fbb42a46
--- /dev/null
+++ b/bundles/runtime/org.eclipse.fx.ui.lifecycle/src/org/eclipse/fx/ui/lifecycle/annotations/PreShow.java
@@ -0,0 +1,14 @@
+package org.eclipse.fx.ui.lifecycle.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Documented
+@Target({ ElementType.METHOD })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface PreShow {
+
+} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/META-INF/MANIFEST.MF
index 7f25b56bb..8f4b13c11 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/META-INF/MANIFEST.MF
@@ -13,7 +13,8 @@ Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="0.10.1",
org.eclipse.fx.ui.workbench.base;bundle-version="0.8.1",
org.eclipse.e4.ui.di;bundle-version="0.10.1",
org.eclipse.fx.core;bundle-version="0.8.1",
- org.eclipse.emf.ecore;bundle-version="2.9.0"
+ org.eclipse.emf.ecore;bundle-version="2.9.0",
+ org.eclipse.fx.ui.lifecycle
Import-Package: javax.annotation;version="1.0.0",
javax.inject;version="1.0.0",
org.osgi.service.event;version="1.3.0"
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseMenuRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseMenuRenderer.java
index 8722825f3..7e43d36c2 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseMenuRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseMenuRenderer.java
@@ -10,21 +10,47 @@
*******************************************************************************/
package org.eclipse.fx.ui.workbench.renderers.base;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
+import java.util.List;
import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+import org.eclipse.e4.core.contexts.ContextInjectionFactory;
+import org.eclipse.e4.core.contexts.IEclipseContext;
+import org.eclipse.e4.core.services.contributions.IContributionFactory;
import org.eclipse.e4.core.services.events.IEventBroker;
+import org.eclipse.e4.ui.di.AboutToHide;
+import org.eclipse.e4.ui.di.AboutToShow;
import org.eclipse.e4.ui.model.application.ui.MUIElement;
+import org.eclipse.e4.ui.model.application.ui.menu.MDynamicMenuContribution;
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.fx.core.log.Log;
+import org.eclipse.fx.core.log.Logger;
+import org.eclipse.fx.ui.lifecycle.ELifecycleService;
+import org.eclipse.fx.ui.lifecycle.annotations.PreClose;
+import org.eclipse.fx.ui.lifecycle.annotations.PreShow;
import org.eclipse.fx.ui.workbench.renderers.base.EventProcessor.ChildrenHandler;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WMenu;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WMenuElement;
+@SuppressWarnings("restriction")
public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>> implements ChildrenHandler<MMenu, MMenuElement> {
+ @Inject
+ private ELifecycleService lifecycleService;
+
+ @Inject
+ private IContributionFactory contributionFactory;
+
+ @Log
+ @Inject
+ private Logger logger;
+
@PostConstruct
void init(IEventBroker eventBroker) {
EventProcessor.attachChildProcessor(eventBroker, this);
@@ -41,9 +67,74 @@ public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>>
handleShowing(element);
}
});
+ widget.setHidingCallback(new Runnable() {
+
+ @Override
+ public void run() {
+ IEclipseContext context = getModelContext(element).createChild("lifecycle");
+ context.set(MMenu.class, element);
+ lifecycleService.validateAnnotation(PreClose.class, element, context);
+
+
+ for( MMenuElement e : element.getChildren().toArray(new MMenuElement[0]) ) {
+ if( e instanceof MDynamicMenuContribution ) {
+ MDynamicMenuContribution dc = (MDynamicMenuContribution) e;
+
+ Object contrib = dc.getObject();
+ if( contrib != null ) {
+ List<MMenuElement> list = new ArrayList<MMenuElement>();
+ context.set(List.class, list);
+ try {
+ ContextInjectionFactory.invoke(contrib, AboutToHide.class, context, null);
+ element.getChildren().removeAll(list);
+ } catch(Throwable t) {
+ logger.debug("Unable to process the AboutToHide", t);
+ }
+
+ }
+ }
+ }
+
+ context.dispose();
+ }
+ });
}
void handleShowing(MMenu element) {
+ IEclipseContext context = getModelContext(element).createChild("lifecycle");
+ context.set(MMenu.class, element);
+ lifecycleService.validateAnnotation(PreShow.class, element, context);
+
+ // we iterate of the copy because it is modified in between
+ for( MMenuElement e : element.getChildren().toArray(new MMenuElement[0]) ) {
+ if( e instanceof MDynamicMenuContribution ) {
+ MDynamicMenuContribution dc = (MDynamicMenuContribution) e;
+ if( dc.getObject() == null && dc.getContributionURI() != null ) {
+ try {
+ //TODO On which context should we create the instance, would
+ dc.setObject(contributionFactory.create(dc.getContributionURI(), context));
+ } catch(Throwable t ) {
+ logger.debug("Unable to create contribution", t);
+ }
+ }
+
+ Object contrib = dc.getObject();
+ if( contrib != null ) {
+ List<MMenuElement> list = new ArrayList<MMenuElement>();
+ context.set(List.class, list);
+ try {
+ ContextInjectionFactory.invoke(contrib, AboutToShow.class, context, null);
+
+ int idx = element.getChildren().indexOf(e);
+ element.getChildren().addAll(idx, list);
+ } catch(Throwable t) {
+ logger.debug("Unable to process AboutToShow", t);
+ }
+
+ }
+ }
+ }
+
for (MMenuElement e : element.getChildren()) {
if (e.getRenderer() instanceof BaseItemRenderer) {
@SuppressWarnings("unchecked")
@@ -51,7 +142,10 @@ public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>>
r.checkEnablement(e);
}
}
+
+ context.dispose();
}
+
@Override
public void doProcessContent(MMenu element) {
@@ -69,6 +163,14 @@ public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>>
Iterator<MMenuElement> iterator = elements.iterator();
while (iterator.hasNext()) {
MMenuElement element = iterator.next();
+
+ if( element instanceof MDynamicMenuContribution ) {
+ MDynamicMenuContribution dc = (MDynamicMenuContribution) element;
+ if( dc.getObject() != null ) {
+
+ }
+ }
+
if (element.isToBeRendered() && element.isVisible() && element.getWidget() != null) {
hideChild(parent, element);
}
@@ -79,6 +181,11 @@ public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>>
Iterator<MMenuElement> iterator = elements.iterator();
while (iterator.hasNext()) {
MMenuElement element = iterator.next();
+// if (element instanceof MDynamicMenuContribution) {
+// MDynamicMenuContribution c = (MDynamicMenuContribution) element;
+// lifecycleService.registerLifecycleURI(element, c.getContributionURI());
+// continue;
+// }
if (element.isToBeRendered() && element.isVisible()) {
if (element.getWidget() == null) {
engineCreateWidget(element);
@@ -103,6 +210,26 @@ public abstract class BaseMenuRenderer<N> extends BaseRenderer<MMenu, WMenu<N>>
}
@Override
+ protected int getRenderedIndex(MUIElement parent, MUIElement element) {
+ EObject eElement = (EObject) element;
+
+ EObject container = eElement.eContainer();
+ @SuppressWarnings("unchecked")
+ List<MUIElement> list = (List<MUIElement>) container.eGet(eElement.eContainmentFeature());
+ int idx = 0;
+ for( MUIElement u : list ) {
+ if( u.isToBeRendered() && u.isVisible() && !(u instanceof MDynamicMenuContribution) ) {
+ if( u == element ) {
+ return idx;
+ }
+ idx++;
+ }
+ }
+ return -1;
+ }
+
+
+ @Override
public void hideChild(MMenu container, MUIElement changedObj) {
WMenu<N> menu = getWidget(container);
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseStackRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseStackRenderer.java
index e17c2e14a..2e2d2b376 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseStackRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseStackRenderer.java
@@ -33,13 +33,14 @@ import org.eclipse.e4.ui.model.application.ui.basic.MStackElement;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.workbench.UIEvents;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
+import org.eclipse.fx.ui.lifecycle.ELifecycleService;
+import org.eclipse.fx.ui.lifecycle.annotations.PreClose;
import org.eclipse.fx.ui.workbench.base.rendering.AbstractRenderer;
import org.eclipse.fx.ui.workbench.base.rendering.RendererFactory;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WCallback;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WLayoutedWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WPlaceholderWidget;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WStack;
-import org.eclipse.fx.ui.workbench.renderers.base.widget.WMinMaxableWidget.WMinMaxState;
import org.eclipse.fx.ui.workbench.renderers.base.widget.WStack.WStackItem;
import org.osgi.service.event.Event;
import org.osgi.service.event.EventHandler;
@@ -53,6 +54,10 @@ public abstract class BaseStackRenderer<N, I, IC> extends BaseRenderer<MPartStac
@Inject
MApplication application;
+ @Inject
+ ELifecycleService lifecycleService;
+
+
boolean inLazyInit;
@PostConstruct
@@ -345,16 +350,25 @@ public abstract class BaseStackRenderer<N, I, IC> extends BaseRenderer<MPartStac
IEclipseContext partContext = part.getContext();
IEclipseContext parentContext = getContextForParent(part);
// a part may not have a context if it hasn't been rendered
- IEclipseContext context = partContext == null ? parentContext : partContext;
+ IEclipseContext context = (partContext == null ? parentContext : partContext).createChild();
+ if( partContext == null ) {
+ context.set(MPart.class, part);
+ }
+
// Allow closes to be 'canceled'
EPartService partService = (EPartService) context.get(EPartService.class.getName());
- if (partService.savePart(part, true)) {
- partService.hidePart(part);
- return true;
+
+ try {
+ if (partService.savePart(part, true) && lifecycleService.validateAnnotation(PreClose.class, part, context)) {
+ partService.hidePart(part);
+ return true;
+ }
+ // the user has canceled out of the save operation, so don't close the
+ // part
+ return false;
+ } finally {
+ context.dispose();
}
- // the user has canceled out of the save operation, so don't close the
- // part
- return false;
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWorkbenchRendererFactory.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWorkbenchRendererFactory.java
index e65bb4519..92dba3513 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWorkbenchRendererFactory.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/BaseWorkbenchRendererFactory.java
@@ -28,6 +28,7 @@ import org.eclipse.e4.ui.model.application.ui.basic.MPartStack;
import org.eclipse.e4.ui.model.application.ui.basic.MTrimBar;
import org.eclipse.e4.ui.model.application.ui.basic.MWindow;
import org.eclipse.e4.ui.model.application.ui.basic.impl.BasicPackageImpl;
+import org.eclipse.e4.ui.model.application.ui.menu.MDynamicMenuContribution;
import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuItem;
import org.eclipse.e4.ui.model.application.ui.menu.MMenuSeparator;
@@ -156,7 +157,7 @@ public abstract class BaseWorkbenchRendererFactory implements RendererFactory {
partRenderer = make(getPartRendererClass());
}
return (R) partRenderer;
- } else if( modelObject instanceof MMenuItem ) {
+ } else if( modelObject instanceof MMenuItem && ! (modelObject instanceof MDynamicMenuContribution) ) {
if( menuItemRenderer == null ) {
menuItemRenderer = make(getMenuItemRendererClass());
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WMenu.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WMenu.java
index 864cfb270..7523e7992 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WMenu.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.base/src/org/eclipse/fx/ui/workbench/renderers/base/widget/WMenu.java
@@ -22,5 +22,7 @@ public interface WMenu<N> extends WMenuElement<MMenu> {
void setShowingCallback(Runnable showingCallback);
void removeElement(WMenuElement<MMenuElement> widget);
+
+ void setHidingCallback(Runnable hidingCallback);
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/META-INF/MANIFEST.MF b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/META-INF/MANIFEST.MF
index 09243d219..e99ce7132 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/META-INF/MANIFEST.MF
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/META-INF/MANIFEST.MF
@@ -25,7 +25,8 @@ Require-Bundle: org.eclipse.e4.ui.model.workbench;bundle-version="0.10.1",
org.eclipse.fx.ui.dialogs;bundle-version="0.8.1",
org.eclipse.emf.common;bundle-version="2.9.0",
org.eclipse.emf.ecore;bundle-version="2.9.0",
- org.eclipse.fx.osgi.util;bundle-version="0.8.1"
+ org.eclipse.fx.osgi.util;bundle-version="0.8.1",
+ org.eclipse.fx.ui.lifecycle;bundle-version="1.0.0"
Import-Package: javafx.application,
javafx.beans;version="2.0.0",
javafx.beans.property,
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefMenuRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefMenuRenderer.java
index db2a4354d..71f0b0b8d 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefMenuRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefMenuRenderer.java
@@ -40,6 +40,7 @@ public class DefMenuRenderer extends BaseMenuRenderer<Menu> {
public static class MenuImpl extends WWidgetImpl<Menu, MMenu> implements WMenu<Menu> {
private ToggleGroup group;
Runnable showingCallback;
+ Runnable hidingCallback;
@Override
protected Menu createWidget() {
@@ -57,6 +58,13 @@ public class DefMenuRenderer extends BaseMenuRenderer<Menu> {
}
}
});
+ m.setOnHiding(new EventHandler<Event>() {
+
+ @Override
+ public void handle(Event arg0) {
+ if (hidingCallback!=null) hidingCallback.run();
+ }
+ });
return m;
}
@@ -123,5 +131,10 @@ public class DefMenuRenderer extends BaseMenuRenderer<Menu> {
protected void setUserData(WWidgetImpl<Menu, MMenu> widget) {
getWidget().setUserData(widget);
}
+
+ @Override
+ public void setHidingCallback(Runnable hidingCallback) {
+ this.hidingCallback=hidingCallback;
+ }
}
}
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefPartMenuRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefPartMenuRenderer.java
index 434b7e99f..e14a0316f 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefPartMenuRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefPartMenuRenderer.java
@@ -44,6 +44,7 @@ public class DefPartMenuRenderer extends BasePartMenuRenderer<Control> {
private ContextMenu menu;
private ToggleGroup group;
Runnable showingCallback;
+ Runnable hidingCallback;
@Override
public void addStyleClasses(List<String> classnames) {
@@ -130,8 +131,19 @@ public class DefPartMenuRenderer extends BasePartMenuRenderer<Control> {
}
}
});
+ menu.setOnHiding(new EventHandler<WindowEvent>() {
+ @Override
+ public void handle(WindowEvent arg0) {
+ if (hidingCallback!=null) hidingCallback.run();
+ }
+ });
b.setContextMenu(menu);
return b;
+ }
+
+ @Override
+ public void setHidingCallback(Runnable hidingCallback) {
+ this.hidingCallback = hidingCallback;
}
}
} \ No newline at end of file
diff --git a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefToolItemMenuRenderer.java b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefToolItemMenuRenderer.java
index 0c1ed250b..130ccbe86 100755
--- a/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefToolItemMenuRenderer.java
+++ b/bundles/runtime/org.eclipse.fx.ui.workbench.renderers.fx/src/org/eclipse/fx/ui/workbench/renderers/fx/DefToolItemMenuRenderer.java
@@ -43,6 +43,7 @@ public class DefToolItemMenuRenderer extends BaseMenuRenderer<ToolItemMenu> {
static class WMenuImpl extends WWidgetImpl<ToolItemMenu, MMenu> implements WMenu<ToolItemMenu> {
private SplitMenuButton button;
Runnable showingCallback;
+ Runnable hidingCallback;
@Inject
public WMenuImpl(@Named(BaseRenderer.CONTEXT_DOM_ELEMENT) MMenu domElement) {
@@ -59,6 +60,7 @@ public class DefToolItemMenuRenderer extends BaseMenuRenderer<ToolItemMenu> {
}
}
});
+// this.button.hidingProperty???
}
@Override
@@ -110,6 +112,11 @@ public class DefToolItemMenuRenderer extends BaseMenuRenderer<ToolItemMenu> {
public void setShowingCallback(Runnable showingCallback) {
this.showingCallback = showingCallback;
}
+
+ @Override
+ public void setHidingCallback(Runnable hidingCallback) {
+ this.hidingCallback = hidingCallback;
+ }
}
} \ No newline at end of file

Back to the top