Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2011-05-24 00:08:57 +0000
committerspingel2011-05-24 00:08:57 +0000
commit468c6d9816b604e4c456011e48336c6a965a60a0 (patch)
tree9235d81aa445d228274b5f1c47fbdd63dbd71507 /org.eclipse.mylyn.tasks.ui
parent6d4bf8288711437291278ac867f86244a9d3c65c (diff)
downloadorg.eclipse.mylyn.tasks-468c6d9816b604e4c456011e48336c6a965a60a0.tar.gz
org.eclipse.mylyn.tasks-468c6d9816b604e4c456011e48336c6a965a60a0.tar.xz
org.eclipse.mylyn.tasks-468c6d9816b604e4c456011e48336c6a965a60a0.zip
NEW - bug 346153: Double clicking a repository in the team repositories view should open the repository properties
https://bugs.eclipse.org/bugs/show_bug.cgi?id=346153
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesNavigatorActionProvider.java44
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesView.java19
4 files changed, 50 insertions, 17 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
index d68c34f2f..e032f10f7 100644
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
@@ -15,6 +15,7 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.editors,
org.eclipse.ui.forms,
org.eclipse.ui.ide,
+ org.eclipse.ui.navigator;resolution:=optional,
org.eclipse.ui.views,
org.eclipse.ui.workbench.texteditor,
org.eclipse.mylyn.context.core;bundle-version="[3.0.0,4.0.0)",
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
index 5da35a966..b683f884e 100644
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ b/org.eclipse.mylyn.tasks.ui/plugin.xml
@@ -2000,6 +2000,9 @@
<commonSorter
class="org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesSorter">
</commonSorter>
+ <actionProvider
+ class="org.eclipse.mylyn.internal.tasks.ui.views.TaskRepositoriesNavigatorActionProvider">
+ </actionProvider>
</navigatorContent>
</extension>
<extension
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesNavigatorActionProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesNavigatorActionProvider.java
new file mode 100644
index 000000000..41e5bad5a
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesNavigatorActionProvider.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Tasktop Technologies.
+ * 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:
+ * Tasktop Technologies - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.views;
+
+import org.eclipse.mylyn.internal.provisional.commons.ui.actions.PropertiesAction;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionConstants;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+
+/**
+ * @author Steffen Pingel
+ */
+public class TaskRepositoriesNavigatorActionProvider extends CommonActionProvider {
+
+ private PropertiesAction propertiesAction;
+
+ public TaskRepositoriesNavigatorActionProvider() {
+ }
+
+ @Override
+ public void init(ICommonActionExtensionSite aSite) {
+ super.init(aSite);
+
+ this.propertiesAction = new PropertiesAction();
+ }
+
+ @Override
+ public void fillActionBars(IActionBars actionBars) {
+ super.fillActionBars(actionBars);
+
+ actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, propertiesAction);
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesView.java
index dccf8eb0a..5dbea9ee2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskRepositoriesView.java
@@ -11,9 +11,6 @@
package org.eclipse.mylyn.internal.tasks.ui.views;
-import org.eclipse.core.commands.NotEnabledException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -25,8 +22,8 @@ import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.mylyn.commons.core.StatusHandler;
import org.eclipse.mylyn.internal.provisional.commons.ui.GradientDrawer;
+import org.eclipse.mylyn.internal.provisional.commons.ui.WorkbenchUtil;
import org.eclipse.mylyn.internal.tasks.core.Category;
import org.eclipse.mylyn.internal.tasks.core.IRepositoryModelListener;
import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryAdapter;
@@ -50,9 +47,7 @@ import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.BaseSelectionListenerAction;
-import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.part.ViewPart;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
import org.eclipse.ui.themes.IThemeManager;
/**
@@ -183,17 +178,7 @@ public class TaskRepositoriesView extends ViewPart {
viewer.setInput(getViewSite());
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
- IHandlerService service = (IHandlerService) getSite().getService(IHandlerService.class);
- if (service != null) {
- try {
- service.executeCommand(IWorkbenchActionDefinitionIds.PROPERTIES, null);
- } catch (NotEnabledException e) {
- // ignore
- } catch (Exception e) {
- StatusHandler.log(new Status(IStatus.ERROR, TasksUiPlugin.ID_PLUGIN,
- "Opening repository properties failed", e)); //$NON-NLS-1$
- }
- }
+ WorkbenchUtil.openProperties(getSite());
}
});

Back to the top