Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-10-27 21:33:51 -0400
committermkersten2005-10-27 21:33:51 -0400
commit3d67d8a8020903bd872a611be33dabde773f8110 (patch)
tree8372dad8c2ab324d4556eb981663675360a26b8b
parentf0c63eb0809596da9b4c392ec1a2d4c6152321a3 (diff)
downloadorg.eclipse.mylyn.tasks-3d67d8a8020903bd872a611be33dabde773f8110.tar.gz
org.eclipse.mylyn.tasks-3d67d8a8020903bd872a611be33dabde773f8110.tar.xz
org.eclipse.mylyn.tasks-3d67d8a8020903bd872a611be33dabde773f8110.zip
Patch for Bug #113585: Automatically fetch task title
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java14
-rw-r--r--org.eclipse.mylyn.tasks.ui/icons/etool16/overlay-web.gifbin0 -> 271 bytes
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITaskListElement.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java27
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskInputDialog.java5
6 files changed, 35 insertions, 20 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
index 77de23d0a..b9af84f5a 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
@@ -72,11 +72,11 @@ public class BugzillaImages {
public static final ImageDescriptor OVERLAY_OUTGOING = create(T_ELCL, "overlay-outgoing.gif");
public static final ImageDescriptor OVERLAY_CONFLICT = create(T_ELCL, "overlay-conflicting.gif");
- public static final ImageDescriptor TASK_BUGZILLA = createWithOverlay(TASK_BUG, null);
- public static final ImageDescriptor TASK_BUGZILLA_INCOMMING = createWithOverlay(TASK_BUGZILLA, OVERLAY_INCOMMING);
- public static final ImageDescriptor TASK_BUGZILLA_CONFLICT = createWithOverlay(TASK_BUGZILLA, OVERLAY_CONFLICT);
- public static final ImageDescriptor TASK_BUGZILLA_OUTGOING = createWithOverlay(TASK_BUGZILLA, OVERLAY_OUTGOING);
- public static final ImageDescriptor BUGZILLA_HIT = createWithOverlay(BUG_HIT, null);
+ public static final ImageDescriptor TASK_BUGZILLA = createWithOverlay(TASK_BUG, null, true);
+ public static final ImageDescriptor TASK_BUGZILLA_INCOMMING = createWithOverlay(TASK_BUGZILLA, OVERLAY_INCOMMING, true);
+ public static final ImageDescriptor TASK_BUGZILLA_CONFLICT = createWithOverlay(TASK_BUGZILLA, OVERLAY_CONFLICT, true);
+ public static final ImageDescriptor TASK_BUGZILLA_OUTGOING = createWithOverlay(TASK_BUGZILLA, OVERLAY_OUTGOING, true);
+ public static final ImageDescriptor BUGZILLA_HIT = createWithOverlay(BUG_HIT, null, true);
public static final ImageDescriptor BUGZILLA_HIT_INCOMMING = BUGZILLA_HIT;//createWithOverlay(BUGZILLA_HIT, OVERLAY_INCOMMING);
public static final ImageDescriptor TASK_BUGZILLA_NEW = create(T_TOOL, "task-bug-new.gif");
@@ -97,8 +97,8 @@ public class BugzillaImages {
}
}
- private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay) {
- return new MylarTasklistOverlayDescriptor(base, overlay);
+ private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay, boolean top) {
+ return new MylarTasklistOverlayDescriptor(base, overlay, top);
}
private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
diff --git a/org.eclipse.mylyn.tasks.ui/icons/etool16/overlay-web.gif b/org.eclipse.mylyn.tasks.ui/icons/etool16/overlay-web.gif
new file mode 100644
index 000000000..58eedbcb0
--- /dev/null
+++ b/org.eclipse.mylyn.tasks.ui/icons/etool16/overlay-web.gif
Binary files differ
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITaskListElement.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITaskListElement.java
index cd1799ab6..798d25c46 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITaskListElement.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ITaskListElement.java
@@ -26,6 +26,9 @@ public interface ITaskListElement {
public Color GRAY_VERY_LIGHT = new Color(Display.getDefault(), 200, 200, 200); // TODO: use theme?
+ /**
+ * TODO: refactor to label decorator
+ */
public abstract Image getIcon();
public abstract Image getStatusIcon();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
index c8cb860dd..6f4fdcacb 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/Task.java
@@ -353,7 +353,11 @@ public class Task implements ITask {
}
public Image getIcon() {
- return TaskListImages.getImage(TaskListImages.TASK);
+ if (issueReportURL != null && !issueReportURL.trim().equals("") && !issueReportURL.equals("http://")) {
+ return TaskListImages.getImage(TaskListImages.TASK_WEB);
+ } else {
+ return TaskListImages.getImage(TaskListImages.TASK);
+ }
}
public String getDescription(boolean label) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
index 81b406c8d..a666d73ba 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java
@@ -50,7 +50,10 @@ public class TaskListImages {
public static final ImageDescriptor COLOR_PALETTE = create(T_ELCL, "color-palette.gif");
public static final ImageDescriptor TASK2 = create(T_TOOL, "task.gif");
- public static final ImageDescriptor TASK = createWithOverlay(TASK2, null);
+ public static final ImageDescriptor TASK = createWithOverlay(TASK2, null, true);
+
+ public static final ImageDescriptor WEB_OVERLAY = create(T_TOOL, "overlay-web.gif");
+ public static final ImageDescriptor TASK_WEB = createWithOverlay(TASK2, WEB_OVERLAY, false);
public static final ImageDescriptor TASK_NEW = create(T_TOOL, "task-new.gif");
public static final ImageDescriptor CATEGORY = create(T_TOOL, "category.gif");
@@ -69,7 +72,7 @@ public class TaskListImages {
public static final ImageDescriptor TASK_INACTIVE_CONTEXT = create(T_TOOL, "task-context.gif");
public static final ImageDescriptor TASK_COMPLETE = create(T_TOOL, "task-complete.gif");
public static final ImageDescriptor TASK_INCOMPLETE = create(T_TOOL, "task-incomplete.gif");
-
+
public static final ImageDescriptor COLLAPSE_ALL = create(T_ELCL, "collapseall.png");
private static ImageDescriptor create(String prefix, String name) {
@@ -80,8 +83,8 @@ public class TaskListImages {
}
}
- private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay) {
- return new MylarTasklistOverlayDescriptor(base, overlay);
+ private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay, boolean top) {
+ return new MylarTasklistOverlayDescriptor(base, overlay, top);
}
private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
@@ -122,11 +125,12 @@ public class TaskListImages {
private ImageData base;
private ImageData overlay;
private Point fSize;
+ private boolean top;
- public MylarTasklistOverlayDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc) {
+ public MylarTasklistOverlayDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc, boolean top) {
this.base = getImageData(baseDesc);
- if(overlayDesc != null)
- this.overlay = getImageData(overlayDesc);
+ this.top = top;
+ if(overlayDesc != null) this.overlay = getImageData(overlayDesc);
Point size = new Point(base.width, base.height);
setImageSize(size);
}
@@ -134,8 +138,13 @@ public class TaskListImages {
@Override
protected void drawCompositeImage(int width, int height) {
drawImage(base, 0, 0);
- if(overlay != null)
- drawImage(overlay, base.width - overlay.width, 0);
+ if(overlay != null) {
+ if (top) {
+ drawImage(overlay, base.width - overlay.width, 0);
+ } else {
+ drawImage(overlay, base.width - overlay.width, base.height - overlay.height);
+ }
+ }
}
private ImageData getImageData(ImageDescriptor descriptor) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskInputDialog.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskInputDialog.java
index 7562ac753..5f52e22ae 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskInputDialog.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/TaskInputDialog.java
@@ -67,7 +67,7 @@ public class TaskInputDialog extends Dialog {
GridData data = new GridData(GridData.GRAB_HORIZONTAL
| GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
| GridData.VERTICAL_ALIGN_CENTER);
- data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
+ data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH + 100);
composite.setLayoutData(data);
Label taskNameLabel = new Label(composite, SWT.WRAP);
@@ -103,7 +103,6 @@ public class TaskInputDialog extends Dialog {
}
});
-
Label urlLabel = new Label(composite, SWT.WRAP);
urlLabel.setText("Web Link:");
urlLabel.setFont(parent.getFont());
@@ -116,7 +115,7 @@ public class TaskInputDialog extends Dialog {
getDescButton = new Button(composite, SWT.PUSH);
getDescButton.setText("Get Description");
- getDescButton.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL));
+ getDescButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
setButtonStatus();

Back to the top