Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2005-06-29 19:15:31 -0400
committermkersten2005-06-29 19:15:31 -0400
commita69cd016f4f53562ca0b94a22c0e58d70bd05723 (patch)
treec669844568721523c4eb9c18cabebe92176bd4ad
parent511f3d313ba97192aa52383783b65536be59e780 (diff)
downloadorg.eclipse.mylyn.tasks-a69cd016f4f53562ca0b94a22c0e58d70bd05723.tar.gz
org.eclipse.mylyn.tasks-a69cd016f4f53562ca0b94a22c0e58d70bd05723.tar.xz
org.eclipse.mylyn.tasks-a69cd016f4f53562ca0b94a22c0e58d70bd05723.zip
UI finessing
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaHit.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaQueryCategory.java25
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskCategory.java7
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java2
9 files changed, 37 insertions, 10 deletions
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
index 23c823b42..751cb0fc5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/AbstractCategory.java
@@ -26,7 +26,7 @@ public class AbstractCategory implements ITaskListElement {
this.description = description;
}
- public Image getTypeIcon() {
+ public Image getIcon() {
return null;
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaHit.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaHit.java
index 79320b426..96fe8ab9d 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaHit.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaHit.java
@@ -28,7 +28,7 @@ public class BugzillaHit implements ITaskListElement {
this.priority = priority;
this.id = id;
}
- public Image getTypeIcon() {
+ public Image getIcon() {
return BugzillaImages.getImage(BugzillaImages.BUG);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaQueryCategory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaQueryCategory.java
index 68972d967..0730e47b8 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaQueryCategory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaQueryCategory.java
@@ -7,7 +7,9 @@
*
* Contributors:
* University Of British Columbia - initial API and implementation
- *******************************************************************************/package org.eclipse.mylar.tasks;
+ *******************************************************************************/
+
+package org.eclipse.mylar.tasks;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -26,6 +28,8 @@ import org.eclipse.mylar.bugzilla.search.BugzillaSearchHit;
import org.eclipse.mylar.tasks.bugzilla.search.BugzillaCategorySearchOperation;
import org.eclipse.mylar.tasks.bugzilla.search.BugzillaResultCollector;
import org.eclipse.mylar.tasks.bugzilla.search.BugzillaCategorySearchOperation.ICategorySearchListener;
+import org.eclipse.mylar.ui.MylarImages;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.PlatformUI;
/**
@@ -36,6 +40,7 @@ public class BugzillaQueryCategory extends AbstractCategory {
private static final long serialVersionUID = 5517146402031743253L;
private String url;
private List<BugzillaHit> hits = new ArrayList<BugzillaHit>();
+ private boolean hasBeenRefreshed = false;
public class BugzillaQueryCategorySearchListener implements
ICategorySearchListener {
@@ -43,11 +48,10 @@ public class BugzillaQueryCategory extends AbstractCategory {
Map<Integer, BugzillaSearchHit> hits = new HashMap<Integer, BugzillaSearchHit>();
public void searchCompleted(BugzillaResultCollector collector) {
-
for(BugzillaSearchHit hit: collector.getResults()){
// HACK need the server name and handle properly
- addHit(new BugzillaHit(hit.getDescription(), hit.getPriority(), hit.getId()));
+ addHit(new BugzillaHit(hit.getId() + ": " + hit.getDescription(), hit.getPriority(), hit.getId()));
}
}
@@ -60,6 +64,20 @@ public class BugzillaQueryCategory extends AbstractCategory {
this.url = url;
}
+ public String getDescription() {
+ if (hits.size() > 0) {
+ return super.getDescription();
+ } else if (!hasBeenRefreshed) {
+ return super.getDescription() + " <needs refresh>";
+ } else {
+ return super.getDescription() + " <no hits>";
+ }
+ }
+
+ public Image getIcon() {
+ return MylarImages.getImage(MylarImages.CATEGORY_QUERY);
+ }
+
public String getUrl() {
return url;
}
@@ -86,6 +104,7 @@ public class BugzillaQueryCategory extends AbstractCategory {
try {
// execute the search operation
catSearch.execute(new NullProgressMonitor());
+ hasBeenRefreshed = true;
// get the status of the search operation
status[0] = catSearch.getStatus();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java
index f1e5097e7..f05dbe9de 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/BugzillaTask.java
@@ -459,7 +459,7 @@ public class BugzillaTask extends Task {
return -1;
}
- public Image getTypeIcon() {
+ public Image getIcon() {
return MylarImages.getImage(MylarImages.TASK_BUGZILLA);
}
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
index a28ff0215..fb132f3e6 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ITaskListElement.java
@@ -16,7 +16,8 @@ import org.eclipse.swt.graphics.Image;
* @author Ken Sueda
*/
public interface ITaskListElement {
- public abstract Image getTypeIcon();
+
+ public abstract Image getIcon();
public abstract Image getStatusIcon();
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
index 47fadb95d..59fddb211 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/Task.java
@@ -280,7 +280,7 @@ public class Task implements ITask, ITaskListElement {
return parentCategory;
}
- public Image getTypeIcon() {
+ public Image getIcon() {
return MylarImages.getImage(MylarImages.TASK);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskCategory.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskCategory.java
index 03ecdc3a9..5bb302ed2 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskCategory.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/TaskCategory.java
@@ -17,6 +17,9 @@ import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
+import org.eclipse.mylar.ui.MylarImages;
+import org.eclipse.swt.graphics.Image;
+
/**
* @author Mik Kersten
@@ -31,6 +34,10 @@ public class TaskCategory extends AbstractCategory implements Serializable {
super(description);
}
+ public Image getIcon() {
+ return MylarImages.getImage(MylarImages.CATEGORY);
+ }
+
public void addTask(ITask task) {
tasks.add(task);
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java
index f8e62a5f0..4a0b4a40e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/bugzilla/BugzillaContentProvider.java
@@ -34,7 +34,7 @@ public class BugzillaContentProvider {
if (bugTask == null) return "<no info>";
String prefix = //((bugTask.isDirty()) ? ">" : "") +
- "<" + BugzillaTask.getBugId(bugTask.getHandle()) + ">: ";
+ BugzillaTask.getBugId(bugTask.getHandle()) + ": ";
if (bugTask.getState() == BugzillaTask.BugTaskState.DOWNLOADING) {
return prefix + ": <Downloading bug report from server...>";
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
index ac18a5ef8..9c4cf0028 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/views/TaskListLabelProvider.java
@@ -82,7 +82,7 @@ public class TaskListLabelProvider extends LabelProvider implements ITableLabelP
if (columnIndex == 0) {
return ((ITaskListElement)element).getStatusIcon();
} else if (columnIndex == 1) {
- return ((ITaskListElement)element).getTypeIcon();
+ return ((ITaskListElement)element).getIcon();
} else {
return null;
}

Back to the top