diff options
author | Tomasz Zarna | 2013-06-10 07:51:54 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2013-08-09 21:12:14 +0000 |
commit | 570eb7dd863a5f6e9bef7eed280e0cd9aa9c9299 (patch) | |
tree | d24832214d2a569186fb8e125c55e4736eb2bf8c | |
parent | 379a46f86cb16aa02af82af4f34bd412ead3d66f (diff) | |
download | org.eclipse.mylyn.tasks-570eb7dd863a5f6e9bef7eed280e0cd9aa9c9299.tar.gz org.eclipse.mylyn.tasks-570eb7dd863a5f6e9bef7eed280e0cd9aa9c9299.tar.xz org.eclipse.mylyn.tasks-570eb7dd863a5f6e9bef7eed280e0cd9aa9c9299.zip |
372298: task list view should indicate display notes directly
Bug: 372298
Change-Id: I393e50050b6db827717aed2133ab5d4f0fb88c23
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=372298
Signed-off-by: Tomasz Zarna <tomasz.zarna@tasktop.com>
6 files changed, 31 insertions, 5 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/icons/ovr16/overlay-notes.gif b/org.eclipse.mylyn.tasks.ui/icons/ovr16/overlay-notes.gif Binary files differnew file mode 100644 index 000000000..21145d350 --- /dev/null +++ b/org.eclipse.mylyn.tasks.ui/icons/ovr16/overlay-notes.gif diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java index 83ec685e4..c9c0c6ed0 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskLabelDecorator.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * Copyright (c) 2004, 2013 Tasktop Technologies 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 @@ -16,12 +16,14 @@ import org.eclipse.jface.viewers.IDecoration; import org.eclipse.jface.viewers.ILabelProviderListener; import org.eclipse.jface.viewers.ILightweightLabelDecorator; import org.eclipse.mylyn.commons.ui.CommonImages; +import org.eclipse.mylyn.internal.tasks.core.AbstractTask; import org.eclipse.mylyn.internal.tasks.core.ITaskRepositoryElement; import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal; import org.eclipse.mylyn.tasks.core.ITask; import org.eclipse.mylyn.tasks.core.TaskRepository; import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi; import org.eclipse.mylyn.tasks.ui.TasksUi; +import org.eclipse.mylyn.tasks.ui.TasksUiImages; /** * @author Mik Kersten @@ -44,6 +46,9 @@ public class TaskLabelDecorator implements ILightweightLabelDecorator { } else if (!task.isCompleted() && task.getDueDate() != null) { decoration.addOverlay(CommonImages.OVERLAY_DATE_DUE, IDecoration.TOP_RIGHT); } + if (hasNotes(task)) { + decoration.addOverlay(TasksUiImages.NOTES, IDecoration.BOTTOM_RIGHT); + } } else if (element instanceof ITaskRepositoryElement) { ITaskRepositoryElement repositoryElement = (ITaskRepositoryElement) element; String repositoryUrl = repositoryElement.getRepositoryUrl(); @@ -92,4 +97,11 @@ public class TaskLabelDecorator implements ILightweightLabelDecorator { return null; } + private boolean hasNotes(ITask task) { + if (task instanceof AbstractTask) { + return !((AbstractTask) task).getNotes().isEmpty(); + } + return false; + } + } diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java index 7ec9fdaf6..ec143d0d2 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/Messages.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * Copyright (c) 2004, 2013 Tasktop Technologies 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 @@ -97,6 +97,8 @@ public class Messages extends NLS { public static String UiLegendControl_New_task; + public static String UiLegendControl_Notes; + public static String UiLegendControl_Open_Task_List_; public static String UiLegendControl_Outgoing_changes; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/UiLegendControl.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/UiLegendControl.java index b32621cfa..a580a6475 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/UiLegendControl.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/UiLegendControl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2008 Tasktop Technologies and others. + * Copyright (c) 2004, 2013 Tasktop Technologies 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 @@ -333,6 +333,10 @@ public class UiLegendControl extends Composite { textLabel.setForeground(themeManager.getCurrentTheme().getColorRegistry().get(CommonThemes.COLOR_OVERDUE)); imageLabel = toolkit.createLabel(activityClient, ""); //$NON-NLS-1$ + imageLabel.setImage(CommonImages.getImage(TasksUiImages.NOTES)); + toolkit.createLabel(activityClient, Messages.UiLegendControl_Notes); + + imageLabel = toolkit.createLabel(activityClient, ""); //$NON-NLS-1$ imageLabel.setImage(CommonImages.getImage(CommonImages.BLANK)); Hyperlink adjust = toolkit.createHyperlink(activityClient, Messages.UiLegendControl_Adjust_Colors_and_Fonts_, SWT.WRAP); diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties index dc33ef9d4..fbfe2786a 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/dialogs/messages.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2009 Tasktop Technologies and others. +# Copyright (c) 2009, 2013 Tasktop Technologies 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 @@ -46,6 +46,7 @@ UiLegendControl_Inactive_task_with_context=Inactive task with context UiLegendControl_Inactive_task_with_no_context=Inactive task with no context UiLegendControl_Incoming_changes=Incoming changes, open to view UiLegendControl_New_task=New task, open to view +UiLegendControl_Notes=Has Private Notes UiLegendControl_Open_Task_List_=Open Task List... UiLegendControl_Outgoing_changes=Outgoing changes UiLegendControl_Past_Due_date=Past Due date 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 33d7b3c82..8bb4950bb 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 @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2004, 2009 Tasktop Technologies and others. + * Copyright (c) 2004, 2013 Tasktop Technologies 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 @@ -39,6 +39,8 @@ public class TasksUiImages { private static final String OBJ = "obj16"; //$NON-NLS-1$ + private static final String OVERLAY = "ovr16"; //$NON-NLS-1$ + private static final String WIZBAN = "wizban"; //$NON-NLS-1$ // Tasks and Task List elements @@ -225,6 +227,11 @@ public class TasksUiImages { */ public static final ImageDescriptor IMAGE_CAPTURE_SMALL = create(TOOL_SMALL, "image_capture.png"); //$NON-NLS-1$ + /** + * @since 3.10 + */ + public static final ImageDescriptor NOTES = create(OVERLAY, "overlay-notes.gif"); //$NON-NLS-1$ + public static Image getImageForPriority(PriorityLevel priorityLevel) { if (priorityLevel == null) { return null; |