diff --git a/Goko/src/goko/contribution/ViewMenuDynamicContribution.java b/Goko/src/goko/contribution/ViewMenuDynamicContribution.java index fcd207e5..d6da6811 100644 --- a/Goko/src/goko/contribution/ViewMenuDynamicContribution.java +++ b/Goko/src/goko/contribution/ViewMenuDynamicContribution.java @@ -11,6 +11,7 @@ import java.util.Map; import javax.inject.Inject; +import javax.inject.Named; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -25,12 +26,15 @@ import org.eclipse.e4.ui.model.application.commands.MParameter; import org.eclipse.e4.ui.model.application.ui.basic.MPart; import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem; +import org.eclipse.e4.ui.model.application.ui.menu.MMenu; import org.eclipse.e4.ui.model.application.ui.menu.MMenuElement; import org.eclipse.e4.ui.model.application.ui.menu.MMenuFactory; import org.eclipse.e4.ui.workbench.modeling.EModelService; import org.eclipse.e4.ui.workbench.modeling.EPartService; +import org.goko.core.log.GkLog; public class ViewMenuDynamicContribution { + private static GkLog LOG = GkLog.getLogger(ViewMenuDynamicContribution.class); public static final String VIEW_MENU_ENTRY_TAG = "view"; public static final String VIEW_NAME_PARAMETER = "org.goko.commands.toggleView.viewName"; @@ -43,22 +47,28 @@ public class ViewMenuDynamicContribution { private MApplication application; @Inject private ECommandService commandService; + @Inject + @Optional + @Named("goko.menu.window") + private MMenu menu; @AboutToHide public void aboutToHide(List items) { - } @AboutToShow - public void aboutToShow(List items) { - + public void aboutToShow(List items) { Collection parts = partService.getParts(); Iterator iterator = parts.iterator(); List children = new ArrayList(); - List existingChidlrenIds = new ArrayList(); + List existingChidlrenIds = new ArrayList(); + MMenu viewMenu = getViewMenu(); // Get existing items. Dirty hack against eclipse bug ? + for (MMenuElement windowsElement : viewMenu.getChildren()) { + existingChidlrenIds.add(windowsElement.getElementId()); + } List commands = modelService.findElements(application, "goko.command.toggleView", MCommand.class, null); if(CollectionUtils.isNotEmpty(commands)){ @@ -95,6 +105,22 @@ public void aboutToShow(List items) { //viewSubmenu.getChildren().addAll(children); } } + + private MMenu getViewMenu(){ + List mainMenus = application.getChildren().get(0).getMainMenu().getChildren(); + for (MMenuElement mMenuElement : mainMenus) { + if(StringUtils.equals(mMenuElement.getElementId(), "goko.menu.window")){ + MMenu windowsMenu = (MMenu) mMenuElement; + + for (MMenuElement windowsElement : windowsMenu.getChildren()) { + if(StringUtils.equals(windowsElement.getElementId(), "goko.menu.window.view")){ + return (MMenu) windowsElement; + } + } + } + } + return null; + } } diff --git a/GokoFeature/launch/Launch Goko.launch b/GokoFeature/launch/Launch Goko.launch index 03a31c0a..ed728351 100644 --- a/GokoFeature/launch/Launch Goko.launch +++ b/GokoFeature/launch/Launch Goko.launch @@ -23,7 +23,7 @@ - + diff --git a/org.goko.tools.zeroprobe/META-INF/MANIFEST.MF b/org.goko.tools.zeroprobe/META-INF/MANIFEST.MF index eefe5995..a39ffe3f 100644 --- a/org.goko.tools.zeroprobe/META-INF/MANIFEST.MF +++ b/org.goko.tools.zeroprobe/META-INF/MANIFEST.MF @@ -31,3 +31,4 @@ Import-Package: javax.annotation;version="1.2.0", org.eclipse.core.runtime;version="3.5.0", org.eclipse.e4.core.contexts, org.osgi.framework;version="1.3.0" +Bundle-ActivationPolicy: lazy diff --git a/org.goko.tools.zeroprobe/build.properties b/org.goko.tools.zeroprobe/build.properties index fb7e80a8..cffb2fb6 100644 --- a/org.goko.tools.zeroprobe/build.properties +++ b/org.goko.tools.zeroprobe/build.properties @@ -1,6 +1,7 @@ output.. = bin/ bin.includes = META-INF/,\ .,\ - resources/ + resources/,\ + plugin.xml source.. = src/,\ ui/ diff --git a/org.goko.tools.zeroprobe/resources/fragments/zeroProbeFragment.e4xmi b/org.goko.tools.zeroprobe/resources/fragments/zeroProbeFragment.e4xmi index 84cca961..38ca61b2 100644 --- a/org.goko.tools.zeroprobe/resources/fragments/zeroProbeFragment.e4xmi +++ b/org.goko.tools.zeroprobe/resources/fragments/zeroProbeFragment.e4xmi @@ -1,7 +1,7 @@ - + view diff --git a/org.goko.tools.zeroprobe/resources/icons/shape_align_left.png b/org.goko.tools.zeroprobe/resources/icons/shape_align_left.png new file mode 100644 index 00000000..aaedc41b Binary files /dev/null and b/org.goko.tools.zeroprobe/resources/icons/shape_align_left.png differ diff --git a/org.goko.tools.zeroprobe/target/MANIFEST.MF b/org.goko.tools.zeroprobe/target/MANIFEST.MF new file mode 100644 index 00000000..19e3a7aa --- /dev/null +++ b/org.goko.tools.zeroprobe/target/MANIFEST.MF @@ -0,0 +1,26 @@ +Manifest-Version: 1.0 +Bundle-SymbolicName: org.goko.tools.zeroprobe;singleton:=true +Bundle-Name: ZeropProbe +Bundle-Version: 0.3.5.201708012217 +Require-Bundle: org.goko.core;bundle-version="0.0.1",org.eclipse.e4.co + re.di;bundle-version="1.1.0",org.eclipse.e4.ui.workbench.renderers.sw + t;bundle-version="0.10.2",org.eclipse.e4.ui.workbench;bundle-version= + "0.10.3",org.eclipse.e4.ui.services;bundle-version="0.10.2",org.eclip + se.e4.ui.di;bundle-version="0.10.1",org.eclipse.swt;bundle-version="3 + .100.1",org.eclipse.core.commands;bundle-version="3.6.2",org.eclipse. + jface;bundle-version="3.8.102",javax.inject;bundle-version="1.0.0",or + g.eclipse.core.databinding;bundle-version="1.4.1",org.eclipse.core.da + tabinding.beans;bundle-version="1.2.200",org.eclipse.core.databinding + .observable;bundle-version="1.4.1",org.eclipse.core.databinding.prope + rty;bundle-version="1.4.200",org.eclipse.jface.databinding;bundle-ver + sion="1.6.200",com.ibm.icu,Goko;bundle-version="0.0.1",org.eclipse.e4 + .ui.model.workbench,org.eclipse.e4.core.di.extensions,org.eclipse.equ + inox.preferences,org.goko.tools.viewer.jogl;bundle-version="0.0.2",or + g.jogamp.jogl;bundle-version="2.0.2",org.goko.gcode.rs274ngcv3 +Bundle-ManifestVersion: 2 +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy +Import-Package: javax.annotation;version="1.2.0",org.eclipse.core.runt + ime;version="3.5.0",org.eclipse.e4.core.contexts,org.osgi.framework;v + ersion="1.3.0" + diff --git a/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart$1.class b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart$1.class new file mode 100644 index 00000000..4d2a41c8 Binary files /dev/null and b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart$1.class differ diff --git a/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart.class b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart.class new file mode 100644 index 00000000..d25a0133 Binary files /dev/null and b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/ZeroProbePart.class differ diff --git a/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController$1.class b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController$1.class new file mode 100644 index 00000000..6fbe658e Binary files /dev/null and b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController$1.class differ diff --git a/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController.class b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController.class new file mode 100644 index 00000000..945b4c3d Binary files /dev/null and b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeController.class differ diff --git a/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeModel.class b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeModel.class new file mode 100644 index 00000000..ab6cefb5 Binary files /dev/null and b/org.goko.tools.zeroprobe/target/classes/org/goko/tools/zeroprobe/controller/ZeroProbeModel.class differ diff --git a/org.goko.tools.zeroprobe/target/local-artifacts.properties b/org.goko.tools.zeroprobe/target/local-artifacts.properties new file mode 100644 index 00000000..639160a2 --- /dev/null +++ b/org.goko.tools.zeroprobe/target/local-artifacts.properties @@ -0,0 +1,4 @@ +#Wed Aug 02 00:17:43 CEST 2017 +artifact.attached.p2metadata=G\:\\Git\\Goko\\org.goko.tools.zeroprobe\\target\\p2content.xml +artifact.main=G\:\\Git\\Goko\\org.goko.tools.zeroprobe\\target\\org.goko.tools.zeroprobe-0.3.5-SNAPSHOT.jar +artifact.attached.p2artifacts=G\:\\Git\\Goko\\org.goko.tools.zeroprobe\\target\\p2artifacts.xml diff --git a/org.goko.tools.zeroprobe/target/maven-archiver/pom.properties b/org.goko.tools.zeroprobe/target/maven-archiver/pom.properties new file mode 100644 index 00000000..e3ce3d86 --- /dev/null +++ b/org.goko.tools.zeroprobe/target/maven-archiver/pom.properties @@ -0,0 +1,5 @@ +#Generated by Maven +#Wed Aug 02 00:17:43 CEST 2017 +version=0.3.5-SNAPSHOT +groupId=org.goko +artifactId=org.goko.tools.zeroprobe diff --git a/org.goko.tools.zeroprobe/target/org.goko.tools.zeroprobe-0.3.5-SNAPSHOT.jar b/org.goko.tools.zeroprobe/target/org.goko.tools.zeroprobe-0.3.5-SNAPSHOT.jar new file mode 100644 index 00000000..f4ac4d08 Binary files /dev/null and b/org.goko.tools.zeroprobe/target/org.goko.tools.zeroprobe-0.3.5-SNAPSHOT.jar differ diff --git a/org.goko.tools.zeroprobe/target/p2artifacts.xml b/org.goko.tools.zeroprobe/target/p2artifacts.xml new file mode 100644 index 00000000..b51adce9 --- /dev/null +++ b/org.goko.tools.zeroprobe/target/p2artifacts.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/org.goko.tools.zeroprobe/target/p2content.xml b/org.goko.tools.zeroprobe/target/p2content.xml new file mode 100644 index 00000000..7399105e --- /dev/null +++ b/org.goko.tools.zeroprobe/target/p2content.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Bundle-SymbolicName: org.goko.tools.zeroprobe;singleton:=true Bundle-Version: 0.3.5.201708012217 + + + + +