Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaxsun McCarthy Huggan2016-10-29 19:11:31 -0400
committerAlexei Trebounskikh2018-11-30 16:46:51 -0500
commit7b7f9d93067ec49bb0e2740993ccf8fe0c201659 (patch)
tree7ebc829d102cb952b4ba86ef07c8d947b6799a5b
parent0df605985bb87ffeeb842632fa207d61e713fc71 (diff)
downloadorg.eclipse.mylyn.reviews-7b7f9d93067ec49bb0e2740993ccf8fe0c201659.tar.gz
org.eclipse.mylyn.reviews-7b7f9d93067ec49bb0e2740993ccf8fe0c201659.tar.xz
org.eclipse.mylyn.reviews-7b7f9d93067ec49bb0e2740993ccf8fe0c201659.zip
394733: Gerrit task list tooltip shows review project/repository
Change-Id: Ib1f0bae5b6bdeb9ca3137115a9bc141753274455 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=394733 Signed-off-by: Jaxsun McCarthy Huggan <jaxsun.mccarthy@tasktop.com>
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java20
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/Messages.java2
-rw-r--r--org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/messages.properties1
3 files changed, 17 insertions, 6 deletions
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java
index b4e4afbb..5fb39c03 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java
@@ -332,27 +332,34 @@ public class GerritConnector extends ReviewsConnector {
task.setModificationDate(oldModificationDate);
}
+ GerritTaskSchema schema = GerritTaskSchema.getDefault();
TaskAttribute status = taskData.getRoot().getMappedAttribute(TaskAttribute.STATUS);
- TaskAttribute codeReview = taskData.getRoot().getAttribute(GerritTaskSchema.getDefault().REVIEW_STATE.getKey());
- TaskAttribute verified = taskData.getRoot().getAttribute(GerritTaskSchema.getDefault().VERIFY_STATE.getKey());
- TaskAttribute branch = taskData.getRoot().getAttribute(GerritTaskSchema.getDefault().BRANCH.getKey());
+ TaskAttribute codeReview = taskData.getRoot().getAttribute(schema.REVIEW_STATE.getKey());
+ TaskAttribute verified = taskData.getRoot().getAttribute(schema.VERIFY_STATE.getKey());
+ TaskAttribute project = taskData.getRoot().getAttribute(schema.PROJECT.getKey());
+ TaskAttribute branch = taskData.getRoot().getAttribute(schema.BRANCH.getKey());
setAttribute(task, TaskAttribute.STATUS, status);
setAttribute(task, ReviewsCoreConstants.CODE_REVIEW, codeReview);
setAttribute(task, ReviewsCoreConstants.VERIFIED, verified);
setAttribute(task, ReviewsCoreConstants.BRANCH, branch);
- addExtendedTooltip(task);
+ addExtendedTooltip(task, project);
super.updateTaskFromTaskData(taskRepository, task, taskData);
}
@SuppressWarnings("restriction")
- private void addExtendedTooltip(ITask task) {
+ private void addExtendedTooltip(ITask task, TaskAttribute projectAttribute) {
+ String projectValue = projectAttribute == null ? null : projectAttribute.getValue();
String branchValue = task.getAttribute(ReviewsCoreConstants.BRANCH);
String codeReviewValue = task.getAttribute(ReviewsCoreConstants.CODE_REVIEW);
String verifiedValue = task.getAttribute(ReviewsCoreConstants.VERIFIED);
+ String projectTooltip = null;
+ if (!Strings.isNullOrEmpty(projectValue)) {
+ projectTooltip = NLS.bind(Messages.GerritConnector_ProjectTooltip, projectValue);
+ }
String branchTooltip = null;
if (!Strings.isNullOrEmpty(branchValue)) {
branchTooltip = NLS.bind(Messages.GerritConnector_BranchTooltip, branchValue);
@@ -360,7 +367,8 @@ public class GerritConnector extends ReviewsConnector {
String reviewTooltip = createVoteTooltipText(Messages.GerritConnector_CodeReviewTooltip, codeReviewValue);
String verifiedTooltip = createVoteTooltipText(Messages.GerritConnector_VerifiedTooltip, verifiedValue);
- String tooltip = Joiner.on("\n").skipNulls().join(branchTooltip, reviewTooltip, verifiedTooltip); //$NON-NLS-1$
+ String tooltip = Joiner.on("\n").skipNulls().join(projectTooltip, branchTooltip, reviewTooltip, //$NON-NLS-1$
+ verifiedTooltip);
if (!tooltip.isEmpty()) {
task.setAttribute(ITasksCoreConstants.ATTRIBUTE_TASK_EXTENDED_TOOLTIP, tooltip);
}
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/Messages.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/Messages.java
index e5da2475..d94d71ac 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/Messages.java
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/Messages.java
@@ -25,6 +25,8 @@ public class Messages extends NLS {
public static String GerritConnector_Label;
+ public static String GerritConnector_ProjectTooltip;
+
public static String GerritConnector_VerifiedTooltip;
public static String GerritQueryResultSchema_Branch;
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/messages.properties b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/messages.properties
index 606a7afd..bfffeae1 100644
--- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/messages.properties
+++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/messages.properties
@@ -13,6 +13,7 @@ GerritConnector_BranchTooltip=Branch: {0}
GerritConnector_CodeReviewTooltip=Code Review: {0}{1}
GerritConnector_Executing_query=Executing query
GerritConnector_Label=Gerrit Code Review (supports {0} to {1})
+GerritConnector_ProjectTooltip=Project: {0}
GerritConnector_VerifiedTooltip=Verified: {0}{1}
GerritQueryResultSchema_Branch=Branch
GerritQueryResultSchema_ChangeId=Change-Id

Back to the top