summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Davis2014-04-16 16:16:37 (EDT)
committerTomasz Zarna2014-04-25 17:33:49 (EDT)
commit838ed5b57b614615b397822b770016c83e5e1da4 (patch)
tree6aaf092d04386ce83687872561874d76df6b0f80
parent48191970115a3e5fedc002932e3de5c4983a8cb4 (diff)
downloadorg.eclipse.mylyn.reviews-838ed5b57b614615b397822b770016c83e5e1da4.zip
org.eclipse.mylyn.reviews-838ed5b57b614615b397822b770016c83e5e1da4.tar.gz
org.eclipse.mylyn.reviews-838ed5b57b614615b397822b770016c83e5e1da4.tar.bz2
409418: add toolbar button to open review navigatorrefs/changes/68/25168/5
provide user guided entry to review navigator Change-Id: Ifd325a9629134be9f7e64589489842cf9a7ba5f0 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=409418 Signed-off-by: Sam Davis <sam.davis@tasktop.com>
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/AbstractReviewTaskEditorPage.java22
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/Messages.java2
-rw-r--r--org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/messages.properties1
3 files changed, 23 insertions, 2 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/AbstractReviewTaskEditorPage.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/AbstractReviewTaskEditorPage.java
index 6ce99bb..549b911 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/AbstractReviewTaskEditorPage.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/AbstractReviewTaskEditorPage.java
@@ -14,10 +14,15 @@ package org.eclipse.mylyn.reviews.ui.spi.editor;
import java.io.File;
import java.util.Date;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.mylyn.commons.workbench.WorkbenchUtil;
+import org.eclipse.mylyn.internal.reviews.ui.ReviewsImages;
+import org.eclipse.mylyn.internal.reviews.ui.ReviewsUiConstants;
import org.eclipse.mylyn.internal.tasks.ui.actions.SynchronizeEditorAction;
-import org.eclipse.mylyn.internal.tasks.ui.editors.Messages;
import org.eclipse.mylyn.internal.tasks.ui.util.TasksUiInternal;
import org.eclipse.mylyn.reviews.core.model.IRepository;
import org.eclipse.mylyn.reviews.core.model.IReview;
@@ -82,7 +87,8 @@ public abstract class AbstractReviewTaskEditorPage extends AbstractTaskEditorPag
.getFilePath(factoryProvider.getContainerSegment(), "Review", getTask().getTaskId(), "reviews") //$NON-NLS-1$ //$NON-NLS-2$
.toOSString();
if (!new File(reviewPath).exists()) {
- getTaskEditor().setMessage(Messages.AbstractTaskEditorPage_Synchronize_to_retrieve_task_data,
+ getTaskEditor().setMessage(
+ org.eclipse.mylyn.internal.tasks.ui.editors.Messages.AbstractTaskEditorPage_Synchronize_to_retrieve_task_data,
IMessageProvider.WARNING, new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
@@ -139,4 +145,16 @@ public abstract class AbstractReviewTaskEditorPage extends AbstractTaskEditorPag
public IReview getReview() {
return reviewConsumer.getModelObject();
}
+
+ @Override
+ public void fillToolBar(IToolBarManager toolBarManager) {
+ toolBarManager.add(new Separator());
+ toolBarManager.add(new Action(Messages.AbstractReviewTaskEditorPage_Show_Review_Navigator, ReviewsImages.REVIEW) {
+ @Override
+ public void run() {
+ WorkbenchUtil.showViewInActiveWindow(ReviewsUiConstants.REVIEW_EXPLORER_ID);
+ }
+ });
+ super.fillToolBar(toolBarManager);
+ }
}
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/Messages.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/Messages.java
index 4c7b08b..bfa81cc 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/Messages.java
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/Messages.java
@@ -16,6 +16,8 @@ import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.mylyn.reviews.ui.spi.editor.messages"; //$NON-NLS-1$
+ public static String AbstractReviewTaskEditorPage_Show_Review_Navigator;
+
public static String ReviewDetailSection_Bracket_X_bracket;
public static String ReviewDetailSection_Depends_On;
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/messages.properties b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/messages.properties
index fc13b8b..fdcc2d7 100644
--- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/messages.properties
+++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/reviews/ui/spi/editor/messages.properties
@@ -8,6 +8,7 @@
# Contributors:
# Tasktop Technologies - initial API and implementation
###############################################################################
+AbstractReviewTaskEditorPage_Show_Review_Navigator=Show Review Navigator
ReviewDetailSection_Bracket_X_bracket=\ ({0})
ReviewDetailSection_Depends_On=Depends On
ReviewDetailSection_Link_W_X_Y_by_Z=<a>{0}</a>: {1} {3} by {2}