From b4a63e3cc42ab7e1e8f34bcecdd608af3d9a71c5 Mon Sep 17 00:00:00 2001 From: David McKnight Date: Tue, 5 Sep 2006 16:22:14 +0000 Subject: [PATCH] get rid of subsystem calls with Shell parameters --- .../daytime/subsystems/DaytimeSubSystem.java | 2 +- .../dstore/DStoreConnectorService.java | 6 +- .../org.eclipse.rse.core/META-INF/MANIFEST.MF | 3 +- .../core/subsystems/IConnectorService.java | 3 +- .../rse/core/subsystems/ISubSystem.java | 45 ++++------ .../subsystems/ISubSystemConfiguration.java | 9 +- .../rse/eclipse/filesystem/RSEFileSystem.java | 22 +---- .../ui/resources/SystemTempFileListener.java | 3 +- .../ui/view/SystemViewRemoteFileAdapter.java | 2 +- .../SystemQualifiedRemoteFolderCombo.java | 2 +- .../rse/shells/ui/RemoteCommandHelpers.java | 6 +- .../ui/SystemRemoteCommandEntryForm.java | 2 +- .../ui/actions/SystemCommandAction.java | 16 ++-- .../SystemTerminateRemoveShellAction.java | 2 +- .../actions/SystemTerminateShellAction.java | 2 +- .../rse/shells/ui/view/CommandsViewPage.java | 4 +- .../ui/view/SystemCommandsViewPart.java | 2 +- .../FileServiceSubSystem.java | 2 +- .../files/core/subsystems/RemoteFile.java | 3 +- .../subsystem/impl/RemoteProcessImpl.java | 3 +- .../ProcessServiceSubSystem.java | 2 +- .../shells/subsystems/RemoteCmdSubSystem.java | 30 +++---- .../model/RemoteCommandShellOperation.java | 8 +- .../core/model/SimpleCommandOperation.java | 6 +- .../core/subsystems/IRemoteCmdSubSystem.java | 23 ++--- .../ShellServiceSubSystem.java | 2 +- .../rse/ui/actions/SystemConnectAction.java | 4 +- .../SystemConnectAllSubSystemsAction.java | 2 +- .../ui/actions/SystemDisconnectAction.java | 2 +- .../ui/actions/SystemWorkOfflineAction.java | 2 +- .../ui/operations/SystemFetchOperation.java | 3 +- .../SystemConnectionPropertyPage.java | 2 +- .../SystemSubSystemPropertyPageCoreForm.java | 4 +- .../ui/view/SystemDNDTransferRunnable.java | 2 +- ...stemSelectRemoteObjectAPIProviderImpl.java | 2 +- ...SystemTestFilterStringAPIProviderImpl.java | 2 +- ...SystemViewAPIProviderForFilterStrings.java | 2 +- .../view/SystemViewAPIProviderForFilters.java | 2 +- .../rse/ui/view/SystemViewFilterAdapter.java | 2 +- .../SystemViewFilterReferenceAdapter.java | 2 +- .../ui/view/SystemViewSubSystemAdapter.java | 4 +- .../org/eclipse/rse/model/SystemRegistry.java | 7 +- .../subsystems/AbstractConnectorService.java | 7 +- .../AbstractConnectorServiceManager.java | 2 +- .../rse/core/subsystems/SubSystem.java | 86 +++++++------------ .../subsystems/SubSystemConfiguration.java | 15 ++-- 46 files changed, 142 insertions(+), 222 deletions(-) diff --git a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java index 9b6874021f4..44fa8be4d8c 100644 --- a/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java +++ b/rse/examples/org.eclipse.rse.examples.daytime/src/org/eclipse/rse/examples/daytime/subsystems/DaytimeSubSystem.java @@ -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); diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java index 3cca538a309..009a6907d6f 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java @@ -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; } diff --git a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF index 4a82bd4f703..247ae637aa6 100644 --- a/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF +++ b/rse/plugins/org.eclipse.rse.core/META-INF/MANIFEST.MF @@ -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, diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java index 1380a156617..f38e56fd26c 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/IConnectorService.java @@ -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 diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java index 5d37ad9a027..80cca54a32c 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystem.java @@ -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; /** diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java index 4be2c22494f..dd304ab92f1 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/subsystems/ISubSystemConfiguration.java @@ -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. *

* 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. diff --git a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java index 88ab6ed283d..f6c71a43082 100644 --- a/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java +++ b/rse/plugins/org.eclipse.rse.eclipse.filesystem/src/org/eclipse/rse/eclipse/filesystem/RSEFileSystem.java @@ -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); } diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java index 62aaedefbf6..8e216ef2bd8 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/resources/SystemTempFileListener.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/view/SystemViewRemoteFileAdapter.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/view/SystemViewRemoteFileAdapter.java index 5a9ee5e4f36..39a6723e697 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/view/SystemViewRemoteFileAdapter.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/view/SystemViewRemoteFileAdapter.java @@ -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)) { diff --git a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java index 5ce59c5bc8b..c9f741c10fd 100644 --- a/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java +++ b/rse/plugins/org.eclipse.rse.files.ui/src/org/eclipse/rse/files/ui/widgets/SystemQualifiedRemoteFolderCombo.java @@ -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); diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java index b90c137f4a0..fe6b716c4ab 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/RemoteCommandHelpers.java @@ -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); } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java index aabc608a6dc..5beb9313bbc 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/SystemRemoteCommandEntryForm.java @@ -148,7 +148,7 @@ public class SystemRemoteCommandEntryForm extends Composite { try { - currSubSystem.runCommand(cmd, getShell(), null); + currSubSystem.runCommand(cmd, null); } catch ( Exception e ) { diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java index 5afdec48ad7..bcfb9fc9459 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemCommandAction.java @@ -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); } diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateRemoveShellAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateRemoveShellAction.java index b1c5ff64925..91c7e2f95ad 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateRemoveShellAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateRemoveShellAction.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateShellAction.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateShellAction.java index f879c9887f8..694566e1cc7 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateShellAction.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/actions/SystemTerminateShellAction.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java index 3874d870e12..5ec2ce47f9d 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/CommandsViewPage.java @@ -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) { diff --git a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java index 7b88974e0d5..aed679d4d45 100644 --- a/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java +++ b/rse/plugins/org.eclipse.rse.shells.ui/src/org/eclipse/rse/shells/ui/view/SystemCommandsViewPart.java @@ -147,7 +147,7 @@ public class SystemCommandsViewPart { try { - IRemoteCommandShell cmd = _cmdSubSystem.runShell(getShell(), null); + IRemoteCommandShell cmd = _cmdSubSystem.runShell( null); if (cmd != null) { showInView(cmd); diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java index 3e095769cee..b9f730ade7e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/servicesubsystem/FileServiceSubSystem.java @@ -820,7 +820,7 @@ public final class FileServiceSubSystem extends RemoteFileSubSystem implements I try { _cachedRemoteFiles.clear(); - disconnect(SystemBasePlugin.getActiveWorkbenchShell()); + disconnect(); } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java index f9da1f93776..148e2c63571 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFile.java @@ -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) {} } diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java index 8a9400e455b..e4862374f23 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java @@ -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; diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java index d57f7eed177..84d56f41c28 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java @@ -155,7 +155,7 @@ public class ProcessServiceSubSystem extends RemoteProcessSubSystemImpl implemen IProcessServiceSubSystemConfiguration factory = (IProcessServiceSubSystemConfiguration)fact; try { - disconnect(SystemBasePlugin.getActiveWorkbenchShell()); + disconnect(); } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java index be3d50fafb9..1f1758a8bff 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/internal/subsystems/shells/subsystems/RemoteCmdSubSystem.java @@ -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). null 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 diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/RemoteCommandShellOperation.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/RemoteCommandShellOperation.java index c2976e7575c..d3226dbf291 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/RemoteCommandShellOperation.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/RemoteCommandShellOperation.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/SimpleCommandOperation.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/SimpleCommandOperation.java index c270f179f15..05ae92231f0 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/SimpleCommandOperation.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/model/SimpleCommandOperation.java @@ -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); } } diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java index 7199bce7ec3..47f14327b2c 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/IRemoteCmdSubSystem.java @@ -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. diff --git a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java index 81952430b08..ddef2d0ea25 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.shells.core/src/org/eclipse/rse/subsystems/shells/core/subsystems/servicesubsystem/ShellServiceSubSystem.java @@ -213,7 +213,7 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I IShellServiceSubSystemConfiguration factory = (IShellServiceSubSystemConfiguration)fact; try { - disconnect(SystemBasePlugin.getActiveWorkbenchShell()); + disconnect(); } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java index 97992e9f51a..c4374dce74b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAction.java @@ -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 } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java index d38ce4218e5..9cb29b37ec4 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemConnectAllSubSystemsAction.java @@ -85,7 +85,7 @@ public class SystemConnectAllSubSystemsAction extends SystemBaseAction { try { - subsystem.connect(shell, false); + subsystem.connect(false); } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java index 3a2551e190c..c3c54fadb1c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemDisconnectAction.java @@ -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 } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java index 4b890bb8ab7..801f87cf6a8 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/actions/SystemWorkOfflineAction.java @@ -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; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java index 4378cbb41f5..178781c1514 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/operations/SystemFetchOperation.java @@ -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) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java index 8b945c513d1..adf89aa5583 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemConnectionPropertyPage.java @@ -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; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java index 755b5df0df5..5a52a473335 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/SystemSubSystemPropertyPageCoreForm.java @@ -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); } /** diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java index bc0d9b15da2..51cf3b9e2a7 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemDNDTransferRunnable.java @@ -515,7 +515,7 @@ public class SystemDNDTransferRunnable extends Job { try { - targetSubSystem.connect(SystemBasePlugin.getActiveWorkbenchShell()); + targetSubSystem.connect(); } catch (Exception e) { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java index 54ccbbe0815..ba1c1b8c334 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemSelectRemoteObjectAPIProviderImpl.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java index 9a0a1bca76a..16b9c15ba7a 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemTestFilterStringAPIProviderImpl.java @@ -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) diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java index d0ebc1a06ba..8c4924dbf4c 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilterStrings.java @@ -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]; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java index 601b0e8a588..60148f6d1e2 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewAPIProviderForFilters.java @@ -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; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java index 2e958c2ac89..c87cae99b84 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterAdapter.java @@ -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); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java index e125e9e1ba3..b5edfcd4544 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewFilterReferenceAdapter.java @@ -360,7 +360,7 @@ public class SystemViewFilterReferenceAdapter if (monitor == null) { Shell shell = getShell(); - allChildren = ss.resolveFilterStrings(filterStrings, shell); + allChildren = ss.resolveFilterStrings(filterStrings); } else { diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java index ae35f82cdcd..af4140726c4 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemViewSubSystemAdapter.java @@ -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); } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java index f10926c9479..4c9ce5d2173 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java @@ -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) { diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java index 41fa2d119a0..53dfa218a1c 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorService.java @@ -450,13 +450,12 @@ public abstract class AbstractConnectorService extends RSEModelObject implements *

  • If password not known then look in the password store and verify that it is still valid. *
  • If a valid password is not found then prompt the user. * - * 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(); diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java index 3eb4df8e2c1..cfd5218853b 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/AbstractConnectorServiceManager.java @@ -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); } } } diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java index 8c0827536a1..bd6f77ae208 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystem.java @@ -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 *

    * @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. - *

    - * 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 *

    * 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 *

    * 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 *

    * 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 diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index 1a1dca020d3..2aa565ed2b0 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -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. *

    - * @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) {