diff options
| author | Kevin Sawicki | 2011-04-20 21:00:04 +0000 |
|---|---|---|
| committer | Kevin Sawicki | 2011-04-20 21:00:04 +0000 |
| commit | 7db856ebcf4464a622e92847bbc9d4347153efc3 (patch) | |
| tree | 193d3966072ab2a3b8b80a8fec93c76f451a7ebc | |
| parent | 1bfc5704f606a1ed7d9c9a09053cfee844401437 (diff) | |
| download | egit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.tar.gz egit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.tar.xz egit-github-7db856ebcf4464a622e92847bbc9d4347153efc3.zip | |
Use string array as input to labels table in query page.
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>
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 bd0fd115..0be3d1ae 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 407030bd..c6d5a374 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; } |
