Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 b4e4afbbd..5fb39c031 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 e5da24755..d94d71ac4 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 606a7afdf..bfffeae17 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