Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjames2002-04-05 19:37:14 -0500
committerjames2002-04-05 19:37:14 -0500
commit68de99e5c734fc9303a6a94090857ed9b1241138 (patch)
tree12148c8d71d1c2bc3fcef2ae93b049c72deb342c
parent8edb5f357938eb7394ac24706b528f85c1a7bf53 (diff)
downloadeclipse.platform.team-68de99e5c734fc9303a6a94090857ed9b1241138.tar.gz
eclipse.platform.team-68de99e5c734fc9303a6a94090857ed9b1241138.tar.xz
eclipse.platform.team-68de99e5c734fc9303a6a94090857ed9b1241138.zip
5072: VCM should have 2 perspectives
-rw-r--r--bundles/org.eclipse.team.cvs.ui/icons/full/cview16/cvs_persp.gifbin0 -> 232 bytes
-rw-r--r--bundles/org.eclipse.team.cvs.ui/plugin.xml23
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPerspective.java49
-rw-r--r--bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java29
4 files changed, 82 insertions, 19 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/cvs_persp.gif b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/cvs_persp.gif
new file mode 100644
index 000000000..0719a5094
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/icons/full/cview16/cvs_persp.gif
Binary files differ
diff --git a/bundles/org.eclipse.team.cvs.ui/plugin.xml b/bundles/org.eclipse.team.cvs.ui/plugin.xml
index 73d085883..b5fd136ed 100644
--- a/bundles/org.eclipse.team.cvs.ui/plugin.xml
+++ b/bundles/org.eclipse.team.cvs.ui/plugin.xml
@@ -354,7 +354,7 @@
</view>
</extension>
- <!-- **************** PREFERENCES ******************* -->
+ <!-- **************** Preferences ******************* -->
<extension
point = "org.eclipse.ui.preferencePages">
<page id="org.eclipse.team.cvs.ui.CVSPreferences"
@@ -419,7 +419,7 @@
</viewContribution>
</extension>
- <!-- **************** MARKERS ******************* -->
+ <!-- **************** Markers ******************* -->
<extension point="org.eclipse.ui.markerResolution">
<markerResolutionGenerator
markerType="org.eclipse.team.cvs.core.cvsremove"
@@ -430,4 +430,23 @@
class="org.eclipse.team.internal.ccvs.ui.CVSAddResolutionGenerator">
</markerResolutionGenerator>
</extension>
+
+ <!-- **************** CVS Perspective ******************* -->
+ <extension
+ point="org.eclipse.ui.perspectives">
+ <perspective
+ id="org.eclipse.team.cvs.ui.cvsPerspective"
+ name="%CVS"
+ class="org.eclipse.team.internal.ccvs.ui.CVSPerspective"
+ icon="icons/full/cview16/cvs_persp.gif">
+ </perspective>
+ </extension>
+
+ <!-- ************** Perspective Extensions **************** -->
+ <extension
+ point="org.eclipse.ui.perspectiveExtensions">
+ <perspectiveExtension targetID="org.eclipse.ui.resourcePerspective">
+ <perspectiveShortcut id="org.eclipse.team.cvs.ui.cvsPerspective"/>
+ </perspectiveExtension>
+ </extension>
</plugin> \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPerspective.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPerspective.java
new file mode 100644
index 000000000..857df3ad7
--- /dev/null
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/CVSPerspective.java
@@ -0,0 +1,49 @@
+package org.eclipse.team.internal.ccvs.ui;
+
+/*
+ * (c) Copyright IBM Corp. 2000, 2002.
+ * All Rights Reserved.
+ */
+
+import org.eclipse.ui.*;
+
+public class CVSPerspective implements IPerspectiveFactory {
+
+ /* (Non-javadoc)
+ * Method declared on IPerpsectiveFactory
+ */
+ public void createInitialLayout(IPageLayout layout) {
+ defineActions(layout);
+ defineLayout(layout);
+ }
+
+ /**
+ * Defines the initial actions for a page.
+ */
+ public void defineActions(IPageLayout layout) {
+ // Add "new wizards".
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.project");
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder");
+ layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file");
+
+ // Add "show views".
+ layout.addShowViewShortcut(IPageLayout.ID_RES_NAV);
+ layout.addShowViewShortcut(IPageLayout.ID_OUTLINE);
+ layout.addShowViewShortcut(IPageLayout.ID_TASK_LIST);
+ layout.addShowViewShortcut(HistoryView.VIEW_ID);
+ layout.addShowViewShortcut(RepositoriesView.VIEW_ID);
+ }
+
+ /**
+ * Defines the initial layout for a page.
+ */
+ public void defineLayout(IPageLayout layout) {
+ String editorArea = layout.getEditorArea();
+
+ IFolderLayout top = layout.createFolder("top", IPageLayout.TOP, 0.60f, editorArea);
+ top.addView(RepositoriesView.VIEW_ID);
+ layout.addView(HistoryView.VIEW_ID, IPageLayout.BOTTOM, 1.0f, editorArea);
+
+ layout.setEditorAreaVisible(false);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
index 8ef645895..870bcfe23 100644
--- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
+++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/HistoryView.java
@@ -15,6 +15,7 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
@@ -408,25 +409,19 @@ public class HistoryView extends ViewPart implements ISelectionListener {
if (!(inputElement instanceof ICVSRemoteFile)) return null;
final ICVSRemoteFile remoteFile = (ICVSRemoteFile)inputElement;
final Object[][] result = new Object[1][];
- try {
- new ProgressMonitorDialog(getViewSite().getShell()).run(true, true, new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- entries = remoteFile.getLogEntries(monitor);
- result[0] = entries;
- } catch (TeamException e) {
- throw new InvocationTargetException(e);
- }
+ final TeamException[] ex = new TeamException[1];
+ BusyIndicator.showWhile(getViewSite().getShell().getDisplay(), new Runnable() {
+ public void run() {
+ try {
+ entries = remoteFile.getLogEntries(new NullProgressMonitor());
+ result[0] = entries;
+ } catch (TeamException e) {
+ ex[0] = e;
}
- });
- } catch (InvocationTargetException e) {
- Throwable t = e.getTargetException();
- if (t instanceof TeamException) {
- ErrorDialog.openError(getViewSite().getShell(), null, null, ((TeamException)t).getStatus());
}
- return new Object[0];
- } catch (InterruptedException e) {
- // Do nothing
+ });
+ if (ex[0] != null) {
+ ErrorDialog.openError(getViewSite().getShell(), null, null, ex[0].getStatus());
return new Object[0];
}
return result[0];

Back to the top