mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-04 07:35:24 +02:00
get rid of subsystem calls with Shell parameters
This commit is contained in:
parent
692138a429
commit
b4a63e3cc4
46 changed files with 142 additions and 222 deletions
|
@ -35,7 +35,7 @@ import org.eclipse.rse.ui.RSEUIPlugin;
|
|||
*/
|
||||
public class DaytimeSubSystem extends SubSystem {
|
||||
|
||||
private IDaytimeService fDaytimeService;
|
||||
private IDaytimeService fDaytimeService;
|
||||
|
||||
public DaytimeSubSystem(IHost host, IConnectorService connectorService, IDaytimeService daytimeService) {
|
||||
super(host, connectorService);
|
||||
|
|
|
@ -925,7 +925,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements
|
|||
{
|
||||
try
|
||||
{
|
||||
promptForPassword(Display.getDefault().getActiveShell(), true);
|
||||
promptForPassword(true);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
|
@ -1037,7 +1037,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements
|
|||
{
|
||||
try
|
||||
{
|
||||
promptForPassword(Display.getDefault().getActiveShell(), true);
|
||||
promptForPassword(true);
|
||||
}
|
||||
catch (InterruptedException e)
|
||||
{
|
||||
|
@ -1139,7 +1139,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements
|
|||
|
||||
|
||||
|
||||
protected boolean promptForTrusting(Shell shell, X509Certificate cert)
|
||||
protected boolean promptForTrusting( X509Certificate cert)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -8,8 +8,7 @@ Bundle-Localization: plugin
|
|||
Require-Bundle: org.eclipse.core.runtime,
|
||||
org.eclipse.core.resources,
|
||||
org.eclipse.rse.logging,
|
||||
org.eclipse.rse.services,
|
||||
org.eclipse.swt
|
||||
org.eclipse.rse.services
|
||||
Eclipse-LazyStart: true
|
||||
Export-Package: org.eclipse.rse.core,
|
||||
org.eclipse.rse.core.filters,
|
||||
|
|
|
@ -18,7 +18,6 @@ package org.eclipse.rse.core.subsystems;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.rse.core.model.IHost;
|
||||
import org.eclipse.rse.core.model.IRSEModelObject;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -175,7 +174,7 @@ public interface IConnectorService extends IRSEModelObject
|
|||
* @param forcePrompt forces the prompt dialog to be displayed even if the password is currently
|
||||
* in memory.
|
||||
*/
|
||||
public void promptForPassword(Shell shell, boolean forcePrompt)
|
||||
public void promptForPassword(boolean forcePrompt)
|
||||
throws InterruptedException;
|
||||
/**
|
||||
* Set the password if you got it from somewhere
|
||||
|
|
|
@ -28,7 +28,6 @@ import org.eclipse.rse.core.model.IRSEModelObject;
|
|||
import org.eclipse.rse.core.model.ISystemProfile;
|
||||
import org.eclipse.rse.core.persistance.IRSEPersistableContainer;
|
||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
|
@ -340,13 +339,7 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* by all subsystems in which case this will always return false.
|
||||
*/
|
||||
public boolean isOffline();
|
||||
/**
|
||||
* Connect to the remote system.
|
||||
* In addition to calling getSystem().connect(),this might fire events.
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
*/
|
||||
public void connect(Shell shell) throws Exception;
|
||||
|
||||
/**
|
||||
* Connect to the remote system.
|
||||
* This uses Display.syncExec to get an active Shell and then calls connect(Shell)
|
||||
|
@ -357,11 +350,10 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* Connect to the remote system, optionally forcing a signon prompt even if the password
|
||||
* is cached in memory or on disk.
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param forcePrompt forces the prompt dialog to be displayed even if the password is currently
|
||||
* @param forcePrompt forces the prompt dialog to be displayed even if the password is currently
|
||||
* in memory.
|
||||
*/
|
||||
public void connect(Shell shell, boolean forcePrompt) throws Exception;
|
||||
public void connect(boolean forcePrompt) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -369,15 +361,15 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* In addition to calling getSystem().disconnect(),this must fire an
|
||||
* event to collapse the expanded nodes in the tree under this node.
|
||||
*/
|
||||
public void disconnect(Shell shell) throws Exception;
|
||||
|
||||
public void disconnect() throws Exception;
|
||||
|
||||
/**
|
||||
* Disconnect from the remote system.
|
||||
* In addition to calling getSystem().disconnect(),this may fire an
|
||||
* event to collapse the expanded nodes in the tree under this node
|
||||
* depending on the value of collapseTree.
|
||||
*/
|
||||
public void disconnect(Shell shell, boolean collapseTree) throws Exception;
|
||||
public void disconnect(boolean collapseTree) throws Exception;
|
||||
|
||||
|
||||
|
||||
|
@ -479,10 +471,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* type. Be sure to register your adapter factory.
|
||||
*
|
||||
* @param filterString filter pattern for objects to return.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Array of objects that are the result of this filter string
|
||||
*/
|
||||
public Object[] resolveFilterString(String filterString, Shell shell)
|
||||
public Object[] resolveFilterString(String filterString)
|
||||
throws Exception;
|
||||
/**
|
||||
* Resolve multiple absolute filter strings. This is only applicable if the subsystem
|
||||
|
@ -492,10 +483,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* filter strings versus a single filter string.
|
||||
*
|
||||
* @param filterStrings array of filter patterns for objects to return.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Array of objects that are the result of resolving all the filter strings
|
||||
* @return Array of objects that are the result of resolving all the filter strings
|
||||
*/
|
||||
public Object[] resolveFilterStrings(String[] filterStrings, Shell shell)
|
||||
public Object[] resolveFilterStrings(String[] filterStrings)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -521,10 +511,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
*
|
||||
* @param parent Object that is being expanded.
|
||||
* @param filterString filter pattern for children of parent.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Array of objects that are the result of this filter string
|
||||
* @return Array of objects that are the result of this filter string
|
||||
*/
|
||||
public Object[] resolveFilterString(Object parent, String filterString, Shell shell)
|
||||
public Object[] resolveFilterString(Object parent, String filterString)
|
||||
throws Exception;
|
||||
|
||||
/*
|
||||
|
@ -553,10 +542,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to set
|
||||
* @param value Value to set property to
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object interpretable by subsystem. Might be a Boolean, or the might be new value for confirmation.
|
||||
*/
|
||||
public Object setProperty(Object subject, String key, String value, Shell shell)
|
||||
public Object setProperty(Object subject, String key, String value)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -565,10 +553,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* true for supportsProperties().
|
||||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to get value of
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return String The value of the requested key.
|
||||
*/
|
||||
public String getProperty(Object subject, String key, Shell shell)
|
||||
public String getProperty(Object subject, String key)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -578,10 +565,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to set
|
||||
* @param value Values to set properties to. One to one mapping to keys by index number
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation.
|
||||
*/
|
||||
public Object setProperties(Object subject, String[] keys, String[] values, Shell shell)
|
||||
public Object setProperties(Object subject, String[] keys, String[] values)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
|
@ -590,10 +576,9 @@ public interface ISubSystem extends ISystemFilterPoolReferenceManagerProvider, I
|
|||
* true for supportsProperties().
|
||||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to get value of
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object The values of the requested keys.
|
||||
*/
|
||||
public String[] getProperties(Object subject, String[] keys, Shell shell)
|
||||
public String[] getProperties(Object subject, String[] keys)
|
||||
throws Exception;
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.eclipse.rse.core.model.IHost;
|
|||
import org.eclipse.rse.core.model.ISystemNewConnectionWizardPage;
|
||||
import org.eclipse.rse.core.model.ISystemProfile;
|
||||
import org.eclipse.rse.core.persistance.IRSEPersistableContainer;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
|
||||
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer
|
||||
|
@ -344,24 +344,23 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
|||
* disconnect.
|
||||
* <p>
|
||||
* The subsystem will be saved to disk.
|
||||
* @param shell parent shell needed in case an error message is displayed
|
||||
* @param subsystem target of the update action
|
||||
* @param updateUserId true if we are updating the userId, else false to ignore userId
|
||||
* @param userId new local user Id. Ignored if updateUserId is false
|
||||
* @param updatePort true if we are updating the port, else false to ignore port
|
||||
* @param port new local port value. Ignored if updatePort is false
|
||||
*/
|
||||
public void updateSubSystem(Shell shell, ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port);
|
||||
public void updateSubSystem(ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port);
|
||||
/**
|
||||
* Update the port for the given subsystem instance.
|
||||
* Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)}
|
||||
*/
|
||||
public void setSubSystemPort(Shell shell, ISubSystem subsystem, int port);
|
||||
public void setSubSystemPort(ISubSystem subsystem, int port);
|
||||
/**
|
||||
* Update the user ID for the given subsystem instance.
|
||||
* Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)}
|
||||
*/
|
||||
public void setSubSystemUserId(Shell shell, ISubSystem subsystem, String userId);
|
||||
public void setSubSystemUserId(ISubSystem subsystem, String userId);
|
||||
|
||||
/**
|
||||
* Returns true if this factory allows users to delete instances of subsystem objects.
|
||||
|
|
|
@ -115,7 +115,7 @@ public class RSEFileSystem extends FileSystem
|
|||
|
||||
try
|
||||
{
|
||||
ss.connect(shell);
|
||||
ss.connect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -138,26 +138,8 @@ public class RSEFileSystem extends FileSystem
|
|||
if (!fs.isConnected())
|
||||
{
|
||||
|
||||
Shell shell = null;
|
||||
try
|
||||
{
|
||||
//if (PlatformUI.isWorkbenchRunning())
|
||||
{
|
||||
//shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
|
||||
|
||||
shell = SystemBasePlugin.getActiveWorkbenchShell();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
}
|
||||
|
||||
if (shell == null)
|
||||
{
|
||||
shell = new Shell();
|
||||
}
|
||||
|
||||
fs.getConnectorService().promptForPassword(shell, false);
|
||||
fs.getConnectorService().promptForPassword(false);
|
||||
fs.getConnectorService().connect(new NullProgressMonitor());
|
||||
//fs.connect(shell);
|
||||
}
|
||||
|
|
|
@ -570,8 +570,7 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
|
|||
// if not, attemp to connect to it
|
||||
if (!fs.isConnected())
|
||||
{
|
||||
Shell theShell = SystemBasePlugin.getActiveWorkbenchShell();
|
||||
fs.connect(theShell);
|
||||
fs.connect();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -720,7 +720,7 @@ public class SystemViewRemoteFileAdapter
|
|||
}
|
||||
else
|
||||
{
|
||||
children = ss.resolveFilterString(file, filter, getShell());
|
||||
children = ss.resolveFilterString(file, filter);
|
||||
}
|
||||
if ((children == null) || (children.length == 0))
|
||||
{
|
||||
|
|
|
@ -603,7 +603,7 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
|
|||
{
|
||||
try
|
||||
{
|
||||
ss.connect(getShell()); // will throw exception if fails.
|
||||
ss.connect(); // will throw exception if fails.
|
||||
} catch (InterruptedException exc)
|
||||
{
|
||||
msg = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_CONNECT_CANCELLED);
|
||||
|
|
|
@ -130,7 +130,7 @@ public class RemoteCommandHelpers
|
|||
try
|
||||
{
|
||||
|
||||
IRemoteCommandShell defaultShell= cmdSubSystem.getDefaultShell(shell);
|
||||
IRemoteCommandShell defaultShell= cmdSubSystem.getDefaultShell();
|
||||
|
||||
|
||||
showInView(defaultShell, isCompile, cmdString);
|
||||
|
@ -154,9 +154,9 @@ public class RemoteCommandHelpers
|
|||
cdCmd = "cd /d " + path; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
cmdSubSystem.sendCommandToShell(cdCmd, shell, defaultShell);
|
||||
cmdSubSystem.sendCommandToShell(cdCmd, defaultShell);
|
||||
}
|
||||
cmdSubSystem.sendCommandToShell(cmdString, shell, defaultShell);
|
||||
cmdSubSystem.sendCommandToShell(cmdString, defaultShell);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -148,7 +148,7 @@ public class SystemRemoteCommandEntryForm extends Composite
|
|||
{
|
||||
try
|
||||
{
|
||||
currSubSystem.runCommand(cmd, getShell(), null);
|
||||
currSubSystem.runCommand(cmd, null);
|
||||
}
|
||||
catch ( Exception e )
|
||||
{
|
||||
|
|
|
@ -402,7 +402,7 @@ public class SystemCommandAction extends SystemBaseAction
|
|||
|
||||
if (launchNewShell)
|
||||
{
|
||||
Object[] results = cmdSubSystem.runCommand(cmd, shell, _selected);
|
||||
Object[] results = cmdSubSystem.runCommand(cmd, _selected);
|
||||
Object cmdObject = results[0];
|
||||
if (cmdObject instanceof IRemoteCommandShell)
|
||||
{
|
||||
|
@ -412,7 +412,7 @@ public class SystemCommandAction extends SystemBaseAction
|
|||
else
|
||||
{
|
||||
// run command in shell
|
||||
IRemoteCommandShell defaultShell = cmdSubSystem.getDefaultShell(shell);
|
||||
IRemoteCommandShell defaultShell = cmdSubSystem.getDefaultShell();
|
||||
if (defaultShell != null)
|
||||
{
|
||||
showInView(defaultShell);
|
||||
|
@ -424,8 +424,8 @@ public class SystemCommandAction extends SystemBaseAction
|
|||
{
|
||||
cdCmd = "cd /d " + path; //$NON-NLS-1$
|
||||
}
|
||||
cmdSubSystem.sendCommandToShell(cdCmd, shell, defaultShell);
|
||||
cmdSubSystem.sendCommandToShell(cmd, shell, defaultShell);
|
||||
cmdSubSystem.sendCommandToShell(cdCmd, defaultShell);
|
||||
cmdSubSystem.sendCommandToShell(cmd, defaultShell);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -433,7 +433,7 @@ public class SystemCommandAction extends SystemBaseAction
|
|||
IRemoteCmdSubSystem cmdSubSystem = getCommandSubSystem();
|
||||
if (cmdSubSystem != null)
|
||||
{
|
||||
Object[] results = cmdSubSystem.runCommand(cmd, shell, _selected);
|
||||
Object[] results = cmdSubSystem.runCommand(cmd, _selected);
|
||||
Object cmdObject = results[0];
|
||||
if (cmdObject instanceof IRemoteCommandShell)
|
||||
{
|
||||
|
@ -483,15 +483,15 @@ public class SystemCommandAction extends SystemBaseAction
|
|||
{
|
||||
SystemCommandsUI commandsUI = SystemCommandsUI.getInstance();
|
||||
SystemCommandsViewPart cmdsPart = commandsUI.activateCommandsView();
|
||||
IRemoteCommandShell cmd = cmdSubSystem.runShell(shell, _selected);
|
||||
IRemoteCommandShell cmd = cmdSubSystem.runShell(_selected);
|
||||
cmdsPart.updateOutput(cmd);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdSubSystem.connect(shell);
|
||||
cmdSubSystem.connect();
|
||||
SystemCommandsUI commandsUI = SystemCommandsUI.getInstance();
|
||||
SystemCommandsViewPart cmdsPart = commandsUI.activateCommandsView();
|
||||
IRemoteCommandShell cmd = cmdSubSystem.runShell(shell, _selected);
|
||||
IRemoteCommandShell cmd = cmdSubSystem.runShell( _selected);
|
||||
cmdsPart.updateOutput(cmd);
|
||||
//showInView(cmd);
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class SystemTerminateRemoveShellAction extends SystemTerminateShellAction
|
|||
IRemoteCmdSubSystem cmdSubSystem = command.getCommandSubSystem();
|
||||
if (cmdSubSystem != null)
|
||||
{
|
||||
cmdSubSystem.removeShell(getShell(), command);
|
||||
cmdSubSystem.removeShell(command);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -81,7 +81,7 @@ public class SystemTerminateShellAction extends SystemBaseShellAction
|
|||
IRemoteCmdSubSystem cmdSubSystem = command.getCommandSubSystem();
|
||||
if (cmdSubSystem != null)
|
||||
{
|
||||
cmdSubSystem.cancelShell(getShell(), command);
|
||||
cmdSubSystem.cancelShell(command);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -443,7 +443,7 @@ FocusListener
|
|||
IRemoteCmdSubSystem commandSubSystem = remoteCommand.getCommandSubSystem();
|
||||
try
|
||||
{
|
||||
commandSubSystem.sendCommandToShell(inputStr, _viewer.getShell(), remoteCommand);
|
||||
commandSubSystem.sendCommandToShell(inputStr, remoteCommand);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -464,7 +464,7 @@ FocusListener
|
|||
IRemoteCmdSubSystem commandSubSystem = remoteCommand.getCommandSubSystem();
|
||||
try
|
||||
{
|
||||
commandSubSystem.sendCommandToShell("#break", _viewer.getShell(), remoteCommand);
|
||||
commandSubSystem.sendCommandToShell("#break", remoteCommand);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -147,7 +147,7 @@ public class SystemCommandsViewPart
|
|||
{
|
||||
try
|
||||
{
|
||||
IRemoteCommandShell cmd = _cmdSubSystem.runShell(getShell(), null);
|
||||
IRemoteCommandShell cmd = _cmdSubSystem.runShell( null);
|
||||
if (cmd != null)
|
||||
{
|
||||
showInView(cmd);
|
||||
|
|
|
@ -820,7 +820,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I
|
|||
try
|
||||
{
|
||||
_cachedRemoteFiles.clear();
|
||||
disconnect(SystemBasePlugin.getActiveWorkbenchShell());
|
||||
disconnect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -107,8 +107,7 @@ public abstract class RemoteFile implements IRemoteFile, IAdaptable, Comparable
|
|||
try
|
||||
{
|
||||
// deduce active shell from display
|
||||
Shell shell = Display.getCurrent().getActiveShell();
|
||||
context.getParentRemoteFileSubSystem().connect(shell);
|
||||
context.getParentRemoteFileSubSystem().connect();
|
||||
} catch (Exception exc) {}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,8 +58,7 @@ public class RemoteProcessImpl implements IRemoteProcess, ISystemProcessRemoteCo
|
|||
try
|
||||
{
|
||||
// deduce active shell from display
|
||||
Shell shell = Display.getCurrent().getActiveShell();
|
||||
context.getParentRemoteProcessSubSystem().connect(shell);
|
||||
context.getParentRemoteProcessSubSystem().connect();
|
||||
} catch (Exception exc) {}
|
||||
|
||||
_underlyingProcess = process;
|
||||
|
|
|
@ -155,7 +155,7 @@ public class ProcessServiceSubSystem extends RemoteProcessSubSystemImpl implemen
|
|||
IProcessServiceSubSystemConfiguration factory = (IProcessServiceSubSystemConfiguration)fact;
|
||||
try
|
||||
{
|
||||
disconnect(SystemBasePlugin.getActiveWorkbenchShell());
|
||||
disconnect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -488,12 +488,12 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
* @param shell the window used for notification
|
||||
* @return the default running command shell
|
||||
*/
|
||||
public IRemoteCommandShell getDefaultShell(Shell shell) throws Exception
|
||||
public IRemoteCommandShell getDefaultShell() throws Exception
|
||||
{
|
||||
IRemoteCommandShell[] shells = getShells();
|
||||
if (shells == null || shells.length == 0)
|
||||
{
|
||||
return runShell(shell, null);
|
||||
return runShell( null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -809,7 +809,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
/**
|
||||
* overridden so that for universal we don't need to do in modal thread
|
||||
*/
|
||||
public Object[] runCommand(String command, Shell shell, Object context, boolean interpretOutput) throws Exception
|
||||
public Object[] runCommand(String command, Object context, boolean interpretOutput) throws Exception
|
||||
{
|
||||
if (shell != null)
|
||||
this.shell = shell;
|
||||
|
@ -845,7 +845,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
/**
|
||||
* overridden so that for universal we don't need to do in modal thread
|
||||
*/
|
||||
public IRemoteCommandShell runShell(Shell shell, Object context) throws Exception
|
||||
public IRemoteCommandShell runShell(Object context) throws Exception
|
||||
{
|
||||
if (shell != null)
|
||||
this.shell = shell;
|
||||
|
@ -887,31 +887,27 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
* factory reports true for supportsCommands().
|
||||
*
|
||||
* @param command Command to be executed remotely.
|
||||
* @param shell parent shell used to show error message. Null means you will
|
||||
* handle showing the error message.
|
||||
* @param context context of a command (i.e. working directory). <code>null</code> is
|
||||
* valid and means to use the default context.
|
||||
* @return Array of objects that are the result of running this command.
|
||||
* Typically, these are messages logged by the command.
|
||||
*/
|
||||
public Object[] runCommand(String command, Shell shell, Object context) throws Exception
|
||||
public Object[] runCommand(String command, Object context) throws Exception
|
||||
{
|
||||
return runCommand(command, shell, context, true);
|
||||
return runCommand(command, context, true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a command as input to a running command shell.
|
||||
*
|
||||
* @param input the command to invoke in the shell.
|
||||
* @param shell parent shell used to show error message. Null means you will
|
||||
* handle showing the error message.
|
||||
* @param commandObject the shell or command to send the invocation to.
|
||||
*/
|
||||
public void sendCommandToShell(String input, Shell shell, Object commandObject) throws Exception
|
||||
public void sendCommandToShell(String input, Object commandObject) throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -942,11 +938,9 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
/**
|
||||
* Cancel a shell or running command.
|
||||
*
|
||||
* @param shell parent shell used to show error message. Null means you will
|
||||
* handle showing the error message.
|
||||
* @param commandObject the shell or command to cancel.
|
||||
*/
|
||||
public void cancelShell(Shell shell, Object commandObject) throws Exception
|
||||
public void cancelShell(Object commandObject) throws Exception
|
||||
{
|
||||
if (isConnected())
|
||||
{
|
||||
|
@ -956,7 +950,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -986,7 +980,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
* handle showing the error message.
|
||||
* @param commandObject the shell or command to cancel.
|
||||
*/
|
||||
public void removeShell(Shell shell, Object commandObject) throws Exception
|
||||
public void removeShell(Object commandObject) throws Exception
|
||||
{
|
||||
if (isConnected())
|
||||
{
|
||||
|
@ -996,7 +990,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
|
|||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -104,7 +104,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
|
|||
try
|
||||
{
|
||||
RSEUIPlugin.getTheSystemRegistry().addSystemResourceChangeListener(this);
|
||||
_remoteCmdShell = _cmdSubSystem.runShell(getShell(), _pwd);
|
||||
_remoteCmdShell = _cmdSubSystem.runShell( _pwd);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -136,7 +136,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
|
|||
{
|
||||
try
|
||||
{
|
||||
_cmdSubSystem.cancelShell(getShell(), _remoteCmdShell);
|
||||
_cmdSubSystem.cancelShell( _remoteCmdShell);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -182,7 +182,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
|
|||
|
||||
// echo command appended after ; so that
|
||||
// it isn't treated like stdin for the intial command
|
||||
_cmdSubSystem.sendCommandToShell(cmd + _cmdSeparator + echoCmd, getShell(), _remoteCmdShell);
|
||||
_cmdSubSystem.sendCommandToShell(cmd + _cmdSeparator + echoCmd, _remoteCmdShell);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
|
@ -203,7 +203,7 @@ public abstract class RemoteCommandShellOperation implements ISystemResourceChan
|
|||
{
|
||||
try
|
||||
{
|
||||
_cmdSubSystem.sendCommandToShell(input, getShell(), _remoteCmdShell);
|
||||
_cmdSubSystem.sendCommandToShell(input, _remoteCmdShell);
|
||||
|
||||
}
|
||||
catch (Exception e)
|
||||
|
|
|
@ -39,7 +39,7 @@ public class SimpleCommandOperation
|
|||
|
||||
public void runCommand(String command) throws Exception
|
||||
{
|
||||
Object[] result =_subsystem.runCommand(command, null, _workingDirectory, false);
|
||||
Object[] result =_subsystem.runCommand(command, _workingDirectory, false);
|
||||
_cmdShell = (IRemoteCommandShell)result[0];
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ public class SimpleCommandOperation
|
|||
{
|
||||
if (isActive())
|
||||
{
|
||||
_subsystem.sendCommandToShell(input, null, _cmdShell);
|
||||
_subsystem.sendCommandToShell(input, _cmdShell);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -82,7 +82,7 @@ public class SimpleCommandOperation
|
|||
{
|
||||
if (_cmdShell != null && _cmdShell.isActive())
|
||||
{
|
||||
_cmdShell.getCommandSubSystem().cancelShell(null, _cmdShell);
|
||||
_cmdShell.getCommandSubSystem().cancelShell(_cmdShell);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -43,20 +43,18 @@ public interface IRemoteCmdSubSystem extends ISubSystem{
|
|||
* Execute a remote command. This is only applicable if the subsystem factory reports
|
||||
* true for supportsCommands().
|
||||
* @param command Command to be executed remotely.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object context context of a command (i.e. working directory). Null is valid and means to run the
|
||||
* command as a shell command in the default shell.
|
||||
* @return Array of objects that are the result of running this command. Typically, these
|
||||
* are messages logged by the command.
|
||||
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
|
||||
*/
|
||||
public Object[] runCommand(String command, Shell shell, Object context) throws Exception;
|
||||
public Object[] runCommand(String command, Object context) throws Exception;
|
||||
|
||||
/**
|
||||
* Execute a remote command. This is only applicable if the subsystem factory reports
|
||||
* true for supportsCommands().
|
||||
* @param command Command to be executed remotely.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object context context of a command (i.e. working directory). Null is valid and means to run the
|
||||
* command as a shell command in the default shell.
|
||||
* @param interpretOutput whether to interpret the output or not
|
||||
|
@ -64,49 +62,44 @@ public interface IRemoteCmdSubSystem extends ISubSystem{
|
|||
* are messages logged by the command.
|
||||
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
|
||||
*/
|
||||
public Object[] runCommand(String command, Shell shell, Object context, boolean interpretOutput) throws Exception;
|
||||
public Object[] runCommand(String command, Object context, boolean interpretOutput) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* Launch a new command shell. This is only applicable if the subsystem factory reports
|
||||
* true for supportsCommands().
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object context context of a shell (i.e. working directory). Null is valid and means to use the default context.
|
||||
* @return An object that represents the command and it's output.
|
||||
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
|
||||
*/
|
||||
public IRemoteCommandShell runShell(Shell shell, Object context) throws Exception;
|
||||
public IRemoteCommandShell runShell(Object context) throws Exception;
|
||||
|
||||
|
||||
/**
|
||||
* Send a command as input to a running command shell.
|
||||
* @param String input the command to invoke in the shell.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object commandObject the shell or command to send the invocation to.
|
||||
* @see org.eclipse.rse.core.subsystems.shells.ui.RemoteCommandHelpers
|
||||
*/
|
||||
public void sendCommandToShell(String input, Shell shell, Object commandObject) throws Exception;
|
||||
public void sendCommandToShell(String input, Object commandObject) throws Exception;
|
||||
|
||||
/**
|
||||
* Cancel a shell or running command.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object commandObject the shell or command to cancel.
|
||||
* @param Object commandObject the shell or command to cancel.
|
||||
*/
|
||||
public void cancelShell(Shell shell, Object commandObject) throws Exception;
|
||||
public void cancelShell(Object commandObject) throws Exception;
|
||||
|
||||
/**
|
||||
* Remove a shell. If the shell is running cancel it first.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param Object commandObject the shell or command to cancel & remove.
|
||||
*/
|
||||
public void removeShell(Shell shell, Object commandObject) throws Exception;
|
||||
public void removeShell(Object commandObject) throws Exception;
|
||||
|
||||
/**
|
||||
* Get the default running command shell for this command subsystem. If no such shell exists or is running, a new one is launched.
|
||||
* @param shell a window used for notification
|
||||
* @return the default running command shell
|
||||
*/
|
||||
public IRemoteCommandShell getDefaultShell(Shell shell) throws Exception;
|
||||
public IRemoteCommandShell getDefaultShell() throws Exception;
|
||||
|
||||
/**
|
||||
* Get all command shells and transient commands that have been run or are running for this command subsystem.
|
||||
|
|
|
@ -213,7 +213,7 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I
|
|||
IShellServiceSubSystemConfiguration factory = (IShellServiceSubSystemConfiguration)fact;
|
||||
try
|
||||
{
|
||||
disconnect(SystemBasePlugin.getActiveWorkbenchShell());
|
||||
disconnect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -65,9 +65,9 @@ public class SystemConnectAction extends SystemBaseAction
|
|||
ISubSystem ss = (ISubSystem)getFirstSelection();
|
||||
try {
|
||||
if (ss.getHost().getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
|
||||
ss.connect(getShell());
|
||||
ss.connect();
|
||||
else
|
||||
ss.connect(getShell(), true);
|
||||
ss.connect(true);
|
||||
} catch (Exception exc) {} // msg already shown
|
||||
}
|
||||
}
|
|
@ -85,7 +85,7 @@ public class SystemConnectAllSubSystemsAction extends SystemBaseAction
|
|||
{
|
||||
try
|
||||
{
|
||||
subsystem.connect(shell, false);
|
||||
subsystem.connect(false);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SystemDisconnectAction extends SystemBaseAction
|
|||
{
|
||||
ISubSystem ss = (ISubSystem)getFirstSelection();
|
||||
try {
|
||||
ss.disconnect(getShell());
|
||||
ss.disconnect();
|
||||
} catch (Exception exc) {} // msg already shown
|
||||
}
|
||||
}
|
|
@ -91,7 +91,7 @@ public class SystemWorkOfflineAction extends SystemBaseAction
|
|||
{
|
||||
try
|
||||
{
|
||||
subsystems[i].disconnect(getShell(), false);
|
||||
subsystems[i].disconnect(false);
|
||||
} catch (InterruptedException e) {
|
||||
// user cancelled disconnect
|
||||
cancelled = true;
|
||||
|
|
|
@ -129,10 +129,9 @@ public class SystemFetchOperation extends JobChangeAdapter implements IRunnableW
|
|||
|
||||
public void run()
|
||||
{
|
||||
Shell shell = Display.getCurrent().getActiveShell();
|
||||
try
|
||||
{
|
||||
_ss.promptForPassword(shell);
|
||||
_ss.promptForPassword();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -119,7 +119,7 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
|
|||
{
|
||||
try
|
||||
{
|
||||
subsystems[i].disconnect(getShell(), false);
|
||||
subsystems[i].disconnect(false);
|
||||
} catch (InterruptedException e) {
|
||||
// user cancelled disconnect
|
||||
cancelled = true;
|
||||
|
|
|
@ -365,7 +365,7 @@ public class SystemSubSystemPropertyPageCoreForm extends AbstractSystemSubSystem
|
|||
// ambiquity as the parent could be the connnection or the user preferences setting for this
|
||||
// system type. Because of this decision, we don't need to tell updateSubSystem(...) where
|
||||
// to update, as it always the local subsystem.
|
||||
ssFactory.updateSubSystem(getShell(), subsys, true, userId, false, subsys.getConnectorService().getPort());
|
||||
ssFactory.updateSubSystem(subsys, true, userId, false, subsys.getConnectorService().getPort());
|
||||
}
|
||||
/**
|
||||
* Change the subsystem port value
|
||||
|
@ -382,7 +382,7 @@ public class SystemSubSystemPropertyPageCoreForm extends AbstractSystemSubSystem
|
|||
*/
|
||||
int portInteger = portPrompt.getPort();
|
||||
ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
|
||||
ssFactory.updateSubSystem(getShell(), subsys, false, subsys.getLocalUserId(), true, portInteger);
|
||||
ssFactory.updateSubSystem(subsys, false, subsys.getLocalUserId(), true, portInteger);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -515,7 +515,7 @@ public class SystemDNDTransferRunnable extends Job
|
|||
{
|
||||
try
|
||||
{
|
||||
targetSubSystem.connect(SystemBasePlugin.getActiveWorkbenchShell());
|
||||
targetSubSystem.connect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
|
|
@ -579,7 +579,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
|
|||
Object[] children = null;
|
||||
try
|
||||
{
|
||||
children = subsystem.resolveFilterString(filterString, shell);
|
||||
children = subsystem.resolveFilterString(filterString);
|
||||
} catch (InterruptedException exc)
|
||||
{
|
||||
if (canceledObject == null)
|
||||
|
|
|
@ -89,7 +89,7 @@ public class SystemTestFilterStringAPIProviderImpl
|
|||
return children;
|
||||
try
|
||||
{
|
||||
children = subsystem.resolveFilterString(filterString, shell);
|
||||
children = subsystem.resolveFilterString(filterString);
|
||||
if ((children == null) || (children.length==0))
|
||||
{
|
||||
if (nullObject == null)
|
||||
|
|
|
@ -136,7 +136,7 @@ public class SystemViewAPIProviderForFilterStrings
|
|||
Object[] children = null;
|
||||
try
|
||||
{
|
||||
children = ss.resolveFilterString(filterStringReference.getString(),getShell());
|
||||
children = ss.resolveFilterString(filterStringReference.getString());
|
||||
if ((children == null) || (children.length==0))
|
||||
{
|
||||
children = new SystemMessageObject[1];
|
||||
|
|
|
@ -182,7 +182,7 @@ public class SystemViewAPIProviderForFilters
|
|||
String[] filterStrings = referencedFilter.getFilterStrings();
|
||||
try
|
||||
{
|
||||
Object[] allChildren = ss.resolveFilterStrings(filterStrings,getShell());
|
||||
Object[] allChildren = ss.resolveFilterStrings(filterStrings);
|
||||
int nbrNestedFilters = (nestedFilterReferences==null) ? 0: nestedFilterReferences.length;
|
||||
children = new Object[nbrNestedFilters + allChildren.length];
|
||||
int idx = 0;
|
||||
|
|
|
@ -214,7 +214,7 @@ public class SystemViewFilterAdapter extends AbstractSystemViewAdapter implement
|
|||
}
|
||||
// otherwise, get children and then cache
|
||||
else {
|
||||
children = checkForNull(ss.resolveFilterStrings(filterStrings,shell), true);
|
||||
children = checkForNull(ss.resolveFilterStrings(filterStrings), true);
|
||||
|
||||
if (ss.getSubSystemConfiguration().supportsFilterCaching()) {
|
||||
simpleFilter.setContents(SystemChildrenContentsType.getInstance(), children);
|
||||
|
|
|
@ -360,7 +360,7 @@ public class SystemViewFilterReferenceAdapter
|
|||
if (monitor == null)
|
||||
{
|
||||
Shell shell = getShell();
|
||||
allChildren = ss.resolveFilterStrings(filterStrings, shell);
|
||||
allChildren = ss.resolveFilterStrings(filterStrings);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -468,7 +468,7 @@ public class SystemViewSubSystemAdapter extends AbstractSystemViewAdapter
|
|||
// ambiquity as the parent could be the connnection or the user preferences setting for this
|
||||
// system type. Because of this decision, we don't need to tell updateSubSystem(...) where
|
||||
// to update, as it always the local subsystem.
|
||||
ssFactory.updateSubSystem((Shell)null, subsys, true, userId, false, subsys.getConnectorService().getPort());
|
||||
ssFactory.updateSubSystem(subsys, true, userId, false, subsys.getConnectorService().getPort());
|
||||
}
|
||||
/**
|
||||
* Change the subsystem port value
|
||||
|
@ -511,7 +511,7 @@ public class SystemViewSubSystemAdapter extends AbstractSystemViewAdapter
|
|||
}
|
||||
int portInt = portInteger.intValue();
|
||||
ISubSystemConfiguration ssFactory = subsys.getSubSystemConfiguration();
|
||||
ssFactory.updateSubSystem((Shell)null, subsys, false, subsys.getLocalUserId(), true, portInt);
|
||||
ssFactory.updateSubSystem(subsys, false, subsys.getLocalUserId(), true, portInt);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2382,7 +2382,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
|
|||
{
|
||||
try
|
||||
{
|
||||
if (subsystems[idx].isConnected()) subsystems[idx].disconnect(shell); // MJB: added conditional for defect 45754
|
||||
if (subsystems[idx].isConnected()) subsystems[idx].disconnect(); // MJB: added conditional for defect 45754
|
||||
if (defaultUserIdChanged)
|
||||
{
|
||||
subsystems[idx].getConnectorService().clearUserIdCache();
|
||||
|
@ -2669,10 +2669,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
|
|||
try
|
||||
{
|
||||
//ss.getConnectorService().disconnect(); defect 40675
|
||||
Shell shell = null;
|
||||
if (Display.getCurrent() != null)
|
||||
shell = Display.getCurrent().getActiveShell();
|
||||
ss.disconnect(shell);
|
||||
ss.disconnect();
|
||||
}
|
||||
catch (InterruptedException exc)
|
||||
{
|
||||
|
|
|
@ -450,13 +450,12 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
|
|||
* <li>If password not known then look in the password store and verify that it is still valid.
|
||||
* <li>If a valid password is not found then prompt the user.
|
||||
* </ol>
|
||||
* Must be run in the UI thread.
|
||||
* @param shell parent for the prompt dialog if needed.
|
||||
* Must be run in the UI thread.
|
||||
* Can be null if the password is known to exist in either this class or in the password store.
|
||||
* @param forcePrompt if true then present the prompt even if the password was found and is valid.
|
||||
* @throws InterruptedException if user is prompted and user cancels that prompt or if isSuppressSignonPrompt is true.
|
||||
*/
|
||||
public void promptForPassword(Shell shell, boolean forcePrompt) throws InterruptedException {
|
||||
public void promptForPassword(boolean forcePrompt) throws InterruptedException {
|
||||
// dy: March 24, 2003: check if prompting is temporarily suppressed by a tool
|
||||
// vendor, this should only be suppressed if the user cancelled a previous signon
|
||||
// dialog (or some other good reason)
|
||||
|
@ -634,7 +633,7 @@ public abstract class AbstractConnectorService extends RSEModelObject implements
|
|||
String ssLocalUserId = subsystem.getLocalUserId();
|
||||
if (ssLocalUserId != null) { // defect 42709
|
||||
ISubSystemConfiguration ssc = subsystem.getSubSystemConfiguration();
|
||||
ssc.updateSubSystem(shell, subsystem, true, userId, false, 0);
|
||||
ssc.updateSubSystem(subsystem, true, userId, false, 0);
|
||||
} else { // it seems intuitive to update the connection object. defect 42709. Phil
|
||||
int whereToUpdate = USERID_LOCATION_CONNECTION;
|
||||
IHost conn = subsystem.getHost();
|
||||
|
|
|
@ -200,7 +200,7 @@ public abstract class AbstractConnectorServiceManager implements IConnectorServi
|
|||
if ( (ss != subsystem) && sharesSystem(ss) )
|
||||
{
|
||||
ISubSystemConfiguration ssFactory = ss.getSubSystemConfiguration();
|
||||
ssFactory.updateSubSystem(shell, ss, updateUserId, userId, updatePort, port);
|
||||
ssFactory.updateSubSystem(ss, updateUserId, userId, updatePort, port);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -189,7 +189,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
|
||||
try
|
||||
{
|
||||
connect(shell);
|
||||
connect();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
|
@ -515,7 +515,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
Shell shell = display.getActiveShell();
|
||||
if (shell != null && !shell.isDisposed())
|
||||
{
|
||||
connect(shell);
|
||||
connect();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -1982,12 +1982,12 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* @param filterString filter pattern for objects to return.
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
*/
|
||||
public Object[] resolveFilterString(String filterString, Shell shell)
|
||||
public Object[] resolveFilterString(String filterString)
|
||||
throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -2033,7 +2033,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Array of objects that are the result of resolving all the filter strings
|
||||
*/
|
||||
public Object[] resolveFilterStrings(String[] filterStrings, Shell shell)
|
||||
public Object[] resolveFilterStrings(String[] filterStrings)
|
||||
throws Exception
|
||||
{
|
||||
|
||||
|
@ -2045,7 +2045,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
}
|
||||
|
||||
if (!isConnected()) {
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
}
|
||||
|
||||
if (ok)
|
||||
|
@ -2160,7 +2160,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
Object[] results = internalResolveFilterString(monitor, filterString);
|
||||
|
@ -2202,7 +2202,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
Object[] results = internalResolveFilterStrings(monitor, filterStrings);
|
||||
|
@ -2245,7 +2245,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
|
||||
if (ok)
|
||||
{
|
||||
|
@ -2288,14 +2288,13 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* <p>
|
||||
* @param parent Object that is being expanded.
|
||||
* @param filterString filter pattern for children of parent. Typically just "*".
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
*/
|
||||
public Object[] resolveFilterString(Object parent, String filterString, Shell shell)
|
||||
public Object[] resolveFilterString(Object parent, String filterString)
|
||||
throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
|
||||
|
@ -2345,15 +2344,14 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to set
|
||||
* @param value Value to set property to
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object interpretable by subsystem. Might be a Boolean, or the might be new value for confirmation.
|
||||
*/
|
||||
public Object setProperty(Object subject, String key, String value, Shell shell)
|
||||
public Object setProperty(Object subject, String key, String value)
|
||||
throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -2384,15 +2382,14 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* true for supportsProperties().
|
||||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to get value of
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return String The value of the requested key.
|
||||
* @return String The value of the requested key.
|
||||
*/
|
||||
public String getProperty(Object subject, String key, Shell shell)
|
||||
public String getProperty(Object subject, String key)
|
||||
throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -2425,15 +2422,14 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to set
|
||||
* @param value Values to set properties to. One to one mapping to keys by index number
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object interpretable by subsystem. Might be a Boolean, or the might be new values for confirmation.
|
||||
*/
|
||||
public Object setProperties(Object subject, String[] keys, String[] values, Shell shell)
|
||||
public Object setProperties(Object subject, String[] keys, String[] values)
|
||||
throws Exception
|
||||
{
|
||||
boolean ok = true;
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
@ -2465,19 +2461,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
*/
|
||||
public abstract void initializeSubSystem(IProgressMonitor monitor);
|
||||
|
||||
/**
|
||||
* Attempt to connect to the remote system.
|
||||
* You do not need to override this, as it does the progress monitor and error message
|
||||
* displaying for you.
|
||||
* <p>
|
||||
* Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor).
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
*/
|
||||
public void connect(Shell shell) throws Exception
|
||||
{
|
||||
connect(shell, false);
|
||||
}
|
||||
|
||||
/**
|
||||
* Attempt to connect to the remote system when a Shell is not available.
|
||||
* You do not need to override this, as it does the progress monitor and error message
|
||||
|
@ -2512,11 +2496,10 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* <p>
|
||||
* Override internalConnect if you want, but by default it calls getSystem().connect(IProgressMonitor).
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param forcePrompt Forces the signon prompt to be displayed even if a valid password in cached in memory
|
||||
* or saved on disk.
|
||||
*/
|
||||
public void connect(Shell shell, boolean forcePrompt) throws Exception {
|
||||
public void connect(boolean forcePrompt) throws Exception {
|
||||
// yantzi: artemis60, (defect 53082) check that the connection has not been deleted before continuing,
|
||||
// this is a defenisve measure to protect against code that stores a handle to subsystems but does
|
||||
// not do this check
|
||||
|
@ -2542,7 +2525,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
if (runnableContext instanceof ProgressMonitorDialog) {
|
||||
((ProgressMonitorDialog) runnableContext).setCancelable(true);
|
||||
}
|
||||
getConnectorService().promptForPassword(shell, forcePrompt); // prompt for userid and password
|
||||
getConnectorService().promptForPassword(forcePrompt); // prompt for userid and password
|
||||
ConnectJob job = new ConnectJob();
|
||||
scheduleJob(job, null, shell != null);
|
||||
IStatus status = job.getResult();
|
||||
|
@ -2555,12 +2538,11 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
|
||||
|
||||
/**
|
||||
* A convenience method, fully equivalent to promptForPassword(shell, false).
|
||||
* @param Shell parent shell used to show any error messages.
|
||||
* A convenience method, fully equivalent to promptForPassword(false).
|
||||
*/
|
||||
public boolean promptForPassword(Shell shell) throws Exception
|
||||
public boolean promptForPassword() throws Exception
|
||||
{
|
||||
return promptForPassword(shell, false);
|
||||
return promptForPassword(false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2568,11 +2550,10 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* but we have detected the user is not connected so we prompt for password outside
|
||||
* of the progress monitor, then set a flag to do the connection within the progress
|
||||
* monitor.
|
||||
* @param Shell parent shell used to show error messages.
|
||||
* @param force true if the prompting should be forced, false if prompting can be skipped if credentials have been stored.
|
||||
* @return true if the credentials are obtained
|
||||
*/
|
||||
public boolean promptForPassword(Shell shell, boolean force) throws Exception
|
||||
public boolean promptForPassword(boolean force) throws Exception
|
||||
{
|
||||
boolean ok = false;
|
||||
if (!supportsConnecting)
|
||||
|
@ -2592,7 +2573,7 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
|
||||
try
|
||||
{
|
||||
getConnectorService().promptForPassword(shell, force); // prompt for password
|
||||
getConnectorService().promptForPassword(force); // prompt for password
|
||||
doConnection = true;
|
||||
ok = true;
|
||||
}
|
||||
|
@ -2614,11 +2595,10 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* <p>
|
||||
* Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
*/
|
||||
public void disconnect(Shell shell) throws Exception
|
||||
public void disconnect() throws Exception
|
||||
{
|
||||
disconnect(shell, true);
|
||||
disconnect(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2628,10 +2608,9 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* <p>
|
||||
* Override internalDisconnect if you want, but by default it calls getSystem().disconnect(IProgressMonitor).
|
||||
*
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @param collapseTree collapse the tree in the system view
|
||||
* @param collapseTree collapse the tree in the system view
|
||||
*/
|
||||
public void disconnect(Shell shell, boolean collapseTree) throws Exception
|
||||
public void disconnect(boolean collapseTree) throws Exception
|
||||
{
|
||||
_disconnecting = true;
|
||||
this.shell = shell; //FIXME remove this
|
||||
|
@ -2673,17 +2652,16 @@ public abstract class SubSystem extends RSEModelObject implements IAdaptable, IS
|
|||
* true for supportsProperties().
|
||||
* @param subject Identifies which object to get the properties of
|
||||
* @param key Identifies property to get value of
|
||||
* @param Shell parent shell used to show error message. Null means you will handle showing the error message.
|
||||
* @return Object The values of the requested keys.
|
||||
*/
|
||||
public String[] getProperties(Object subject, String[] keys, Shell shell)
|
||||
public String[] getProperties(Object subject, String[] keys)
|
||||
throws Exception
|
||||
{
|
||||
this.shell = shell; //FIXME remove this
|
||||
boolean ok = true;
|
||||
|
||||
if (!isConnected())
|
||||
ok = promptForPassword(shell);
|
||||
ok = promptForPassword();
|
||||
if (ok)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -936,7 +936,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
{
|
||||
try
|
||||
{
|
||||
subsystems[idx].disconnect((Shell) null); // be nice if we had a shell to pass!
|
||||
subsystems[idx].disconnect(); // be nice if we had a shell to pass!
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
@ -1453,14 +1453,13 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
* The changes to the subsystem configuration will be saved to disk.
|
||||
* Further, it will be asked to disconnect as this data affects the connection.
|
||||
* <p>
|
||||
* @param shell parent shell needed in case an error message is displayed
|
||||
* @param subsystem target of the update action
|
||||
* @param updateUserId true if we are updating the userId, else false to ignore userId
|
||||
* @param userId new local user Id. Ignored if updateUserId is false
|
||||
* @param updatePort true if we are updating the port, else false to ignore port
|
||||
* @param port new local port value. Ignored if updatePort is false
|
||||
*/
|
||||
public void updateSubSystem(Shell shell, ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port)
|
||||
public void updateSubSystem(ISubSystem subsystem, boolean updateUserId, String userId, boolean updatePort, int port)
|
||||
{
|
||||
// we pushed down the code that checks if this change is real, such that
|
||||
// in a multi-subsystem environment it will not enter an infinite loop
|
||||
|
@ -1510,17 +1509,17 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
* Update the port for the given subsystem instance.
|
||||
* Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)}
|
||||
*/
|
||||
public void setSubSystemPort(Shell shell, ISubSystem subsystem, int port)
|
||||
public void setSubSystemPort(ISubSystem subsystem, int port)
|
||||
{
|
||||
updateSubSystem(shell, subsystem, false, null, true, port);
|
||||
updateSubSystem( subsystem, false, null, true, port);
|
||||
}
|
||||
/**
|
||||
* Update the user ID for the given subsystem instance.
|
||||
* Shortcut to {@link #updateSubSystem(Shell, ISubSystem, boolean, String, boolean, int)}
|
||||
*/
|
||||
public void setSubSystemUserId(Shell shell, ISubSystem subsystem, String userId)
|
||||
public void setSubSystemUserId(ISubSystem subsystem, String userId)
|
||||
{
|
||||
updateSubSystem(shell, subsystem, true, userId, false, 0);
|
||||
updateSubSystem(subsystem, true, userId, false, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1588,7 +1587,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
|
|||
{
|
||||
try
|
||||
{
|
||||
subsystem.disconnect((Shell) null); // just in case.
|
||||
subsystem.disconnect(); // just in case.
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue