1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-04 07:35:24 +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.
* 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
*
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
*
* Contributors:
* David Dykstal (IBM) - refactoring IConnectorService and ServerLauncher hierarchies
********************************************************************************/
@ -17,7 +17,6 @@
package org.eclipse.rse.ui.widgets;
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.internal.ui.SystemResources;
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
*/
public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implements IServerLauncherForm, RemoteServerLauncherConstants, ISystemConnectionWizardErrorUpdater
public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implements IServerLauncherForm, ISystemConnectionWizardErrorUpdater
{
protected String _hostName;
protected ISystemMessageLine _msgLine;
@ -54,8 +50,8 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
}
public abstract void disable();
/**
* @see org.eclipse.rse.ui.SystemBaseForm#createContents(Composite)
*/
@ -63,7 +59,7 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
{
// server lanucher group
Group group =createGroupControl(parent);
// create launcher type controls
createLauncherControls(group);
@ -74,7 +70,7 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
initDefaults();
return parent;
}
protected Group createGroupControl(Composite parent)
{
return SystemWidgetHelpers.createGroupComposite(
@ -87,13 +83,13 @@ public abstract class RemoteBaseServerLauncherForm extends SystemBaseForm implem
protected abstract ServerLaunchType getLaunchType();
protected abstract void setLaunchType(ServerLaunchType type);
protected abstract void initDefaults();
/**
* Verify page contents on OK.
* @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.
* @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 void setHostname(String hostname)
{
_hostName = hostname;

View file

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