1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-25 18:05:33 +02:00

[168977][api][refactor] - stage 2.6

- dropped Shell parameter from ISystemRegistryUI.updateHost. This will allow updateHost to be moved to ISystemRegistry.
This commit is contained in:
David Dykstal 2007-03-27 18:31:10 +00:00
parent 91db5014c0
commit f4e0d37785
6 changed files with 34 additions and 34 deletions

View file

@ -633,13 +633,13 @@ public class SystemViewConnectionAdapter
} }
else if (property.equals(ISystemPropertyConstants.P_HOSTNAME)) else if (property.equals(ISystemPropertyConstants.P_HOSTNAME))
{ {
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), original_hostName,
original_hostName, conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
} }
else if (property.equals(ISystemPropertyConstants.P_DESCRIPTION)) else if (property.equals(ISystemPropertyConstants.P_DESCRIPTION))
{ {
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
conn.getHostName(), original_description, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); original_description, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
} }
} }
/** /**
@ -652,8 +652,8 @@ public class SystemViewConnectionAdapter
//whereToUpdate = USERID_LOCATION_DEFAULT_SYSTEMTYPE; //whereToUpdate = USERID_LOCATION_DEFAULT_SYSTEMTYPE;
String userId = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override String userId = data.getLocalValue(); // will be "" if !data.getIsLocal(), which results in wiping out local override
ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
conn.getHostName(), conn.getDescription(), userId, whereToUpdate); conn.getDescription(), userId, whereToUpdate);
} }
/** /**
@ -679,8 +679,8 @@ public class SystemViewConnectionAdapter
// defect 57739 // defect 57739
if (!((String)value).equalsIgnoreCase(conn.getHostName())) if (!((String)value).equalsIgnoreCase(conn.getHostName()))
{ {
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), (String)value,
(String)value, conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_hostName = true; changed_hostName = true;
} }
} }
@ -690,8 +690,8 @@ public class SystemViewConnectionAdapter
// defect 57739 // defect 57739
if (!((String)value).equalsIgnoreCase(conn.getDescription())) if (!((String)value).equalsIgnoreCase(conn.getDescription()))
{ {
sr.updateHost(null, conn, conn.getSystemType(), conn.getAliasName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
conn.getHostName(), (String)value, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); (String)value, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_description = true; changed_description = true;
} }
} }

View file

@ -121,9 +121,9 @@ public class SystemUpdateConnectionDialog extends SystemPromptDialog implements
{ {
IHost conn = (IHost)getInputObject(); IHost conn = (IHost)getInputObject();
ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
sr.updateHost( getShell(),conn,conn.getSystemType(),form.getConnectionName(), sr.updateHost( conn,conn.getSystemType(),form.getConnectionName(),form.getHostName(),
form.getHostName(), form.getConnectionDescription(), form.getConnectionDescription(), form.getDefaultUserId(),
form.getDefaultUserId(), form.getUserIdLocation() ); form.getUserIdLocation() );
} }
return closeDialog; return closeDialog;
} }

View file

@ -88,9 +88,9 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
{ {
IHost conn = (IHost)getElement(); IHost conn = (IHost)getElement();
ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
sr.updateHost( getShell(),conn,conn.getSystemType(),form.getConnectionName(), sr.updateHost( conn,conn.getSystemType(),form.getConnectionName(),form.getHostName(),
form.getHostName(), form.getConnectionDescription(), form.getConnectionDescription(), form.getDefaultUserId(),
form.getDefaultUserId(), form.getUserIdLocation() ); form.getUserIdLocation() );
boolean offlineSelection = form.isWorkOffline(); boolean offlineSelection = form.isWorkOffline();

View file

@ -18,7 +18,6 @@ package org.eclipse.rse.model;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.swt.dnd.Clipboard; import org.eclipse.swt.dnd.Clipboard;
import org.eclipse.swt.widgets.Shell;
/** /**
* Registry or front door for all remote system connections. * Registry or front door for all remote system connections.
@ -26,31 +25,31 @@ import org.eclipse.swt.widgets.Shell;
public interface ISystemRegistryUI extends ISystemRegistry { public interface ISystemRegistryUI extends ISystemRegistry {
/** /**
* Update an existing connection given the new information. * Update an existing host given the new information.
* This method: * This method:
* <ul> * <ul>
* <li>calls the setXXX methods on the given connection object, updating the information in it. * <li>calls the setXXX methods on the given host object, updating the information in it.
* <li>save the connection's connection pool to disk * <li>save the host's host pool to disk
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners * <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
* <li>if the systemtype or hostname is changed, calls disconnect on each associated subsystem. * <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
* We must do this because a hostname changes fundamentally affects the connection, * We must do this because a host name changes fundamentally affects the connection,
* rendering any information currently displayed under * rendering any information currently displayed under
* that connection obsolete. That is, the user will have to reconnect. * that host obsolete.
* </ul> * </ul>
* <p> * <p>
* @param conn SystemConnection to be updated * @param host the host to be updated
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system type names defined via the
* systemTypes extension point. * systemTypes extension point.
* @param connectionName unique connection name. * @param connectionName unique connection name.
* @param hostName ip name of host. * @param hostName ip name of host.
* @param description optional description of the connection. Can be null. * @param description optional description of the host. Can be null.
* @param defaultUserId userId to use as the default for the subsystems under this host.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id * that tells us where to set the user Id
* @param defaultUserId userId to use as the default for the subsystems.
*/ */
public void updateHost(Shell shell, IHost conn, String systemType, public void updateHost(IHost host, String systemType, String connectionName,
String connectionName, String hostName, String hostName, String description,
String description,String defaultUserId, int defaultUserIdLocation); String defaultUserId, int defaultUserIdLocation);
/** /**
* Returns the clipboard used for copy actions * Returns the clipboard used for copy actions

View file

@ -2495,7 +2495,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants} * @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id * that tells us where to set the user Id
*/ */
public void updateHost(Shell shell, IHost conn, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) public void updateHost(IHost conn, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation)
{ {
lastException = null; lastException = null;
boolean connectionNameChanged = !connectionName.equalsIgnoreCase(conn.getAliasName()); boolean connectionNameChanged = !connectionName.equalsIgnoreCase(conn.getAliasName());

View file

@ -21,6 +21,7 @@ import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.PasswordPersistenceManager; import org.eclipse.rse.core.PasswordPersistenceManager;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.model.SystemSignonInformation;
@ -261,7 +262,7 @@ public abstract class AbstractConnectorService extends SuperAbstractConnectorSer
private void updatePasswordForOtherSystemsInConnection(String uid, String password, boolean persist) { private void updatePasswordForOtherSystemsInConnection(String uid, String password, boolean persist) {
IHost connection = getPrimarySubSystem().getHost(); IHost connection = getPrimarySubSystem().getHost();
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry registry = RSECorePlugin.getDefault().getSystemRegistry();
ISubSystem[] subsystems = registry.getSubSystems(connection); ISubSystem[] subsystems = registry.getSubSystems(connection);
List uniqueSystems = new ArrayList(); List uniqueSystems = new ArrayList();
for (int i = 0; i < subsystems.length; i++) { for (int i = 0; i < subsystems.length; i++) {
@ -287,7 +288,7 @@ public abstract class AbstractConnectorService extends SuperAbstractConnectorSer
private void clearPasswordForOtherSystemsInConnection(String uid, boolean persist) { private void clearPasswordForOtherSystemsInConnection(String uid, boolean persist) {
if (uid != null) { if (uid != null) {
IHost connection = getHost(); IHost connection = getHost();
ISystemRegistry registry = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry registry = RSECorePlugin.getDefault().getSystemRegistry();
ISubSystem[] subsystems = registry.getSubSystems(connection); ISubSystem[] subsystems = registry.getSubSystems(connection);
List uniqueSystems = new ArrayList(); List uniqueSystems = new ArrayList();
for (int i = 0; i < subsystems.length; i++) { for (int i = 0; i < subsystems.length; i++) {
@ -319,8 +320,8 @@ public abstract class AbstractConnectorService extends SuperAbstractConnectorSer
} else { } else {
int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST; int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST;
IHost host = subsystem.getHost(); IHost host = subsystem.getHost();
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getDefault().getSystemRegistry();
sr.updateHost(null, host, host.getSystemType(), host.getAliasName(), host.getHostName(), host.getDescription(), userId, whereToUpdate); sr.updateHost(host, host.getSystemType(), host.getAliasName(), host.getHostName(), host.getDescription(), userId, whereToUpdate);
} }
} }
} }