diff options
author | Jean Michel-Lemieux | 2002-02-25 14:40:29 +0000 |
---|---|---|
committer | Jean Michel-Lemieux | 2002-02-25 14:40:29 +0000 |
commit | ced9d610e70dee10a6a13dbe0aa3f064d91f6b61 (patch) | |
tree | 36d7d8292abba3783b3558ebcbf397d494422e11 /bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java | |
parent | 9f5bb6bd9d45e42c22e26988a7f06901aa6c090a (diff) | |
download | eclipse.platform.team-ced9d610e70dee10a6a13dbe0aa3f064d91f6b61.tar.gz eclipse.platform.team-ced9d610e70dee10a6a13dbe0aa3f064d91f6b61.tar.xz eclipse.platform.team-ced9d610e70dee10a6a13dbe0aa3f064d91f6b61.zip |
Bug 7276: Add EXT support to CVS provider
Diffstat (limited to 'bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java new file mode 100644 index 000000000..ec71ca748 --- /dev/null +++ b/bundles/org.eclipse.team.cvs.ui/src/org/eclipse/team/internal/ccvs/ui/ExtMethodPreferencePage.java @@ -0,0 +1,143 @@ +package org.eclipse.team.internal.ccvs.ui; + +/* + * (c) Copyright IBM Corp. 2000, 2002. + * All Rights Reserved. + */ + +import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.resource.JFaceResources; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Text; +import org.eclipse.team.ccvs.core.CVSProviderPlugin; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPreferencePage; + +public class ExtMethodPreferencePage extends PreferencePage implements IWorkbenchPreferencePage { + + Text cvsRsh; + Text cvsServer; + + /* + * @see PreferencePage#createContents(Composite) + */ + protected Control createContents(Composite parent) { + Composite composite = new Composite(parent, SWT.NULL); + GridLayout layout= new GridLayout(); + layout.numColumns = 3; + composite.setLayout(layout); + composite.setLayoutData(new GridData()); + + Label intro = new Label(composite, SWT.LEFT); + intro.setText("These variables define the external connection program to use with the 'ext' connection method.\nThese values should be the same as the 'ext' CVS command-line environment variable settings."); + GridData data = new GridData(); + data.horizontalSpan = 3; + data.horizontalAlignment = GridData.FILL; + intro.setLayoutData(data); + + new Label(composite, SWT.NULL); new Label(composite, SWT.NULL); new Label(composite, SWT.NULL); // spacer + + new Label(composite, SWT.LEFT).setText("CVS_RSH:"); + cvsRsh = new Text(composite, SWT.BORDER); + cvsRsh.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + + final Button b = new Button(composite, SWT.NONE); + b.setText("Browse..."); + b.setLayoutData(new GridData()); + b.addListener(SWT.MouseDown, new Listener() { + public void handleEvent (Event event) { + FileDialog d = new FileDialog(getShell()); + d.setText("Select a program or script"); + String file = d.open(); + if(file!=null) { + setCvsRshText(file); + } + } + }); + + + Label l = new Label(composite, SWT.LEFT | SWT.BOLD); + l.setText("Note:"); + l.setFont(JFaceResources.getBannerFont()); + + l = new Label(composite, SWT.LEFT); + l.setText("The RSH command must fit the following calling pattern:\n<CVS_RSH> -l <USERNAME> <HOST> <CVS_SERVER>\nThis program will be called to connect to the remote CVS server."); + data = new GridData(); + data.horizontalSpan = 2; + data.horizontalAlignment = GridData.FILL; + l.setLayoutData(data); + + new Label(composite, SWT.NULL); new Label(composite, SWT.NULL); new Label(composite, SWT.NULL); // spacer + + new Label(composite, SWT.LEFT).setText("CVS_SERVER:"); + cvsServer = new Text(composite, SWT.BORDER); + data = new GridData(); + data.horizontalSpan = 2; + data.horizontalAlignment = GridData.FILL; + cvsServer.setLayoutData(data); + + l = new Label(composite, SWT.LEFT | SWT.BOLD); + l.setText("Note:"); + l.setFont(JFaceResources.getBannerFont()); + + l = new Label(composite, SWT.LEFT); + l.setText("This is the name of the remote CVS server program.\nChange this setting only if the remote CVS server name\nis different than the default."); + data = new GridData(); + data.horizontalSpan = 2; + data.horizontalAlignment = GridData.FILL; + l.setLayoutData(data); + + + initializeDefaults(); + + return composite; + } + + protected void initializeDefaults() { + IPreferenceStore store = getPreferenceStore(); + cvsRsh.setText(store.getString(ICVSUIConstants.PREF_CVS_RSH)); + cvsServer.setText(store.getString(ICVSUIConstants.PREF_CVS_SERVER)); + } + + /* + * Set CVS_RSH program + */ + protected void setCvsRshText(String s) { + cvsRsh.setText(s); + } + + /* + * @see IWorkbenchPreferencePage#init(IWorkbench) + */ + public void init(IWorkbench workbench) { + } + + /* + * @see IPreferencePage#performOk() + */ + public boolean performOk() { + IPreferenceStore store = getPreferenceStore(); + store.setValue(ICVSUIConstants.PREF_CVS_RSH, cvsRsh.getText()); + store.setValue(ICVSUIConstants.PREF_CVS_SERVER, cvsServer.getText()); + CVSProviderPlugin.getPlugin().setCvsRshCommand(cvsRsh.getText()); + CVSProviderPlugin.getPlugin().setCvsServer(cvsServer.getText()); + return super.performOk(); + } + /* + * @see PreferencePage#doGetPreferenceStore() + */ + protected IPreferenceStore doGetPreferenceStore() { + return CVSUIPlugin.getPlugin().getPreferenceStore(); + } + +} |