Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-08-22 16:00:11 -0400
committerspingel2008-08-22 16:00:11 -0400
commite2bf27b59ee1e7e10f890162d766fe76cd36892a (patch)
treee80e0347220eaf9cb554cf30cfe70874e48bda91
parentd02c721f1fd8d144c1d827d0480a2311ebde68fe (diff)
downloadorg.eclipse.mylyn.tasks-e2bf27b59ee1e7e10f890162d766fe76cd36892a.tar.gz
org.eclipse.mylyn.tasks-e2bf27b59ee1e7e10f890162d766fe76cd36892a.tar.xz
org.eclipse.mylyn.tasks-e2bf27b59ee1e7e10f890162d766fe76cd36892a.zip
RESOLVED - bug 242997: shortcut for properties in Task Repositories view is missing
https://bugs.eclipse.org/bugs/show_bug.cgi?id=242997
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml21
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java4
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskRepositoryPropertyTester.java33
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java1
4 files changed, 55 insertions, 4 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
index 82eedece7..cbcacc34c 100644
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ b/org.eclipse.mylyn.tasks.ui/plugin.xml
@@ -1409,11 +1409,18 @@
value="1">
</count>
<iterate>
- <or>
+ <and>
<instanceof
value="org.eclipse.mylyn.tasks.core.TaskRepository">
</instanceof>
- </or>
+ <not>
+ <test
+ forcePluginActivation="false"
+ property="org.eclipse.mylyn.taskRepository.connectorKind"
+ value="local">
+ </test>
+ </not>
+ </and>
</iterate>
</and>
</enabledWhen>
@@ -1756,4 +1763,14 @@
parentId="org.eclipse.ui.textEditorScope">
</context>
</extension>
+ <extension
+ point="org.eclipse.core.expressions.propertyTesters">
+ <propertyTester
+ class="org.eclipse.mylyn.internal.tasks.ui.util.TaskRepositoryPropertyTester"
+ id="org.eclipse.mylyn.tasks.ui.propertyTester.taskRepository"
+ namespace="org.eclipse.mylyn.taskRepository"
+ properties="connectorKind"
+ type="org.eclipse.mylyn.tasks.core.TaskRepository">
+ </propertyTester>
+ </extension>
</plugin>
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
index 072f275e6..425707bb5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskEditorActionContributor.java
@@ -27,6 +27,7 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.internal.provisional.commons.ui.CommonImages;
import org.eclipse.mylyn.internal.tasks.core.AbstractTaskCategory;
+import org.eclipse.mylyn.internal.tasks.core.LocalTask;
import org.eclipse.mylyn.internal.tasks.core.UnmatchedTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.AddExistingTaskJob;
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
@@ -49,7 +50,6 @@ import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylyn.tasks.core.IRepositoryElement;
import org.eclipse.mylyn.tasks.core.ITask;
-import org.eclipse.mylyn.tasks.core.ITask.SynchronizationState;
import org.eclipse.mylyn.tasks.ui.TasksUiImages;
import org.eclipse.mylyn.tasks.ui.editors.AbstractTaskEditorPage;
import org.eclipse.mylyn.tasks.ui.editors.TaskEditor;
@@ -215,7 +215,7 @@ public class TaskEditorActionContributor extends MultiPageEditorActionBarContrib
showInTaskListAction.selectionChanged(selection);
manager.add(new Separator());
- if (task.getSynchronizationState() != SynchronizationState.OUTGOING_NEW) {
+ if (!(task instanceof LocalTask)) {
manager.add(synchronizeEditorAction);
}
manager.add(openWithBrowserAction);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskRepositoryPropertyTester.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskRepositoryPropertyTester.java
new file mode 100644
index 000000000..3278c46bd
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/util/TaskRepositoryPropertyTester.java
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Mylyn project committers 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
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.tasks.ui.util;
+
+import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.mylyn.tasks.core.TaskRepository;
+
+/**
+ * @author Jingwen Ou
+ */
+
+public class TaskRepositoryPropertyTester extends PropertyTester {
+
+ private static final String PROPERTY_CONNECTOR_KIND = "connectorKind";
+
+ public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
+ if (receiver instanceof TaskRepository) {
+ TaskRepository taskRepository = (TaskRepository) receiver;
+ if (PROPERTY_CONNECTOR_KIND.equals(property)) {
+ return taskRepository.getConnectorKind().equals(expectedValue);
+ }
+ }
+
+ return false;
+ }
+
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
index c83ef744a..5e0e44f4a 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/wizards/EditRepositoryWizard.java
@@ -86,6 +86,7 @@ public class EditRepositoryWizard extends Wizard implements INewWizard {
@Override
public void addPages() {
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind());
+ // TODO 3.1 pass repository
settingsPage = connectorUi.getSettingsPage(null);
if (settingsPage instanceof AbstractRepositorySettingsPage) {
((AbstractRepositorySettingsPage) settingsPage).setRepository(repository);

Back to the top