Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2014-05-04 12:24:17 -0400
committerFrank Becker2014-05-05 14:25:30 -0400
commit572047efc509fffef7b1cdc3def9e1483e3a641a (patch)
treeb2720fae2687e400ae1ee83538caa104366a1506
parentb1ed9f60da3ef37041635abe0d5beb4f9d3d1cec (diff)
downloadorg.eclipse.mylyn.tasks-572047efc509fffef7b1cdc3def9e1483e3a641a.tar.gz
org.eclipse.mylyn.tasks-572047efc509fffef7b1cdc3def9e1483e3a641a.tar.xz
org.eclipse.mylyn.tasks-572047efc509fffef7b1cdc3def9e1483e3a641a.zip
434057: Support for Luna M7
Change-Id: I69eb7a7ceb0b8d37cbb0c38697f59deb074c1e4d Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=434057
-rw-r--r--org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.tasks.core/build.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF3
-rw-r--r--org.eclipse.mylyn.tasks.ui/build.properties1
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java42
5 files changed, 43 insertions, 7 deletions
diff --git a/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF
index 3d1bc79d6..d7c3abc87 100644
--- a/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.core/META-INF/MANIFEST.MF
@@ -12,7 +12,8 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.mylyn.commons.net;bundle-version="3.8.0",
org.eclipse.mylyn.commons.repositories.core;bundle-version="1.0.0",
com.google.guava;bundle-version="15.0.0",
- org.apache.xerces;bundle-version="2.9.0";resolution:=optional
+ org.apache.xerces;bundle-version="2.9.0";resolution:=optional,
+ org.eclipse.jdt.annotation;bundle-version="[1.0.0,2.0.0)"
Export-Package: org.eclipse.mylyn.internal.tasks.core;x-friends:="org.eclipse.mylyn.tasks.ui,org.eclipse.mylyn.tasks.bugs",
org.eclipse.mylyn.internal.tasks.core.activity;x-friends:="org.eclipse.mylyn.tasks.ui,org.eclipse.mylyn.tasks.bugs",
org.eclipse.mylyn.internal.tasks.core.context;x-friends:="org.eclipse.mylyn.tasks.ui,org.eclipse.mylyn.tasks.bugs",
diff --git a/org.eclipse.mylyn.tasks.core/build.properties b/org.eclipse.mylyn.tasks.core/build.properties
index bfd49132b..53225309c 100644
--- a/org.eclipse.mylyn.tasks.core/build.properties
+++ b/org.eclipse.mylyn.tasks.core/build.properties
@@ -16,5 +16,4 @@ src.includes = about.html,\
schema/
source.. = src/
-additional.bundles = org.eclipse.jdt.annotation
jars.extra.classpath = platform:/plugin/org.eclipse.jdt.annotation
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
index abdf75acf..9c3f2741d 100644
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
@@ -32,7 +32,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.mylyn.monitor.core;bundle-version="3.8.0",
org.eclipse.mylyn.monitor.ui;bundle-version="3.8.0",
org.eclipse.mylyn.tasks.core;bundle-version="3.8.0",
- com.google.guava;bundle-version="15.0.0"
+ com.google.guava;bundle-version="15.0.0",
+ org.eclipse.jdt.annotation;bundle-version="[1.0.0,2.0.0)"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor
Export-Package: org.eclipse.mylyn.internal.tasks.ui;x-internal:=true,
diff --git a/org.eclipse.mylyn.tasks.ui/build.properties b/org.eclipse.mylyn.tasks.ui/build.properties
index 0cc50f7b3..5957a47b3 100644
--- a/org.eclipse.mylyn.tasks.ui/build.properties
+++ b/org.eclipse.mylyn.tasks.ui/build.properties
@@ -16,5 +16,4 @@ src.includes = about.html,\
schema/
source.. = src/
-additional.bundles = org.eclipse.jdt.annotation
jars.extra.classpath = platform:/plugin/org.eclipse.ui.navigator,platform:/plugin/org.eclipse.mylyn.discovery.ui,platform:/plugin/org.eclipse.jdt.annotation
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
index 547427c8e..1f0bad864 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
@@ -11,11 +11,15 @@
package org.eclipse.mylyn.internal.tasks.ui;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Collections;
import java.util.Set;
+import org.apache.commons.lang.reflect.MethodUtils;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.commons.ui.SelectionProviderAdapter;
import org.eclipse.mylyn.internal.tasks.core.ITaskListChangeListener;
@@ -40,6 +44,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Menu;
+import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
import org.eclipse.ui.internal.ObjectActionContributorManager;
@@ -229,10 +234,11 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
menuManager.addMenuListener(new IMenuListener() {
public void menuAboutToShow(IMenuManager manager) {
actionGroup.fillContextMenu(manager);
- // trims do not have a workbench part so there is no simple way of registering the
+ // trims do not have a workbench part so there is no simple way of registering the
// context menu
- ObjectActionContributorManager.getManager().contributeObjectActions(null, manager,
- activeTaskSelectionProvider);
+ if (!contributeObjectActionsOld(manager)) {
+ contributeObjectActionsNew(manager);
+ }
}
});
}
@@ -260,6 +266,36 @@ public class TaskTrimWidget extends WorkbenchWindowControlContribution {
activeTaskSelectionProvider.setSelection(StructuredSelection.EMPTY);
}
+ private boolean contributeObjectActionsOld(IMenuManager manager) {
+ try {
+ MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", //$NON-NLS-1$
+ new Object[] { null, manager, activeTaskSelectionProvider }, new Class[] { IWorkbenchPart.class,
+ IMenuManager.class, ISelectionProvider.class });
+ } catch (NoSuchMethodException e) {
+ return false;
+ } catch (IllegalAccessException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private boolean contributeObjectActionsNew(IMenuManager manager) {
+ try {
+ MethodUtils.invokeExactMethod(ObjectActionContributorManager.getManager(), "contributeObjectActions", //$NON-NLS-1$
+ new Object[] { null, manager, activeTaskSelectionProvider, Collections.EMPTY_SET }, new Class[] {
+ IWorkbenchPart.class, IMenuManager.class, ISelectionProvider.class, Set.class });
+ } catch (NoSuchMethodException e) {
+ return false;
+ } catch (IllegalAccessException e) {
+ return false;
+ } catch (InvocationTargetException e) {
+ return false;
+ }
+ return true;
+ }
+
// // From PerspectiveBarContributionItem
// private String shortenText(String taskLabel) {
// if (taskLabel == null || composite == null || composite.isDisposed()) {

Back to the top