diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src')
3 files changed, 23 insertions, 14 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java index 0856db87a..aabc68028 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/AnnotateView.java @@ -169,12 +169,8 @@ public class AnnotateView extends ViewPart implements ISelectionChangedListener * isn't a view registered <code>null</code> is returned. * Otherwise the opened view part is returned. */ - public static AnnotateView openInActivePerspective() { - try { - return (AnnotateView) CVSUIPlugin.getActivePage().showView(VIEW_ID); - } catch (PartInitException pe) { - return null; - } + public static AnnotateView openInActivePerspective() throws PartInitException { + return (AnnotateView) CVSUIPlugin.getActivePage().showView(VIEW_ID); } /** diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java index d40d616c2..a6a0eb624 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/ShowAnnotationAction.java @@ -37,6 +37,10 @@ import org.eclipse.team.internal.ccvs.core.resources.CVSWorkspaceRoot; import org.eclipse.team.internal.ccvs.core.syncinfo.FolderSyncInfo; import org.eclipse.team.internal.ccvs.ui.AnnotateView; import org.eclipse.team.internal.ccvs.ui.Policy; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.WorkbenchException; public class ShowAnnotationAction extends CVSAction { @@ -71,18 +75,26 @@ public class ShowAnnotationAction extends CVSAction { } }, true, PROGRESS_DIALOG); + + if (listener.hasError()) { + throw new InvocationTargetException(new CVSException(Policy.bind("ShowAnnotationAction.1", listener.getError()))); //$NON-NLS-1$ + } + // Open the view - AnnotateView view = AnnotateView.openInActivePerspective(); - if (view == null) { - return; + IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); + if (window != null) { + try { + PlatformUI.getWorkbench().showPerspective("org.eclipse.team.cvs.ui.cvsPerspective", window); //$NON-NLS-1$ + } catch (WorkbenchException e1) { + // If this does not work we will just open the view in the curren perspective. + } } - - // Populate the view. - if (listener.hasError()) { - throw new InvocationTargetException(new CVSException("Unexpected response from CVS Server: " + listener.getError())); - } else { + try { + AnnotateView view = AnnotateView.openInActivePerspective(); view.showAnnotations(cvsResource, listener.getCvsAnnotateBlocks(), listener.getContents()); + } catch (PartInitException e1) { + handle(e1); } } diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties index a40e94e41..58382dfda 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/messages.properties @@ -1011,3 +1011,4 @@ UpdateDialog.overwriteMessage=All mergable resources have been updated. However, ReplaceOperation.taskName=Replacing... Error.unableToShowSyncView=Error opening Synchronize View. Please ensure that the Team plugin is installed correctly. +ShowAnnotationAction.1=Unexpected response from CVS Server: {0} |