Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-04-26 22:45:52 +0000
committermkersten2007-04-26 22:45:52 +0000
commit40b6e0bc15bb0bff840087da703d3dbadbcb436c (patch)
tree45794041fb8063ff2c2c6fba9ccd1a8754457c38
parentd96a110ddcda404092ae6078638c37367f37e7de (diff)
downloadorg.eclipse.mylyn.tasks-40b6e0bc15bb0bff840087da703d3dbadbcb436c.tar.gz
org.eclipse.mylyn.tasks-40b6e0bc15bb0bff840087da703d3dbadbcb436c.tar.xz
org.eclipse.mylyn.tasks-40b6e0bc15bb0bff840087da703d3dbadbcb436c.zip
NEW - bug 182772: improve Task List table/tree layout
https://bugs.eclipse.org/bugs/show_bug.cgi?id=182772
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/eview16/overlay-normal.gifbin0 -> 78 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/find.gif (renamed from org.eclipse.mylyn.bugzilla.ui/icons/openresult.gif)bin157 -> 157 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/remove-all.gifbin117 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/remove.gifbin97 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/selectAll.gifbin149 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskDecorator.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/etool16/task-active.gifbin199 -> 197 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/etool16/task-context.gifbin197 -> 194 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/etool16/task-inactive.gifbin132 -> 128 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-context.gifbin0 -> 162 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-due.gifbin80 -> 179 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-incoming-new.gifbin0 -> 116 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-overdue.gifbin0 -> 178 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-repository-context.gifbin111 -> 166 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-3.gifbin55 -> 50 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p1.gifbin0 -> 136 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p2.gifbin0 -> 122 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p3.gifbin0 -> 50 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p4.gifbin0 -> 177 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p5.gifbin0 -> 186 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/find.gifbin0 -> 157 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryTaskDecorator.java72
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java8
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java61
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java18
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java69
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java117
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableLabelProvider.java32
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java175
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractTaskDecorator.java29
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java20
32 files changed, 289 insertions, 324 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/eview16/overlay-normal.gif b/org.eclipse.mylyn.bugzilla.ui/icons/eview16/overlay-normal.gif
new file mode 100644
index 000000000..d582fe0de
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/eview16/overlay-normal.gif
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/openresult.gif b/org.eclipse.mylyn.bugzilla.ui/icons/find.gif
index 2b645a88f..2b645a88f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/icons/openresult.gif
+++ b/org.eclipse.mylyn.bugzilla.ui/icons/find.gif
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/remove-all.gif b/org.eclipse.mylyn.bugzilla.ui/icons/remove-all.gif
deleted file mode 100644
index 2c069ab3f..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/remove-all.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/remove.gif b/org.eclipse.mylyn.bugzilla.ui/icons/remove.gif
deleted file mode 100644
index 12a9167c5..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/remove.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/selectAll.gif b/org.eclipse.mylyn.bugzilla.ui/icons/selectAll.gif
deleted file mode 100644
index e159862e3..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/selectAll.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
index b7306b1ff..db1f076c5 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/BugzillaImages.java
@@ -51,6 +51,8 @@ public class BugzillaImages {
public static final ImageDescriptor OVERLAY_ENHANCEMENT = create(T_VIEW, "overlay-feature.gif");
+ public static final ImageDescriptor OVERLAY_NORMAL = create(T_VIEW, "overlay-normal.gif");
+
private static ImageDescriptor create(String prefix, String name) {
try {
return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskDecorator.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskDecorator.java
index d4e4ff65a..d96f53974 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskDecorator.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaTaskDecorator.java
@@ -13,15 +13,15 @@ package org.eclipse.mylar.internal.bugzilla.ui.tasklist;
import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ILightweightLabelDecorator;
import org.eclipse.mylar.internal.bugzilla.core.BugzillaQueryHit;
import org.eclipse.mylar.internal.bugzilla.core.BugzillaTask;
import org.eclipse.mylar.internal.bugzilla.ui.BugzillaImages;
+import org.eclipse.mylar.tasks.ui.AbstractTaskDecorator;
/**
* @author Mik Kersten
*/
-public class BugzillaTaskDecorator implements ILightweightLabelDecorator {
+public class BugzillaTaskDecorator extends AbstractTaskDecorator {
public void decorate(Object element, IDecoration decoration) {
if (element instanceof BugzillaTask) {
@@ -31,9 +31,11 @@ public class BugzillaTaskDecorator implements ILightweightLabelDecorator {
if (severity != null) {
// XXX: refactor to use configuration
if ("major".equals(severity) || "blocker".equals(severity) || "critical".equals(severity)) {
- decoration.addOverlay(BugzillaImages.OVERLAY_MAJOR, IDecoration.BOTTOM_RIGHT);
+ decoration.addOverlay(BugzillaImages.OVERLAY_MAJOR, getQuadrantForKind());
} else if ("enhancement".equals(severity)) {
- decoration.addOverlay(BugzillaImages.OVERLAY_ENHANCEMENT, IDecoration.BOTTOM_RIGHT);
+ decoration.addOverlay(BugzillaImages.OVERLAY_ENHANCEMENT, getQuadrantForKind());
+ } else {
+ decoration.addOverlay(BugzillaImages.OVERLAY_NORMAL, getQuadrantForKind());
}
}
} else if (element instanceof BugzillaQueryHit) {
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-active.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-active.gif
index ca4bf9d0a..79510e888 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-active.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-active.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-context.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-context.gif
index 407dc5495..e41316f1b 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-context.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-context.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-inactive.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-inactive.gif
index b55c1f528..dd7090c55 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/etool16/task-inactive.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/task-inactive.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-context.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-context.gif
new file mode 100644
index 000000000..c53adcf7f
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-context.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-due.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-due.gif
index 91ae2fbf6..a0bb744fb 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-due.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-has-due.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-incoming-new.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-incoming-new.gif
new file mode 100644
index 000000000..fee0e1b1c
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-incoming-new.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-overdue.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-overdue.gif
new file mode 100644
index 000000000..15b07bbff
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-overdue.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-repository-context.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-repository-context.gif
index cf4b159cc..9e878c2dc 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-repository-context.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/overlay-repository-context.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-3.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-3.gif
index 45b759436..bc468f71e 100644
--- a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-3.gif
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-3.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p1.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p1.gif
new file mode 100644
index 000000000..c02b062ce
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p1.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p2.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p2.gif
new file mode 100644
index 000000000..7b33bb888
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p2.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p3.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p3.gif
new file mode 100644
index 000000000..bc468f71e
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p3.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p4.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p4.gif
new file mode 100644
index 000000000..47b83dc67
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p4.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p5.gif b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p5.gif
new file mode 100644
index 000000000..30b6322b1
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/eview16/priority-p5.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/icons/find.gif b/org.eclipse.mylyn.tasks.ui/icons/find.gif
new file mode 100644
index 000000000..2b645a88f
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/find.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryTaskDecorator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryTaskDecorator.java
index bc913d0ce..eea82ac60 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryTaskDecorator.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/RepositoryTaskDecorator.java
@@ -53,36 +53,31 @@ public class RepositoryTaskDecorator implements ILightweightLabelDecorator {
decoration.addSuffix(" [" + taskRepository.getRepositoryLabel() + "]");
}
}
- if (query.isSynchronizing()) {
- decoration.addOverlay(TasksUiImages.OVERLAY_SYNCHRONIZING, IDecoration.TOP_LEFT);
- }
} else if (element instanceof AbstractRepositoryTask) {
AbstractRepositoryTask task = (AbstractRepositoryTask) element;
- AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
- task.getRepositoryKind());
AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(task.getRepositoryKind());
- TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(),
- task.getRepositoryUrl());
if (connectorUi != null) {
if (!connectorUi.hasRichEditor()) {
decoration.addOverlay(TasksUiImages.OVERLAY_WEB, IDecoration.BOTTOM_LEFT);
- } else if (connector != null && connector.hasRepositoryContext(repository, task)) {
- decoration.addOverlay(TasksUiImages.OVERLAY_REPOSITORY_CONTEXT, IDecoration.BOTTOM_LEFT);
- } else {
- decoration.addOverlay(TasksUiImages.OVERLAY_REPOSITORY, IDecoration.BOTTOM_LEFT);
}
}
- if (task.isSynchronizing()) {
- decoration.addOverlay(TasksUiImages.OVERLAY_SYNCHRONIZING, IDecoration.TOP_LEFT);
- }
if (!task.isCompleted() && TasksUiPlugin.getTaskListManager().isOverdue(task)) {
- decoration.addOverlay(TasksUiImages.OVERLAY_DUE, IDecoration.TOP_LEFT);
+ decoration.addOverlay(TasksUiImages.OVERLAY_OVER_DUE, IDecoration.TOP_LEFT);
} else if (!task.isCompleted() && task.getDueDate() != null) {
decoration.addOverlay(TasksUiImages.OVERLAY_HAS_DUE, IDecoration.TOP_LEFT);
}
- decoration.addOverlay(getSynchronizationStateImageDescriptor(element), IDecoration.TOP_RIGHT);
+ decoration.addOverlay(getPriorityImageDescriptor(element), IDecoration.TOP_RIGHT);
+ AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager().getRepositoryConnector(
+ task.getRepositoryKind());
+ TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(task.getRepositoryKind(),
+ task.getRepositoryUrl());
+ if (connectorUi != null) {
+ if (connector != null && connector.hasRepositoryContext(repository, task)) {
+ decoration.addOverlay(TasksUiImages.OVERLAY_REPOSITORY_CONTEXT, IDecoration.BOTTOM_RIGHT);
+ }
+ }
} else if (element instanceof AbstractQueryHit) {
ITask correspondingTask = ((AbstractQueryHit) element).getCorrespondingTask();
decorate(correspondingTask, decoration);
@@ -93,10 +88,10 @@ public class RepositoryTaskDecorator implements ILightweightLabelDecorator {
decoration.addOverlay(TasksUiImages.OVERLAY_WEB, IDecoration.BOTTOM_LEFT);
}
if (!task.isCompleted() && TasksUiPlugin.getTaskListManager().isOverdue(task)) {
- decoration.addOverlay(TasksUiImages.OVERLAY_DUE, IDecoration.TOP_LEFT);
+ decoration.addOverlay(TasksUiImages.OVERLAY_OVER_DUE, IDecoration.TOP_LEFT);
}
- decoration.addOverlay(getSynchronizationStateImageDescriptor(element), IDecoration.TOP_RIGHT);
+ decoration.addOverlay(getPriorityImageDescriptor(element), IDecoration.TOP_RIGHT);
} else if (element instanceof TaskRepository) {
ImageDescriptor overlay = TasksUiPlugin.getDefault().getOverlayIcon(((TaskRepository) element).getKind());
@@ -106,57 +101,19 @@ public class RepositoryTaskDecorator implements ILightweightLabelDecorator {
}
}
-
-
- private ImageDescriptor getSynchronizationStateImageDescriptor(Object element) {
+ private ImageDescriptor getPriorityImageDescriptor(Object element) {
if (element instanceof ITaskListElement && !(element instanceof AbstractTaskContainer)) {
ITaskListElement taskElement = (ITaskListElement) element;
return TasksUiUtil.getImageDescriptorForPriority(PriorityLevel.fromString(taskElement.getPriority()));
-// return TasksUiImages.PRIORITY_1;
}
return null;
-
-// AbstractRepositoryTask repositoryTask = null;
-// if (element instanceof AbstractQueryHit) {
-// repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
-// } else if (element instanceof AbstractRepositoryTask) {
-// repositoryTask = (AbstractRepositoryTask) element;
-// }
-// if (repositoryTask != null) {
-// ImageDescriptor image = null;
-// if (repositoryTask.getSyncState() == RepositoryTaskSyncState.OUTGOING) {
-// image = TasksUiImages.OVERLAY_OUTGOING;
-// } else if (repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING) {
-// image = TasksUiImages.OVERLAY_INCOMMING;
-// } else if (repositoryTask.getSyncState() == RepositoryTaskSyncState.CONFLICT) {
-// image = TasksUiImages.OVERLAY_CONFLICT;
-// }
-// if (image == null && repositoryTask.getStatus() != null) {
-// return TasksUiImages.OVERLAY_WARNING;
-// } else if (image != null) {
-// return image;
-// }
-// } else if (element instanceof AbstractQueryHit) {
-// return TasksUiImages.OVERLAY_INCOMMING;
-// } else if (element instanceof AbstractTaskContainer) {
-// AbstractTaskContainer container = (AbstractTaskContainer) element;
-// if (container instanceof AbstractRepositoryQuery) {
-// AbstractRepositoryQuery query = (AbstractRepositoryQuery) container;
-// if (query.getStatus() != null) {
-// return TasksUiImages.OVERLAY_WARNING;
-// }
-// }
-// }
-// return null;
}
public void addListener(ILabelProviderListener listener) {
// ignore
-
}
public void dispose() {
// ignore
-
}
public boolean isLabelProperty(Object element, String property) {
@@ -165,7 +122,6 @@ public class RepositoryTaskDecorator implements ILightweightLabelDecorator {
public void removeListener(ILabelProviderListener listener) {
// ignore
-
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java
index a16828907..ede3562fa 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageDescriptor.java
@@ -25,12 +25,12 @@ public class TaskListImageDescriptor extends CompositeImageDescriptor {
private ImageData overlay;
- private Point fSize;
-
private boolean top;
private boolean left;
+ protected Point size;
+
public TaskListImageDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc, boolean top,
boolean left) {
this.base = getImageData(baseDesc);
@@ -81,11 +81,11 @@ public class TaskListImageDescriptor extends CompositeImageDescriptor {
* @see ImageDescriptor#createImage()
*/
public void setImageSize(Point size) {
- fSize = size;
+ this.size = size;
}
@Override
protected Point getSize() {
- return new Point(24, fSize.y);
+ return new Point(size.x, size.y);
}
} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java
index acfd1d49b..607ecfb35 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TasksUiImages.java
@@ -43,8 +43,8 @@ public class TasksUiImages {
public static final Point SIZE = new Point(16, 16);
- public static final Point SIZE_WIDE = new Point(32, 16);
-
+ public static final Point SIZE_WIDE = new Point(26, 16);
+
private static final URL baseURL = TasksUiPlugin.getDefault().getBundle().getEntry("/icons/");
public static final ImageDescriptor TASK_ACTIVE = createSize(create(T_TOOL, "task-active.gif"), SIZE);
@@ -67,18 +67,18 @@ public class TasksUiImages {
public static final ImageDescriptor TASK_NOTES = createSize(create(T_TOOL, "task-notes.gif"), SIZE);
public static final ImageDescriptor TASK_NEW = create(T_TOOL, "task-new.gif");
-
+
public static final ImageDescriptor TASK_REPOSITORY_HISTORY = createSize(create(T_TOOL,
- "task-repository-history.gif"), SIZE);
+ "task-repository-history.gif"), SIZE);
public static final ImageDescriptor TASK_REPOSITORY_NOTES = createSize(create(T_TOOL, "task-repository-notes.gif"),
- SIZE);
-
+ SIZE);
+
public static final ImageDescriptor TASK_REPOSITORY_COMPLETED = createSize(create(T_TOOL,
- "task-repository-completed.gif"), SIZE);
-
+ "task-repository-completed.gif"), SIZE);
+
public static final ImageDescriptor TASK_REMOTE = createSize(create(T_TOOL, "task-remote.gif"), SIZE);
-
+
public static final ImageDescriptor TASKLIST = create("eview16", "task-list.gif");
public static final ImageDescriptor REPOSITORY = create("eview16", "repository.gif");
@@ -111,7 +111,7 @@ public class TasksUiImages {
public static final ImageDescriptor OVERLAY_HAS_DUE = create(T_EVIEW, "overlay-has-due.gif");
- public static final ImageDescriptor OVERLAY_DUE = create(T_EVIEW, "overlay-due.gif");
+ public static final ImageDescriptor OVERLAY_OVER_DUE = create(T_EVIEW, "overlay-over-due.gif");
public static final ImageDescriptor TASK_WEB = createWithOverlay(TASK, OVERLAY_WEB, false, true);
@@ -141,6 +141,8 @@ public class TasksUiImages {
public static final ImageDescriptor OVERLAY_INCOMMING = create(T_EVIEW, "overlay-incoming.gif");
+ public static final ImageDescriptor OVERLAY_INCOMMING_NEW = create(T_EVIEW, "overlay-incoming-new.gif");
+
public static final ImageDescriptor OVERLAY_OUTGOING = create(T_EVIEW, "overlay-outgoing.gif");
public static final ImageDescriptor OVERLAY_CONFLICT = create(T_EVIEW, "overlay-conflicting.gif");
@@ -207,20 +209,20 @@ public class TasksUiImages {
public static final ImageDescriptor PRIORITY_2 = create(T_EVIEW, "priority-2.gif");
- public static final ImageDescriptor PRIORITY_3 = createSize(create(T_EVIEW, "priority-3.gif"), SIZE);
+ public static final ImageDescriptor PRIORITY_3 = create(T_EVIEW, "priority-3.gif");
- public static final ImageDescriptor PRIORITY_4 = createSize(create(T_EVIEW, "priority-4.gif"), SIZE);
+ public static final ImageDescriptor PRIORITY_4 = create(T_EVIEW, "priority-4.gif");
- public static final ImageDescriptor PRIORITY_5 = createSize(create(T_EVIEW, "priority-5.gif"), SIZE);
+ public static final ImageDescriptor PRIORITY_5 = create(T_EVIEW, "priority-5.gif");
- public static final ImageDescriptor CALENDAR = create(T_TOOL, "calendar.gif");
+ public static final ImageDescriptor CALENDAR = createSize(create(T_TOOL, "calendar.gif"), SIZE);
public static final ImageDescriptor CALENDAR_SMALL = create(T_OBJ, "calendar-small.gif");
public static final ImageDescriptor BANNER_REPOSITORY = create(T_WIZBAN, "banner-repository.gif");
public static final ImageDescriptor BANNER_REPOSITORY_SETTINGS = create(T_WIZBAN, "banner-repository-settings.gif");
-
+
public static final ImageDescriptor BANNER_REPOSITORY_CONTEXT = create(T_WIZBAN, "banner-repository-context.gif");
public static final ImageDescriptor BANNER_IMPORT = create(T_WIZBAN, "banner-import.gif");
@@ -247,16 +249,28 @@ public class TasksUiImages {
return new TaskListImageDescriptor(base, overlay, top, left);
}
+ public static Image getImage(ImageDescriptor imageDescriptor) {
+ return getImage(imageDescriptor, false);
+ }
+
/**
* Lazily initializes image map.
*/
- public static Image getImage(ImageDescriptor imageDescriptor) {
+ public static Image getImage(ImageDescriptor imageDescriptor, boolean wide) {
+ String suffix = "";
+ if (wide) {
+ suffix = ".wide";
+ }
+
ImageRegistry imageRegistry = getImageRegistry();
+ Image image = imageRegistry.get(imageDescriptor.hashCode() + suffix);
- Image image = imageRegistry.get("" + imageDescriptor.hashCode());
if (image == null) {
- image = imageDescriptor.createImage();
- imageRegistry.put("" + imageDescriptor.hashCode(), image);
+ if (wide && imageDescriptor instanceof TaskListImageDescriptor) {
+ ((TaskListImageDescriptor) imageDescriptor).setImageSize(SIZE_WIDE);
+ }
+ image = imageDescriptor.createImage(true);
+ imageRegistry.put(imageDescriptor.hashCode() + suffix, image);
}
return image;
}
@@ -279,21 +293,20 @@ public class TasksUiImages {
return new URL(baseURL, buffer.toString());
}
-
private static Image[] progressImages;
-
+
public static Image[] getProgressImages() {
- if(progressImages != null)
+ if (progressImages != null)
return progressImages;
-
+
progressImages = new Image[8];
for (int i = 1; i <= 8; i++) {
ImageDescriptor imageDescriptor = create(T_EVIEW + "/progress", i + ".png");
progressImages[i - 1] = getImage(imageDescriptor);
}
-
+
return progressImages;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
index 3a6aedf45..220469b1b 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/RenameAction.java
@@ -10,24 +10,26 @@
*******************************************************************************/
package org.eclipse.mylar.internal.tasks.ui.actions;
-import org.eclipse.jface.action.Action;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.mylar.internal.tasks.ui.views.TaskListView;
import org.eclipse.mylar.tasks.core.ITaskListElement;
import org.eclipse.swt.SWT;
+import org.eclipse.ui.actions.BaseSelectionListenerAction;
/**
* @author Mik Kersten
*/
-public class RenameAction extends Action {
+public class RenameAction extends BaseSelectionListenerAction {
+
+ private static final String LABEL_NAME = "Rename";
public static final String ID = "org.eclipse.mylar.tasklist.actions.rename";
private TaskListView view;
public RenameAction(TaskListView view) {
+ super(LABEL_NAME);
this.view = view;
- setText("Rename");
setId(ID);
setAccelerator(SWT.F2);
}
@@ -38,8 +40,16 @@ public class RenameAction extends Action {
if (selectedObject instanceof ITaskListElement) {
ITaskListElement element = (ITaskListElement) selectedObject;
view.setInRenameAction(true);
- view.getViewer().editElement(element, 4);
+ view.getViewer().editElement(element, 0);
view.setInRenameAction(false);
}
}
+
+ @Override
+ protected boolean updateSelection(IStructuredSelection selection) {
+// Object selected = selection.getFirstElement();
+ setEnabled(false);
+ return false;
+// return super.updateSelection(selection);
+ }
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
index 112763b67..ef2e3dee8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskElementLabelProvider.java
@@ -13,6 +13,7 @@ package org.eclipse.mylar.internal.tasks.ui.views;
import java.util.regex.Pattern;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IColorProvider;
import org.eclipse.jface.viewers.IFontProvider;
import org.eclipse.jface.viewers.LabelProvider;
@@ -27,7 +28,6 @@ import org.eclipse.mylar.tasks.core.ITask;
import org.eclipse.mylar.tasks.core.ITaskListElement;
import org.eclipse.mylar.tasks.core.TaskArchive;
import org.eclipse.mylar.tasks.core.TaskCategory;
-import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Font;
@@ -46,65 +46,52 @@ public class TaskElementLabelProvider extends LabelProvider implements IColorPro
private static final Pattern pattern = Pattern.compile("\\d*: .*");
+ private boolean wide = false;
+
+ public TaskElementLabelProvider() {
+ super();
+ }
+
+ /**
+ * @parma wide set true for wide images, with whitespace to right of icon.
+ */
+ public TaskElementLabelProvider(boolean wide) {
+ super();
+ this.wide = wide;
+ }
+
@Override
public Image getImage(Object element) {
+ return TasksUiImages.getImage(getImageDescriptor(element), wide);
+ }
+
+ public ImageDescriptor getImageDescriptor(Object element) {
if (element instanceof TaskArchive) {
- return TasksUiImages.getImage(TasksUiImages.CATEGORY_ARCHIVE);
+ return TasksUiImages.CATEGORY_ARCHIVE;
} else if (element instanceof TaskCategory) {
- return TasksUiImages.getImage(TasksUiImages.CATEGORY);
+ return TasksUiImages.CATEGORY;
} else if (element instanceof AbstractRepositoryQuery) {
- return TasksUiImages.getImage(TasksUiImages.QUERY);
+ return TasksUiImages.QUERY;
} else if (element instanceof AbstractQueryHit) {
AbstractQueryHit hit = (AbstractQueryHit) element;
if (hit.getCorrespondingTask() != null) {
- return getImage(hit.getCorrespondingTask());
+ return getImageDescriptor(hit.getCorrespondingTask());
} else {
- return TasksUiImages.getImage(TasksUiImages.TASK_REMOTE);
+ return TasksUiImages.TASK_REMOTE;
}
} else if (element instanceof ITask) {
ITask task = (ITask) element;
- // TODO: fix this mess that delaying decoration got us into
if (task.isCompleted()) {
- if (task instanceof AbstractRepositoryTask) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin
- .getRepositoryUi(((AbstractRepositoryTask) task).getRepositoryKind());
- if (connectorUi != null && !connectorUi.hasRichEditor()) {
- return TasksUiImages.getImage(TasksUiImages.TASK_COMPLETED);
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK_REPOSITORY_COMPLETED);
- }
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK_COMPLETED);
- }
+ return TasksUiImages.TASK_COMPLETED;
} else if (task.getNotes() != null && !task.getNotes().trim().equals("")) {
- if (task instanceof AbstractRepositoryTask) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin
- .getRepositoryUi(((AbstractRepositoryTask) task).getRepositoryKind());
- if (connectorUi != null && !connectorUi.hasRichEditor()) {
- return TasksUiImages.getImage(TasksUiImages.TASK_NOTES);
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK_REPOSITORY_NOTES);
- }
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK_NOTES);
- }
+ return TasksUiImages.TASK_NOTES;
} else {
- if (task instanceof AbstractRepositoryTask) {
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin
- .getRepositoryUi(((AbstractRepositoryTask) task).getRepositoryKind());
- if (connectorUi != null && !connectorUi.hasRichEditor()) {
- return TasksUiImages.getImage(TasksUiImages.TASK);
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK_REPOSITORY);
- }
- } else {
- return TasksUiImages.getImage(TasksUiImages.TASK);
- }
+ return TasksUiImages.TASK;
}
}
return null;
}
-
+
@Override
public String getText(Object object) {
if (object instanceof AbstractQueryHit) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
new file mode 100644
index 000000000..e0b072d33
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListCellModifier.java
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 Mylar 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.mylar.internal.tasks.ui.views;
+
+import java.util.Arrays;
+
+import org.eclipse.jface.viewers.ICellModifier;
+import org.eclipse.mylar.core.MylarStatusHandler;
+import org.eclipse.mylar.internal.tasks.ui.actions.TaskActivateAction;
+import org.eclipse.mylar.internal.tasks.ui.actions.TaskDeactivateAction;
+import org.eclipse.mylar.tasks.core.AbstractQueryHit;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
+import org.eclipse.mylar.tasks.core.AbstractTaskContainer;
+import org.eclipse.mylar.tasks.core.ITask;
+import org.eclipse.mylar.tasks.core.ITaskListElement;
+import org.eclipse.mylar.tasks.core.Task;
+import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author Mik Kersten
+ */
+class TaskListCellModifier implements ICellModifier {
+
+ private final TaskListView taskListView;
+
+ TaskListCellModifier(TaskListView taskListView) {
+ this.taskListView = taskListView;
+ }
+
+ public boolean canModify(Object element, String property) {
+ return taskListView.isInRenameAction;
+ }
+
+ public Object getValue(Object element, String property) {
+ try {
+ int columnIndex = Arrays.asList(this.taskListView.columnNames).indexOf(property);
+ if (element instanceof ITaskListElement) {
+ final ITaskListElement taskListElement = (ITaskListElement) element;
+ switch (columnIndex) {
+ case 0:
+ return taskListElement.getSummary();
+ case 1:
+ return "";
+ case 2:
+ return "";
+ }
+ }
+ } catch (Exception e) {
+ MylarStatusHandler.log(e, e.getMessage());
+ }
+ return "";
+ }
+
+ public void modify(Object element, String property, Object value) {
+ int columnIndex = -1;
+ try {
+ columnIndex = Arrays.asList(this.taskListView.columnNames).indexOf(property);
+ if (((TreeItem) element).getData() instanceof AbstractTaskContainer) {
+ AbstractTaskContainer container = (AbstractTaskContainer) ((TreeItem) element).getData();
+ switch (columnIndex) {
+ case 0:
+ TasksUiPlugin.getTaskListManager().getTaskList()
+ .renameContainer(container, ((String) value).trim());
+ case 1:
+ break;
+ case 2:
+ break;
+ }
+ } else if (((TreeItem) element).getData() instanceof ITaskListElement) {
+ final ITaskListElement taskListElement = (ITaskListElement) ((TreeItem) element).getData();
+ ITask task = null;
+ if (taskListElement instanceof ITask) {
+ task = (ITask) taskListElement;
+ } else if (taskListElement instanceof AbstractQueryHit) {
+ if (((AbstractQueryHit) taskListElement).getCorrespondingTask() != null) {
+ task = ((AbstractQueryHit) taskListElement).getCorrespondingTask();
+ }
+ }
+ switch (columnIndex) {
+ case 0:
+ if (!(task instanceof AbstractRepositoryTask)) {
+ TasksUiPlugin.getTaskListManager().getTaskList().renameTask((Task) task,
+ ((String) value).trim());
+ }
+ break;
+ case 1:
+ break;
+ case 2:
+ if (taskListElement instanceof AbstractQueryHit) {
+ task = ((AbstractQueryHit) taskListElement).getOrCreateCorrespondingTask();
+ }
+ if (task != null) {
+ if (task.isActive()) {
+ new TaskDeactivateAction().run(task);
+ this.taskListView.previousTaskAction.setButtonStatus();
+ } else {
+ new TaskActivateAction().run(task);
+ this.taskListView.addTaskToHistory(task);
+ this.taskListView.previousTaskAction.setButtonStatus();
+ }
+ }
+ break;
+ }
+ }
+ } catch (Exception e) {
+ MylarStatusHandler.fail(e, e.getMessage(), true);
+ }
+ this.taskListView.getViewer().refresh();
+ }
+} \ No newline at end of file
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableLabelProvider.java
index fbe18c60c..d501631d4 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListTableLabelProvider.java
@@ -86,15 +86,12 @@ public class TaskListTableLabelProvider extends DecoratingLabelProvider implemen
}
if (columnIndex == 0) {
if (element instanceof DateRangeContainer) {
- return TasksUiImages.getImage(TasksUiImages.CALENDAR);
+ return TasksUiImages.getImage(TasksUiImages.CALENDAR, true);
} else {
return super.getImage(element);
+// TaskElementLabelProvider taskElementProvider = (TaskElementLabelProvider) super.getLabelProvider();
+// return TasksUiImages.getImage(taskElementProvider.getImageDescriptor(element), true);
}
-// } else if (columnIndex == 1) {
-// if (element instanceof ITaskListElement && !(element instanceof AbstractTaskContainer)) {
-// ITaskListElement taskElement = (ITaskListElement) element;
-// return TasksUiUtil.getImageForPriority(PriorityLevel.fromString(taskElement.getPriority()));
-// }
} else if (columnIndex == 1) {
return getSynchronizationStateImage(element);
} else if (columnIndex == 2) {
@@ -107,13 +104,16 @@ public class TaskListTableLabelProvider extends DecoratingLabelProvider implemen
private Image getSynchronizationStateImage(Object element) {
AbstractRepositoryTask repositoryTask = null;
+ ImageDescriptor image = null;
if (element instanceof AbstractQueryHit) {
repositoryTask = ((AbstractQueryHit) element).getCorrespondingTask();
+ if (repositoryTask == null) {
+// return TasksUiImages.getImage(TasksUiImages.OVERLAY_INCOMMING_NEW, true);
+ }
} else if (element instanceof AbstractRepositoryTask) {
repositoryTask = (AbstractRepositoryTask) element;
}
if (repositoryTask != null) {
- ImageDescriptor image = null;
if (repositoryTask.getSyncState() == RepositoryTaskSyncState.OUTGOING) {
image = TasksUiImages.STATUS_NORMAL_OUTGOING;
} else if (repositoryTask.getSyncState() == RepositoryTaskSyncState.INCOMING) {
@@ -122,23 +122,23 @@ public class TaskListTableLabelProvider extends DecoratingLabelProvider implemen
image = TasksUiImages.STATUS_NORMAL_CONFLICT;
}
if (image == null && repositoryTask.getStatus() != null) {
- return TasksUiImages.getImage(TasksUiImages.STATUS_WARNING);
+ return TasksUiImages.getImage(TasksUiImages.STATUS_WARNING, true);
} else if (image != null) {
- return TasksUiImages.getImage(image);
+ return TasksUiImages.getImage(image, true);
}
} else if (element instanceof AbstractQueryHit) {
- return TasksUiImages.getImage(TasksUiImages.STATUS_NORMAL_INCOMING);
+ return TasksUiImages.getImage(TasksUiImages.STATUS_NORMAL_INCOMING, true);
} else if (element instanceof AbstractTaskContainer) {
AbstractTaskContainer container = (AbstractTaskContainer) element;
if (container instanceof AbstractRepositoryQuery) {
AbstractRepositoryQuery query = (AbstractRepositoryQuery) container;
if (query.getStatus() != null) {
- return TasksUiImages.getImage(TasksUiImages.STATUS_WARNING);
+ return TasksUiImages.getImage(TasksUiImages.STATUS_WARNING, true);
}
}
if (view != null && !Arrays.asList(view.getViewer().getExpandedElements()).contains(element)
&& hasIncoming(container)) {
- return TasksUiImages.getImage(TasksUiImages.STATUS_NORMAL_INCOMING);
+ return TasksUiImages.getImage(TasksUiImages.STATUS_NORMAL_INCOMING, true);
}
}
return null;
@@ -148,16 +148,16 @@ public class TaskListTableLabelProvider extends DecoratingLabelProvider implemen
ITask task = TaskElementLabelProvider.getCorrespondingTask((ITaskListElement) element);
if (task != null) {
if (task.isActive()) {
- return TasksUiImages.getImage(TasksUiImages.TASK_ACTIVE);
+ return TasksUiImages.getImage(TasksUiImages.TASK_ACTIVE, true);
} else {
if (ContextCorePlugin.getContextManager().hasContext(task.getHandleIdentifier())) {
- return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE_CONTEXT);
+ return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE_CONTEXT, true);
} else {
- return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE);
+ return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE, true);
}
}
} else {
- return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE);
+ return TasksUiImages.getImage(TasksUiImages.TASK_INACTIVE, true);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index b9b83a6ae..7600920fd 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -12,7 +12,6 @@
package org.eclipse.mylar.internal.tasks.ui.views;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -33,11 +32,9 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
import org.eclipse.jface.viewers.ColumnPixelData;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICellModifier;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
@@ -124,7 +121,6 @@ import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.IViewPart;
@@ -228,7 +224,7 @@ public class TaskListView extends ViewPart {
private PriorityDropDownAction filterOnPriority;
- private PreviousTaskDropDownAction previousTaskAction;
+ PreviousTaskDropDownAction previousTaskAction;
private PresentationDropDownSelectionAction presentationDropDownSelectionAction;
@@ -242,7 +238,7 @@ public class TaskListView extends ViewPart {
protected String[] columnNames = new String[] { " Summary", " ?", " !" };
- protected int[] columnWidths = new int[] { 100, 14, 16 };
+ protected int[] columnWidths = new int[] { 100, 14, 15 };
private TreeColumn[] columns;
@@ -326,11 +322,16 @@ public class TaskListView extends ViewPart {
Color oldBackground = gc.getBackground();
gc.setForeground(categoryGradientStart);
- gc.setBackground(categoryGradientEnd);
+ gc.setBackground(TaskListView.this.getViewer().getControl().getParent().getBackground());
+
+// gc.setForeground(categoryGradientStart);
+// gc.setBackground(categoryGradientEnd);
+
gc.fillGradientRectangle(0, rect.y, area.width, rect.height, true);
/* Bottom Line */
- gc.setForeground(categoryGradientEnd);
+ gc.setForeground(TaskListView.this.getViewer().getControl().getParent().getBackground());
+// gc.setForeground(categoryGradientEnd);
gc.drawLine(0, rect.y + rect.height - 1, area.width, rect.y + rect.height - 1);
gc.setForeground(oldForeground);
@@ -603,151 +604,6 @@ public class TaskListView extends ViewPart {
}
}
- class TaskListCellModifier implements ICellModifier {
-
- public boolean canModify(Object element, String property) {
- int columnIndex = Arrays.asList(columnNames).indexOf(property);
- if (columnIndex == 2) {
- return true;
- } else if (columnIndex == 0 && isInRenameAction) {
- return !(element instanceof AbstractRepositoryTask);
- }
-// else if (element instanceof ITaskListElement && isInRenameAction) {
-// switch (columnIndex) {
-// case 0:
-// return element instanceof AbstractTaskContainer
-// || (element instanceof ITask && !(element instanceof AbstractRepositoryTask));
-// }
-// }
- return false;
- }
-
- public Object getValue(Object element, String property) {
- try {
- int columnIndex = Arrays.asList(columnNames).indexOf(property);
- if (element instanceof ITaskListElement) {
- final ITaskListElement taskListElement = (ITaskListElement) element;
- ITask task = null;
- if (taskListElement instanceof ITask) {
- task = (ITask) taskListElement;
- } else if (taskListElement instanceof AbstractQueryHit) {
- if (((AbstractQueryHit) taskListElement).getCorrespondingTask() != null) {
- task = ((AbstractQueryHit) taskListElement).getCorrespondingTask();
- }
- }
- switch (columnIndex) {
- case 0:
- if (task == null) {
- return Boolean.TRUE;
- } else {
- return Boolean.valueOf(task.isCompleted());
- }
- case 1:
- return "";
- case 2:
- String priorityString = taskListElement.getPriority().substring(1);
- int priorityInt = new Integer(priorityString);
- return priorityInt - 1;
- case 3:
- return "";
- case 4:
- return taskListElement.getSummary();
- }
- } else if (element instanceof AbstractTaskContainer) {
- AbstractTaskContainer cat = (AbstractTaskContainer) element;
- switch (columnIndex) {
- case 0:
- return Boolean.FALSE;
- case 1:
- return "";
- case 2:
- return "";
- case 3:
- return cat.getSummary();
- }
- } else if (element instanceof AbstractRepositoryQuery) {
- AbstractRepositoryQuery cat = (AbstractRepositoryQuery) element;
- switch (columnIndex) {
- case 0:
- return Boolean.FALSE;
- case 1:
- return "";
- case 2:
- return "";
- case 3:
- return cat.getSummary();
- }
- }
- } catch (Exception e) {
- MylarStatusHandler.log(e, e.getMessage());
- }
- return "";
- }
-
- public void modify(Object element, String property, Object value) {
- int columnIndex = -1;
- try {
- columnIndex = Arrays.asList(columnNames).indexOf(property);
- if (((TreeItem) element).getData() instanceof AbstractTaskContainer) {
- AbstractTaskContainer container = (AbstractTaskContainer) ((TreeItem) element).getData();
- switch (columnIndex) {
- case 0:
- TasksUiPlugin.getTaskListManager().getTaskList().renameContainer(container,
- ((String) value).trim());
- case 1:
- break;
- case 2:
- break;
- }
- } else if (((TreeItem) element).getData() instanceof ITaskListElement) {
- final ITaskListElement taskListElement = (ITaskListElement) ((TreeItem) element).getData();
- ITask task = null;
- if (taskListElement instanceof ITask) {
- task = (ITask) taskListElement;
- } else if (taskListElement instanceof AbstractQueryHit) {
- if (((AbstractQueryHit) taskListElement).getCorrespondingTask() != null) {
- task = ((AbstractQueryHit) taskListElement).getCorrespondingTask();
- }
- }
- switch (columnIndex) {
- case 0:
- if (!(task instanceof AbstractRepositoryTask)) {
- TasksUiPlugin.getTaskListManager().getTaskList().renameTask((Task) task,
- ((String) value).trim());
- }
- break;
- case 1:
- break;
- case 2:
- if (taskListElement instanceof AbstractQueryHit) {
- task = ((AbstractQueryHit) taskListElement).getOrCreateCorrespondingTask();
- }
- if (task != null) {
- if (task.isActive()) {
- new TaskDeactivateAction().run(task);
- previousTaskAction.setButtonStatus();
- } else {
- new TaskActivateAction().run(task);
- addTaskToHistory(task);
- previousTaskAction.setButtonStatus();
- }
- }
- break;
- // if (!(task instanceof AbstractRepositoryTask)) {
- // Integer intVal = (Integer) value;
- // task.setPriority("P" + (intVal + 1));
- // TasksUiPlugin.getTaskListManager().getTaskList().notifyLocalInfoChanged(task);
- // }
- // break;
- }
- }
- } catch (Exception e) {
- MylarStatusHandler.fail(e, e.getMessage(), true);
- }
- getViewer().refresh();
- }
- }
-
public void addTaskToHistory(ITask task) {
if (!TasksUiPlugin.getDefault().isMultipleActiveTasksMode()) {
TasksUiPlugin.getTaskListManager().getTaskActivationHistory().addTask(task);
@@ -851,7 +707,7 @@ public class TaskListView extends ViewPart {
final IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager();
Color categoryBackground = themeManager.getCurrentTheme().getColorRegistry().get(
TaskListColorsAndFonts.THEME_COLOR_TASKLIST_CATEGORY);
- taskListTableLabelProvider = new TaskListTableLabelProvider(new TaskElementLabelProvider(), PlatformUI
+ taskListTableLabelProvider = new TaskListTableLabelProvider(new TaskElementLabelProvider(true), PlatformUI
.getWorkbench().getDecoratorManager().getLabelDecorator(), categoryBackground, this);
getViewer().setLabelProvider(taskListTableLabelProvider);
@@ -862,11 +718,11 @@ public class TaskListView extends ViewPart {
// editors[1] = new ComboBoxCellEditor(getViewer().getTree(),
// PRIORITY_LEVEL_DESCRIPTIONS, SWT.READ_ONLY);
editors[1] = null;
-// editors[2] = null;
- editors[2] = new CheckboxCellEditor();
+ editors[2] = null;
+// editors[2] = new CheckboxCellEditor();
getViewer().setCellEditors(editors);
- getViewer().setCellModifier(new TaskListCellModifier());
+ getViewer().setCellModifier(new TaskListCellModifier(this));
tableSorter = new TaskListTableSorter(this, columnNames[sortIndex]);
getViewer().setSorter(tableSorter);
@@ -1279,7 +1135,8 @@ public class TaskListView extends ViewPart {
newLocalTaskAction = new NewLocalTaskAction(this);
removeFromCategoryAction = new RemoveFromCategoryAction(this);
renameAction = new RenameAction(this);
-
+ filteredTree.getViewer().addSelectionChangedListener(renameAction);
+
deleteAction = new DeleteAction();
collapseAll = new CollapseAllAction(this);
expandAll = new ExpandAllAction(this);
@@ -1451,7 +1308,7 @@ public class TaskListView extends ViewPart {
}
}
- private boolean isInRenameAction = false;
+ boolean isInRenameAction = false;
public void setInRenameAction(boolean b) {
isInRenameAction = b;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractTaskDecorator.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractTaskDecorator.java
new file mode 100644
index 000000000..2aaa8d9e0
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractTaskDecorator.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2004 - 2006 Mylar 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.mylar.tasks.ui;
+
+import org.eclipse.jface.viewers.IDecoration;
+import org.eclipse.jface.viewers.ILightweightLabelDecorator;
+
+/**
+ * Enforces consistency between decorators.
+ *
+ * @author Mik Kersten
+ */
+public abstract class AbstractTaskDecorator implements ILightweightLabelDecorator {
+
+ /**
+ * Default location for the task kind decoration, used to distinguish
+ * between different tasks within a repository (e.g. defect vs.
+ * enhancement).
+ */
+ protected int getQuadrantForKind() {
+ return IDecoration.BOTTOM_LEFT;
+ }
+}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
index f4e52ee99..8cf0753c8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/TasksUiUtil.java
@@ -87,21 +87,13 @@ public class TasksUiUtil {
public static Image getImageForPriority(Task.PriorityLevel priorityLevel) {
if (priorityLevel == null) {
return null;
+ } else {
+ ImageDescriptor imageDescriptor = getImageDescriptorForPriority(priorityLevel);
+ if (imageDescriptor != null) {
+ return TasksUiImages.getImage(imageDescriptor);
+ }
}
- switch (priorityLevel) {
- case P1:
- return TasksUiImages.getImage(TasksUiImages.PRIORITY_1);
- case P2:
- return TasksUiImages.getImage(TasksUiImages.PRIORITY_2);
- case P3:
- return TasksUiImages.getImage(TasksUiImages.PRIORITY_3);
- case P4:
- return TasksUiImages.getImage(TasksUiImages.PRIORITY_4);
- case P5:
- return TasksUiImages.getImage(TasksUiImages.PRIORITY_5);
- default:
- return null;
- }
+ return null;
}
public static ImageDescriptor getImageDescriptorForPriority(Task.PriorityLevel priorityLevel) {

Back to the top