diff options
author | Jean Michel-Lemieux | 2002-05-02 22:13:27 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2002-05-02 22:13:27 +0000 |
commit | 89b15315791c3216d34f78ea0a3a86e9b0870cd8 (patch) | |
tree | 70b0a6767b554053fab908bfafa0052d44eea5b3 | |
parent | 4502202592efef427fe8e6ed994b80d5edb78219 (diff) | |
download | eclipse.platform.team-89b15315791c3216d34f78ea0a3a86e9b0870cd8.tar.gz eclipse.platform.team-89b15315791c3216d34f78ea0a3a86e9b0870cd8.tar.xz eclipse.platform.team-89b15315791c3216d34f78ea0a3a86e9b0870cd8.zip |
Bug 14252: Improvements needed in welcome page
7 files changed, 108 insertions, 87 deletions
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 index a68898e79..8710d22f2 100644 --- 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 @@ -1,49 +1 @@ -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"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
- layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
-
- // 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); //$NON-NLS-1$
- top.addView(RepositoriesView.VIEW_ID);
- layout.addView(HistoryView.VIEW_ID, IPageLayout.BOTTOM, 1.0f, editorArea);
-
- layout.setEditorAreaVisible(false);
- }
-}
\ No newline at end of file +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"); //$NON-NLS-1$
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.folder"); //$NON-NLS-1$
layout.addNewWizardShortcut("org.eclipse.ui.wizards.new.file"); //$NON-NLS-1$
// 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.LEFT, 0.40f, editorArea); //$NON-NLS-1$
top.addView(RepositoriesView.VIEW_ID);
layout.addView(HistoryView.VIEW_ID, IPageLayout.BOTTOM, 0.70f, editorArea);
layout.setEditorAreaVisible(true);
}
}
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java index e0ccbd9b1..8378e2ead 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/RepositoriesView.java @@ -5,6 +5,8 @@ package org.eclipse.team.internal.ccvs.ui; * All Rights Reserved. */ +import java.util.Properties; + import org.eclipse.jface.action.Action; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; @@ -33,7 +35,6 @@ import org.eclipse.team.internal.ccvs.core.ICVSRemoteFile; import org.eclipse.team.internal.ccvs.core.ICVSRepositoryLocation; import org.eclipse.team.internal.ccvs.ui.actions.OpenRemoteFileAction; import org.eclipse.team.internal.ccvs.ui.model.AllRootsElement; -import org.eclipse.team.internal.ccvs.ui.model.BranchTag; import org.eclipse.team.internal.ccvs.ui.model.RemoteContentProvider; import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard; import org.eclipse.ui.IActionBars; @@ -124,6 +125,19 @@ public class RepositoriesView extends ViewPart { dialog.open(); } }; + + final Action newAnonAction = new Action(Policy.bind("RepositoriesView.newAnonCVS"), CVSUIPlugin.getPlugin().getImageDescriptor(ICVSUIConstants.IMG_NEWLOCATION)) { //$NON-NLS-1$ + public void run() { + Properties p = new Properties(); + p.setProperty("connection", "pserver"); + p.setProperty("user", "anonymous"); + p.setProperty("host", "dev.eclipse.org"); + p.setProperty("root", "/home/eclipse"); + NewLocationWizard wizard = new NewLocationWizard(p); + WizardDialog dialog = new WizardDialog(shell, wizard); + dialog.open(); + } + }; // Properties propertiesAction = new PropertyDialogAction(shell, viewer); @@ -166,6 +180,7 @@ public class RepositoriesView extends ViewPart { manager.add(propertiesAction); } sub.add(newAction); + sub.add(newAnonAction); } }); menuMgr.setRemoveAllWhenShown(true); diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSAnonEclipseConnection.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSAnonEclipseConnection.java new file mode 100644 index 000000000..93aa8c15f --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSAnonEclipseConnection.java @@ -0,0 +1,40 @@ +package org.eclipse.team.internal.ccvs.ui.actions; + +/* + * (c) Copyright IBM Corp. 2000, 2001. + * All Rights Reserved. + */ + +import java.util.Properties; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.wizard.WizardDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; +import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard; +import org.eclipse.ui.IWorkbenchWindow; + +/** + * Called from Welcome page only. + */ +public class NewCVSAnonEclipseConnection extends Action { + public void run() { + Shell shell; + IWorkbenchWindow window = CVSUIPlugin.getPlugin().getWorkbench().getActiveWorkbenchWindow(); + if (window != null) { + shell = window.getShell(); + } else { + Display display = Display.getCurrent(); + shell = new Shell(display); + } + Properties p = new Properties(); + p.setProperty("connection", "pserver"); + p.setProperty("user", "anonymous"); + p.setProperty("host", "dev.eclipse.org"); + p.setProperty("root", "/home/eclipse"); + NewLocationWizard wizard = new NewLocationWizard(p); + WizardDialog dialog = new WizardDialog(shell, wizard); + dialog.open(); + } +}
\ No newline at end of file diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSRepositoryAction.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSRepositoryAction.java index b1ad796bd..36a1c5917 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSRepositoryAction.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/actions/NewCVSRepositoryAction.java @@ -14,6 +14,9 @@ import org.eclipse.team.internal.ccvs.ui.CVSUIPlugin; import org.eclipse.team.internal.ccvs.ui.wizards.NewLocationWizard; import org.eclipse.ui.IWorkbenchWindow; +/** + * Called from Welcome page only. + */ public class NewCVSRepositoryAction extends Action { public void run() { Shell shell; 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 bd7bf27c7..7ecfc927b 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 @@ -406,10 +406,11 @@ RepositoryManager.save=An IO Exception occurred while saving the state file RepositoryManager.ioException=An IO Exception occurred while reading the state file RepositoriesView.refresh=&Refresh View -RepositoriesView.new=&CVS Repository Location... +RepositoriesView.new=&Repository Location... RepositoriesView.newSubmenu=&New RepositoriesView.Show_Folders_6=Show Folders RepositoriesView.Show_Modules_7=Show Modules +RepositoriesView.newAnonCVS=&Anonymous Repository Location to dev.eclipse.org... ResourcePropertiesPage.status=Status ResourcePropertiesPage.notManaged=Not managed by CVS diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java index b5a9eba21..c58df1252 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/ConfigurationWizardMainPage.java @@ -56,7 +56,7 @@ public class ConfigurationWizardMainPage extends CVSWizardPage { private static final int COMBO_HISTORY_LENGTH = 5; - private Properties properties = new Properties(); + private Properties properties = null; // Dialog store id constants private static final String STORE_USERNAME_ID = @@ -266,39 +266,43 @@ public class ConfigurationWizardMainPage extends CVSWizardPage { for (int i = 0; i < methods.length; i++) { connectionMethodCombo.add(methods[i]); } - String method = (String)properties.getProperty("connection"); //$NON-NLS-1$ - if (method == null) { - connectionMethodCombo.select(0); - } else { - connectionMethodCombo.select(connectionMethodCombo.indexOf(method)); - } - - String user = (String)properties.getProperty("user"); //$NON-NLS-1$ - if (user != null) { - userCombo.setText(user); - } - - String password = (String)properties.getProperty("password"); //$NON-NLS-1$ - if (password != null) { - passwordText.setText(password); - } - - String host = (String)properties.getProperty("host"); //$NON-NLS-1$ - if (host != null) { - hostCombo.setText(host); - } - - String port = (String)properties.getProperty("port"); //$NON-NLS-1$ - if (port == null) { - useDefaultPort.setSelection(true); - } else { - useCustomPort.setSelection(true); - portText.setText(port); - } - - String repositoryPath = (String)properties.getProperty("root"); //$NON-NLS-1$ - if (repositoryPath != null) { - repositoryPathCombo.setText(repositoryPath); + + connectionMethodCombo.select(0); + if(properties != null) { + String method = (String)properties.getProperty("connection"); //$NON-NLS-1$ + if (method == null) { + connectionMethodCombo.select(0); + } else { + connectionMethodCombo.select(connectionMethodCombo.indexOf(method)); + } + + String user = (String)properties.getProperty("user"); //$NON-NLS-1$ + if (user != null) { + userCombo.setText(user); + } + + String password = (String)properties.getProperty("password"); //$NON-NLS-1$ + if (password != null) { + passwordText.setText(password); + } + + String host = (String)properties.getProperty("host"); //$NON-NLS-1$ + if (host != null) { + hostCombo.setText(host); + } + + String port = (String)properties.getProperty("port"); //$NON-NLS-1$ + if (port == null) { + useDefaultPort.setSelection(true); + } else { + useCustomPort.setSelection(true); + portText.setText(port); + } + + String repositoryPath = (String)properties.getProperty("root"); //$NON-NLS-1$ + if (repositoryPath != null) { + repositoryPathCombo.setText(repositoryPath); + } } } /** @@ -339,8 +343,9 @@ public class ConfigurationWizardMainPage extends CVSWizardPage { * @param properties the properties or null */ public void setProperties(Properties properties) { - this.properties = properties; + this.properties = properties; } + /** * Updates widget enablements and sets error message if appropriate. */ diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java index e65b584c5..d5860bea0 100644 --- a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/wizards/NewLocationWizard.java @@ -28,7 +28,7 @@ import org.eclipse.team.internal.ccvs.ui.Policy; public class NewLocationWizard extends Wizard { private ConfigurationWizardMainPage mainPage; - private Properties properties; + private Properties properties = null; public NewLocationWizard() { IDialogSettings workbenchSettings = CVSUIPlugin.getPlugin().getDialogSettings(); @@ -39,6 +39,11 @@ public class NewLocationWizard extends Wizard { setDialogSettings(section); setWindowTitle(Policy.bind("NewLocationWizard.title")); //$NON-NLS-1$ } + + public NewLocationWizard(Properties initialProperties) { + this(); + this.properties = initialProperties; + } /** * Creates the wizard pages |