diff options
author | Colin Ritchie | 2016-08-11 23:46:34 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2016-08-12 21:37:03 +0000 |
commit | 4b77d3f2081127abd2ee27500d84b7bd94d8ff70 (patch) | |
tree | bb78c02569f8d7617638cdfc0435bdfeddaae8d4 /org.eclipse.mylyn.tasks.ui | |
parent | 87d261761bc06e87322fdd61d94b264f451c4518 (diff) | |
download | org.eclipse.mylyn.tasks-4b77d3f2081127abd2ee27500d84b7bd94d8ff70.tar.gz org.eclipse.mylyn.tasks-4b77d3f2081127abd2ee27500d84b7bd94d8ff70.tar.xz org.eclipse.mylyn.tasks-4b77d3f2081127abd2ee27500d84b7bd94d8ff70.zip |
499581: Task Image is different when the task is owned by the user
Introduce the "Golden Clipboard" for tasks owned by the active user.
Change-Id: I4fed0b3dccf3b2e1199e792881ca369f9490903e
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=499581
Diffstat (limited to 'org.eclipse.mylyn.tasks.ui')
3 files changed, 28 insertions, 17 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-owned.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-owned.gif Binary files differnew file mode 100644 index 000000000..b32982724 --- /dev/null +++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-owned.gif diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java index 5cb813243..b387f6316 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java @@ -26,6 +26,7 @@ import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery; import org.eclipse.mylyn.internal.tasks.ui.Messages; +import org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector; import org.eclipse.mylyn.tasks.core.IRepositoryElement; @@ -44,7 +45,7 @@ import org.eclipse.ui.IEditorInput; /** * Extend to provide connector-specific UI extensions. TODO: consider refactoring into extension points - * + * * @author Mik Kersten * @since 2.0 */ @@ -59,7 +60,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Connectors should provide a one-argument constructor that can be used to pass the connector into the connector UI * in tests. Connectors must provide a default constructor so that they can be created via extension point. - * + * * @param connector * the task repository connector * @noreference This method is not intended to be referenced by clients. @@ -103,7 +104,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Connectors can implement this method if they need to open a wizard dialog before opening a new subtask editor. - * + * * @since 3.18 */ @Nullable @@ -115,7 +116,7 @@ public abstract class AbstractRepositoryConnectorUi { * Override to return a custom task editor ID. If overriding this method the connector becomes responsible for * showing the additional pages handled by the default task editor. As of Mylyn 2.0M2 these are the Planning and * Context pages. - * + * * @since 3.0 */ @NonNull @@ -128,7 +129,7 @@ public abstract class AbstractRepositoryConnectorUi { * this method to return a custom task editor input. The connector author must ensure the corresponding editor is * capable of opening this editor input and will likely need to override * AbstractRepositoryConnectorUi.getTaskEditorId() as well. - * + * * @param repository * - task repository for which to construct an editor * @param task @@ -144,7 +145,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Contributions to the UI legend. - * + * * @deprecated use {@link #getLegendElements()} instead */ @Deprecated @@ -155,7 +156,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Contributions to the UI legend. - * + * * @since 3.0 */ @NonNull @@ -177,7 +178,7 @@ public abstract class AbstractRepositoryConnectorUi { * Connector-specific task icons. Not recommended to override unless providing custom icons and kind overlays. For * connectors that have a decorator that they want to reuse, the connector can maintain a reference to the label * provider and get the descriptor from the images it returns. - * + * * @since 3.0 */ @Nullable @@ -185,6 +186,11 @@ public abstract class AbstractRepositoryConnectorUi { if (element instanceof RepositoryQuery) { return ((RepositoryQuery) element).getAutoUpdate() ? TasksUiImages.QUERY : TasksUiImages.QUERY_OFFLINE; } else if (element instanceof ITask) { + ITask task = (ITask) element; + TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryUrl()); + if (repository != null && connector != null && connector.isOwnedByUser(repository, task)) { + return TasksUiImages.TASK_OWNED; + } return TasksUiImages.TASK; } else { return null; @@ -193,7 +199,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Task kind overlay, recommended to override with connector-specific overlay. - * + * * @since 3.0 */ @Nullable @@ -204,7 +210,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Connector-specific priority icons. Not recommended to override since priority icons are used elsewhere in the * Task List UI (e.g. filter selection in view menu). - * + * * @since 3.0 */ @NonNull @@ -214,7 +220,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * This method is not used anymore. - * + * * @return returns null */ @Deprecated @@ -233,7 +239,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Override to return a URL that provides the user with an account creation page for the repository - * + * * @param taskRepository * TODO */ @@ -244,7 +250,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Override to return a URL that provides the user with an account management page for the repository - * + * * @param taskRepository * TODO */ @@ -255,7 +261,7 @@ public abstract class AbstractRepositoryConnectorUi { /** * Override to return a URL that provides the user with a history page for the task. - * + * * @return a url of a page for the history of the task; null, if no history url is available * @since 3.0 */ @@ -268,7 +274,7 @@ public abstract class AbstractRepositoryConnectorUi { * Override to return a specific textual reference to a comment, e.g. by default this method returns * <code>In reply to comment #12</code> for a reply to comment 12. This text is used when generating replies to * comments. - * + * * @return the reply text with a reference to <code>taskComment</code>; null, if no reference is available * @since 3.0 */ @@ -290,7 +296,7 @@ public abstract class AbstractRepositoryConnectorUi { * Returns an array of hyperlinks that link to tasks within <code>text</code>. If <code>index</code> is != -1 * clients may limit the results to hyperlinks found at <code>index</code>. It is legal for clients to always return * all results. - * + * * @param repository * the task repository, never <code>null</code> * @param text @@ -337,7 +343,7 @@ public abstract class AbstractRepositoryConnectorUi { * Returns an array of hyperlinks that link to tasks within <code>text</code>. If <code>index</code> is != -1 * clients may limit the results to hyperlinks found at <code>index</code>. It is legal for clients to always return * all results. - * + * * @param repository * the task repository, never <code>null</code> * @param task diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java index 8bb4950bb..cbf27a1b4 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiImages.java @@ -70,6 +70,11 @@ public class TasksUiImages { public static final ImageDescriptor TASK_ATTACHMENT_PATCH = create(OBJ, "attachment-patch.gif"); //$NON-NLS-1$ /** + * @since 3.21 + */ + public static final ImageDescriptor TASK_OWNED = create(TOOL, "task-owned.gif"); //$NON-NLS-1$ + + /** * @since 3.7 */ public static final ImageDescriptor FILTER_OBSOLETE_SMALL = create(TOOL_SMALL, "file-delete-line-12x12.png"); //$NON-NLS-1$ |