Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-08-30 21:29:34 +0000
committersminto2005-08-30 21:29:34 +0000
commitc21d048600678bfd09126b2759732415690941c7 (patch)
treedbb2401c269a9ceb7059097b291b79afaa6b7b2c
parentf9d875d48a947f57f3a52011a03f0dcda90c3bab (diff)
downloadorg.eclipse.mylyn.tasks-c21d048600678bfd09126b2759732415690941c7.tar.gz
org.eclipse.mylyn.tasks-c21d048600678bfd09126b2759732415690941c7.tar.xz
org.eclipse.mylyn.tasks-c21d048600678bfd09126b2759732415690941c7.zip
updated the icons
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-con.gifbin915 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-in.gifbin905 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-out.gifbin881 -> 0 bytes
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java23
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java6
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/TaskListImages.java61
8 files changed, 83 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-con.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-con.gif
deleted file mode 100644
index 83c6e094d..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-con.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-in.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-in.gif
deleted file mode 100644
index a62cc75e1..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-in.gif
+++ /dev/null
Binary files differ
diff --git a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-out.gif b/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-out.gif
deleted file mode 100644
index 4b9634f78..000000000
--- a/org.eclipse.mylyn.bugzilla.ui/icons/etool16/task-bug-out.gif
+++ /dev/null
Binary files differ
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 a1234e439..b871b8f76 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
@@ -16,6 +16,7 @@ import java.util.HashMap;
import java.util.Map;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.mylar.tasklist.TaskListImages.MylarTasklistOverlayDescriptor;
import org.eclipse.swt.graphics.Image;
/**
@@ -64,11 +65,18 @@ public class BugzillaImages {
public static final ImageDescriptor IMG_TOOL_ADD_TO_FAVORITES = create(T_ELCL, "bug-favorite.gif");
public static final ImageDescriptor BUG = create(T_ELCL, "bug.gif");
public static final ImageDescriptor IMG_COMMENT = create(T_ELCL, "bug-comment.gif");
- public static final ImageDescriptor TASK_BUGZILLA = create(T_TOOL, "task-bug.gif");
- public static final ImageDescriptor TASK_BUGZILLA_INCOMMING = create(T_TOOL, "task-bug-in.gif");;
- public static final ImageDescriptor TASK_BUGZILLA_CONFLICT = create(T_TOOL, "task-bug-con.gif");;
- public static final ImageDescriptor TASK_BUGZILLA_OUTGOING = create(T_TOOL, "task-bug-out.gif");;
+ public static final ImageDescriptor TASK_BUG = create(T_TOOL, "task-bug.gif");
+ public static final ImageDescriptor OVERLAY_INCOMMING = create(T_ELCL, "overlay-incoming.gif");
+ 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, null);
+
public static final ImageDescriptor TASK_BUGZILLA_NEW = create(T_TOOL, "task-bug-new.gif");
public static final ImageDescriptor CATEGORY_QUERY = create(T_TOOL, "category-query.gif");
public static final ImageDescriptor CATEGORY_QUERY_NEW = create(T_TOOL, "category-query-new.gif");
@@ -78,6 +86,8 @@ public class BugzillaImages {
public static final ImageDescriptor REMOVE = create("", "remove.gif");
public static final ImageDescriptor SELECT_ALL = create("", "selectAll.gif");
public static final ImageDescriptor OPEN = create("", "openresult.gif");
+
+
@@ -89,6 +99,10 @@ public class BugzillaImages {
}
}
+ private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay) {
+ return new MylarTasklistOverlayDescriptor(base, overlay);
+ }
+
private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
if (baseURL == null)
throw new MalformedURLException();
@@ -111,5 +125,4 @@ public class BugzillaImages {
}
return image;
}
-
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
index e08176b0b..2cb03a84b 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaHit.java
@@ -58,7 +58,7 @@ public class BugzillaHit implements IQueryHit {
if(hasCorrespondingActivatableTask()){
return task.getIcon();
} else {
- return BugzillaImages.getImage(BugzillaImages.BUG);
+ return BugzillaImages.getImage(BugzillaImages.BUGZILLA_HIT);
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
index aaae8c5df..6a0de02f5 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java
@@ -320,10 +320,10 @@ public class BugzillaTask extends Task {
if(!isBugDownloaded() && offline){
MessageDialog.openInformation(null, "Unable to open bug", "Unable to open the selected bugzilla task since you are currently offline");
return;
- }else if(!isBugDownloaded() && syncState != BugReportSyncState.OUTGOING) {
+ }else if(!isBugDownloaded() && syncState != BugReportSyncState.OUTGOING && syncState != BugReportSyncState.CONFLICT) {
input.getBugTask().downloadReport();
input.setOfflineBug(input.getBugTask().getBugReport());
- } else if(syncState == BugReportSyncState.OUTGOING){
+ } else if(syncState == BugReportSyncState.OUTGOING || syncState == BugReportSyncState.CONFLICT){
input.setOfflineBug(bugReport);
}
@@ -438,7 +438,7 @@ public class BugzillaTask extends Task {
@Override
protected IStatus run(IProgressMonitor monitor) {
try{
- boolean isLikeOffline = offline || syncState == BugReportSyncState.OUTGOING;
+ boolean isLikeOffline = offline || syncState == BugReportSyncState.OUTGOING || syncState == BugReportSyncState.CONFLICT;
final BugzillaTaskEditorInput input = new BugzillaTaskEditorInput(bugTask, isLikeOffline);
// state = BugTaskState.OPENING;
// notifyTaskDataChange();
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
index ce561da5d..3c913c206 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditorInput.java
@@ -101,7 +101,7 @@ public class BugzillaTaskEditorInput extends ExistingBugEditorInput {
* Returns the offline bug for this input's Bugzilla task
*/
public BugReport getOfflineBug() {
- if(offline || bugTask.getSyncState() == BugReportSyncState.OUTGOING)
+ if(offline || bugTask.getSyncState() == BugReportSyncState.OUTGOING || bugTask.getSyncState() == BugReportSyncState.CONFLICT)
return offlineBug;
else
return super.getBug();
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 4d2cb25b5..6af288585 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
@@ -18,9 +18,13 @@ import java.net.URL;
import java.util.HashMap;
import java.util.Map;
+import org.eclipse.jface.resource.CompositeImageDescriptor;
import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.Assert;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.widgets.Display;
/**
@@ -44,7 +48,9 @@ public class TaskListImages {
public static final ImageDescriptor COLOR_PALETTE = create(T_ELCL, "color-palette.gif");
- public static final ImageDescriptor TASK = create(T_TOOL, "task.gif");
+ public static final ImageDescriptor TASK2 = create(T_TOOL, "task.gif");
+ public static final ImageDescriptor TASK = createWithOverlay(TASK2, null);
+
public static final ImageDescriptor TASK_NEW = create(T_TOOL, "task-new.gif");
public static final ImageDescriptor CATEGORY = create(T_TOOL, "category.gif");
public static final ImageDescriptor CATEGORY_NEW = create(T_TOOL, "category-new.gif");
@@ -72,6 +78,10 @@ public class TaskListImages {
}
}
+ private static ImageDescriptor createWithOverlay(ImageDescriptor base, ImageDescriptor overlay) {
+ return new MylarTasklistOverlayDescriptor(base, overlay);
+ }
+
private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
if (baseURL == null)
throw new MalformedURLException();
@@ -93,4 +103,53 @@ public class TaskListImages {
}
return image;
}
+
+
+ public static class MylarTasklistOverlayDescriptor extends CompositeImageDescriptor {
+
+ private ImageData base;
+ private ImageData overlay;
+ private Point fSize;
+
+ public MylarTasklistOverlayDescriptor(ImageDescriptor baseDesc, ImageDescriptor overlayDesc) {
+ this.base = getImageData(baseDesc);
+ if(overlayDesc != null)
+ this.overlay = getImageData(overlayDesc);
+ Point size = new Point(base.width, base.height);
+ setImageSize(size);
+ }
+
+ @Override
+ protected void drawCompositeImage(int width, int height) {
+ drawImage(base, 0, 0);
+ if(overlay != null)
+ drawImage(overlay, base.width - overlay.width, 0);
+ }
+
+ private ImageData getImageData(ImageDescriptor descriptor) {
+ ImageData data= descriptor.getImageData(); // see bug 51965: getImageData can return null
+ if (data == null) {
+ data= DEFAULT_IMAGE_DATA;
+ }
+ return data;
+ }
+
+ /**
+ * Sets the size of the image created by calling <code>createImage()</code>.
+ *
+ * @param size the size of the image returned from calling <code>createImage()</code>
+ * @see ImageDescriptor#createImage()
+ */
+ public void setImageSize(Point size) {
+ Assert.isNotNull(size);
+ Assert.isTrue(size.x >= 0 && size.y >= 0);
+ fSize= size;
+ }
+
+ @Override
+ protected Point getSize() {
+ return new Point(fSize.x, fSize.y);
+ }
+
+ }
}

Back to the top