Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Schindl2014-04-02 07:36:10 -0400
committerTom Schindl2014-04-02 07:36:10 -0400
commit38c42e1bb5bdcdff674d111413763642be636da5 (patch)
tree65dd9fdc28fb858c38e4c01416ff05c6f98f2c0c /testcases/org.eclipse.fx.testcases.e4
parent7d62ba635b8bb4aebba55593d21c6c6a9e116273 (diff)
downloadorg.eclipse.efxclipse-38c42e1bb5bdcdff674d111413763642be636da5.tar.gz
org.eclipse.efxclipse-38c42e1bb5bdcdff674d111413763642be636da5.tar.xz
org.eclipse.efxclipse-38c42e1bb5bdcdff674d111413763642be636da5.zip
Bug 431338 - Dynamically add ViewMenu to Part
Diffstat (limited to 'testcases/org.eclipse.fx.testcases.e4')
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/.classpath14
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/.settings/org.eclipse.jdt.core.prefs6
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/Application.e4xmi1
-rwxr-xr-xtestcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF2
-rw-r--r--testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/Test_431338.java44
5 files changed, 56 insertions, 11 deletions
diff --git a/testcases/org.eclipse.fx.testcases.e4/.classpath b/testcases/org.eclipse.fx.testcases.e4/.classpath
index 098194ca4..b862a296d 100755
--- a/testcases/org.eclipse.fx.testcases.e4/.classpath
+++ b/testcases/org.eclipse.fx.testcases.e4/.classpath
@@ -1,7 +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>
+<?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.8"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/testcases/org.eclipse.fx.testcases.e4/.settings/org.eclipse.jdt.core.prefs b/testcases/org.eclipse.fx.testcases.e4/.settings/org.eclipse.jdt.core.prefs
index f42de363a..0c68a61dc 100755
--- a/testcases/org.eclipse.fx.testcases.e4/.settings/org.eclipse.jdt.core.prefs
+++ b/testcases/org.eclipse.fx.testcases.e4/.settings/org.eclipse.jdt.core.prefs
@@ -1,7 +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.codegen.targetPlatform=1.8
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
diff --git a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
index e46fa0249..daa0642e2 100755
--- a/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
+++ b/testcases/org.eclipse.fx.testcases.e4/Application.e4xmi
@@ -46,6 +46,7 @@
</children>
<children xsi:type="basic:Part" xmi:id="_UXm2oI3yEeOEhJYRfEsdog" elementId="org.eclipse.fx.testcases.e4.part.17" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.TestFXMLBuilder" label="FXMLLoader" closeable="true"/>
<children xsi:type="basic:Part" xmi:id="_NbT9cI3zEeOEhJYRfEsdog" elementId="org.eclipse.fx.testcases.e4.part.18" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.TestExtendedFXMLBuilder" label="ExtendedFXMLLoader"/>
+ <children xsi:type="basic:Part" xmi:id="__dr90LpZEeOpi709HEnsKw" elementId="org.eclipse.fx.testcases.e4.part.20" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.Test_431338" label="Test_431338"/>
</children>
<children xsi:type="basic:Part" xmi:id="_txxY4OMsEeGP-5z69KadAQ" elementId="org.eclipse.fx.testcases.e4.part.4" toBeRendered="false" containerData="10" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.ContentPanel" label="C4"/>
<children xsi:type="basic:Part" xmi:id="_-czbgLpMEeOpi709HEnsKw" elementId="org.eclipse.fx.testcases.e4.part.19" containerData="10" contributionURI="bundleclass://org.eclipse.fx.testcases.e4/org.eclipse.fx.testcases.e4.parts.Test_431391" label="Label Test"/>
diff --git a/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF b/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
index e8ab01fb7..9c33194d6 100755
--- a/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
+++ b/testcases/org.eclipse.fx.testcases.e4/META-INF/MANIFEST.MF
@@ -65,4 +65,4 @@ Import-Package: javafx.animation;version="2.0.0",
javax.inject;version="1.0.0",
org.eclipse.fx.ui.lifecycle,
org.osgi.framework;version="1.3.0"
-Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/Test_431338.java b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/Test_431338.java
new file mode 100644
index 000000000..918db8bff
--- /dev/null
+++ b/testcases/org.eclipse.fx.testcases.e4/src/org/eclipse/fx/testcases/e4/parts/Test_431338.java
@@ -0,0 +1,44 @@
+package org.eclipse.fx.testcases.e4.parts;
+
+import javafx.event.ActionEvent;
+import javafx.scene.control.Button;
+import javafx.scene.layout.BorderPane;
+
+import javax.annotation.PostConstruct;
+import javax.inject.Inject;
+
+import org.eclipse.e4.ui.model.application.ui.basic.MPart;
+import org.eclipse.e4.ui.model.application.ui.menu.MDirectMenuItem;
+import org.eclipse.e4.ui.model.application.ui.menu.MMenu;
+import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory;
+
+public class Test_431338 {
+ @Inject
+ MPart part;
+
+ @PostConstruct
+ void init(BorderPane parent) {
+ Button b = new Button("Add ViewMenu");
+ b.setOnAction(this::showHideViewMenu);
+
+ parent.setCenter(b);
+ }
+
+ void showHideViewMenu(ActionEvent e) {
+ if( ! part.getMenus().stream().filter(this::viewFilter).findFirst().isPresent() ) {
+ MMenu m = MMenuFactory.INSTANCE.createMenu();
+ m.getTags().add("ViewMenu");
+
+ MDirectMenuItem mi = MMenuFactory.INSTANCE.createDirectMenuItem();
+ mi.setLabel("Sample Item");
+ m.getChildren().add(mi);
+ part.getMenus().add(m);
+ }
+ }
+
+ boolean viewFilter(MMenu m) {
+ return m.getTags().contains("ViewMenu");
+ }
+
+
+}

Back to the top