summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Sawicki2011-04-20 17:00:04 (EDT)
committer Kevin Sawicki2011-04-20 17:00:04 (EDT)
commit7db856ebcf4464a622e92847bbc9d4347153efc3 (patch)
tree193d3966072ab2a3b8b80a8fec93c76f451a7ebc
parent1bfc5704f606a1ed7d9c9a09053cfee844401437 (diff)
downloadegit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.zip
egit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.tar.gz
egit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.tar.bz2
Use string array as input to labels table in query page.refs/changes/83/3183/1
This fixes an issue with labels not correctly being check when opening an existing query. Change-Id: I0321dca476ebf72e7cc722da37afca5aa19f32f6 Signed-off-by: Kevin Sawicki <kevin@github.com>
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Label.java14
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java11
2 files changed, 19 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Label.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Label.java
index bd0fd11..0be3d1a 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Label.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/github/internal/Label.java
@@ -33,6 +33,20 @@ public class Label {
}
/**
+ * @see java.lang.Object#hashCode()
+ */
+ public int hashCode() {
+ return this.name.hashCode();
+ }
+
+ /**
+ * @see java.lang.Object#toString()
+ */
+ public String toString() {
+ return this.name;
+ }
+
+ /**
* @return color
*/
public String getColor() {
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java
index 407030b..c6d5a37 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/github/ui/internal/GitHubRepositoryQueryPage.java
@@ -13,6 +13,7 @@
package org.eclipse.mylyn.github.ui.internal;
import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
@@ -109,11 +110,6 @@ public class GitHubRepositoryQueryPage extends AbstractRepositoryQueryPage {
labelsViewer.setContentProvider(ArrayContentProvider.getInstance());
labelsViewer.setLabelProvider(new LabelProvider() {
- public String getText(Object element) {
- return ((org.eclipse.mylyn.github.internal.Label) element)
- .getName();
- }
-
public Image getImage(Object element) {
return GitHubImages.get(GitHubImages.GITHUB_ISSUE_LABEL_OBJ);
}
@@ -246,7 +242,10 @@ public class GitHubRepositoryQueryPage extends AbstractRepositoryQueryPage {
List<org.eclipse.mylyn.github.internal.Label> labels = connector
.getLabels(repository);
Collections.sort(labels, new LabelComparator());
- this.labelsViewer.setInput(labels);
+ List<String> labelNames = new ArrayList<String>(labels.size());
+ for (org.eclipse.mylyn.github.internal.Label label : labels)
+ labelNames.add(label.getName());
+ this.labelsViewer.setInput(labelNames);
}
return hasLabels;
}