diff options
author | Sam Davis | 2014-04-25 17:11:05 +0000 |
---|---|---|
committer | Sam Davis | 2014-05-08 22:21:01 +0000 |
commit | ce61656071f884f4b6d8e9cb5da9b5a66c75f8f4 (patch) | |
tree | 8ea37d1bbe27bf8b27d1493583da34f5f1bd65a0 | |
parent | bd39a2ef3a536986bb2561df8b6e7e4591173fe0 (diff) | |
download | org.eclipse.mylyn.reviews-ce61656071f884f4b6d8e9cb5da9b5a66c75f8f4.tar.gz org.eclipse.mylyn.reviews-ce61656071f884f4b6d8e9cb5da9b5a66c75f8f4.tar.xz org.eclipse.mylyn.reviews-ce61656071f884f4b6d8e9cb5da9b5a66c75f8f4.zip |
430151: [regression] cannot open html file in compare editor
Change-Id: I7eeb6e5d956653dd93101fad980ddccc3d1f0257
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=430151
Signed-off-by: Sam Davis <sam.davis@tasktop.com>
-rw-r--r-- | org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewItemCompareEditorInput.java | 46 |
1 files changed, 28 insertions, 18 deletions
diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewItemCompareEditorInput.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewItemCompareEditorInput.java index 27bf5929f..43e4c444b 100644 --- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewItemCompareEditorInput.java +++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewItemCompareEditorInput.java @@ -26,9 +26,12 @@ import org.eclipse.compare.structuremergeviewer.Differencer; import org.eclipse.compare.structuremergeviewer.ICompareInput; import org.eclipse.compare.structuremergeviewer.IDiffElement; import org.eclipse.compare.structuremergeviewer.StructureDiffViewer; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.Viewer; +import org.eclipse.mylyn.commons.core.StatusHandler; import org.eclipse.mylyn.internal.reviews.ui.Messages; import org.eclipse.mylyn.internal.reviews.ui.ReviewsImages; import org.eclipse.mylyn.internal.reviews.ui.ReviewsUiPlugin; @@ -53,6 +56,8 @@ import org.eclipse.ui.services.IServiceLocator; */ public abstract class ReviewItemCompareEditorInput extends CompareEditorInput { + private static final String NAVIGATION_GROUP = "navigation"; //$NON-NLS-1$ + final ReviewBehavior behavior; private IHandlerActivation gotoNextCommentHandler; @@ -138,24 +143,29 @@ public abstract class ReviewItemCompareEditorInput extends CompareEditorInput { }); } - CommandContributionItemParameter p = new CommandContributionItemParameter( - serviceLocator, - ReviewsUiPlugin.PLUGIN_ID + ".navigate.comment.next", //$NON-NLS-1$ - ReviewsUiPlugin.PLUGIN_ID + ".commands.navigate.comment.next", //$NON-NLS-1$ // command id - null, ReviewsImages.NEXT_COMMENT, ReviewsImages.NEXT_COMMENT, null, - Messages.Reviews_NextComment, Messages.Reviews_NextComment.substring(0, 1), - Messages.Reviews_NextComment_Tooltip, CommandContributionItem.STYLE_PUSH, null, true); - - tbm.appendToGroup("navigation", new CommandContributionItem(p)); //$NON-NLS-1$ - - p = new CommandContributionItemParameter( - serviceLocator, // - ReviewsUiPlugin.PLUGIN_ID + ".navigate.comment.previous", //$NON-NLS-1$ - ReviewsUiPlugin.PLUGIN_ID + ".commands.navigate.comment.previous", //$NON-NLS-1$ // command id - null, ReviewsImages.PREVIOUS_COMMENT, ReviewsImages.PREVIOUS_COMMENT, null, - Messages.Reviews_PreviousComment, Messages.Reviews_PreviousComment.substring(0, 1), - Messages.Reviews_PreviousComment_Tooltip, CommandContributionItem.STYLE_PUSH, null, true); - tbm.appendToGroup("navigation", new CommandContributionItem(p)); //$NON-NLS-1$ + if (tbm.find(NAVIGATION_GROUP) != null) { + CommandContributionItemParameter p = new CommandContributionItemParameter( + serviceLocator, + ReviewsUiPlugin.PLUGIN_ID + ".navigate.comment.next", //$NON-NLS-1$ + ReviewsUiPlugin.PLUGIN_ID + ".commands.navigate.comment.next", //$NON-NLS-1$ // command id + null, ReviewsImages.NEXT_COMMENT, ReviewsImages.NEXT_COMMENT, null, + Messages.Reviews_NextComment, Messages.Reviews_NextComment.substring(0, 1), + Messages.Reviews_NextComment_Tooltip, CommandContributionItem.STYLE_PUSH, null, true); + + tbm.appendToGroup(NAVIGATION_GROUP, new CommandContributionItem(p)); + + p = new CommandContributionItemParameter( + serviceLocator, // + ReviewsUiPlugin.PLUGIN_ID + ".navigate.comment.previous", //$NON-NLS-1$ + ReviewsUiPlugin.PLUGIN_ID + ".commands.navigate.comment.previous", //$NON-NLS-1$ // command id + null, ReviewsImages.PREVIOUS_COMMENT, ReviewsImages.PREVIOUS_COMMENT, null, + Messages.Reviews_PreviousComment, Messages.Reviews_PreviousComment.substring(0, 1), + Messages.Reviews_PreviousComment_Tooltip, CommandContributionItem.STYLE_PUSH, null, true); + tbm.appendToGroup(NAVIGATION_GROUP, new CommandContributionItem(p)); + } else {// bug 430151 + StatusHandler.log(new Status(IStatus.ERROR, ReviewsUiPlugin.PLUGIN_ID, + "Could not create comment navigation buttons", new Exception())); //$NON-NLS-1$ + } tbm.update(true); } } |