1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-15 04:55:22 +02:00

[226364][api][breaking] RemoteBaseServerLauncherForm should not implement RemoteServerLauncherConstants.

This commit is contained in:
Martin Oberhuber 2008-04-09 20:34:41 +00:00
parent 5e6868fa1c
commit 7ebf952fa2
2 changed files with 59 additions and 62 deletions

View file

@ -1,15 +1,15 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - refactoring IConnectorService and ServerLauncher hierarchies
********************************************************************************/ ********************************************************************************/
@ -17,7 +17,6 @@
package org.eclipse.rse.ui.widgets; package org.eclipse.rse.ui.widgets;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties; import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.core.subsystems.RemoteServerLauncherConstants;
import org.eclipse.rse.core.subsystems.ServerLaunchType; import org.eclipse.rse.core.subsystems.ServerLaunchType;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
@ -34,11 +33,8 @@ import org.eclipse.swt.widgets.Shell;
/** /**
* Base Remote server launcher form. Extend this to provide a specialized server launcher form * Base Remote server launcher form. Extend this to provide a specialized server launcher form
*/ */
public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implements IServerLauncherForm, RemoteServerLauncherConstants, ISystemConnectionWizardErrorUpdater public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implements IServerLauncherForm, ISystemConnectionWizardErrorUpdater
{ {
protected String _hostName; protected String _hostName;
protected ISystemMessageLine _msgLine; protected ISystemMessageLine _msgLine;
@ -54,8 +50,8 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
} }
public abstract void disable(); public abstract void disable();
/** /**
* @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite) * @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
*/ */
@ -63,7 +59,7 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
{ {
// server lanucher group // server lanucher group
Group group =createGroupControl(parent); Group group =createGroupControl(parent);
// create launcher type controls // create launcher type controls
createLauncherControls(group); createLauncherControls(group);
@ -74,7 +70,7 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
initDefaults(); initDefaults();
return parent; return parent;
} }
protected Group createGroupControl(Composite parent) protected Group createGroupControl(Composite parent)
{ {
return SystemWidgetHelpers.createGroupComposite( return SystemWidgetHelpers.createGroupComposite(
@ -87,13 +83,13 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
protected abstract ServerLaunchType getLaunchType(); protected abstract ServerLaunchType getLaunchType();
protected abstract void setLaunchType(ServerLaunchType type); protected abstract void setLaunchType(ServerLaunchType type);
protected abstract void initDefaults(); protected abstract void initDefaults();
/** /**
* Verify page contents on OK. * Verify page contents on OK.
* @return true if all went well, false if error found. * @return true if all went well, false if error found.
@ -102,11 +98,11 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
/** /**
* Update the actual values in the server launcher, from the widgets. Called on successful press of OK. * Update the actual values in the server launcher, from the widgets. Called on successful press of OK.
* @return true if all went well, false if something failed for some reason. * @return true if all went well, false if something failed for some reason.
*/ */
public abstract boolean updateValues(IServerLauncherProperties launcher); public abstract boolean updateValues(IServerLauncherProperties launcher);
public void setHostname(String hostname) public void setHostname(String hostname)
{ {
_hostName = hostname; _hostName = hostname;

View file

@ -7,10 +7,10 @@
* *
* Initial Contributors: * Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer * The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir, * component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * {Name} (company) - description of contribution.
*******************************************************************************/ *******************************************************************************/
@ -19,6 +19,7 @@ package org.eclipse.rse.ui.widgets;
import org.eclipse.rse.core.subsystems.IRemoteServerLauncher; import org.eclipse.rse.core.subsystems.IRemoteServerLauncher;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties; import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.core.subsystems.RemoteServerLauncherConstants;
import org.eclipse.rse.core.subsystems.ServerLaunchType; import org.eclipse.rse.core.subsystems.ServerLaunchType;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -56,9 +57,9 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
private ValidatorPortInput _daemonPortValidator; private ValidatorPortInput _daemonPortValidator;
private ValidatorPortInput _rexecPortValidator; private ValidatorPortInput _rexecPortValidator;
private ServerLaunchType _origlaunchType; private ServerLaunchType _origlaunchType;
private String _origPath; private String _origPath;
private String _origInvocation; private String _origInvocation;
private int _origRexecPort; private int _origRexecPort;
@ -88,7 +89,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_origAutoDetect != getAutoDetect(); _origAutoDetect != getAutoDetect();
return isDirty; return isDirty;
} }
public void disable() public void disable()
{ {
_radioDaemon.setEnabled(false); _radioDaemon.setEnabled(false);
@ -184,7 +185,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
subRexecControls.setLayout(l2); subRexecControls.setLayout(l2);
subRexecControls.setLayoutData(d2); subRexecControls.setLayoutData(d2);
_checkBoxAutoDetect = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_AUTODETECT_LABEL, this); _checkBoxAutoDetect = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_AUTODETECT_LABEL, this);
_checkBoxAutoDetect.setToolTipText(SystemResources.RESID_SUBSYSTEM_AUTODETECT_TIP); _checkBoxAutoDetect.setToolTipText(SystemResources.RESID_SUBSYSTEM_AUTODETECT_TIP);
_checkBoxRexecSSL = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_SSL_LABEL, this); _checkBoxRexecSSL = SystemWidgetHelpers.createCheckBox(_rexecControls, SystemResources.RESID_SUBSYSTEM_SSL_LABEL, this);
@ -231,13 +232,13 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_checkBoxRexecSSL.setEnabled(_radioRexec.getSelection()); _checkBoxRexecSSL.setEnabled(_radioRexec.getSelection());
_checkBoxAutoDetect.setEnabled(_radioRexec.getSelection()); _checkBoxAutoDetect.setEnabled(_radioRexec.getSelection());
_checkBoxSSL.setEnabled(_radioNone.getSelection()); _checkBoxSSL.setEnabled(_radioNone.getSelection());
_fieldDaemonPort.setText(String.valueOf(DEFAULT_DAEMON_PORT)); _fieldDaemonPort.setText(String.valueOf(RemoteServerLauncherConstants.DEFAULT_DAEMON_PORT));
_fieldRexecPath.setText(DEFAULT_REXEC_PATH); _fieldRexecPath.setText(RemoteServerLauncherConstants.DEFAULT_REXEC_PATH);
_fieldRexecInvocation.setText(DEFAULT_REXEC_SCRIPT); _fieldRexecInvocation.setText(RemoteServerLauncherConstants.DEFAULT_REXEC_SCRIPT);
_fieldRexecPort.setText(String.valueOf(DEFAULT_REXEC_PORT)); _fieldRexecPort.setText(String.valueOf(RemoteServerLauncherConstants.DEFAULT_REXEC_PORT));
} }
/** /**
* Set the initial values for the widgets, based on the server launcher * Set the initial values for the widgets, based on the server launcher
*/ */
@ -252,35 +253,35 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
int daemonPort = isl.getDaemonPort(); // defect 54335 int daemonPort = isl.getDaemonPort(); // defect 54335
boolean useSSL = isl.getConnectorService().isUsingSSL(); boolean useSSL = isl.getConnectorService().isUsingSSL();
boolean autoDetectSSL = isl.getAutoDetectSSL(); boolean autoDetectSSL = isl.getAutoDetectSSL();
// find out if daemon can be launched // find out if daemon can be launched
boolean allowDaemon = isl.isEnabledServerLaunchType(ServerLaunchType.DAEMON_LITERAL); boolean allowDaemon = isl.isEnabledServerLaunchType(ServerLaunchType.DAEMON_LITERAL);
// find out if rexec can be launched // find out if rexec can be launched
boolean allowRexec = isl.isEnabledServerLaunchType(ServerLaunchType.REXEC_LITERAL); boolean allowRexec = isl.isEnabledServerLaunchType(ServerLaunchType.REXEC_LITERAL);
// find out if connect to running server should be allowed // find out if connect to running server should be allowed
boolean allowNo = isl.isEnabledServerLaunchType(ServerLaunchType.RUNNING_LITERAL); boolean allowNo = isl.isEnabledServerLaunchType(ServerLaunchType.RUNNING_LITERAL);
// enable/disable as appropriate // enable/disable as appropriate
setDaemonLaunchEnabled(allowDaemon); setDaemonLaunchEnabled(allowDaemon);
setRexecLaunchEnabled(allowRexec); setRexecLaunchEnabled(allowRexec);
setNoLaunchEnabled(allowNo); setNoLaunchEnabled(allowNo);
setLaunchType(type); setLaunchType(type);
setDaemonPort(daemonPort); setDaemonPort(daemonPort);
setServerInstallPath(path); setServerInstallPath(path);
setServerInvocation(invocation); setServerInvocation(invocation);
setREXECPort(rexecport); setREXECPort(rexecport);
setUseSSL(useSSL); setUseSSL(useSSL);
setAutoDetect(autoDetectSSL); setAutoDetect(autoDetectSSL);
if (!allowDaemon && !allowRexec && !allowNo) { if (!allowDaemon && !allowRexec && !allowNo) {
disable(); disable();
} }
_origlaunchType = getLaunchType(); _origlaunchType = getLaunchType();
_origPath = getServerInstallPath(); _origPath = getServerInstallPath();
_origInvocation = getServerInvocation(); _origInvocation = getServerInvocation();
@ -289,7 +290,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_origUseSSL = getUseSSL(); _origUseSSL = getUseSSL();
_origAutoDetect = getAutoDetect(); _origAutoDetect = getAutoDetect();
} }
/** /**
* Verify page contents on OK. * Verify page contents on OK.
* @return true if all went well, false if error found. * @return true if all went well, false if error found.
@ -350,7 +351,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
/** /**
* Update the actual values in the server launcher, from the widgets. Called on successful press of OK. * Update the actual values in the server launcher, from the widgets. Called on successful press of OK.
* @return true if all went well, false if something failed for some reason. * @return true if all went well, false if something failed for some reason.
*/ */
public boolean updateValues(IServerLauncherProperties launcher) public boolean updateValues(IServerLauncherProperties launcher)
{ {
@ -375,12 +376,12 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
isl.getConnectorService().commit(); isl.getConnectorService().commit();
} }
catch (Exception e) catch (Exception e)
{ {
return false; return false;
} }
return true; return true;
} }
public void handleEvent(Event evt) public void handleEvent(Event evt)
{ {
@ -411,14 +412,14 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
else else
return null; return null;
} }
protected boolean getUseSSL() protected boolean getUseSSL()
{ {
if (_radioRexec.getSelection()) if (_radioRexec.getSelection())
return _checkBoxRexecSSL.getSelection(); return _checkBoxRexecSSL.getSelection();
else return _checkBoxSSL.getSelection(); else return _checkBoxSSL.getSelection();
} }
protected boolean getAutoDetect() protected boolean getAutoDetect()
{ {
if (_radioNone.getSelection()) return false; if (_radioNone.getSelection()) return false;
@ -426,13 +427,13 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
return _checkBoxAutoDetect.getSelection(); return _checkBoxAutoDetect.getSelection();
else return true; else return true;
} }
protected void setUseSSL(boolean use) protected void setUseSSL(boolean use)
{ {
_checkBoxSSL.setSelection(use); _checkBoxSSL.setSelection(use);
_checkBoxRexecSSL.setSelection(use); _checkBoxRexecSSL.setSelection(use);
} }
protected void setAutoDetect(boolean use) protected void setAutoDetect(boolean use)
{ {
_checkBoxAutoDetect.setSelection(use); _checkBoxAutoDetect.setSelection(use);
@ -478,7 +479,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
//_daemonControls.getLayout(). //_daemonControls.getLayout().
_labelDaemonPort.setEnabled(enable); _labelDaemonPort.setEnabled(enable);
_fieldDaemonPort.setEnabled(enable); _fieldDaemonPort.setEnabled(enable);
_radioDaemon.setEnabled(enable); _radioDaemon.setEnabled(enable);
} }
@ -498,15 +499,15 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_fieldRexecInvocation.setEnabled(enable); _fieldRexecInvocation.setEnabled(enable);
_fieldRexecPath.setEnabled(enable); _fieldRexecPath.setEnabled(enable);
_fieldRexecPort.setEnabled(enable); _fieldRexecPort.setEnabled(enable);
_radioRexec.setEnabled(enable); _radioRexec.setEnabled(enable);
} }
public void setHostname(String hostname) public void setHostname(String hostname)
{ {
_hostName = hostname; _hostName = hostname;
} }
/** /**
* Set the daemon port widget value * Set the daemon port widget value
* @param port - the port value as a string * @param port - the port value as a string
@ -515,10 +516,10 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
{ {
_fieldDaemonPort.setText(port); _fieldDaemonPort.setText(port);
} }
/** /**
* Set the daemon port widget value * Set the daemon port widget value
* @param port - the port value as an int * @param port - the port value as an int
*/ */
public void setDaemonPort(int port) public void setDaemonPort(int port)
{ {
@ -545,7 +546,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
{ {
return _fieldDaemonPort.getText().trim(); return _fieldDaemonPort.getText().trim();
} }
/** /**
* Set the REXEC port's widget value, as a String * Set the REXEC port's widget value, as a String
* @param port - the value to apply to the widget * @param port - the value to apply to the widget
@ -594,7 +595,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_checkBoxSSL.setEnabled(enable); _checkBoxSSL.setEnabled(enable);
} }
/** /**
* Return the current value of the REXEC server install path widget * Return the current value of the REXEC server install path widget
* @return widget value as a string * @return widget value as a string
*/ */
public String getServerInstallPath() public String getServerInstallPath()
@ -610,7 +611,7 @@ public class RemoteServerLauncherForm extends RemoteBaseServerLauncherForm
_fieldRexecPath.setText(path); _fieldRexecPath.setText(path);
} }
/** /**
* Return the current value of the REXEC server invocation widget * Return the current value of the REXEC server invocation widget
* @return widget value as a string * @return widget value as a string
*/ */
public String getServerInvocation() public String getServerInvocation()