1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-21 07:05:58 +02:00

[184095][api] Replace String systemTypeName by IRSESystemType everywhere.

Migrate to using system type labels in all UI, and system type IDs when storing Preferences.
Combine NLS messages in rse.core. Add some API to SystemWidgetHelpers for dealing with system types.
Update and beautify Javadoc.
This commit is contained in:
Martin Oberhuber 2007-04-25 20:24:16 +00:00
parent 216e97eaf8
commit 1646646eaf
102 changed files with 1329 additions and 1254 deletions

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 Symbian Software Ltd. All rights reserved. * Copyright (c) 2006, 2007 Symbian Software Ltd. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -7,6 +7,7 @@
* Contributors: * Contributors:
* Javier Montalvo Orus (Symbian) - initial API and implementation * Javier Montalvo Orus (Symbian) - initial API and implementation
* Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE * Javier Montalvo Orus (Symbian) - [plan] Improve Discovery and Autodetect in RSE
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.discovery; package org.eclipse.rse.internal.discovery;
@ -21,6 +22,8 @@ import org.eclipse.core.runtime.IExtensionPoint;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.core.IRSESystemType;
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.IPropertySet; import org.eclipse.rse.core.model.IPropertySet;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
@ -101,7 +104,8 @@ public class ServiceDiscoveryWizard extends Wizard {
IHost conn = null; IHost conn = null;
try { try {
conn = registry.createHost("Discovery", "Discovery@" + hostName, hostName, "Discovered services in "+hostName);//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$; IRSESystemType discoveryType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById("org.eclipse.rse.systemtype.discovery"); //$NON-NLS-1$
conn = registry.createHost(discoveryType, "Discovery@" + hostName, hostName, "Discovered services in "+hostName);//$NON-NLS-1$ //$NON-NLS-2$
} catch (Exception e) { } catch (Exception e) {
RSEUIPlugin.getTheSystemRegistry().deleteHost(conn); RSEUIPlugin.getTheSystemRegistry().deleteHost(conn);
return false; return false;

View file

@ -1,3 +1,3 @@
#Fri Mar 30 16:58:07 EST 2007 #Wed Apr 25 15:35:14 CEST 2007
eclipse.preferences.version=1 eclipse.preferences.version=1
encoding//src/org/eclipse/rse/internal/persistence/messages.properties=8859_1 encoding//src/org/eclipse/rse/internal/core/messages.properties=8859_1

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - moved from core package in the UI plugin * David Dykstal (IBM) - moved from core package in the UI plugin
* - updated to use new RSEPreferencesManager * - updated to use new RSEPreferencesManager
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -29,6 +30,8 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.model.SystemSignonInformation;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.osgi.framework.Bundle;
/** /**
@ -39,7 +42,6 @@ import org.eclipse.rse.core.model.SystemSignonInformation;
*/ */
public class PasswordPersistenceManager { public class PasswordPersistenceManager {
// Keys used for using the Platform authorization methods // Keys used for using the Platform authorization methods
// The server url is generic so we can lookup all registered user IDs / passwords // The server url is generic so we can lookup all registered user IDs / passwords
// to display to the user in the password information preference page // to display to the user in the password information preference page
@ -54,7 +56,7 @@ public class PasswordPersistenceManager {
// Default System Type, on a lookup if the specified system type and hostname is not found // Default System Type, on a lookup if the specified system type and hostname is not found
// then the call will automatically lookup the default system type and hostname // then the call will automatically lookup the default system type and hostname
public static final String DEFAULT_SYSTEM_TYPE = "DEFAULT"; //$NON-NLS-1$ public static final IRSESystemType DEFAULT_SYSTEM_TYPE = new DefaultSystemType();
// Default user name // Default user name
public static final String DEFAULT_USER_NAME = "DEFAULT_USER"; //$NON-NLS-1$ public static final String DEFAULT_USER_NAME = "DEFAULT_USER"; //$NON-NLS-1$
@ -72,15 +74,49 @@ public class PasswordPersistenceManager {
*/ */
private RegisteredSystemType[] systemTypes; private RegisteredSystemType[] systemTypes;
/**
* Default System Type
*/
private static class DefaultSystemType implements IRSESystemType
{
private DefaultSystemType() {
}
public Bundle getDefiningBundle() {
return null;
}
public String getDescription() {
return getLabel();
}
public String getId() {
//TODO consider a space character at the beginning to ensure uniqueness
return "DEFAULT"; //$NON-NLS-1$
}
public String getLabel() {
return RSECoreMessages.DefaultSystemType_Label;
}
public String getName() {
return getId();
}
public String getProperty(String key) {
return null;
}
public String[] getSubsystemConfigurationIds() {
return null;
}
public Object getAdapter(Class adapter) {
return null;
}
}
/** /**
* Inner class used for storing registered system types * Inner class used for storing registered system types
*/ */
private class RegisteredSystemType private class RegisteredSystemType
{ {
private String _systemType; private IRSESystemType _systemType;
private boolean _userIDCaseSensitive; private boolean _userIDCaseSensitive;
protected RegisteredSystemType(String systemType, boolean caseSensitive) protected RegisteredSystemType(IRSESystemType systemType, boolean caseSensitive)
{ {
_systemType = systemType; _systemType = systemType;
_userIDCaseSensitive = caseSensitive; _userIDCaseSensitive = caseSensitive;
@ -90,7 +126,7 @@ public class PasswordPersistenceManager {
* Returns the system type. * Returns the system type.
* @return the system type. * @return the system type.
*/ */
public String getSystemType() { public IRSESystemType getSystemType() {
return _systemType; return _systemType;
} }
@ -140,7 +176,7 @@ public class PasswordPersistenceManager {
systemTypes = new RegisteredSystemType[sysTypes.length]; systemTypes = new RegisteredSystemType[sysTypes.length];
for (int i = 0; i < sysTypes.length; i++) { for (int i = 0; i < sysTypes.length; i++) {
systemTypes[i] = new RegisteredSystemType(sysTypes[i].getName(), true); systemTypes[i] = new RegisteredSystemType(sysTypes[i], true);
} }
} }
@ -156,8 +192,11 @@ public class PasswordPersistenceManager {
/** /**
* Remove the entry from the keyring that matches the hostname, userid and * Remove the entry from the keyring that matches the hostname, userid and
* system type parameters. * system type parameters.
* @param systemtype the systemType
* @param hname the connection name
* @param userid the user id
*/ */
public void remove(String systemtype, String hname, String userid) public void remove(IRSESystemType systemtype, String hname, String userid)
{ {
String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname); String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname);
// Convert userid to upper case if required // Convert userid to upper case if required
@ -172,7 +211,7 @@ public class PasswordPersistenceManager {
{ {
if (removePassword(passwords, hostname, userid)) if (removePassword(passwords, hostname, userid))
{ {
savePasswordMap(systemtype, passwords); savePasswordMap(systemtype.getId(), passwords);
} }
} }
else else
@ -189,7 +228,7 @@ public class PasswordPersistenceManager {
* Check if a password entry exists for the specified system type, hostname * Check if a password entry exists for the specified system type, hostname
* and userid. * and userid.
*/ */
public boolean passwordExists(String systemtype, String hostname, String userid) public boolean passwordExists(IRSESystemType systemtype, String hostname, String userid)
{ {
return passwordExists(systemtype, hostname, userid, true); return passwordExists(systemtype, hostname, userid, true);
@ -204,7 +243,7 @@ public class PasswordPersistenceManager {
* @param userid The user ID to check for. * @param userid The user ID to check for.
* @param checkDefault Whether or not to check for a default system type if the specified system type is not found. * @param checkDefault Whether or not to check for a default system type if the specified system type is not found.
*/ */
public boolean passwordExists(String systemtype, String hname, String userid, boolean checkDefault) public boolean passwordExists(IRSESystemType systemtype, String hname, String userid, boolean checkDefault)
{ {
String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname); String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname);
return (find(systemtype, hostname, userid) != null); return (find(systemtype, hostname, userid) != null);
@ -242,7 +281,7 @@ public class PasswordPersistenceManager {
*/ */
public int add(SystemSignonInformation info, boolean overwrite, boolean updateDefault) public int add(SystemSignonInformation info, boolean overwrite, boolean updateDefault)
{ {
String systemtype = info.getSystemType(); IRSESystemType systemtype = info.getSystemType();
// Convert userid to upper case if required // Convert userid to upper case if required
if (!isUserIDCaseSensitive(systemtype)) if (!isUserIDCaseSensitive(systemtype))
@ -301,7 +340,7 @@ public class PasswordPersistenceManager {
passwords.put(passwordKey, info.getPassword()); passwords.put(passwordKey, info.getPassword());
savePasswordMap(systemtype, passwords); savePasswordMap(systemtype.getId(), passwords);
return RC_OK; return RC_OK;
} }
@ -310,33 +349,34 @@ public class PasswordPersistenceManager {
/* /*
* Retrieve the password map from the keyring for the specified system type * Retrieve the password map from the keyring for the specified system type
*/ */
private Map getPasswordMap(String systemType) private Map getPasswordMap(IRSESystemType systemType)
{ {
Map passwords = null; Map passwords = null;
String systemTypeId = systemType.getId();
try try
{ {
URL serverURL = new URL(newURL); URL serverURL = new URL(newURL);
passwords = Platform.getAuthorizationInfo(serverURL, systemType, AUTH_SCHEME); passwords = Platform.getAuthorizationInfo(serverURL, systemTypeId, AUTH_SCHEME);
// if no passwords found with new URL, check old URL // if no passwords found with new URL, check old URL
if (passwords == null) { if (passwords == null) {
URL oldServerURL1 = new URL(SERVER_URL + ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString()); URL oldServerURL1 = new URL(SERVER_URL + ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
passwords = Platform.getAuthorizationInfo(oldServerURL1, systemType, AUTH_SCHEME); passwords = Platform.getAuthorizationInfo(oldServerURL1, systemTypeId, AUTH_SCHEME);
// passwords found, so migrate to using new URL // passwords found, so migrate to using new URL
if (passwords != null) { if (passwords != null) {
savePasswordMap(systemType, passwords); savePasswordMap(systemTypeId, passwords);
} }
// if still no passwords found, check with even older URL // if still no passwords found, check with even older URL
else { else {
URL oldServerURL2 = new URL(SERVER_URL); URL oldServerURL2 = new URL(SERVER_URL);
passwords = Platform.getAuthorizationInfo(oldServerURL2, systemType, AUTH_SCHEME); passwords = Platform.getAuthorizationInfo(oldServerURL2, systemTypeId, AUTH_SCHEME);
// passwords found, so migrate to using new URL // passwords found, so migrate to using new URL
if (passwords != null) { if (passwords != null) {
savePasswordMap(systemType, passwords); savePasswordMap(systemTypeId, passwords);
} }
} }
} }
@ -351,13 +391,13 @@ public class PasswordPersistenceManager {
/* /*
* Retrieve the password map from the keyring for the specified system type * Retrieve the password map from the keyring for the specified system type
*/ */
private void savePasswordMap(String systemType, Map passwords) private void savePasswordMap(String systemTypeId, Map passwords)
{ {
try try
{ {
URL serverURL = new URL(newURL); URL serverURL = new URL(newURL);
Platform.flushAuthorizationInfo(serverURL, systemType, AUTH_SCHEME); Platform.flushAuthorizationInfo(serverURL, systemTypeId, AUTH_SCHEME);
Platform.addAuthorizationInfo(serverURL, systemType, AUTH_SCHEME, passwords); Platform.addAuthorizationInfo(serverURL, systemTypeId, AUTH_SCHEME, passwords);
} }
catch (MalformedURLException e) { catch (MalformedURLException e) {
RSECorePlugin.getDefault().getLogger().logError("PasswordPersistenceManager.savePasswordMap", e); //$NON-NLS-1$ RSECorePlugin.getDefault().getLogger().logError("PasswordPersistenceManager.savePasswordMap", e); //$NON-NLS-1$
@ -370,7 +410,7 @@ public class PasswordPersistenceManager {
/** /**
* Find the persisted password for the specified systemtype, hostname and userid. * Find the persisted password for the specified systemtype, hostname and userid.
*/ */
public SystemSignonInformation find(String systemtype, String hostname, String userid) public SystemSignonInformation find(IRSESystemType systemtype, String hostname, String userid)
{ {
return find(systemtype, hostname, userid, true); return find(systemtype, hostname, userid, true);
} }
@ -483,7 +523,7 @@ public class PasswordPersistenceManager {
* @param userid The user ID to check for. * @param userid The user ID to check for.
* @param checkDefault Whether or not to check for a default system type if the specified system type is not found. * @param checkDefault Whether or not to check for a default system type if the specified system type is not found.
*/ */
public SystemSignonInformation find(String systemtype, String hname, String userid, boolean checkDefault) public SystemSignonInformation find(IRSESystemType systemtype, String hname, String userid, boolean checkDefault)
{ {
String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname); String hostname = hname;//RSEUIPlugin.getQualifiedHostName(hname);
// Convert userid to upper case if required // Convert userid to upper case if required
@ -541,7 +581,7 @@ public class PasswordPersistenceManager {
/** /**
* Helper method for determining if system type uses case sensitive user IDs * Helper method for determining if system type uses case sensitive user IDs
*/ */
public boolean isUserIDCaseSensitive(String systemType) public boolean isUserIDCaseSensitive(IRSESystemType systemType)
{ {
// First find the correct provider // First find the correct provider
for (int i = 0; i < systemTypes.length; i++) for (int i = 0; i < systemTypes.length; i++)
@ -553,16 +593,17 @@ public class PasswordPersistenceManager {
} }
} }
//Not found: Default system type is case sensitive
return true; return true;
} }
/** /**
* Retrieve the list of registered system types * Retrieve the list of registered system types
*/ */
public String[] getRegisteredSystemTypes() public IRSESystemType[] getRegisteredSystemTypes()
{ {
// yantzi: artemis 6.2, added default system type to list // yantzi: artemis 6.2, added default system type to list
String[] types = new String[systemTypes.length + 1]; IRSESystemType[] types = new IRSESystemType[systemTypes.length + 1];
types[0] = DEFAULT_SYSTEM_TYPE; types[0] = DEFAULT_SYSTEM_TYPE;

View file

@ -1,11 +1,12 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2007 IBM Corporation. All rights reserved. * Copyright (c) 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - initial API and implementation * David Dykstal (IBM) - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -133,19 +134,6 @@ public class RSEPreferencesManager {
return result; return result;
} }
/**
* Sets the default userId for the given system type.
* @param systemTypeName the name of the system type
* @param userId the default user id for this system type.
* This may be null to "unset" the default.
*/
public static void setDefaultUserId(String systemTypeName, String userId) {
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeName);
if (systemType != null) {
setDefaultUserId(systemType, userId);
}
}
/** /**
* Sets the default userId for the given system type. * Sets the default userId for the given system type.
* @param systemType the system type for which to set the default * @param systemType the system type for which to set the default
@ -162,7 +150,7 @@ public class RSEPreferencesManager {
/** /**
* Gets the system type values table for editing. This is a synthesized preference * Gets the system type values table for editing. This is a synthesized preference
* that is handled as a single value. Rows are separated by semi-colons. * that is handled as a single value. Rows are separated by semi-colons.
* Each row is of the format <systemTypeName>=<enabled>+<defaultUserId>; * Each row is of the format <systemTypeId>=<enabled>+<defaultUserId>;
* @return the table of system types formatted as a single string * @return the table of system types formatted as a single string
*/ */
public static String getSystemTypeValues() { public static String getSystemTypeValues() {
@ -170,7 +158,7 @@ public class RSEPreferencesManager {
StringBuffer buffer = new StringBuffer(100); StringBuffer buffer = new StringBuffer(100);
for (int i = 0; i < systemTypes.length; i++) { for (int i = 0; i < systemTypes.length; i++) {
IRSESystemType systemType = systemTypes[i]; IRSESystemType systemType = systemTypes[i];
buffer.append(systemType.getName()); buffer.append(systemType.getId());
buffer.append('='); buffer.append('=');
buffer.append(getIsSystemTypeEnabled(systemType)); buffer.append(getIsSystemTypeEnabled(systemType));
buffer.append('+'); buffer.append('+');
@ -197,7 +185,7 @@ public class RSEPreferencesManager {
String[] values = compoundValue.split("\\+"); //$NON-NLS-1$ String[] values = compoundValue.split("\\+"); //$NON-NLS-1$
String isEnabled = values[0]; String isEnabled = values[0];
String defaultUserId = values[1]; String defaultUserId = values[1];
IRSESystemType systemType = registry.getSystemType(key); IRSESystemType systemType = registry.getSystemTypeById(key);
setIsSystemTypeEnabled(systemType, isEnabled.equals("true")); //$NON-NLS-1$ setIsSystemTypeEnabled(systemType, isEnabled.equals("true")); //$NON-NLS-1$
setDefaultUserId(systemType, defaultUserId); setDefaultUserId(systemType, defaultUserId);
} }
@ -234,7 +222,7 @@ public class RSEPreferencesManager {
} }
private static String getSystemTypePreferencesKey(IRSESystemType systemType, String preference) { private static String getSystemTypePreferencesKey(IRSESystemType systemType, String preference) {
String key = systemType.getName() + "." + preference; //$NON-NLS-1$ String key = systemType.getId() + "." + preference; //$NON-NLS-1$
return key; return key;
} }

View file

@ -17,6 +17,7 @@
* - Moved to package org.eclipse.rse.model for being extendable. * - Moved to package org.eclipse.rse.model for being extendable.
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -210,10 +211,10 @@ public class Host extends RSEModelObject implements IHost {
// defect 43219 // defect 43219
if (systemType != null) { if (systemType != null) {
//FIXME MOB this should be in IRSESystemType.isForceUC() / IRSESystemType.isUIDCaseSensitive() //FIXME MOB this should be in IRSESystemType.isForceUC() / IRSESystemType.isUIDCaseSensitive()
String systemTypeName = systemType.getName(); String systemTypeId = systemType.getId();
boolean forceUC = systemTypeName.equals(IRSESystemType.SYSTEMTYPE_ISERIES); boolean forceUC = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID);
boolean caseSensitiveUID = systemTypeName.equals(IRSESystemType.SYSTEMTYPE_UNIX) || systemTypeName.equals(IRSESystemType.SYSTEMTYPE_LINUX) boolean caseSensitiveUID = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_UNIX_ID) || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LINUX_ID)
|| (systemTypeName.equals(IRSESystemType.SYSTEMTYPE_LOCAL) && !System.getProperty("os.name").toLowerCase().startsWith("windows")); //$NON-NLS-1$ //$NON-NLS-2$ || (systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && !System.getProperty("os.name").toLowerCase().startsWith("windows")); //$NON-NLS-1$ //$NON-NLS-2$
setForceUserIdToUpperCase(forceUC); setForceUserIdToUpperCase(forceUC);
setUserIdCaseSensitive(caseSensitiveUID); setUserIdCaseSensitive(caseSensitiveUID);
} }
@ -264,7 +265,7 @@ public class Host extends RSEModelObject implements IHost {
public String getDefaultUserId() { public String getDefaultUserId() {
String uid = getLocalDefaultUserId(); String uid = getLocalDefaultUserId();
if ((uid == null) || (uid.length() == 0)) { if ((uid == null) || (uid.length() == 0)) {
uid = RSEPreferencesManager.getUserId(getSystemType().getName()); // resolve from preferences uid = RSEPreferencesManager.getUserId(getSystemType().getId()); // resolve from preferences
if ((uid != null) && ucId) uid = uid.toUpperCase(); if ((uid != null) && ucId) uid = uid.toUpperCase();
} }
return uid; return uid;
@ -491,15 +492,6 @@ public class Host extends RSEModelObject implements IHost {
hostName = newHostName; hostName = newHostName;
} }
private String getDefaultUserIdGen() {
return defaultUserId;
}
private void setDefaultUserIdGen(String newDefaultUserId) {
setDirty(!compareStrings(defaultUserId, newDefaultUserId));
defaultUserId = newDefaultUserId;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.model.IRSEPersistableContainer#commit() * @see org.eclipse.rse.core.model.IRSEPersistableContainer#commit()
*/ */

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,13 +11,14 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
@ -47,19 +48,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
public IHost[] getHosts(); public IHost[] getHosts();
/** /**
* Create a connection. * Create a connection object, given only the minimal information.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/ */
public IHost createHost(String systemType, String aliasName, String hostName) throws Exception; public IHost createHost(IRSESystemType systemType, String aliasName, String hostName) throws Exception;
/** /**
* Create a connection. * Create a connection object, given all the possible attributes except default userId.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/ */
public IHost createHost(String systemType, String aliasName, String hostName, String description) throws Exception; public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description) throws Exception;
/** /**
* Create a connection. * Create a connection object, given all the possible attributes.
* <p>
* The new connection is added to the list and saved to disk.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
* @see IRSEUserIdConstants
*/ */
public IHost createHost(String systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) throws Exception; public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) throws Exception;
/** /**
* Update an existing connection given the new information. * Update an existing connection given the new information.
@ -70,8 +100,8 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
* </ul> * </ul>
* <p> * <p>
* @param conn SystemConnection to be updated * @param conn SystemConnection 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 types
* systemType extension point. * defined via the systemType extension point.
* @param aliasName unique connection name. * @param aliasName 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 connection. Can be null.
@ -79,7 +109,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants. * @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
* @see IRSEUserIdConstants * @see IRSEUserIdConstants
*/ */
public void updateHost(IHost conn, String systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) throws Exception; public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) throws Exception;
/** /**
* Return a connection given its name. * Return a connection given its name.

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,10 +12,12 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.persistence.IRSEPersistenceProvider; import org.eclipse.rse.persistence.IRSEPersistenceProvider;
@ -51,9 +53,9 @@ public interface ISystemProfile extends IRSEModelObject {
/** /**
* Convenience method for create a new connection within this profile. * Convenience method for create a new connection within this profile.
* Shortcut for {@link ISystemRegistry#createHost(String,String,String,String)} * Shortcut for {@link ISystemRegistry#createHost(IRSESystemType,String,String,String)}
*/ */
public IHost createHost(String systemType, String connectionName, String hostName, String description) throws Exception; public IHost createHost(IRSESystemType systemType, String connectionName, String hostName, String description) throws Exception;
/** /**
* @return The value of the Name attribute * @return The value of the Name attribute

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -35,6 +36,7 @@ import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.core.RSECoreRegistry;
/** /**
* Registry or front door for all remote system connections. * Registry or front door for all remote system connections.
@ -118,24 +120,13 @@ public interface ISystemRegistry extends ISchedulingRule {
public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory); public ISubSystemConfiguration[] getSubSystemConfigurationsByCategory(String factoryCategory);
/** /**
* Return all subsystem factories which support the given system type. If the type is null, * Return all subsystem factories which support the given system type.
* returns all. * If the type is null, returns all.
* @param systemType system type to filter
* @param filterDuplicateServiceSubSystemFactories set false by default
*/ */
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicateServiceSubSystemFactories); public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicateServiceSubSystemFactories);
/**
* Return all subsystem factories which support the given system type. If the type is null,
* returns all.
*
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType);
/**
* Return all subsystem factories which support the given system type. If the type is null,
* returns all.
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType, boolean filterDuplicateServiceSubSystemFactories);
// ---------------------------------- // ----------------------------------
// SYSTEMVIEWINPUTPROVIDER METHODS... // SYSTEMVIEWINPUTPROVIDER METHODS...
// ---------------------------------- // ----------------------------------
@ -368,35 +359,38 @@ public interface ISystemRegistry extends ISchedulingRule {
public IHost[] getHosts(); public IHost[] getHosts();
/** /**
* Return all connections in a given profile name. * Return all connections in a given profile.
*/ */
public IHost[] getHostsByProfile(ISystemProfile profile); public IHost[] getHostsByProfile(ISystemProfile profile);
/** /**
* Return all connections in a given profile. * Return all connections in a given profile name.
*/ */
public IHost[] getHostsByProfile(String profileName); public IHost[] getHostsByProfile(String profileName);
/** /**
* Return all connections for which there exists one or more subsystems owned * Return all connections for which there exists one or more
* by a given subsystem factory. * subsystems owned by a given subsystem configuration.
* @see #getSubSystemConfiguration(String) * @see #getSubSystemConfiguration(String)
*/ */
public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory); public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory);
/** /**
* Return all connections for which there exists one or more subsystems owned * Return all connections for which there exists one or more
* by a given subsystem factory, identified by factory Id * subsystems owned by a given subsystem configuration,
* identified by configuration Id.
*/ */
public IHost[] getHostsBySubSystemConfigurationId(String factoryId); public IHost[] getHostsBySubSystemConfigurationId(String factoryId);
/** /**
* Return all connections for which there exists one or more subsystems owned * Return all connections for which there exists one or more
* by any a given subsystem factory that is of the given category. * subsystems owned by any a given subsystem configuration
* that is of the given category.
* <p> * <p>
* This looks for a match on the "category" of the subsystem factory's xml declaration * This looks for a match on the "category" of the subsystem
* in its plugin.xml file. Thus, it is effecient as it need not bring to life a * configuration's xml declaration in its plugin.xml file.
* subsystem factory just to test its parent class type. * Thus, it is effecient as it need not bring to life a
* subsystem configuration just to test its parent class type.
* *
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories * @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
*/ */
@ -405,21 +399,21 @@ public interface ISystemRegistry extends ISchedulingRule {
/** /**
* Returns all connections for all active profiles, for the given system type. * Returns all connections for all active profiles, for the given system type.
* If the specified system type is null, an empty array is returned. * If the specified system type is null, an empty array is returned.
* In order to get an IRSESystemType, use
* <code>RSECorePlugin.getDefault().getRegistry().{@link RSECoreRegistry#getSystemTypeById(String) getSystemTypeById(String)}</code>
* *
* @param systemType The system type instance. * @param systemType The system type instance.
* @return The list of connections or an empty array. * @return The list of connections or an empty array.
*/ */
public IHost[] getHostsBySystemType(IRSESystemType systemType); public IHost[] getHostsBySystemType(IRSESystemType systemType);
/**
* Return all connections for all active profiles, for the given system type.
*/
public IHost[] getHostsBySystemType(String systemType);
/** /**
* Return all connections for all active profiles, for the given system types. * Return all connections for all active profiles, for the given system types.
*
* In order to get an IRSESystemType, use
* <code>RSECorePlugin.getDefault().getRegistry().{@link RSECoreRegistry#getSystemTypeById(String) getSystemTypeById(String)}</code>
*/ */
public IHost[] getHostsBySystemTypes(String[] systemTypes); public IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes);
/** /**
* Return a SystemConnection object given a system profile containing it, * Return a SystemConnection object given a system profile containing it,
@ -428,22 +422,25 @@ public interface ISystemRegistry extends ISchedulingRule {
public IHost getHost(ISystemProfile profile, String connectionName); public IHost getHost(ISystemProfile profile, String connectionName);
/** /**
* Return the zero-based position of a SystemConnection object within its profile. * Return the zero-based position of a SystemConnection object within
* its profile.
*/ */
public int getHostPosition(IHost conn); public int getHostPosition(IHost conn);
/** /**
* Return the number of SystemConnection objects within the given profile * Return the number of SystemConnection objects within the given profile.
*/ */
public int getHostCount(String profileName); public int getHostCount(String profileName);
/** /**
* Return the number of SystemConnection objects within the given connection's owning profile * Return the number of SystemConnection objects within the given
* connection's owning profile.
*/ */
public int getHostCountWithinProfile(IHost conn); public int getHostCountWithinProfile(IHost conn);
/** /**
* Return the number of SystemConnection objects within all active profiles * Return the number of SystemConnection objects within all active
* profiles.
*/ */
public int getHostCount(); public int getHostCount();
@ -464,15 +461,12 @@ public interface ISystemRegistry extends ISchedulingRule {
*/ */
public Vector getHostAliasNamesForAllActiveProfiles(); public Vector getHostAliasNamesForAllActiveProfiles();
/**
* Return array of all previously specified hostnames.
*/
public String[] getHostNames();
/** /**
* Return array of previously specified hostnames for a given system type. * Return array of previously specified hostnames for a given system type.
* After careful consideration, it is decided that if the system type is null,
* then no hostnames should be returned. Previously all for all types were returned.
*/ */
public String[] getHostNames(String systemType); public String[] getHostNames(IRSESystemType systemType);
/** /**
* Returns the list of objects on the system clipboard * Returns the list of objects on the system clipboard
@ -504,8 +498,8 @@ public interface ISystemRegistry extends ISchedulingRule {
* </ul> * </ul>
* <p> * <p>
* @param profileName Name of the system profile the connection is to be added to. * @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system types
* systemTypes extension point. * defined via the 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 connection. Can be null.
@ -517,7 +511,7 @@ public interface ISystemRegistry extends ISchedulingRule {
* @return SystemConnection object, or null if it failed to create. This is typically * @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary. * because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost(String profileName, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation, public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation,
ISystemNewConnectionWizardPage[] newConnectionWizardPages) throws Exception; ISystemNewConnectionWizardPage[] newConnectionWizardPages) throws Exception;
/** /**
@ -534,15 +528,15 @@ public interface ISystemRegistry extends ISchedulingRule {
* </ul> * </ul>
* <p> * <p>
* @param profileName Name of the system profile the connection is to be added to. * @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system types
* systemTypes extension point. * defined via the 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 connection. Can be null.
* @return SystemConnection object, or null if it failed to create. This is typically * @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary. * because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost(String profileName, String systemType, String connectionName, String hostName, String description) throws Exception; public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description) throws Exception;
/** /**
* Create a connection object. This is a very simplified version that defaults to the user's * Create a connection object. This is a very simplified version that defaults to the user's
@ -558,15 +552,15 @@ public interface ISystemRegistry extends ISchedulingRule {
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners * <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* </ul> * </ul>
* <p> * <p>
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system types
* systemTypes extension point. * defined via the systemTypes extension point.
* @param connectionName unique connection name. * @param connectionName unique connection name.
* @param hostAddress ip name of host. * @param hostAddress ip name of host.
* @param description optional description of the connection. Can be null. * @param description optional description of the connection. Can be null.
* @return SystemConnection object, or null if it failed to create. This is typically * @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary. * because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost(String systemType, String connectionName, String hostAddress, String description) throws Exception; public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
/** /**
* Update an existing host given the new information. * Update an existing host given the new information.
@ -582,8 +576,8 @@ public interface ISystemRegistry extends ISchedulingRule {
* </ul> * </ul>
* <p> * <p>
* @param host the host 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 types
* systemTypes extension point. * defined via the 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 host. Can be null. * @param description optional description of the host. Can be null.
@ -591,7 +585,7 @@ public interface ISystemRegistry extends ISchedulingRule {
* @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(IHost host, String systemType, String connectionName, public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
String hostName, String description, String hostName, String description,
String defaultUserId, int defaultUserIdLocation); String defaultUserId, int defaultUserIdLocation);
@ -663,11 +657,15 @@ public interface ISystemRegistry extends ISchedulingRule {
public IHost copyHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception; public IHost copyHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception;
/** /**
* Move a SystemConnection to another profile. All subsystems are copied, and all connection data is copied. * Move a SystemConnection to another profile.
* All subsystems are moved, and all connection data is moved.
* This is actually accomplished by doing a copy operation first,
* and if successful deleting the original.
* @param monitor Progress monitor to reflect each step of the operation * @param monitor Progress monitor to reflect each step of the operation
* @param conn The connection to move * @param conn The connection to move
* @param targetProfile What profile to move to * @param targetProfile What profile to move into
* @param newName Unique name to give moved profile * @param newName Unique name to give copied profile. Typically this is the same as the original name, but
* will be different on name collisions
* @return new SystemConnection object * @return new SystemConnection object
*/ */
public IHost moveHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception; public IHost moveHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception;
@ -680,27 +678,34 @@ public interface ISystemRegistry extends ISchedulingRule {
public boolean isAnySubSystemSupportsConnect(IHost conn); public boolean isAnySubSystemSupportsConnect(IHost conn);
/** /**
* Return true if any of the subsystems for the given connection are currently connected * Return true if any of the subsystems for the given connection are
* currently connected.
*/ */
public boolean isAnySubSystemConnected(IHost conn); public boolean isAnySubSystemConnected(IHost conn);
/** /**
* Return true if all of the subsystems for the given connection are currently connected * Return true if all of the subsystems for the given connection are
* currently connected.
*/ */
public boolean areAllSubSystemsConnected(IHost conn); public boolean areAllSubSystemsConnected(IHost conn);
/** /**
* Disconnect all subsystems for the given connection, if they are currently connected. * Disconnect all subsystems for the given connection, if they are
* currently connected.
*/ */
public void disconnectAllSubSystems(IHost conn); public void disconnectAllSubSystems(IHost conn);
/** /**
* Inform the world when the connection status changes for a subsystem within a connection * Inform the world when the connection status changes for a subsystem
* within a connection.
* Update properties for the subsystem and its connection.
*/ */
public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected); public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected);
/** /**
* Inform the world when the connection status changes for a subsystem within a connection * Inform the world when the connection status changes for a subsystem
* within a connection.
* Update properties for the subsystem and its connection.
*/ */
public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree); public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree);

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,11 +12,12 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
/** /**
* Provides common support for local RSE model objects * Provides common support for local RSE model objects
@ -27,7 +28,7 @@ import org.eclipse.rse.internal.core.model.RSEModelResources;
public abstract class RSEModelObject extends PropertySetContainer implements IRSEModelObject { public abstract class RSEModelObject extends PropertySetContainer implements IRSEModelObject {
public String getDescription() { public String getDescription() {
return RSEModelResources.RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION;
} }
} }

View file

@ -13,10 +13,12 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.subsystems.ICredentials; import org.eclipse.rse.core.subsystems.ICredentials;
/** /**
@ -24,14 +26,12 @@ import org.eclipse.rse.core.subsystems.ICredentials;
* must be secure and never disclose the password for the remote system in its unencrypted form. * must be secure and never disclose the password for the remote system in its unencrypted form.
* However the encrypted form of the password is not considered secret information and can be * However the encrypted form of the password is not considered secret information and can be
* accessed by anyone. * accessed by anyone.
*
* @author yantzi
*/ */
public final class SystemSignonInformation implements ICredentials { public final class SystemSignonInformation implements ICredentials {
private IRSESystemType _systemType;
private String _hostname; private String _hostname;
private String _userId; private String _userId;
private String _systemType;
private String _password; private String _password;
/** /**
@ -43,7 +43,7 @@ public final class SystemSignonInformation implements ICredentials {
/** /**
* Constructor for SystemSignonInformation. * Constructor for SystemSignonInformation.
*/ */
public SystemSignonInformation(String hostname, String userid, String systemType) { public SystemSignonInformation(String hostname, String userid, IRSESystemType systemType) {
_hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase(); _hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase();
_userId = userid; _userId = userid;
_systemType = systemType; _systemType = systemType;
@ -52,7 +52,7 @@ public final class SystemSignonInformation implements ICredentials {
/** /**
* Constructor for SystemSignonInformation. * Constructor for SystemSignonInformation.
*/ */
public SystemSignonInformation(String hostname, String userid, String password, String systemType) { public SystemSignonInformation(String hostname, String userid, String password, IRSESystemType systemType) {
_hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase(); _hostname = hostname;//RSEUIPlugin.getQualifiedHostName(hostname).toUpperCase();
_userId = userid; _userId = userid;
_password = password; _password = password;
@ -68,18 +68,16 @@ public final class SystemSignonInformation implements ICredentials {
} }
/** /**
* Returns the systemType of the remote system * Returns the systemType of the remote system.
* //FIXME should be replaced by IRSESystemType getSystemType() * @return the systemType object.
* @deprecated
* @return String
*/ */
public String getSystemType() { public IRSESystemType getSystemType() {
return _systemType; return _systemType;
} }
/** /**
* Returns the userid for the remote system * Returns the userid for the remote system
* @return String * @return the user ID.
*/ */
public String getUserId() { public String getUserId() {
return _userId; return _userId;
@ -111,7 +109,7 @@ public final class SystemSignonInformation implements ICredentials {
* Sets the systemType. * Sets the systemType.
* @param systemType The systemType to set * @param systemType The systemType to set
*/ */
public void setSystemType(String systemType) { public void setSystemType(IRSESystemType systemType) {
_systemType = systemType; _systemType = systemType;
} }

View file

@ -12,9 +12,11 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
@ -53,18 +55,20 @@ public class SystemStartHere
* SAME AS: <code>getSystemRegistry().getConnectionsBySystemType(systemType)</code> * SAME AS: <code>getSystemRegistry().getConnectionsBySystemType(systemType)</code>
* @param systemType One of the system types defined via system type extension point: * @param systemType One of the system types defined via system type extension point:
* <ul> * <ul>
* <li>"iSeries" * <li>"iSeries" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID})
* <li>"Windows" * <li>"Windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID})
* <li>"z/OS" * <li>"z/OS" ({@link IRSESystemType#SYSTEMTYPE_ZSERIES_ID})
* <li>"Unix" * <li>"Unix" ({@link IRSESystemType#SYSTEMTYPE_UNIX_ID})
* <li>"Linux" * <li>"Linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_ID})
* <li>"Local" * <li>"Local" ({@link IRSESystemType#SYSTEMTYPE_LOCAL_ID})
* </ul> * </ul>
* @see org.eclipse.rse.core.IRSESystemType * @see org.eclipse.rse.core.IRSESystemType
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(String) * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(String)
*
*/ */
public static IHost[] getConnectionsBySystemType(String systemType) public static IHost[] getConnectionsBySystemType(String systemTypeId)
{ {
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(systemTypeId);
return getSystemRegistry().getHostsBySystemType(systemType); return getSystemRegistry().getHostsBySystemType(systemType);
} }

View file

@ -7,12 +7,14 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - initial API and implementation from AbstractConnectorService. * David Dykstal (IBM) - initial API and implementation from AbstractConnectorService.
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
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.RSECorePlugin;
@ -102,7 +104,7 @@ public abstract class AuthenticatingConnectorService extends AbstractConnectorSe
ICredentials credentials = credentialsProvider.getCredentials(); ICredentials credentials = credentialsProvider.getCredentials();
boolean cached = (credentials != null && credentials.getPassword() != null); boolean cached = (credentials != null && credentials.getPassword() != null);
if (!cached && onDisk) { if (!cached && onDisk) {
String systemType = getHostType(); IRSESystemType systemType = getHost().getSystemType();
String hostName = getHostName(); String hostName = getHostName();
String userId = getUserId(); String userId = getUserId();
if (userId != null) { if (userId != null) {
@ -149,7 +151,7 @@ public abstract class AuthenticatingConnectorService extends AbstractConnectorSe
* @see org.eclipse.rse.core.subsystems.IConnectorService#removePassword() * @see org.eclipse.rse.core.subsystems.IConnectorService#removePassword()
*/ */
public final void removePassword() { public final void removePassword() {
String systemType = getHostType(); IRSESystemType systemType = getHost().getSystemType();
String hostName = getHostName(); String hostName = getHostName();
String userId = credentialsProvider.getUserId(); String userId = credentialsProvider.getUserId();
PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId); PasswordPersistenceManager.getInstance().remove(systemType, hostName, userId);
@ -255,7 +257,7 @@ public abstract class AuthenticatingConnectorService extends AbstractConnectorSe
int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST; int whereToUpdate = IRSEUserIdConstants.USERID_LOCATION_HOST;
IHost host = subsystem.getHost(); IHost host = subsystem.getHost();
ISystemRegistry sr = RSECorePlugin.getDefault().getSystemRegistry(); ISystemRegistry sr = RSECorePlugin.getDefault().getSystemRegistry();
sr.updateHost(host, host.getSystemType().getName(), host.getAliasName(), host.getHostName(), host.getDescription(), userId, whereToUpdate); sr.updateHost(host, host.getSystemType(), host.getAliasName(), host.getHostName(), host.getDescription(), userId, whereToUpdate);
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,10 +12,12 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 168870: move core function from UI to core * David Dykstal (IBM) - 168870: move core function from UI to core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
@ -291,7 +293,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
/** /**
* Return the system types this subsystem factory supports. * Return the system types this subsystem factory supports.
*/ */
public String[] getSystemTypes(); public IRSESystemType[] getSystemTypes();
// --------------------------------- // ---------------------------------
// PROFILE METHODS... // PROFILE METHODS...

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,12 +12,14 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 168870: move core function from UI to core * David Dykstal (IBM) - 168870: move core function from UI to core
********************************************************************************/ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
import java.net.URL; import java.net.URL;
import org.eclipse.rse.core.IRSESystemType;
import org.osgi.framework.Bundle; import org.osgi.framework.Bundle;
/** /**
@ -65,7 +67,7 @@ public interface ISubSystemConfigurationProxy {
* *
* @return The list of supported system types or an empty list. * @return The list of supported system types or an empty list.
*/ */
public String[] getSystemTypes(); public IRSESystemType[] getSystemTypes();
/** /**
* Return true if this factory supports all system types * Return true if this factory supports all system types
@ -108,10 +110,10 @@ public interface ISubSystemConfigurationProxy {
// public IConnectorService getSystemObject(); // public IConnectorService getSystemObject();
/** /**
* Test if the given system type matches one or more of the type names declared in the * Test if the given system type matches one or more of the
* <samp>systemTypes</samp> attribute of this extension. * <samp>systemTypes</samp> attribute of this extension.
*/ */
public boolean appliesToSystemType(String type); public boolean appliesToSystemType(IRSESystemType type);
/** /**
* Reset for a full refresh from disk, such as after a team synch. * Reset for a full refresh from disk, such as after a team synch.

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
@ -23,7 +24,7 @@ import org.eclipse.rse.core.model.IProperty;
import org.eclipse.rse.core.model.IPropertySet; import org.eclipse.rse.core.model.IPropertySet;
import org.eclipse.rse.core.model.IPropertyType; import org.eclipse.rse.core.model.IPropertyType;
import org.eclipse.rse.core.model.PropertyType; import org.eclipse.rse.core.model.PropertyType;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.core.subsystems.ServerLauncher; import org.eclipse.rse.internal.core.subsystems.ServerLauncher;
@ -140,14 +141,14 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe
try try
{ {
IProperty launchTypeProperty = set.getProperty(KEY_SERVER_LAUNCH_TYPE_NAME); IProperty launchTypeProperty = set.getProperty(KEY_SERVER_LAUNCH_TYPE_NAME);
launchTypeProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_MEANS_LABEL); launchTypeProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_MEANS_LABEL);
String launchTypeName = launchTypeProperty.getValue(); String launchTypeName = launchTypeProperty.getValue();
_serverLaunchType = ServerLaunchType.get(launchTypeName); _serverLaunchType = ServerLaunchType.get(launchTypeName);
IProperty daemonPortProperty = set.getProperty(KEY_DAEMON_PORT); IProperty daemonPortProperty = set.getProperty(KEY_DAEMON_PORT);
boolean daemon = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.DAEMON; boolean daemon = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.DAEMON;
daemonPortProperty.setEnabled(daemon); daemonPortProperty.setEnabled(daemon);
daemonPortProperty.setLabel(RSEModelResources.RESID_CONNECTION_DAEMON_PORT_LABEL); daemonPortProperty.setLabel(RSECoreMessages.RESID_CONNECTION_DAEMON_PORT_LABEL);
_daemonPort = Integer.parseInt(daemonPortProperty.getValue()); _daemonPort = Integer.parseInt(daemonPortProperty.getValue());
@ -156,7 +157,7 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe
{ {
boolean autoDetect = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.REXEC; boolean autoDetect = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.REXEC;
autoDetectProperty.setEnabled(autoDetect); autoDetectProperty.setEnabled(autoDetect);
autoDetectProperty.setLabel(RSEModelResources.RESID_SUBSYSTEM_AUTODETECT_LABEL); autoDetectProperty.setLabel(RSECoreMessages.RESID_SUBSYSTEM_AUTODETECT_LABEL);
_autoDetectSSL = Boolean.getBoolean(autoDetectProperty.getValue()); _autoDetectSSL = Boolean.getBoolean(autoDetectProperty.getValue());
} }
@ -164,18 +165,18 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe
boolean usingRexec = _serverLaunchType != null && _serverLaunchType.getType() == ServerLaunchType.REXEC; boolean usingRexec = _serverLaunchType != null && _serverLaunchType.getType() == ServerLaunchType.REXEC;
IProperty rexecPortProperty = set.getProperty(KEY_REXEC_PORT); IProperty rexecPortProperty = set.getProperty(KEY_REXEC_PORT);
rexecPortProperty.setEnabled(usingRexec); rexecPortProperty.setEnabled(usingRexec);
rexecPortProperty.setLabel(RSEModelResources.RESID_CONNECTION_PORT_LABEL); rexecPortProperty.setLabel(RSECoreMessages.RESID_CONNECTION_PORT_LABEL);
_rexecPort = Integer.parseInt(rexecPortProperty.getValue()); _rexecPort = Integer.parseInt(rexecPortProperty.getValue());
IProperty serverPathProperty = set.getProperty(KEY_SERVER_PATH); IProperty serverPathProperty = set.getProperty(KEY_SERVER_PATH);
serverPathProperty.setEnabled(usingRexec); serverPathProperty.setEnabled(usingRexec);
serverPathProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_PATH); serverPathProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_PATH);
_serverPath = serverPathProperty.getValue(); _serverPath = serverPathProperty.getValue();
IProperty serverScriptProperty = set.getProperty(KEY_SERVER_SCRIPT); IProperty serverScriptProperty = set.getProperty(KEY_SERVER_SCRIPT);
serverScriptProperty.setEnabled(usingRexec); serverScriptProperty.setEnabled(usingRexec);
serverScriptProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_INVOCATION); serverScriptProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_INVOCATION);
_serverScript = serverScriptProperty.getValue(); _serverScript = serverScriptProperty.getValue();
_hasSetServerLaunchType = true; _hasSetServerLaunchType = true;
@ -199,28 +200,28 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe
if (_serverLaunchType == null) if (_serverLaunchType == null)
_serverLaunchType = ServerLaunchType.get(ServerLaunchType.DAEMON); _serverLaunchType = ServerLaunchType.get(ServerLaunchType.DAEMON);
IProperty launchTypeProperty = set.addProperty(KEY_SERVER_LAUNCH_TYPE_NAME, _serverLaunchType.getName(), getServerLauncherPropertyType()); IProperty launchTypeProperty = set.addProperty(KEY_SERVER_LAUNCH_TYPE_NAME, _serverLaunchType.getName(), getServerLauncherPropertyType());
launchTypeProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_MEANS_LABEL); launchTypeProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_MEANS_LABEL);
IProperty daemonPortProperty = set.addProperty(KEY_DAEMON_PORT, ""+_daemonPort, PropertyType.getIntegerPropertyType()); //$NON-NLS-1$ IProperty daemonPortProperty = set.addProperty(KEY_DAEMON_PORT, ""+_daemonPort, PropertyType.getIntegerPropertyType()); //$NON-NLS-1$
daemonPortProperty.setEnabled(_serverLaunchType.getType() == ServerLaunchType.DAEMON); daemonPortProperty.setEnabled(_serverLaunchType.getType() == ServerLaunchType.DAEMON);
daemonPortProperty.setLabel(RSEModelResources.RESID_CONNECTION_DAEMON_PORT_LABEL); daemonPortProperty.setLabel(RSECoreMessages.RESID_CONNECTION_DAEMON_PORT_LABEL);
IProperty rexecPortProperty = set.addProperty(KEY_REXEC_PORT, ""+_rexecPort, PropertyType.getIntegerPropertyType()); //$NON-NLS-1$ IProperty rexecPortProperty = set.addProperty(KEY_REXEC_PORT, ""+_rexecPort, PropertyType.getIntegerPropertyType()); //$NON-NLS-1$
boolean usingRexec = _serverLaunchType.getType() == ServerLaunchType.REXEC; boolean usingRexec = _serverLaunchType.getType() == ServerLaunchType.REXEC;
rexecPortProperty.setEnabled(usingRexec); rexecPortProperty.setEnabled(usingRexec);
rexecPortProperty.setLabel(RSEModelResources.RESID_CONNECTION_PORT_LABEL); rexecPortProperty.setLabel(RSECoreMessages.RESID_CONNECTION_PORT_LABEL);
IProperty autoDetectSSLProperty = set.addProperty(KEY_AUTODETECT_SSL, ""+_autoDetectSSL, PropertyType.getBooleanPropertyType()); //$NON-NLS-1$ IProperty autoDetectSSLProperty = set.addProperty(KEY_AUTODETECT_SSL, ""+_autoDetectSSL, PropertyType.getBooleanPropertyType()); //$NON-NLS-1$
autoDetectSSLProperty.setEnabled(usingRexec); autoDetectSSLProperty.setEnabled(usingRexec);
autoDetectSSLProperty.setLabel(RSEModelResources.RESID_SUBSYSTEM_AUTODETECT_LABEL); autoDetectSSLProperty.setLabel(RSECoreMessages.RESID_SUBSYSTEM_AUTODETECT_LABEL);
IProperty serverPathProperty = set.addProperty(KEY_SERVER_PATH, ""+_serverPath); //$NON-NLS-1$ IProperty serverPathProperty = set.addProperty(KEY_SERVER_PATH, ""+_serverPath); //$NON-NLS-1$
serverPathProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_PATH); serverPathProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_PATH);
serverPathProperty.setEnabled(usingRexec); serverPathProperty.setEnabled(usingRexec);
IProperty serverScriptProperty = set.addProperty(KEY_SERVER_SCRIPT, ""+_serverScript); //$NON-NLS-1$ IProperty serverScriptProperty = set.addProperty(KEY_SERVER_SCRIPT, ""+_serverScript); //$NON-NLS-1$
serverScriptProperty.setEnabled(usingRexec); serverScriptProperty.setEnabled(usingRexec);
serverScriptProperty.setLabel(RSEModelResources.RESID_PROP_SERVERLAUNCHER_INVOCATION); serverScriptProperty.setLabel(RSECoreMessages.RESID_PROP_SERVERLAUNCHER_INVOCATION);
} }

View file

@ -1,30 +1,26 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors: * Contributors:
* David Dykstal (IBM) - initial API and implementation
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* Martin Oberhuber (Wind River) - [184095] combined RSEModelResources and persistence.Messages into this file
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core;
package org.eclipse.rse.internal.core.model;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
/** public class RSECoreMessages extends NLS {
* This class contains bundle resources for model objects. private static final String BUNDLE_NAME = "org.eclipse.rse.internal.core.messages"; //$NON-NLS-1$
*/ static {
public class RSEModelResources extends NLS { // initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, RSECoreMessages.class);
private static String BUNDLE_NAME = "org.eclipse.rse.internal.core.model.RSEModelResources"; //$NON-NLS-1$ }
// Model
public static String RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION; public static String RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION;
public static String RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION; public static String RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION;
public static String RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION; public static String RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION;
@ -41,11 +37,17 @@ public class RSEModelResources extends NLS {
public static String RESID_CONNECTION_PORT_LABEL; public static String RESID_CONNECTION_PORT_LABEL;
public static String RESID_SUBSYSTEM_AUTODETECT_LABEL; public static String RESID_SUBSYSTEM_AUTODETECT_LABEL;
// Persistence
public static String PropertyFileProvider_LoadingTaskName;
public static String PropertyFileProvider_SavingTaskName;
public static String PropertyFileProvider_UnexpectedException;
public static String RSEPersistenceManager_DeleteProfileJobName;
public static String SaveRSEDOMJob_SavingProfileJobName;
public static String SerializingProvider_UnexpectedException;
static { // Password Persistence Manager
// load message values from bundle file public static String DefaultSystemType_Label;
NLS.initializeMessages(BUNDLE_NAME, RSEModelResources.class);
private RSECoreMessages() {
} }
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Dynamic system type provider extension. * Uwe Stieber (Wind River) - Dynamic system type provider extension.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core; package org.eclipse.rse.internal.core;
@ -25,6 +26,7 @@ import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject; import org.eclipse.core.runtime.PlatformObject;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSESystemTypeConstants; import org.eclipse.rse.core.IRSESystemTypeConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.osgi.framework.Bundle; import org.osgi.framework.Bundle;
/** /**
@ -58,6 +60,13 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
id = element.getAttribute(ATTR_ID); id = element.getAttribute(ATTR_ID);
name = element.getAttribute(ATTR_NAME); name = element.getAttribute(ATTR_NAME);
if (id==null) {
RSECorePlugin.getDefault().getLogger().logWarning("RSE: System Type \""+name+"\" does not define an ID"); //$NON-NLS-1$ //$NON-NLS-2$
//Fallback: use the name as ID. When PDE was used to define the
//extension, this should never happen since ID is marked as a
//required attribute.
id = name;
}
label = element.getAttribute(ATTR_LABEL); label = element.getAttribute(ATTR_LABEL);
description = element.getAttribute(ATTR_DESCRIPTION); description = element.getAttribute(ATTR_DESCRIPTION);
@ -85,6 +94,27 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
subsystemConfigurationIds = (String[])subsystemConfigs.toArray(new String[subsystemConfigs.size()]); subsystemConfigurationIds = (String[])subsystemConfigs.toArray(new String[subsystemConfigs.size()]);
} }
/**
* Checks whether two system types are the same.
*
* System types are considered the same if they have the same ID.
*/
public boolean equals(Object obj) {
if (obj instanceof IRSESystemType) {
return id.equals( ((IRSESystemType)obj).getId() );
}
return false;
}
/**
* Returns the hashCode for this system type.
*
* The hashCode is the hashCode of its ID.
*/
public int hashCode() {
return id.hashCode();
}
/** /**
* Loads properties defined for the system type. * Loads properties defined for the system type.
* @param element the configuration element * @param element the configuration element
@ -114,14 +144,15 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
*/ */
public String getLabel() { public String getLabel() {
// For default RSE system types, the UI label is equal to the // For default RSE system types, the UI label is equal to the
// name. Therefor, fallback to the name if the label is not // name. Therefore, fallback to the name if the label is not
// explicitly set. // explicitly set.
if (label == null) return getName(); if (label == null) return getName();
return label; return label;
} }
/* (non-Javadoc) /*
* @see org.eclipse.rse.core.IRSESystemType#getName() * (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getNameOfSystemTypeDeprecated()
*/ */
public String getName() { public String getName() {
return name; return name;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.filters; package org.eclipse.rse.internal.core.filters;
@ -36,7 +37,7 @@ import org.eclipse.rse.core.filters.SystemFilterSimple;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.references.IRSEReferencedObject; import org.eclipse.rse.core.references.IRSEReferencedObject;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.references.SystemReferencedObject; import org.eclipse.rse.internal.references.SystemReferencedObject;
@ -1022,7 +1023,7 @@ public class SystemFilter extends SystemReferencedObject implements ISystemFilte
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_FILTER_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_FILTER_DESCRIPTION;
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - removing implementation of ISystemFilterSavePolicies, ISystemFilterConstants * David Dykstal (IBM) - removing implementation of ISystemFilterSavePolicies, ISystemFilterConstants
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.filters; package org.eclipse.rse.internal.core.filters;
@ -35,7 +36,7 @@ import org.eclipse.rse.core.filters.ISystemFilterPoolManagerProvider;
import org.eclipse.rse.core.filters.SystemFilterNamingPolicy; import org.eclipse.rse.core.filters.SystemFilterNamingPolicy;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.references.SystemPersistableReferencedObject; import org.eclipse.rse.internal.references.SystemPersistableReferencedObject;
@ -465,7 +466,7 @@ public class SystemFilterPool extends SystemPersistableReferencedObject
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_FILTERPOOL_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_FILTERPOOL_DESCRIPTION;
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.filters; package org.eclipse.rse.internal.core.filters;
@ -25,7 +26,7 @@ import org.eclipse.rse.core.filters.ISystemFilterString;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.core.references.IRSEBaseReferencingObject; import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.references.SystemReferencedObjectHelper; import org.eclipse.rse.internal.references.SystemReferencedObjectHelper;
@ -219,7 +220,7 @@ public class SystemFilterString extends RSEModelObject implements ISystemFilterS
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION;
} }
public String getString() public String getString()

View file

@ -1,22 +1,20 @@
################################################################################ ###############################################################################
# Copyright (c) 2000, 2007 IBM Corporation. All rights reserved. # Copyright (c) 2000, 2007 IBM Corporation and others.
# This program and the accompanying materials are made available under the terms # All rights reserved. This program and the accompanying materials
# of the Eclipse Public License v1.0 which accompanies this distribution, and is # are made available under the terms of the Eclipse Public License v1.0
# available at http://www.eclipse.org/legal/epl-v10.html # which accompanies this distribution, and is available at
# # http://www.eclipse.org/legal/epl-v10.html
# Initial Contributors:
# The following IBM employees contributed to the Remote System Explorer
# component that contains this file: David McKnight, Kushal Munir,
# Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
# Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
# #
# Contributors: # Contributors:
# David Dykstal (IBM) - initial API and implementation
# David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies # David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
################################################################################ # Martin Oberhuber (Wind River) - [184095] combined RSEModelResources and persistence.Messages into this file
###############################################################################
# NLS_MESSAGEFORMAT_VAR # NLS_MESSAGEFORMAT_VAR
# NLS_ENCODING=UTF-8 # NLS_ENCODING=UTF-8
# Model
RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION=An RSE Model Object represents any object in the Remote System Explorer. RESID_MODELOBJECTS_MODELOBJECT_DESCRIPTION=An RSE Model Object represents any object in the Remote System Explorer.
RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION=A Referencing Object encapsulates the operations required of an object which is merely a reference to another object. RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION=A Referencing Object encapsulates the operations required of an object which is merely a reference to another object.
RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION=A filter string is a single string in a filter. It describes which files will pass through the filter. RESID_MODELOBJECTS_FILTERSTRING_DESCRIPTION=A filter string is a single string in a filter. It describes which files will pass through the filter.
@ -32,3 +30,14 @@ RESID_PROP_SERVERLAUNCHER_PATH=Path to installed server on host
RESID_PROP_SERVERLAUNCHER_INVOCATION=Server launch command RESID_PROP_SERVERLAUNCHER_INVOCATION=Server launch command
RESID_CONNECTION_PORT_LABEL=Port RESID_CONNECTION_PORT_LABEL=Port
RESID_CONNECTION_DAEMON_PORT_LABEL=Daemon Port RESID_CONNECTION_DAEMON_PORT_LABEL=Daemon Port
# Persistence
RSEPersistenceManager_DeleteProfileJobName=Delete RSE Profile Job
PropertyFileProvider_SavingTaskName=Saving DOM
PropertyFileProvider_UnexpectedException=Unexpected Exception
PropertyFileProvider_LoadingTaskName=Loading DOM
SaveRSEDOMJob_SavingProfileJobName=Saving RSE Profile {0}
SerializingProvider_UnexpectedException=Unexpected Exception
# Password Persistence Manager
DefaultSystemType_Label=Default

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.model; package org.eclipse.rse.internal.core.model;
@ -22,6 +23,7 @@ import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
@ -32,6 +34,7 @@ import org.eclipse.rse.core.model.ISystemProfileManager;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.persistence.IRSEPersistenceProvider; import org.eclipse.rse.persistence.IRSEPersistenceProvider;
/** /**
@ -80,7 +83,7 @@ public class SystemProfile extends RSEModelObject implements ISystemProfile, IAd
* Convenience method for create a new connection within this profile. * Convenience method for create a new connection within this profile.
* Shortcut for {@link ISystemRegistry#createHost(String,String,String,String)} * Shortcut for {@link ISystemRegistry#createHost(String,String,String,String)}
*/ */
public IHost createHost(String systemType, String connectionName, String hostName, String description) throws Exception public IHost createHost(IRSESystemType systemType, String connectionName, String hostName, String description) throws Exception
{ {
return RSECorePlugin.getDefault().getSystemRegistry().createHost(getName(), systemType, connectionName, hostName, description); return RSECorePlugin.getDefault().getSystemRegistry().createHost(getName(), systemType, connectionName, hostName, description);
} }
@ -174,7 +177,7 @@ public class SystemProfile extends RSEModelObject implements ISystemProfile, IAd
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_PROFILE_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_PROFILE_DESCRIPTION;
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2004, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.subsystems; package org.eclipse.rse.internal.core.subsystems;
@ -24,7 +25,7 @@ import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties; import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
public abstract class ServerLauncher extends RSEModelObject implements IServerLauncherProperties public abstract class ServerLauncher extends RSEModelObject implements IServerLauncherProperties
@ -48,7 +49,7 @@ public abstract class ServerLauncher extends RSEModelObject implements IServerLa
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_SERVERLAUNCHER_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_SERVERLAUNCHER_DESCRIPTION;
} }
public IConnectorService getConnectorService() public IConnectorService getConnectorService()

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -14,14 +14,15 @@
* Uwe Stieber (Wind River) - systemTypeIds attribute extension and dynamic association * Uwe Stieber (Wind River) - systemTypeIds attribute extension and dynamic association
* of system types. * of system types.
* David Dykstal (IBM) - 168870: move core function from UI to core * David Dykstal (IBM) - 168870: move core function from UI to core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core.subsystems; package org.eclipse.rse.internal.core.subsystems;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
@ -51,7 +52,7 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy
private String systemTypeIds; private String systemTypeIds;
// The list of resolved system types supported by this subsystem configuration. // The list of resolved system types supported by this subsystem configuration.
private List resolvedSystemTypes; private IRSESystemType[] resolvedSystemTypes;
// The subsystem configuration vendor // The subsystem configuration vendor
private String vendor; private String vendor;
@ -145,35 +146,35 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy#getSystemTypes() * @see org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy#getSystemTypes()
*/ */
public String[] getSystemTypes() { public IRSESystemType[] getSystemTypes() {
if (resolvedSystemTypes == null) { if (resolvedSystemTypes == null) {
resolvedSystemTypes = new LinkedList(); IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
// If the subsystem configuration supports all system types, just add all // If the subsystem configuration supports all system types, just add all
// currently registered system types to th resolved list // currently registered system types to the resolved list
if (supportsAllSystemTypes()) { if (supportsAllSystemTypes()) {
IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes(); resolvedSystemTypes = systemTypes;
for (int i = 0; i < systemTypes.length; i++) resolvedSystemTypes.add(systemTypes[i].getName());
} else { } else {
// We have to match the given lists of system type ids against // We have to match the given lists of system type ids against
// the list of available system types. As the list of system types cannot // the list of available system types. As the list of system types cannot
// change ones it has been initialized, we filter out the not matching ones // change ones it has been initialized, we filter out the not matching ones
// here directly. // here directly.
IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes(); List systemTypesList = new ArrayList(systemTypes.length);
for (int i = 0; i < systemTypes.length; i++) { for (int i = 0; i < systemTypes.length; i++) {
IRSESystemType systemType = systemTypes[i]; IRSESystemType systemType = systemTypes[i];
if (isMatchingDeclaredSystemTypes(systemType) if (isMatchingDeclaredSystemTypes(systemType)
|| (systemType.getSubsystemConfigurationIds() != null || (systemType.getSubsystemConfigurationIds() != null
&& Arrays.asList(systemType.getSubsystemConfigurationIds()).contains(getId()))) { && Arrays.asList(systemType.getSubsystemConfigurationIds()).contains(getId()))
if (!resolvedSystemTypes.contains(systemType.getName())) { ) {
resolvedSystemTypes.add(systemType.getName()); if (!systemTypesList.contains(systemType)) {
systemTypesList.add(systemType);
} }
} }
} }
resolvedSystemTypes = (IRSESystemType[])systemTypesList.toArray(new IRSESystemType[systemTypesList.size()]);
} }
} }
return resolvedSystemTypes;
return (String[])resolvedSystemTypes.toArray(new String[resolvedSystemTypes.size()]);
} }
/** /**
@ -210,7 +211,7 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy
/** /**
* Return true if this extension's systemTypes attribute matches the given system type name. * Return true if this extension's systemTypes attribute matches the given system type name.
*/ */
public boolean appliesToSystemType(String type) { public boolean appliesToSystemType(IRSESystemType type) {
assert type != null; assert type != null;
if (systemTypeMatcher.supportsAllSystemTypes()) return true; if (systemTypeMatcher.supportsAllSystemTypes()) return true;
return Arrays.asList(getSystemTypes()).contains(type); return Arrays.asList(getSystemTypes()).contains(type);

View file

@ -1,29 +0,0 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* David Dykstal (IBM) - initial API and implementation
********************************************************************************/
package org.eclipse.rse.internal.persistence;
import org.eclipse.osgi.util.NLS;
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.rse.internal.persistence.messages"; //$NON-NLS-1$
public static String PropertyFileProvider_LoadingTaskName;
public static String PropertyFileProvider_SavingTaskName;
public static String PropertyFileProvider_UnexpectedException;
public static String RSEPersistenceManager_DeleteProfileJobName;
public static String SaveRSEDOMJob_SavingProfileJobName;
public static String SerializingProvider_UnexpectedException;
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
}
private Messages() {
}
}

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,6 +11,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - removed printlns, printStackTrace and added logging. * David Dykstal (IBM) - removed printlns, printStackTrace and added logging.
* David Dykstal (IBM) - [177882] fixed escapeValue for garbling of CJK characters * David Dykstal (IBM) - [177882] fixed escapeValue for garbling of CJK characters
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -45,6 +46,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.logging.Logger; import org.eclipse.rse.logging.Logger;
import org.eclipse.rse.persistence.IRSEPersistenceProvider; import org.eclipse.rse.persistence.IRSEPersistenceProvider;
import org.eclipse.rse.persistence.dom.IRSEDOMConstants; import org.eclipse.rse.persistence.dom.IRSEDOMConstants;
@ -132,7 +134,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
IFolder providerFolder = getProviderFolder(); IFolder providerFolder = getProviderFolder();
try { try {
int n = countNodes(dom); int n = countNodes(dom);
if (monitor != null) monitor.beginTask(Messages.PropertyFileProvider_SavingTaskName, n); if (monitor != null) monitor.beginTask(RSECoreMessages.PropertyFileProvider_SavingTaskName, n);
saveNode(dom, providerFolder, monitor); saveNode(dom, providerFolder, monitor);
if (monitor != null) monitor.done(); if (monitor != null) monitor.done();
} catch (Exception e) { } catch (Exception e) {
@ -152,7 +154,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
try { try {
profileFolder.delete(IResource.FORCE, monitor); profileFolder.delete(IResource.FORCE, monitor);
} catch (CoreException e) { } catch (CoreException e) {
result = new Status(IStatus.ERROR, null, 0, Messages.PropertyFileProvider_UnexpectedException, e); result = new Status(IStatus.ERROR, null, 0, RSECoreMessages.PropertyFileProvider_UnexpectedException, e);
} }
} }
return result; return result;
@ -538,7 +540,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
IFolder profileFolder = getProfileFolder(profileName); IFolder profileFolder = getProfileFolder(profileName);
if (profileFolder.exists()) { if (profileFolder.exists()) {
int n = countPropertiesFiles(profileFolder); int n = countPropertiesFiles(profileFolder);
if (monitor != null) monitor.beginTask(Messages.PropertyFileProvider_LoadingTaskName, n); if (monitor != null) monitor.beginTask(RSECoreMessages.PropertyFileProvider_LoadingTaskName, n);
dom = (RSEDOM) loadNode(null, profileFolder, monitor); dom = (RSEDOM) loadNode(null, profileFolder, monitor);
if (monitor != null) monitor.done(); if (monitor != null) monitor.done();
} else { } else {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -37,6 +38,7 @@ import org.eclipse.rse.core.SystemResourceManager;
import org.eclipse.rse.core.model.IRSEPersistableContainer; import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.core.model.SystemProfileManager; import org.eclipse.rse.internal.core.model.SystemProfileManager;
import org.eclipse.rse.internal.persistence.dom.RSEDOMExporter; import org.eclipse.rse.internal.persistence.dom.RSEDOMExporter;
import org.eclipse.rse.internal.persistence.dom.RSEDOMImporter; import org.eclipse.rse.internal.persistence.dom.RSEDOMImporter;
@ -142,7 +144,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
* @see org.eclipse.rse.persistence.IRSEPersistenceManager#deleteProfile(java.lang.String) * @see org.eclipse.rse.persistence.IRSEPersistenceManager#deleteProfile(java.lang.String)
*/ */
public void deleteProfile(final IRSEPersistenceProvider persistenceProvider, final String profileName) { public void deleteProfile(final IRSEPersistenceProvider persistenceProvider, final String profileName) {
Job job = new Job(Messages.RSEPersistenceManager_DeleteProfileJobName) { Job job = new Job(RSECoreMessages.RSEPersistenceManager_DeleteProfileJobName) {
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
IRSEPersistenceProvider p = persistenceProvider != null ? persistenceProvider : getDefaultPersistenceProvider(); IRSEPersistenceProvider p = persistenceProvider != null ? persistenceProvider : getDefaultPersistenceProvider();
IStatus result = p.deleteProfile(profileName, monitor); IStatus result = p.deleteProfile(profileName, monitor);

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -23,6 +23,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.persistence.IRSEPersistenceProvider; import org.eclipse.rse.persistence.IRSEPersistenceProvider;
import org.eclipse.rse.persistence.dom.RSEDOM; import org.eclipse.rse.persistence.dom.RSEDOM;
@ -38,7 +39,7 @@ public class SaveRSEDOMJob extends WorkspaceJob {
public SaveRSEDOMJob(RSEDOM dom, IRSEPersistenceProvider provider) { public SaveRSEDOMJob(RSEDOM dom, IRSEPersistenceProvider provider) {
super("Saving Profile"); //$NON-NLS-1$ super("Saving Profile"); //$NON-NLS-1$
String title = MessageFormat.format(Messages.SaveRSEDOMJob_SavingProfileJobName, new Object[] { dom.getName() }); String title = MessageFormat.format(RSECoreMessages.SaveRSEDOMJob_SavingProfileJobName, new Object[] { dom.getName() });
setName(title); setName(title);
_dom = dom; _dom = dom;
_provider = provider; _provider = provider;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence; package org.eclipse.rse.internal.persistence;
@ -33,6 +33,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.persistence.IRSEPersistenceProvider; import org.eclipse.rse.persistence.IRSEPersistenceProvider;
import org.eclipse.rse.persistence.dom.RSEDOM; import org.eclipse.rse.persistence.dom.RSEDOM;
@ -157,7 +158,7 @@ public class SerializingProvider implements IRSEPersistenceProvider {
try { try {
profileFile.delete(IResource.FORCE | IResource.KEEP_HISTORY, monitor); profileFile.delete(IResource.FORCE | IResource.KEEP_HISTORY, monitor);
} catch (CoreException e) { } catch (CoreException e) {
result = new Status(IStatus.ERROR, null, 0, Messages.SerializingProvider_UnexpectedException, e); result = new Status(IStatus.ERROR, null, 0, RSECoreMessages.SerializingProvider_UnexpectedException, e);
} }
} }
return result; return result;

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence.dom; package org.eclipse.rse.internal.persistence.dom;
@ -21,6 +22,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolReference; import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
@ -316,7 +318,8 @@ public class RSEDOMExporter implements IRSEDOMExporter {
RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_CONNECTOR_SERVICE, connectorService, clean); RSEDOMNode node = findOrCreateNode(parent, IRSEDOMConstants.TYPE_CONNECTOR_SERVICE, connectorService, clean);
if (clean || node.isDirty()) { if (clean || node.isDirty()) {
// store it's attributes // store it's attributes
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, connectorService.getHostType()); IRSESystemType systemType = connectorService.getHost().getSystemType();
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE, systemType.getName());
// can't do this til connector service owns the properties (right now it's still subsystem) // can't do this til connector service owns the properties (right now it's still subsystem)
node.addAttribute(IRSEDOMConstants.ATTRIBUTE_GROUP, connectorService.getName()); node.addAttribute(IRSEDOMConstants.ATTRIBUTE_GROUP, connectorService.getName());

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,13 +11,15 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.persistence.dom; package org.eclipse.rse.internal.persistence.dom;
import java.util.Vector; import java.util.Vector;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilter;
import org.eclipse.rse.core.filters.ISystemFilterPool; import org.eclipse.rse.core.filters.ISystemFilterPool;
import org.eclipse.rse.core.filters.ISystemFilterPoolManager; import org.eclipse.rse.core.filters.ISystemFilterPoolManager;
@ -99,7 +101,7 @@ public class RSEDOMImporter {
// get host node attributes // get host node attributes
String connectionName = hostNode.getName(); String connectionName = hostNode.getName();
String systemType = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue(); String systemTypeName = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_TYPE).getValue();
String hostName = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_HOSTNAME).getValue(); String hostName = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_HOSTNAME).getValue();
String description = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION).getValue(); String description = hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_DESCRIPTION).getValue();
boolean isOffline = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_OFFLINE).getValue()); boolean isOffline = getBooleanValue(hostNode.getAttribute(IRSEDOMConstants.ATTRIBUTE_OFFLINE).getValue());
@ -109,6 +111,7 @@ public class RSEDOMImporter {
try { try {
// NOTE create host effectively recreates the subsystems // NOTE create host effectively recreates the subsystems
// so instead of creating subsystems on restore, we should be updating their properties // so instead of creating subsystems on restore, we should be updating their properties
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypeName);
host = profile.createHost(systemType, connectionName, hostName, description); host = profile.createHost(systemType, connectionName, hostName, description);
host.setOffline(isOffline); host.setOffline(isOffline);
host.setPromptable(isPromptable); host.setPromptable(isPromptable);

View file

@ -1,20 +0,0 @@
###############################################################################
# Copyright (c) 2006 IBM Corporation.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html
#
# Contributors:
# David Dykstal (IBM) - initial API and implementation
###############################################################################
# NLS_MESSAGEFORMAT_VAR
# NLS_ENCODING=UTF-8
RSEPersistenceManager_DeleteProfileJobName=Delete RSE Profile Job
PropertyFileProvider_SavingTaskName=Saving DOM
PropertyFileProvider_UnexpectedException=Unexpected Exception
PropertyFileProvider_LoadingTaskName=Loading DOM
SaveRSEDOMJob_SavingProfileJobName=Saving RSE Profile {0}
SerializingProvider_UnexpectedException=Unexpected Exception

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.references; package org.eclipse.rse.internal.references;
@ -19,7 +19,7 @@ package org.eclipse.rse.internal.references;
import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.core.references.IRSEBaseReferencedObject; import org.eclipse.rse.core.references.IRSEBaseReferencedObject;
import org.eclipse.rse.core.references.IRSEReferencingObject; import org.eclipse.rse.core.references.IRSEReferencingObject;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
/** /**
* A class to encapsulate the operations required of an object which * A class to encapsulate the operations required of an object which
@ -32,36 +32,36 @@ import org.eclipse.rse.internal.core.model.RSEModelResources;
* These references are not persistent. Persistent references are managed * These references are not persistent. Persistent references are managed
* by the subclass SystemPersistableReferencingObject. * by the subclass SystemPersistableReferencingObject.
*/ */
/**
* @lastgen class SystemReferencingObjectImpl Impl implements SystemReferencingObject, EObject {}
*/
public abstract class SystemReferencingObject extends RSEModelObject implements IRSEReferencingObject { public abstract class SystemReferencingObject extends RSEModelObject implements IRSEReferencingObject {
private SystemReferencingObjectHelper helper = null; private SystemReferencingObjectHelper helper = null;
protected boolean referenceBroken = false; protected boolean referenceBroken = false;
/** /**
* Default constructor. Typically called by EMF factory method. * Default constructor.
*/ */
protected SystemReferencingObject() { protected SystemReferencingObject() {
super(); super();
helper = new SystemReferencingObjectHelper(this); helper = new SystemReferencingObjectHelper(this);
} }
/** /*
* @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#setReferencedObject(IRSEBaseReferencedObject) * (non-Javadoc)
* @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#setReferencedObject(org.eclipse.rse.core.references.IRSEBaseReferencedObject)
*/ */
public void setReferencedObject(IRSEBaseReferencedObject obj) { public void setReferencedObject(IRSEBaseReferencedObject obj) {
helper.setReferencedObject(obj); helper.setReferencedObject(obj);
} }
/** /*
* (non-Javadoc)
* @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#getReferencedObject() * @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#getReferencedObject()
*/ */
public IRSEBaseReferencedObject getReferencedObject() { public IRSEBaseReferencedObject getReferencedObject() {
return helper.getReferencedObject(); return helper.getReferencedObject();
} }
/** /*
* (non-Javadoc)
* @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#removeReference() * @see org.eclipse.rse.core.references.IRSEBaseReferencingObject#removeReference()
*/ */
public int removeReference() { public int removeReference() {
@ -83,7 +83,7 @@ public abstract class SystemReferencingObject extends RSEModelObject implements
} }
public String getDescription() { public String getDescription() {
return RSEModelResources.RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION;
} }
protected final SystemReferencingObjectHelper getHelper() { protected final SystemReferencingObjectHelper getHelper() {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.actions; package org.eclipse.rse.files.ui.actions;
@ -21,6 +21,7 @@ import java.util.List;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog; import org.eclipse.rse.files.ui.dialogs.SystemSelectRemoteFileOrFolderDialog;
@ -39,7 +40,7 @@ import org.eclipse.swt.widgets.Shell;
* <ul> * <ul>
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setSystemType(String)} or {@link #setSystemTypes(String[])} * <li>{@link #setSystemType(IRSESystemType)} or {@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
* <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)} * <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)}
* <li>{@link #setAutoExpandDepth(int)} * <li>{@link #setAutoExpandDepth(int)}
@ -64,7 +65,7 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemSelectRemoteFileAction extends SystemBaseDialogAction public class SystemSelectRemoteFileAction extends SystemBaseDialogAction
{ {
private String[] systemTypes; private IRSESystemType[] systemTypes;
private IHost systemConnection, outputConnection; private IHost systemConnection, outputConnection;
private IHost rootFolderConnection; private IHost rootFolderConnection;
private IRemoteFile preSelection; private IRemoteFile preSelection;
@ -130,30 +131,34 @@ public class SystemSelectRemoteFileAction extends SystemBaseDialogAction
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The name of the system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.actions; package org.eclipse.rse.files.ui.actions;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog; import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog;
@ -36,7 +37,7 @@ import org.eclipse.swt.widgets.Shell;
* <ul> * <ul>
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setSystemType(String)} or {@link #setSystemTypes(String[])} * <li>{@link #setSystemType(IRSESystemType)} or {@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
* <li>{@link #setAutoExpandDepth(int)} * <li>{@link #setAutoExpandDepth(int)}
* <li>{@link #setShowPropertySheet(boolean)} * <li>{@link #setShowPropertySheet(boolean)}
@ -60,7 +61,7 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction
{ {
private String[] systemTypes; private IRSESystemType[] systemTypes;
private boolean foldersOnly = false; private boolean foldersOnly = false;
private IHost systemConnection, outputConnection; private IHost systemConnection, outputConnection;
private IHost rootFolderConnection; private IHost rootFolderConnection;
@ -159,7 +160,7 @@ public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction
* *
* @see org.eclipse.rse.core.IRSESystemType * @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
@ -167,16 +168,17 @@ public class SystemSelectRemoteFolderAction extends SystemBaseDialogAction
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new String[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The name of the system type to restrict to,
* * or <code>null</code> to allow all valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem
* configuration is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2003, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2003, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.dialogs; package org.eclipse.rse.files.ui.dialogs;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2003, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2003, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.dialogs; package org.eclipse.rse.files.ui.dialogs;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.dialogs; package org.eclipse.rse.files.ui.dialogs;
import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm; import org.eclipse.rse.files.ui.widgets.SystemSelectRemoteFileOrFolderForm;
@ -40,7 +41,7 @@ import org.eclipse.swt.widgets.Shell;
* <ul> * <ul>
* <li>{@link #setSystemConnection(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setSystemConnection(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setSystemTypes(String[])} * <li>{@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setAutoExpandDepth(int)} * <li>{@link #setAutoExpandDepth(int)}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
* <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)} * <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)}
@ -132,12 +133,15 @@ public class SystemSelectRemoteFileOrFolderDialog
} }
/** /**
* Restrict to certain system types * Set the system types to restrict what connections the user sees,
* @param systemTypes the system types to restrict what connections are shown and what types of connections * and what types of connections they can create.
* the user can create *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
form.setSystemTypes(systemTypes); form.setSystemTypes(systemTypes);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,12 +12,14 @@
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.widgets; package org.eclipse.rse.files.ui.widgets;
import java.util.Hashtable; import java.util.Hashtable;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
@ -82,7 +84,7 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
//private IRemoteFile[] folders = null; //private IRemoteFile[] folders = null;
private Hashtable resolvedFolders = new Hashtable(); private Hashtable resolvedFolders = new Hashtable();
//private String[] folderStrings = null; //private String[] folderStrings = null;
private String[] systemTypes; private IRSESystemType[] systemTypes;
private boolean readOnly = true; private boolean readOnly = true;
private boolean showNewPrompt = true; private boolean showNewPrompt = true;
private SystemSelectRemoteFolderAction browseAction = null; private SystemSelectRemoteFolderAction browseAction = null;
@ -99,7 +101,7 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
* @param parent Parent composite * @param parent Parent composite
* @param style SWT style flags for overall composite widget * @param style SWT style flags for overall composite widget
* @param historyKey A string identifying the key into the user preferences where this combo's history will be stored. * @param historyKey A string identifying the key into the user preferences where this combo's history will be stored.
* @see #setSystemType(String) * @see #setSystemType(IRSESystemType)
*/ */
public SystemQualifiedRemoteFolderCombo(Composite parent, int style, String historyKey) public SystemQualifiedRemoteFolderCombo(Composite parent, int style, String historyKey)
{ {
@ -129,30 +131,33 @@ public class SystemQualifiedRemoteFolderCombo extends Composite
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
//System.out.println("SYSTEM TYPES SET TO "+systemType+" IN SYSQUALRMTFLDRCMBO"); //System.out.println("SYSTEM TYPES SET TO "+systemType+" IN SYSQUALRMTFLDRCMBO");
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.widgets; package org.eclipse.rse.files.ui.widgets;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.widgets.SystemHostCombo; import org.eclipse.rse.ui.widgets.SystemHostCombo;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
@ -28,10 +29,12 @@ import org.eclipse.swt.widgets.Composite;
*/ */
public class SystemRemoteConnectionCombo extends SystemHostCombo { public class SystemRemoteConnectionCombo extends SystemHostCombo {
private static final String[] SYSTEM_TYPES = { IRSESystemType.SYSTEMTYPE_LINUX, private static final String[] SYSTEM_TYPE_IDS = {
IRSESystemType.SYSTEMTYPE_LOCAL, IRSESystemType.SYSTEMTYPE_LINUX_ID,
IRSESystemType.SYSTEMTYPE_UNIX, IRSESystemType.SYSTEMTYPE_LOCAL_ID,
IRSESystemType.SYSTEMTYPE_WINDOWS }; IRSESystemType.SYSTEMTYPE_UNIX_ID,
IRSESystemType.SYSTEMTYPE_WINDOWS_ID
};
/** /**
* Constructor when you want to set the style. * Constructor when you want to set the style.
@ -41,7 +44,7 @@ public class SystemRemoteConnectionCombo extends SystemHostCombo {
* @param showNewButton true if a New... button is to be included in this composite. * @param showNewButton true if a New... button is to be included in this composite.
*/ */
public SystemRemoteConnectionCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton) { public SystemRemoteConnectionCombo(Composite parent, int style, IHost defaultConnection, boolean showNewButton) {
super(parent, style, SYSTEM_TYPES, defaultConnection, showNewButton); super(parent, style, SystemWidgetHelpers.getValidSystemTypes(SYSTEM_TYPE_IDS), defaultConnection, showNewButton);
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.widgets; package org.eclipse.rse.files.ui.widgets;
@ -19,6 +19,7 @@ import java.util.Iterator;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import java.util.Vector; import java.util.Vector;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction; import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction;
@ -70,7 +71,7 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo
private Button browseButton = null; private Button browseButton = null;
//private RemoteFileSubSystem subsystem = null; //private RemoteFileSubSystem subsystem = null;
//private RemoteFileSubSystemConfiguration subsystemFactory = null; //private RemoteFileSubSystemConfiguration subsystemFactory = null;
private String[] systemTypes = null; private IRSESystemType[] systemTypes = null;
private IHost connection = null; private IHost connection = null;
private boolean showNewConnectionPrompt = true; private boolean showNewConnectionPrompt = true;
//private static final int DEFAULT_COMBO_WIDTH = 300; //private static final int DEFAULT_COMBO_WIDTH = 300;
@ -118,30 +119,34 @@ public class SystemRemoteFolderCombo extends Composite implements ISystemCombo
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.widgets; package org.eclipse.rse.files.ui.widgets;
@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardPage; import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.SystemAdapterHelpers; import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.SystemRemoteObjectMatcher; import org.eclipse.rse.core.SystemRemoteObjectMatcher;
@ -73,7 +74,7 @@ import org.eclipse.swt.widgets.Text;
* <ul> * <ul>
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setSystemConnection(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setSystemConnection(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setSystemTypes(String[])} * <li>{@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)}
* <li>{@link #setPreSelection(IRemoteFile)} * <li>{@link #setPreSelection(IRemoteFile)}
* <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)} * <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)}
@ -156,7 +157,7 @@ public class SystemSelectRemoteFileOrFolderForm
* @see #setSystemConnection(IHost) * @see #setSystemConnection(IHost)
* @see #setShowNewConnectionPrompt(boolean) * @see #setShowNewConnectionPrompt(boolean)
* @see #setSystemTypes(String[]) * @see #setSystemTypes(IRSESystemType[])
* @see #setSelectionTreeToolTipText(String) * @see #setSelectionTreeToolTipText(String)
*/ */
public SystemSelectRemoteFileOrFolderForm(ISystemMessageLine msgLine, Object caller, boolean fileMode) public SystemSelectRemoteFileOrFolderForm(ISystemMessageLine msgLine, Object caller, boolean fileMode)
@ -240,16 +241,21 @@ public class SystemSelectRemoteFileOrFolderForm
{ {
inputProvider.setShowNewConnectionPrompt(show); inputProvider.setShowNewConnectionPrompt(show);
} }
/** /**
* Restrict to certain system types * Set the system types to restrict what connections the user sees,
* @param systemTypes the system types to restrict what connections are shown and what types of connections * and what types of connections they can create.
* the user can create *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
inputProvider.setSystemTypes(systemTypes); inputProvider.setSystemTypes(systemTypes);
} }
/** /**
* Set the message shown as the text at the top of the form. Eg, "Select a file" * Set the message shown as the text at the top of the form. Eg, "Select a file"
*/ */

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2000, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2000, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.widgets; package org.eclipse.rse.files.ui.widgets;
@ -21,6 +21,7 @@ import java.util.Iterator;
import java.util.Map; import java.util.Map;
import org.eclipse.jface.viewers.ICheckStateListener; import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.internal.files.ui.actions.SystemSelectFileTypesAction; import org.eclipse.rse.internal.files.ui.actions.SystemSelectFileTypesAction;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemViewLabelAndContentProvider; import org.eclipse.rse.internal.ui.view.SystemViewLabelAndContentProvider;
@ -158,30 +159,33 @@ public class SystemSelectRemoteFilesForm extends Composite
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
dirCombo.setSystemTypes(systemTypes); dirCombo.setSystemTypes(systemTypes);
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions; package org.eclipse.rse.internal.files.ui.actions;
@ -64,7 +65,7 @@ public class SystemCombineAction extends SystemExtractToAction {
dialog.setMessage(FileResources.RESID_COMBINE_PROMPT); dialog.setMessage(FileResources.RESID_COMBINE_PROMPT);
dialog.setShowNewConnectionPrompt(true); dialog.setShowNewConnectionPrompt(true);
dialog.setShowPropertySheet(true, false); dialog.setShowPropertySheet(true, false);
dialog.setSystemTypes(systemTypes); dialog.setSystemTypes(getValidSystemTypes());
dialog.setPreSelection(firstSelection); dialog.setPreSelection(firstSelection);

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions; package org.eclipse.rse.internal.files.ui.actions;
@ -64,7 +65,7 @@ public class SystemConvertAction extends SystemExtractToAction {
dialog.setMessage(message); dialog.setMessage(message);
dialog.setShowNewConnectionPrompt(true); dialog.setShowNewConnectionPrompt(true);
dialog.setShowPropertySheet(true, false); dialog.setShowPropertySheet(true, false);
dialog.setSystemTypes(systemTypes); dialog.setSystemTypes(getValidSystemTypes());
dialog.setPreSelection(selection); dialog.setPreSelection(selection);

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions; package org.eclipse.rse.internal.files.ui.actions;
@ -21,15 +22,16 @@ import org.eclipse.rse.core.events.ISystemRemoteChangeEvents;
import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
import org.eclipse.rse.core.events.SystemResourceChangeEvent; import org.eclipse.rse.core.events.SystemResourceChangeEvent;
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.files.ui.dialogs.ExtractToDialog; import org.eclipse.rse.files.ui.dialogs.ExtractToDialog;
import org.eclipse.rse.internal.files.ui.FileResources; import org.eclipse.rse.internal.files.ui.FileResources;
import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem; import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.ui.ISystemIconConstants; import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemWidgetHelpers;
import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.rse.ui.validators.IValidatorRemoteSelection; import org.eclipse.rse.ui.validators.IValidatorRemoteSelection;
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter; import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
@ -44,14 +46,17 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemExtractToAction extends SystemExtractAction implements IValidatorRemoteSelection public class SystemExtractToAction extends SystemExtractAction implements IValidatorRemoteSelection
{ {
protected static final String[] systemTypes = { IRSESystemType.SYSTEMTYPE_LOCAL, private static final String[] validSystemTypesIds = {
IRSESystemType.SYSTEMTYPE_WINDOWS, IRSESystemType.SYSTEMTYPE_LOCAL_ID,
IRSESystemType.SYSTEMTYPE_LINUX, IRSESystemType.SYSTEMTYPE_WINDOWS_ID,
IRSESystemType.SYSTEMTYPE_POWER_LINUX, IRSESystemType.SYSTEMTYPE_LINUX_ID,
IRSESystemType.SYSTEMTYPE_UNIX, IRSESystemType.SYSTEMTYPE_POWER_LINUX_ID,
IRSESystemType.SYSTEMTYPE_AIX, IRSESystemType.SYSTEMTYPE_UNIX_ID,
IRSESystemType.SYSTEMTYPE_ISERIES IRSESystemType.SYSTEMTYPE_AIX_ID,
IRSESystemType.SYSTEMTYPE_ISERIES_ID
}; };
private static IRSESystemType[] validSystemTypes = null;
protected SystemMessage targetDescendsFromSrcMsg = null; protected SystemMessage targetDescendsFromSrcMsg = null;
protected int currentlyProcessingSelection = 0; protected int currentlyProcessingSelection = 0;
@ -70,6 +75,13 @@ public class SystemExtractToAction extends SystemExtractAction implements IValid
setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_EXTRACTTO_ID)); setImageDescriptor(RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_EXTRACTTO_ID));
} }
protected IRSESystemType[] getValidSystemTypes() {
if (validSystemTypes==null) {
validSystemTypes = SystemWidgetHelpers.getValidSystemTypes(validSystemTypesIds);
}
return validSystemTypes;
}
public void run() public void run()
{ {
for (int i = 0; i < _selected.size(); i++) for (int i = 0; i < _selected.size(); i++)
@ -86,7 +98,7 @@ public class SystemExtractToAction extends SystemExtractAction implements IValid
dialog.setMessage(message); dialog.setMessage(message);
dialog.setShowNewConnectionPrompt(true); dialog.setShowNewConnectionPrompt(true);
dialog.setShowPropertySheet(true, false); dialog.setShowPropertySheet(true, false);
dialog.setSystemTypes(systemTypes); dialog.setSystemTypes(getValidSystemTypes());
dialog.setPreSelection(selection); dialog.setPreSelection(selection);

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions; package org.eclipse.rse.internal.files.ui.actions;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog; import org.eclipse.rse.files.ui.dialogs.SystemRemoteFileDialog;
@ -38,7 +39,7 @@ import org.eclipse.swt.widgets.Shell;
* <ul> * <ul>
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setSystemType(String)} or {@link #setSystemTypes(String[])} * <li>{@link #setSystemType(IRSESystemType)} or {@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
* <li>{@link #setAutoExpandDepth(int)} * <li>{@link #setAutoExpandDepth(int)}
* <li>{@link #setShowPropertySheet(boolean)} * <li>{@link #setShowPropertySheet(boolean)}
@ -62,7 +63,7 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemRemoteFileSelectAction extends SystemBaseDialogAction public class SystemRemoteFileSelectAction extends SystemBaseDialogAction
{ {
private String[] systemTypes; private IRSESystemType[] systemTypes;
private IHost systemConnection, outputConnection; private IHost systemConnection, outputConnection;
private IRemoteFile preSelection; private IRemoteFile preSelection;
private String rootFolderAbsPath; private String rootFolderAbsPath;
@ -143,30 +144,33 @@ public class SystemRemoteFileSelectAction extends SystemBaseDialogAction
onlyConnection = false; onlyConnection = false;
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The name of the system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.propertypages; package org.eclipse.rse.internal.files.ui.propertypages;
@ -19,6 +20,7 @@ package org.eclipse.rse.internal.files.ui.propertypages;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
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.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
@ -47,7 +49,7 @@ public class FileServicesPropertyPage extends ServicesPropertyPage
IHost host = subSystem.getHost(); IHost host = subSystem.getHost();
_currentFactory = (IFileServiceSubSystemConfiguration)subSystem.getParentRemoteFileSubSystemConfiguration(); _currentFactory = (IFileServiceSubSystemConfiguration)subSystem.getParentRemoteFileSubSystemConfiguration();
IFileServiceSubSystemConfiguration[] factories = getFileServiceSubSystemFactories(host.getSystemType().getName()); IFileServiceSubSystemConfiguration[] factories = getFileServiceSubSystemConfigurations(host.getSystemType());
// create elements for each // create elements for each
@ -65,11 +67,11 @@ public class FileServicesPropertyPage extends ServicesPropertyPage
return elements; return elements;
} }
protected IFileServiceSubSystemConfiguration[] getFileServiceSubSystemFactories(String systemType) protected IFileServiceSubSystemConfiguration[] getFileServiceSubSystemConfigurations(IRSESystemType systemType)
{ {
List results = new ArrayList(); List results = new ArrayList();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType); ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < factories.length; i++) for (int i = 0; i < factories.length; i++)
{ {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.search; package org.eclipse.rse.internal.files.ui.search;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.files.ui.ISystemAddFileListener; import org.eclipse.rse.files.ui.ISystemAddFileListener;
import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction; import org.eclipse.rse.files.ui.actions.SystemSelectRemoteFolderAction;
@ -28,7 +29,7 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderAction { public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderAction {
private String[] systemTypes; private IRSESystemType[] systemTypes;
private IHost systemConnection, outputConnection; private IHost systemConnection, outputConnection;
private IHost rootFolderConnection; private IHost rootFolderConnection;
private IRemoteFile preSelection; private IRemoteFile preSelection;
@ -109,31 +110,36 @@ public class SystemSearchRemoteFolderAction extends SystemSelectRemoteFolderActi
systemConnection = conn; systemConnection = conn;
onlyConnection = false; onlyConnection = false;
} }
/** /**
* Set the system types to restrict what connections the user sees, and what types of * Set the system types to restrict what connections the user sees,
* connections they can create. * and what types of connections they can create.
* @param systemTypes An array of system type names
* *
* @see org.eclipse.rse.core.IRSESystemType * @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Convenience method to restrict to a single system type. * Convenience method to restrict to a single system type.
* Same as setSystemTypes(new String[] {systemType}) * Same as setSystemTypes(new IRSESystemType[] {systemType})
* *
* @param systemType The name of the system type to restrict to * @param systemType The system type to restrict to, or
* * <code>null</code> to allow all registered valid system types.
* @see org.eclipse.rse.core.IRSESystemType * A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
if (systemType == null) if (systemType == null)
setSystemTypes(null); setSystemTypes(null);
else else
setSystemTypes(new String[] {systemType}); setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**

View file

@ -1,11 +1,12 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Kushal Munir (IBM) - initial API and implementation. * Kushal Munir (IBM) - initial API and implementation.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.search; package org.eclipse.rse.internal.files.ui.search;
@ -13,6 +14,7 @@ package org.eclipse.rse.internal.files.ui.search;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.ui.view.SystemSelectRemoteObjectAPIProviderImpl; import org.eclipse.rse.internal.ui.view.SystemSelectRemoteObjectAPIProviderImpl;
@ -31,7 +33,7 @@ public class SystemSearchRemoteObjectAPIProvider extends SystemSelectRemoteObjec
* @param showNewConnectionPrompt whether to show new connection prompt. * @param showNewConnectionPrompt whether to show new connection prompt.
* @param systemTypes the system types to restrict to. * @param systemTypes the system types to restrict to.
*/ */
public SystemSearchRemoteObjectAPIProvider(String factoryId, String factoryCategory, boolean showNewConnectionPrompt, String[] systemTypes) { public SystemSearchRemoteObjectAPIProvider(String factoryId, String factoryCategory, boolean showNewConnectionPrompt, IRSESystemType[] systemTypes) {
super(factoryId, factoryCategory, showNewConnectionPrompt, systemTypes); super(factoryId, factoryCategory, showNewConnectionPrompt, systemTypes);
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.processes.ui.propertypages; package org.eclipse.rse.internal.processes.ui.propertypages;
@ -19,6 +20,7 @@ package org.eclipse.rse.internal.processes.ui.propertypages;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
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.subsystems.IServiceSubSystemConfiguration; import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
@ -45,7 +47,7 @@ public class ProcessServicesPropertyPage extends ServicesPropertyPage
IHost host = subSystem.getHost(); IHost host = subSystem.getHost();
_currentFactory = (IProcessServiceSubSystemConfiguration)subSystem.getParentRemoteProcessSubSystemConfiguration(); _currentFactory = (IProcessServiceSubSystemConfiguration)subSystem.getParentRemoteProcessSubSystemConfiguration();
IProcessServiceSubSystemConfiguration[] factories = getProcessServiceSubSystemFactories(host.getSystemType().getName()); IProcessServiceSubSystemConfiguration[] factories = getProcessServiceSubSystemConfigurations(host.getSystemType());
// create elements for each // create elements for each
@ -63,11 +65,11 @@ public class ProcessServicesPropertyPage extends ServicesPropertyPage
return elements; return elements;
} }
protected IProcessServiceSubSystemConfiguration[] getProcessServiceSubSystemFactories(String systemType) protected IProcessServiceSubSystemConfiguration[] getProcessServiceSubSystemConfigurations(IRSESystemType systemType)
{ {
List results = new ArrayList(); List results = new ArrayList();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType); ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < factories.length; i++) for (int i = 0; i < factories.length; i++)
{ {

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.shells.ui.propertypages; package org.eclipse.rse.internal.shells.ui.propertypages;
@ -19,6 +20,7 @@ package org.eclipse.rse.internal.shells.ui.propertypages;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.DummyHost; import org.eclipse.rse.core.model.DummyHost;
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;
@ -52,14 +54,14 @@ public class ShellServicesPropertyPage extends ServicesPropertyPage
if (subSystem == null || _currentFactory != null) if (subSystem == null || _currentFactory != null)
{ {
// create dummy host // create dummy host
factories = getShellServiceSubSystemFactories(getSystemType().getName()); factories = getShellServiceSubSystemConfigurations(getSystemType());
host = new DummyHost(getHostname(), getSystemType()); host = new DummyHost(getHostname(), getSystemType());
} }
else else
{ {
host = subSystem.getHost(); host = subSystem.getHost();
_currentFactory = (IShellServiceSubSystemConfiguration)subSystem.getParentRemoteCmdSubSystemConfiguration(); _currentFactory = (IShellServiceSubSystemConfiguration)subSystem.getParentRemoteCmdSubSystemConfiguration();
factories = getShellServiceSubSystemFactories(host.getSystemType().getName()); factories = getShellServiceSubSystemConfigurations(host.getSystemType());
} }
// create elements for each // create elements for each
@ -78,11 +80,11 @@ public class ShellServicesPropertyPage extends ServicesPropertyPage
} }
protected IShellServiceSubSystemConfiguration[] getShellServiceSubSystemFactories(String systemType) protected IShellServiceSubSystemConfiguration[] getShellServiceSubSystemConfigurations(IRSESystemType systemType)
{ {
List results = new ArrayList(); List results = new ArrayList();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType); ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < factories.length; i++) for (int i = 0; i < factories.length; i++)
{ {

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name * Martin Oberhuber (Wind River) - Fix 154874 - handle files with space or $ in the name
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.shells.ui; package org.eclipse.rse.shells.ui;
@ -140,7 +141,7 @@ public class RemoteCommandHelpers
showInView(defaultShell, isCompile, cmdString); showInView(defaultShell, isCompile, cmdString);
IRemoteFileSubSystemConfiguration fileSSF = RemoteFileUtility.getFileSubSystemConfiguration(cmdSubSystem.getHost().getSystemType().getName()); IRemoteFileSubSystemConfiguration fileSSF = RemoteFileUtility.getFileSubSystemConfiguration(cmdSubSystem.getHost().getSystemType());
IRemoteFile pwd = ((RemoteCommandShell)defaultShell).getWorkingDirectory(); IRemoteFile pwd = ((RemoteCommandShell)defaultShell).getWorkingDirectory();
if (pwd == null || !pwd.getAbsolutePath().equals(path)) if (pwd == null || !pwd.getAbsolutePath().equals(path))
{ {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.subsystems.files.core.model; package org.eclipse.rse.subsystems.files.core.model;
@ -19,6 +19,7 @@ package org.eclipse.rse.subsystems.files.core.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
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.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
@ -63,10 +64,10 @@ public class RemoteFileUtility
return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]); return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]);
} }
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(String systemType) public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
{ {
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType); ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < sses.length; i++) for (int i = 0; i < sses.length; i++)
{ {
if (sses[i] instanceof IRemoteFileSubSystemConfiguration) if (sses[i] instanceof IRemoteFileSubSystemConfiguration)

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.actions; package org.eclipse.rse.internal.ui.actions;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.actions.SystemBaseDialogAction; import org.eclipse.rse.ui.actions.SystemBaseDialogAction;
@ -35,8 +36,8 @@ public class SystemSelectConnectionAction extends SystemBaseDialogAction
private boolean showPropertySheet; private boolean showPropertySheet;
private String message; private String message;
private boolean showNewConnectionPrompt = true; private boolean showNewConnectionPrompt = true;
private String[] systemTypes; private IRSESystemType[] systemTypes;
private String systemType; private IRSESystemType systemType;
private IHost defaultConn; private IHost defaultConn;
private Object result; private Object result;
@ -56,22 +57,20 @@ public class SystemSelectConnectionAction extends SystemBaseDialogAction
this.defaultConn = conn; this.defaultConn = conn;
} }
/** /**
* Restrict to certain system types * Restrict to certain system types.
* @param systemTypes the system types to restrict what connections are shown and what types of connections * @param systemTypes the system types to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Restrict to a certain system type * Restrict to a certain system type.
* @param systemType the system type to restrict what connections are shown and what types of connections * @param systemType the system type to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
this.systemType = systemType; this.systemType = systemType;
} }

View file

@ -13,9 +13,11 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.dialogs; package org.eclipse.rse.internal.ui.dialogs;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.ISystemConnectionFormCaller; import org.eclipse.rse.ui.ISystemConnectionFormCaller;
@ -123,7 +125,7 @@ public class SystemUpdateConnectionDialog extends SystemPromptDialog implements
{ {
IHost conn = (IHost)getInputObject(); IHost conn = (IHost)getInputObject();
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
sr.updateHost( conn,conn.getSystemType().getName(),form.getConnectionName(),form.getHostName(), sr.updateHost( conn,conn.getSystemType(), form.getConnectionName(),form.getHostName(),
form.getConnectionDescription(), form.getDefaultUserId(), form.getConnectionDescription(), form.getDefaultUserId(),
form.getUserIdLocation() ); form.getUserIdLocation() );
} }
@ -136,7 +138,7 @@ public class SystemUpdateConnectionDialog extends SystemPromptDialog implements
/** /**
* Event: the user has selected a system type. * Event: the user has selected a system type.
*/ */
public void systemTypeSelected(String systemType, boolean duringInitialization) public void systemTypeSelected(IRSESystemType systemType, boolean duringInitialization)
{ {
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.comm.SystemKeystoreProviderManager; import org.eclipse.rse.core.comm.SystemKeystoreProviderManager;
import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
@ -120,7 +121,7 @@ public class ServerConnectionSecurityPropertyPage extends SystemBasePropertyPage
{ {
} }
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.IServerLauncherProperties; import org.eclipse.rse.core.subsystems.IServerLauncherProperties;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
@ -39,7 +40,7 @@ public class ServerLauncherPropertyPage extends SystemBasePropertyPage implement
{ {
private IServerLauncherForm _form; private IServerLauncherForm _form;
protected String _systemType; protected IRSESystemType _systemType;
private IServerLauncherProperties sl; private IServerLauncherProperties sl;
private ISubSystemConfiguration _factory; private ISubSystemConfiguration _factory;
@ -180,7 +181,7 @@ public class ServerLauncherPropertyPage extends SystemBasePropertyPage implement
return getErrorMessage(); return getErrorMessage();
} }
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
_systemType = systemType; _systemType = systemType;
} }

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
@ -90,7 +91,7 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
{ {
IHost conn = (IHost)getElement(); IHost conn = (IHost)getElement();
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
sr.updateHost( conn,conn.getSystemType().getName(),form.getConnectionName(),form.getHostName(), sr.updateHost( conn, conn.getSystemType(), form.getConnectionName(),form.getHostName(),
form.getConnectionDescription(), form.getDefaultUserId(), form.getConnectionDescription(), form.getDefaultUserId(),
form.getUserIdLocation() ); form.getUserIdLocation() );
@ -130,7 +131,7 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
} }
// check that everything was disconnedted okay and this is not the local connection // check that everything was disconnedted okay and this is not the local connection
if(sr.isAnySubSystemConnected(conn) && !IRSESystemType.SYSTEMTYPE_LOCAL.equals(conn.getSystemType().getName())) if(sr.isAnySubSystemConnected(conn) && !IRSESystemType.SYSTEMTYPE_LOCAL_ID.equals(conn.getSystemType().getId()))
{ {
// backout changes, likely because user cancelled the disconnect // backout changes, likely because user cancelled the disconnect
sr.setHostOffline(conn, false); sr.setHostOffline(conn, false);
@ -161,7 +162,7 @@ public class SystemConnectionPropertyPage extends SystemBasePropertyPage
/** /**
* Event: the user has selected a system type. * Event: the user has selected a system type.
*/ */
public void systemTypeSelected(String systemType, boolean duringInitialization) public void systemTypeSelected(IRSESystemType systemType, boolean duringInitialization)
{ {
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
@ -19,6 +20,7 @@ import java.util.ResourceBundle;
import java.util.Vector; import java.util.Vector;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.SystemAdapterHelpers; import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
@ -391,7 +393,7 @@ public class SystemConnectionSubSystemsPropertyPage extends SystemBasePropertyPa
/** /**
* Event: the user has selected a system type. * Event: the user has selected a system type.
*/ */
public void systemTypeSelected(String systemType, boolean duringInitialization) public void systemTypeSelected(IRSESystemType systemType, boolean duringInitialization)
{ {
} }
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,10 +11,11 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.ui.SystemPropertyResources; import org.eclipse.rse.internal.ui.SystemPropertyResources;
@ -114,20 +115,21 @@ public class SystemTeamViewSubSystemConfigurationPropertyPage extends SystemBase
labelId.setText(proxy.getId()); labelId.setText(proxy.getId());
labelVendor.setText(proxy.getVendor()); labelVendor.setText(proxy.getVendor());
String systypes = ""; //$NON-NLS-1$ String systypes = ""; //$NON-NLS-1$
String[] types = ssf.getSystemTypes();
if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes()) if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes())
{ {
systypes = SystemResources.TERM_ALL; systypes = SystemResources.TERM_ALL;
} }
else else
{ {
IRSESystemType[] types = ssf.getSystemTypes();
StringBuffer buf = new StringBuffer();
for (int idx=0; idx<types.length; idx++) for (int idx=0; idx<types.length; idx++)
{ {
if (idx==0) if (idx>0)
systypes += types[idx]; buf.append(", "); //$NON-NLS-1$
else buf.append(types[idx].getLabel());
systypes += ", " + types[idx]; //$NON-NLS-1$
} }
systypes = buf.toString();
} }
labelTypes.setText(systypes); labelTypes.setText(systypes);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -26,6 +26,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.WizardPage; import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.SystemAdapterHelpers; import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.filters.ISystemFilterReference;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
@ -158,12 +159,12 @@ public class SystemResourceSelectionForm implements ISelectionChangedListener
} }
else else
{ {
String[] systemTypes = _inputProvider.getSystemTypes(); IRSESystemType[] systemTypes = _inputProvider.getSystemTypes();
String category = _inputProvider.getCategory(); String category = _inputProvider.getCategory();
if (systemTypes != null) if (systemTypes != null)
{ {
_connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, _inputProvider.getSystemTypes(), _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection()); _connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, systemTypes, _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection());
} }
else if (category != null) else if (category != null)
{ {
@ -171,7 +172,10 @@ public class SystemResourceSelectionForm implements ISelectionChangedListener
} }
else else
{ {
_connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL, "*", _inputProvider.getSystemConnection(), _inputProvider.allowNewConnection()); //$NON-NLS-1$ _connectionCombo = new SystemHostCombo(composite_prompts, SWT.NULL,
SystemWidgetHelpers.getValidSystemTypes(null),
_inputProvider.getSystemConnection(),
_inputProvider.allowNewConnection());
} }
_connectionCombo.addSelectionListener(new SelectionAdapter() _connectionCombo.addSelectionListener(new SelectionAdapter()

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2004, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2004, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,10 +11,11 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
import org.eclipse.rse.core.IRSESystemType;
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.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
@ -26,7 +27,7 @@ public abstract class SystemResourceSelectionInputProvider extends SystemAbstrac
private IHost _connection; private IHost _connection;
private boolean _onlyConnection = false; private boolean _onlyConnection = false;
private boolean _allowNew = true; private boolean _allowNew = true;
private String[] _systemTypes; private IRSESystemType[] _systemTypes;
private String _category = null; private String _category = null;
public SystemResourceSelectionInputProvider(IHost connection) public SystemResourceSelectionInputProvider(IHost connection)
@ -69,12 +70,12 @@ public abstract class SystemResourceSelectionInputProvider extends SystemAbstrac
_onlyConnection = onlyConnection; _onlyConnection = onlyConnection;
} }
public String[] getSystemTypes() public IRSESystemType[] getSystemTypes()
{ {
return _systemTypes; return _systemTypes;
} }
public void setSystemTypes(String[] types) public void setSystemTypes(IRSESystemType[] types)
{ {
_systemTypes = types; _systemTypes = types;
} }

View file

@ -12,11 +12,13 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.SystemAdapterHelpers; import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.filters.ISystemFilter; import org.eclipse.rse.core.filters.ISystemFilter;
@ -61,7 +63,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
protected String subsystemFactoryId; protected String subsystemFactoryId;
protected String subsystemFactoryCategory; protected String subsystemFactoryCategory;
protected String filterSuffix; protected String filterSuffix;
protected String[] systemTypes; protected IRSESystemType[] systemTypes;
protected String preSelectFilterChild; protected String preSelectFilterChild;
protected Object preSelectFilterChildObject; protected Object preSelectFilterChildObject;
protected ISystemFilter[] quickFilters; protected ISystemFilter[] quickFilters;
@ -102,7 +104,7 @@ public class SystemSelectRemoteObjectAPIProviderImpl
* @param systemTypes Optional list of system types to restrict the "New Connection" wizard to. Pass null for no restrictions * @param systemTypes Optional list of system types to restrict the "New Connection" wizard to. Pass null for no restrictions
*/ */
public SystemSelectRemoteObjectAPIProviderImpl(String factoryId, String factoryCategory, public SystemSelectRemoteObjectAPIProviderImpl(String factoryId, String factoryCategory,
boolean showNewConnectionPrompt, String[] systemTypes) boolean showNewConnectionPrompt, IRSESystemType[] systemTypes)
{ {
super(); super();
this.subsystemFactoryId = factoryId; this.subsystemFactoryId = factoryId;
@ -130,11 +132,16 @@ public class SystemSelectRemoteObjectAPIProviderImpl
} }
/** /**
* Specify system types to restrict what types of connections the user can create, and see. * Specify system types to restrict what types of connections
* the user can create, and see.
* This will override subsystemFactoryId,if that has been set! * This will override subsystemFactoryId,if that has been set!
* @see org.eclipse.rse.core.IRSESystemType *
* @param systemTypes An array of system types, or
* <code>null</code> to allow all registered valid system types.
* A system type is valid if at least one subsystem configuration
* is registered against it.
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }

View file

@ -18,6 +18,7 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -31,6 +32,7 @@ import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.RSEPreferencesManager;
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;
@ -572,7 +574,7 @@ public class SystemViewConnectionAdapter
{ {
String localUserId = conn.getLocalDefaultUserId(); String localUserId = conn.getLocalDefaultUserId();
data.setLocalValue(localUserId); data.setLocalValue(localUserId);
String parentUserId = RSEPreferencesManager.getUserId(conn.getSystemType().getName()); String parentUserId = RSEPreferencesManager.getUserId(conn.getSystemType().getId());
data.setInheritedValue(parentUserId); data.setInheritedValue(parentUserId);
data.setIsLocal((localUserId!=null)&&(localUserId.length()>0)); data.setIsLocal((localUserId!=null)&&(localUserId.length()>0));
//data.printDetails(); //data.printDetails();
@ -635,12 +637,12 @@ public class SystemViewConnectionAdapter
} }
else if (property.equals(ISystemPropertyConstants.P_HOSTNAME)) else if (property.equals(ISystemPropertyConstants.P_HOSTNAME))
{ {
sr.updateHost(conn, conn.getSystemType().getName(), conn.getAliasName(), original_hostName, sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), 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(conn, conn.getSystemType().getName(), conn.getAliasName(), conn.getHostName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
original_description, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); original_description, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
} }
} }
@ -654,7 +656,7 @@ 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.getTheSystemRegistry(); ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
sr.updateHost(conn, conn.getSystemType().getName(), conn.getAliasName(), conn.getHostName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
conn.getDescription(), userId, whereToUpdate); conn.getDescription(), userId, whereToUpdate);
} }
@ -681,7 +683,7 @@ public class SystemViewConnectionAdapter
// defect 57739 // defect 57739
if (!((String)value).equalsIgnoreCase(conn.getHostName())) if (!((String)value).equalsIgnoreCase(conn.getHostName()))
{ {
sr.updateHost(conn, conn.getSystemType().getName(), conn.getAliasName(), (String)value, sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), (String)value,
conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); conn.getDescription(), conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_hostName = true; changed_hostName = true;
} }
@ -692,7 +694,7 @@ public class SystemViewConnectionAdapter
// defect 57739 // defect 57739
if (!((String)value).equalsIgnoreCase(conn.getDescription())) if (!((String)value).equalsIgnoreCase(conn.getDescription()))
{ {
sr.updateHost(conn, conn.getSystemType().getName(), conn.getAliasName(), conn.getHostName(), sr.updateHost(conn, conn.getSystemType(), conn.getAliasName(), conn.getHostName(),
(String)value, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET); (String)value, conn.getDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_NOTSET);
changed_description = true; changed_description = true;
} }
@ -709,7 +711,7 @@ public class SystemViewConnectionAdapter
if (element instanceof IHost) if (element instanceof IHost)
{ {
IHost sysCon = (IHost) element; IHost sysCon = (IHost) element;
if (sysCon.getSystemType().getName().equals(IRSESystemType.SYSTEMTYPE_LOCAL)) return existsMoreThanOneLocalConnection(); if (sysCon.getSystemType().getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID)) return existsMoreThanOneLocalConnection();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
return !sr.isAnySubSystemConnected((IHost)element); return !sr.isAnySubSystemConnected((IHost)element);
} }
@ -718,7 +720,8 @@ public class SystemViewConnectionAdapter
protected boolean existsMoreThanOneLocalConnection() protected boolean existsMoreThanOneLocalConnection()
{ {
IHost[] localCons = RSEUIPlugin.getTheSystemRegistry().getHostsBySystemType(IRSESystemType.SYSTEMTYPE_LOCAL); IRSESystemType localType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
IHost[] localCons = RSEUIPlugin.getTheSystemRegistry().getHostsBySystemType(localType);
return localCons.length > 1; return localCons.length > 1;
} }

View file

@ -12,10 +12,12 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.internal.model.SystemNewConnectionPromptObject; import org.eclipse.rse.ui.internal.model.SystemNewConnectionPromptObject;
@ -32,7 +34,7 @@ public class SystemViewConnectionSelectionInputProvider extends SystemAbstractAP
private boolean showNew = true; private boolean showNew = true;
private SystemNewConnectionPromptObject newConnPrompt; private SystemNewConnectionPromptObject newConnPrompt;
private Object[] newConnPromptArray; private Object[] newConnPromptArray;
private String[] systemTypes; private IRSESystemType[] systemTypes;
/** /**
* Constructor * Constructor
@ -60,14 +62,14 @@ public class SystemViewConnectionSelectionInputProvider extends SystemAbstractAP
/** /**
* Set the system types to restrict by * Set the system types to restrict by
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Return the system types we are restricted by * Return the system types we are restricted by
*/ */
public String[] getSystemTypes() public IRSESystemType[] getSystemTypes()
{ {
return systemTypes; return systemTypes;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view.team; package org.eclipse.rse.internal.ui.view.team;
@ -19,6 +19,7 @@ package org.eclipse.rse.internal.ui.view.team;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter; import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter;
@ -95,24 +96,24 @@ public class SystemTeamViewSubSystemConfigurationNode implements IAdaptable
{ {
if (name == null) if (name == null)
{ {
name = ""; //$NON-NLS-1$ StringBuffer buf = new StringBuffer();
String[] types = ssf.getSystemTypes(); buf.append(ssf.getName());
buf.append(" ("); //$NON-NLS-1$
if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes()) if (ssf.getSubSystemConfigurationProxy().supportsAllSystemTypes())
{ {
name = SystemResources.TERM_ALL; buf.append(SystemResources.TERM_ALL);
} }
else else
{ {
IRSESystemType[] types = ssf.getSystemTypes();
for (int idx=0; idx<types.length; idx++) for (int idx=0; idx<types.length; idx++)
{ {
if (idx==0) if (idx>0) buf.append(", "); //$NON-NLS-1$
name += types[idx]; buf.append(types[idx].getLabel());
else
name += ", " + types[idx]; //$NON-NLS-1$
} }
} }
name = ssf.getName() + " ("+name+")"; //$NON-NLS-1$ //$NON-NLS-2$ buf.append(")"); //$NON-NLS-1$
//name = ssf.getName() + ": "+name; name = buf.toString();
} }
return name; return name;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,10 +11,11 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
@ -28,7 +29,7 @@ public interface ISystemConnectionFormCaller {
* @param systemType the type of system selected * @param systemType the type of system selected
* @param duringInitialization true if this is being set at page initialization time versus selected by the user * @param duringInitialization true if this is being set at page initialization time versus selected by the user
*/ */
public void systemTypeSelected(String systemType, boolean duringInitialization); public void systemTypeSelected(IRSESystemType systemType, boolean duringInitialization);
/** /**
* Return the shell hosting this form * Return the shell hosting this form

View file

@ -17,12 +17,15 @@
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* David Dykstal (IBM) - 180562: remove implementation of IRSEUserIdConstants * David Dykstal (IBM) - 180562: remove implementation of IRSEUserIdConstants
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.net.InetAddress; import java.net.InetAddress;
import java.util.Arrays;
import java.util.List;
import java.util.Vector; import java.util.Vector;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
@ -34,7 +37,6 @@ import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage; import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.RSEPreferencesManager;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
@ -81,7 +83,9 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
public static final boolean CREATE_MODE = false; public static final boolean CREATE_MODE = false;
public static final boolean UPDATE_MODE = true; public static final boolean UPDATE_MODE = true;
public static String lastSystemType = null; public static IRSESystemType lastSystemType = null;
protected IRSESystemType defaultSystemType;
protected IRSESystemType[] validSystemTypes;
// GUI widgets // GUI widgets
protected Label labelType, labelConnectionName, labelHostName, labelUserId, labelDescription, labelProfile; protected Label labelType, labelConnectionName, labelHostName, labelUserId, labelDescription, labelProfile;
@ -104,8 +108,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
// other inputs // other inputs
protected ISystemMessageLine msgLine; protected ISystemMessageLine msgLine;
protected ISystemConnectionFormCaller caller; protected ISystemConnectionFormCaller caller;
protected String[] restrictSystemTypesTo; protected String defaultConnectionName, defaultHostName;
protected String defaultSystemType, defaultConnectionName, defaultHostName;
protected String defaultUserId, defaultDescription, defaultProfile; // update mode initial values protected String defaultUserId, defaultDescription, defaultProfile; // update mode initial values
protected String[] defaultProfileNames; protected String[] defaultProfileNames;
protected boolean defaultWorkOffline; protected boolean defaultWorkOffline;
@ -227,28 +230,56 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
} }
/** /**
* Call this to restrict the system type that the user is allowed to choose * Call this to restrict the system type that the user is allowed to choose.
* Must be called before the widgets are created in
* {@link #createContents(Composite, boolean, String)}.
*
* @param systemType the only IRSESystemType allowed, or
* <code>null</code> to show all allowed system types.
*/ */
public void restrictSystemType(String systemType) { public void restrictSystemType(IRSESystemType systemType) {
if (systemType.equals("*")) //$NON-NLS-1$ if (systemType==null) {
return; restrictSystemTypes(null);
this.restrictSystemTypesTo = new String[1]; } else {
this.restrictSystemTypesTo[0] = systemType; IRSESystemType[] types = new IRSESystemType[] { systemType };
if (defaultSystemType == null) restrictSystemTypes (types);
defaultSystemType = systemType; }
} }
/** /**
* Call this to restrict the system types that the user is allowed to choose * Call this to restrict the system types that the user is allowed to choose.
*
* @param systemTypes the list of allowed system types, or
* <code>null</code> to not restrict the allowed system types.
*/ */
public void restrictSystemTypes(String[] systemTypes) { public void restrictSystemTypes(IRSESystemType[] systemTypes) {
if (systemTypes == null) //Remember the old selection before changing the data
return; IRSESystemType oldSelection = getSystemType();
else if ((systemTypes.length == 1) && (systemTypes[0].equals("*"))) //$NON-NLS-1$
return; //Update the known list of valid system types
this.restrictSystemTypesTo = systemTypes; if (systemTypes == null) {
if (defaultSystemType == null) validSystemTypes = SystemWidgetHelpers.getValidSystemTypes(null);
defaultSystemType = systemTypes[0]; } else {
validSystemTypes = new IRSESystemType[systemTypes.length];
System.arraycopy(systemTypes, 0, validSystemTypes, 0, systemTypes.length);
SystemWidgetHelpers.sortSystemTypesByLabel(validSystemTypes);
}
//Restore the default system type based on the new list
List systemTypesAsList = Arrays.asList(validSystemTypes);
if (defaultSystemType == null || !systemTypesAsList.contains(defaultSystemType)) {
defaultSystemType = validSystemTypes[0];
}
//Set items in Combo and restore the previous selection
if (textSystemType!=null) {
textSystemType.setItems(SystemWidgetHelpers.getSystemTypeLabels(validSystemTypes));
if (oldSelection!=null && Arrays.asList(validSystemTypes).contains(oldSelection)) {
textSystemType.select(systemTypesAsList.indexOf(oldSelection));
} else {
textSystemType.select(0);
}
}
} }
/** /**
@ -271,7 +302,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
*/ */
public void initializeInputFields(IHost conn, boolean updateMode) { public void initializeInputFields(IHost conn, boolean updateMode) {
this.updateMode = updateMode; this.updateMode = updateMode;
defaultSystemType = conn.getSystemType().getName(); defaultSystemType = conn.getSystemType();
defaultConnectionName = conn.getAliasName(); defaultConnectionName = conn.getAliasName();
defaultHostName = conn.getHostName(); defaultHostName = conn.getHostName();
defaultUserId = conn.getLocalDefaultUserId(); defaultUserId = conn.getLocalDefaultUserId();
@ -468,20 +499,21 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
if (!updateMode) { if (!updateMode) {
return false; return false;
} }
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(defaultSystemType.getAdapter(IRSESystemType.class));
IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(defaultSystemType); return sysTypeAdapter.isEnableOffline(defaultSystemType);
RSESystemTypeAdapter sysTypeAdapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class));
return sysTypeAdapter.isEnableOffline(sysType);
} }
/** /**
* Return user-entered System Type. * Return user-entered System Type.
* Call this after finish ends successfully. * Call this after finish ends successfully.
*/ */
public String getSystemType() { public IRSESystemType getSystemType() {
if (textSystemType != null) if (textSystemType != null) {
return textSystemType.getText().trim(); int idx = textSystemType.getSelectionIndex();
else if (idx >= 0) {
return validSystemTypes[idx];
}
}
return defaultSystemType; return defaultSystemType;
} }
@ -603,7 +635,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
SystemWidgetHelpers.createLabel(composite_prompts, " ", 2); // filler //$NON-NLS-1$ SystemWidgetHelpers.createLabel(composite_prompts, " ", 2); // filler //$NON-NLS-1$
// SYSTEMTYPE PROMPT IN UPDATE MODE OR RESTRICTED MODE // SYSTEMTYPE PROMPT IN UPDATE MODE OR RESTRICTED MODE
if (updateMode || ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length == 1))) { if (updateMode || ((validSystemTypes != null) && (validSystemTypes.length == 1))) {
if (updateMode) { if (updateMode) {
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL); temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp); labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
@ -624,9 +656,9 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
if (!updateMode && (defaultSystemType == null)) { if (!updateMode && (defaultSystemType == null)) {
defaultSystemType = lastSystemType; defaultSystemType = lastSystemType;
if (defaultSystemType == null) {
if ((defaultSystemType == null) || (defaultSystemType.length() == 0)) defaultSystemType = validSystemTypes[0];
defaultSystemType = textSystemType.getItem(0); }
} }
textHostName = SystemWidgetHelpers.createHostNameCombo(composite_prompts, null, defaultSystemType); textHostName = SystemWidgetHelpers.createHostNameCombo(composite_prompts, null, defaultSystemType);
@ -646,7 +678,12 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL); temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp); labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
textSystemType = SystemWidgetHelpers.createSystemTypeCombo(composite_prompts, null, restrictSystemTypesTo); if (validSystemTypes==null) {
validSystemTypes = SystemWidgetHelpers.getValidSystemTypes(null);
} else {
SystemWidgetHelpers.sortSystemTypesByLabel(validSystemTypes);
}
textSystemType = SystemWidgetHelpers.createSystemTypeCombo(composite_prompts, null, validSystemTypes);
textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$ SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$
} }
@ -725,10 +762,10 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
verifyHostNameCB.addSelectionListener(this); verifyHostNameCB.addSelectionListener(this);
} }
if ((textSystemType != null) && (textSystemType.getText() != null)) if ((textSystemType != null) && (textSystemType.getSelectionIndex()>=0))
caller.systemTypeSelected(textSystemType.getText(), true); caller.systemTypeSelected(validSystemTypes[textSystemType.getSelectionIndex()], true);
else if ((restrictSystemTypesTo != null) && (restrictSystemTypesTo.length == 1)) else if ((validSystemTypes != null) && (validSystemTypes.length == 1))
caller.systemTypeSelected(restrictSystemTypesTo[0], true); caller.systemTypeSelected(validSystemTypes[0], true);
if (textUserId == null) if (textUserId == null)
userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET; userIdLocation = IRSEUserIdConstants.USERID_LOCATION_NOTSET;
@ -774,7 +811,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
{ {
String currHostName = textHostName.getText().trim(); String currHostName = textHostName.getText().trim();
boolean hostNameChanged = !currHostName.equals(originalHostName); boolean hostNameChanged = !currHostName.equals(originalHostName);
String currSystemType = textSystemType.getText().trim(); IRSESystemType currSystemType = getSystemType();
textHostName.setItems(RSEUIPlugin.getTheSystemRegistry().getHostNames(currSystemType)); textHostName.setItems(RSEUIPlugin.getTheSystemRegistry().getHostNames(currSystemType));
if (hostNameChanged) { if (hostNameChanged) {
textHostName.setText(currHostName); textHostName.setText(currHostName);
@ -893,14 +930,14 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
// ----------- // -----------
// ...output-only: // ...output-only:
if ((textSystemTypeReadOnly != null) || singleTypeMode) { if ((textSystemTypeReadOnly != null) || singleTypeMode) {
if (restrictSystemTypesTo != null) { if (validSystemTypes != null) {
if (textSystemTypeReadOnly != null) if (textSystemTypeReadOnly != null)
textSystemTypeReadOnly.setText(restrictSystemTypesTo[0]); textSystemTypeReadOnly.setText(validSystemTypes[0].getLabel());
if (defaultSystemType == null) if (defaultSystemType == null)
defaultSystemType = restrictSystemTypesTo[0]; defaultSystemType = validSystemTypes[0];
} else if (defaultSystemType != null) { } else if (defaultSystemType != null) {
if (textSystemTypeReadOnly != null) if (textSystemTypeReadOnly != null)
textSystemTypeReadOnly.setText(defaultSystemType); textSystemTypeReadOnly.setText(defaultSystemType.getLabel());
} }
} }
// ...selectable: // ...selectable:
@ -909,13 +946,16 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
defaultSystemType = lastSystemType; defaultSystemType = lastSystemType;
} }
if (defaultSystemType != null) { if (defaultSystemType != null) {
int selIdx = textSystemType.indexOf(defaultSystemType); int selIdx = Arrays.asList(validSystemTypes).indexOf(defaultSystemType);
if (selIdx >= 0) if (selIdx >= 0) {
textSystemType.select(selIdx); textSystemType.select(selIdx);
} else { } else {
textSystemType.select(0); textSystemType.select(0);
defaultSystemType = textSystemType.getText();
} }
} else {
textSystemType.select(0);
}
defaultSystemType = getSystemType();
} }
// --------------------------------------------------- // ---------------------------------------------------
@ -961,11 +1001,11 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
* Initialize userId values. * Initialize userId values.
* We have to reset after user changes the system type * We have to reset after user changes the system type
*/ */
private void initializeUserIdField(String systemType, String currentUserId) { private void initializeUserIdField(IRSESystemType systemType, String currentUserId) {
// --------------- // ---------------
// default user id // default user id
// --------------- // ---------------
String parentUserId = RSEPreferencesManager.getUserId(systemType); String parentUserId = RSEPreferencesManager.getUserId(systemType.getId());
if (textUserId != null) { if (textUserId != null) {
textUserId.setInheritedText(parentUserId); textUserId.setInheritedText(parentUserId);
boolean allowEditingOfInherited = ((parentUserId == null) || (parentUserId.length() == 0)); boolean allowEditingOfInherited = ((parentUserId == null) || (parentUserId.length() == 0));
@ -1101,7 +1141,7 @@ public class SystemConnectionForm implements Listener, SelectionListener, Runnab
public void setPageComplete() { public void setPageComplete() {
boolean complete = isPageComplete(); boolean complete = isPageComplete();
if (complete && (textSystemType != null)) if (complete && (textSystemType != null))
lastSystemType = textSystemType.getText().trim(); lastSystemType = getSystemType();
if (callerInstanceOfWizardPage) { if (callerInstanceOfWizardPage) {
((WizardPage)caller).setPageComplete(complete); ((WizardPage)caller).setPageComplete(complete);
} else if (callerInstanceOfSystemPromptDialog) { } else if (callerInstanceOfSystemPromptDialog) {

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -12,11 +12,13 @@
* *
* Contributors: * Contributors:
* Javier Montalvo Orús (Symbian) - Bug 149151: New Connection first page should use a Listbox for systemtype * Javier Montalvo Orús (Symbian) - Bug 149151: New Connection first page should use a Listbox for systemtype
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui; package org.eclipse.rse.ui;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.Comparator;
import java.util.Locale; import java.util.Locale;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
@ -24,6 +26,7 @@ import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
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.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.widgets.InheritableEntryField; import org.eclipse.rse.ui.widgets.InheritableEntryField;
@ -749,58 +752,28 @@ public class SystemWidgetHelpers {
return createPushButton(group, label, listener, tooltip); return createPushButton(group, label, listener, tooltip);
} }
/**
* Creates a readonly system type listbox.
* Does NOT create the leading prompt or anything except the listbox.
* @param group composite to put the listbox into.
* @param listener object to listen for events. Can be null.
* @return empty listbox
*/
public static List createSystemTypeListBox(Composite group, Listener listener) {
return createSystemTypeListBox(group, listener, null);
}
/** /**
* Creates a readonly system type listbox with the given system types. * Creates a readonly system type listbox with the given system types.
* Does NOT create the leading prompt or anything except the listbox. * Does NOT create the leading prompt or anything except the listbox.
*
* @param group composite to put the listbox into. * @param group composite to put the listbox into.
* @param listener object to listen for events. Can be null. * @param listener object to listen for events. Can be null.
* @param systemTypes array of system types to add to the listbox * @param systemTypes an array of system types to show in this Combo.
* Must not be <code>null</code>.
* Fill this with the result of {@link #getValidSystemTypes(String[])}
* with a null argument in order to get a combo box with all valid
* system types.
* @return listbox containing the given system types * @return listbox containing the given system types
*/ */
public static List createSystemTypeListBox(Composite group, Listener listener, String[] systemTypes) { public static List createSystemTypeListBox(Composite group, Listener listener, IRSESystemType[] systemTypes) {
ArrayList arrayList = new ArrayList();
List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
list.setItems(getSystemTypeLabels(systemTypes));
String[] typeItems = ((systemTypes == null) ? getSystemTypeNames() : systemTypes);
if (systemTypes == null) {
for (int i = 0; i < typeItems.length; i++) {
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
if (configurations != null && configurations.length > 0) {
arrayList.add(typeItems[i]);
}
}
systemTypes = (String[])arrayList.toArray(new String[arrayList.size()]);
Arrays.sort(systemTypes);
}
for(int i=0; i<systemTypes.length; i++){
list.add(systemTypes[i]);
}
if(list.getItemCount()>0){ if(list.getItemCount()>0){
list.select(0); list.select(0);
} }
return list; return list;
} }
/** /**
* Creates a new listbox instance and sets the default * Creates a new listbox instance and sets the default
* layout data. * layout data.
@ -1080,7 +1053,7 @@ public class SystemWidgetHelpers {
* @param horizontalSpan number of columns this should span * @param horizontalSpan number of columns this should span
* @param newButton true if the combo is to have a "New..." button beside it * @param newButton true if the combo is to have a "New..." button beside it
*/ */
public static SystemHostCombo createConnectionCombo(Composite parent, SelectionListener listener, String[] systemTypes, ISubSystemConfiguration factory, String factoryId, String factoryCategory, IHost defaultConnection, int horizontalSpan, boolean newButton) { public static SystemHostCombo createConnectionCombo(Composite parent, SelectionListener listener, IRSESystemType[] systemTypes, ISubSystemConfiguration factory, String factoryId, String factoryCategory, IHost defaultConnection, int horizontalSpan, boolean newButton) {
SystemHostCombo combo = null; SystemHostCombo combo = null;
if (systemTypes != null) if (systemTypes != null)
combo = new SystemHostCombo(parent, SWT.NULL, systemTypes, defaultConnection, newButton); combo = new SystemHostCombo(parent, SWT.NULL, systemTypes, defaultConnection, newButton);
@ -1120,56 +1093,100 @@ public class SystemWidgetHelpers {
return combo; return combo;
} }
/** private static IRSESystemType[] validSystemTypes = null;
* Creates a readonly system type combination box.
* Does NOT create the leading prompt or anything except the combo.
*/
public static Combo createSystemTypeCombo(Composite parent, Listener listener) {
return createSystemTypeCombo(parent, listener, null);
}
private static String[] systemTypeNames = null;
/** /**
* Internal method. Helper to get the list of registered system type names. * Return the list of all registered valid system types.
*
* A system type is considered valid, if at least one subsystem
* configuration is registered against it. The list is ordered
* alphabetically by system type label.
*
* @param restrictIds An array of system type IDs to restrict the
* returned list of valid system types to only those requested,
* or <code>null</code> to return all valid system types.
* @return an ordered list of all registered valid system types.
*/ */
private static String[] getSystemTypeNames() { public static IRSESystemType[] getValidSystemTypes(String[] restrictIds) {
if (systemTypeNames == null) { if (validSystemTypes==null) {
java.util.List names = new ArrayList();
IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes(); IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
for (int i = 0; i < systemTypes.length; i++) names.add(systemTypes[i].getName()); ArrayList list = new ArrayList(systemTypes.length);
systemTypeNames = (String[])names.toArray(new String[names.size()]); ISystemRegistry sr = RSECorePlugin.getDefault().getSystemRegistry();
for (int i=0; i<systemTypes.length; i++) {
ISubSystemConfiguration[] configurations = sr.getSubSystemConfigurationsBySystemType(systemTypes[i], false);
if (configurations != null && configurations.length > 0) {
list.add(systemTypes[i]);
} }
return systemTypeNames; }
systemTypes = (IRSESystemType[])list.toArray(new IRSESystemType[list.size()]);
sortSystemTypesByLabel(systemTypes);
}
if (restrictIds==null) {
return validSystemTypes;
} else {
java.util.List result = new ArrayList(validSystemTypes.length);
java.util.List restrictList = Arrays.asList(restrictIds);
for(int i=0; i<validSystemTypes.length; i++) {
if (restrictList.contains(validSystemTypes[i].getId())) {
result.add(validSystemTypes[i]);
}
}
return (IRSESystemType[])result.toArray(new IRSESystemType[result.size()]);
}
}
/**
* Sorts the given array of systemTypes in ascending order by system
* type label.
* @param systemTypes list of system types to sort
*/
public static void sortSystemTypesByLabel(IRSESystemType[] systemTypes) {
Arrays.sort(systemTypes, new Comparator() {
public int compare(Object o1, Object o2) {
String l1 = ((IRSESystemType)o1).getLabel();
String l2 = ((IRSESystemType)o2).getLabel();
//FIXME use com.ibm.icu.text.Collator.getInstance(Locale)
return l1.compareTo(l2);
}
public boolean equals(Object obj) {
return this==obj;
}
});
}
/**
* Return the labels for the given list of system types.
* @param systemTypes an array of system types
* @return the String labels for the system types.
*/
public static String[] getSystemTypeLabels(IRSESystemType[] systemTypes) {
String[] labels = new String[systemTypes.length];
for (int i=0; i<systemTypes.length; i++) {
labels[i] = systemTypes[i].getLabel();
}
return labels;
} }
/** /**
* Creates a readonly system type combination box with the given system types. * Creates a readonly system type combination box with the given system types.
*
* Does NOT create the leading prompt or anything except the combo. * Does NOT create the leading prompt or anything except the combo.
* In order to find out what system type was selected, clients need to
* use {@link Combo#getSelectionIndex()} and use the return value as
* an index into the array of system types they provided.
*
* @param parent the parent composite to embed this widget in.
* @param listener a listener for selection events.
* @param systemTypes an array of system types to show in this Combo.
* Must not be <code>null</code>.
* Fill this with the result of {@link #getValidSystemTypes(String[])}
* with a null argument in order to get a combo box with all valid
* system types.
* @return a Combo box displaying the given system types.
*/ */
public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) { public static Combo createSystemTypeCombo(Composite parent, Listener listener, IRSESystemType[] systemTypes) {
Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
String[] typeItems = ((systemTypes == null) ? getSystemTypeNames() : systemTypes); combo.setItems(getSystemTypeLabels(systemTypes));
ArrayList list = new ArrayList();
if (systemTypes == null) {
for (int i = 0; i < typeItems.length; i++) {
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
if (configurations != null && configurations.length > 0) {
list.add(typeItems[i]);
}
}
}
typeItems = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
typeItems[i] = (String)(list.get(i));
}
combo.setItems(typeItems);
combo.select(0); combo.select(0);
return combo; return combo;
} }
@ -1180,7 +1197,7 @@ public class SystemWidgetHelpers {
* <p> * <p>
* Does NOT create the leading prompt or anything except the combo. * Does NOT create the leading prompt or anything except the combo.
*/ */
public static Combo createHostNameCombo(Composite parent, Listener listener, String systemType) { public static Combo createHostNameCombo(Composite parent, Listener listener, IRSESystemType systemType) {
//System.out.println("TipId: " + ISystemConstants.RESID_HOSTNAME_TIP); //System.out.println("TipId: " + ISystemConstants.RESID_HOSTNAME_TIP);
Combo combo = createCombo(parent, listener, SystemResources.RESID_CONNECTION_HOSTNAME_TIP); Combo combo = createCombo(parent, listener, SystemResources.RESID_CONNECTION_HOSTNAME_TIP);
//System.out.println("Tip : " + combo.getToolTipText()); //System.out.println("Tip : " + combo.getToolTipText());
@ -1189,10 +1206,6 @@ public class SystemWidgetHelpers {
return combo; return combo;
} }
/** /**
* Create an entry field controlled by an inherit/override switch button * Create an entry field controlled by an inherit/override switch button
* <p> * <p>

View file

@ -12,12 +12,10 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Set action id for identification from plugin.xml menu extensions. * Uwe Stieber (Wind River) - Set action id for identification from plugin.xml menu extensions.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.actions; package org.eclipse.rse.ui.actions;
import java.util.LinkedList;
import java.util.List;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.ISelectionProvider;
@ -26,7 +24,6 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.WizardDialog; import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.filters.ISystemFilterPoolReference; import org.eclipse.rse.core.filters.ISystemFilterPoolReference;
import org.eclipse.rse.core.filters.ISystemFilterReference; import org.eclipse.rse.core.filters.ISystemFilterReference;
import org.eclipse.rse.core.filters.ISystemFilterStringReference; import org.eclipse.rse.core.filters.ISystemFilterStringReference;
@ -47,7 +44,7 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction {
private boolean fromPopupMenu = true; private boolean fromPopupMenu = true;
private ISelectionProvider sp; private ISelectionProvider sp;
private String[] restrictSystemTypesTo; private IRSESystemType[] restrictSystemTypesTo;
// The current selection the action is knowing of. Just pass on // The current selection the action is knowing of. Just pass on
// to the wizards. Do not interpret here! // to the wizards. Do not interpret here!
@ -120,16 +117,7 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction {
// First, restrict the wizard in the system types to show if this is // First, restrict the wizard in the system types to show if this is
// requested. // requested.
if (restrictSystemTypesTo != null) { if (restrictSystemTypesTo != null) {
// Till now, we get the list of system types to restrict to via system newConnWizard.restrictToSystemTypes(restrictSystemTypesTo);
// type name. This should be changed to be a list of system type objects
// as soon as possible. Till than, we have to translate the lists here.
List systemTypes = new LinkedList();
for (int i = 0; i < restrictSystemTypesTo.length; i++) {
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemType(restrictSystemTypesTo[i]);
if (systemType != null) systemTypes.add(systemType);
}
newConnWizard.restrictToSystemTypes((IRSESystemType[])systemTypes.toArray(new IRSESystemType[systemTypes.size()]));
} }
// If there is an remembered selection, we pass on the selected context // If there is an remembered selection, we pass on the selected context
@ -167,7 +155,7 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction {
/** /**
* Call this to restrict the system types that the user is allowed to choose * Call this to restrict the system types that the user is allowed to choose
*/ */
public void restrictSystemTypes(String[] systemTypes) { public void restrictSystemTypes(IRSESystemType[] systemTypes) {
this.restrictSystemTypesTo = systemTypes; this.restrictSystemTypesTo = systemTypes;
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessage;
import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.ISystemMessages;
@ -36,7 +37,8 @@ public class EnvironmentVariablesPromptDialog extends SystemPromptDialog impleme
private Text nameTextField, valueTextField; private Text nameTextField, valueTextField;
private String name, value, systemType, invalidNameChars; private String name, value, invalidNameChars;
private IRSESystemType systemType;
private boolean change; // Is this dialog for add or change private boolean change; // Is this dialog for add or change
private String[] existingNames; private String[] existingNames;
@ -45,7 +47,7 @@ public class EnvironmentVariablesPromptDialog extends SystemPromptDialog impleme
* @param shell * @param shell
* @param title * @param title
*/ */
public EnvironmentVariablesPromptDialog(Shell shell, String title, String systemType, String invalidNameChars, String[] existingNames, boolean change) { public EnvironmentVariablesPromptDialog(Shell shell, String title, IRSESystemType systemType, String invalidNameChars, String[] existingNames, boolean change) {
super(shell, title); super(shell, title);
this.change = change; this.change = change;
this.systemType = systemType; this.systemType = systemType;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,13 +11,14 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
import java.util.List; import java.util.List;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.PasswordPersistenceManager; import org.eclipse.rse.core.PasswordPersistenceManager;
import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.model.SystemSignonInformation;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
@ -45,9 +46,11 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
private Text hostname, userid, password, passwordVerify; private Text hostname, userid, password, passwordVerify;
private Combo systemType; private Combo systemType;
private IRSESystemType[] systemTypes;
private SystemSignonInformation signonInfo; private SystemSignonInformation signonInfo;
private boolean change; private boolean change;
private String originalHostname, originalUserid, originalSystemType; private String originalHostname, originalUserid;
private IRSESystemType originalSystemType;
private List existingEntries; private List existingEntries;
@ -79,11 +82,16 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
hostname.addModifyListener(this); hostname.addModifyListener(this);
// System type prompt // System type prompt
systemTypes = PasswordPersistenceManager.getInstance().getRegisteredSystemTypes();
String[] systemTypeLabels = new String[systemTypes.length];
for (int i=0; i<systemTypes.length; i++) {
systemTypeLabels[i] = systemTypes[i].getLabel();
}
SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_SYSTYPE_LABEL, SystemResources.RESID_PREF_SIGNON_SYSTYPE_TOOLTIP); SystemWidgetHelpers.createLabel(page, SystemResources.RESID_PREF_SIGNON_SYSTYPE_LABEL, SystemResources.RESID_PREF_SIGNON_SYSTYPE_TOOLTIP);
systemType = SystemWidgetHelpers.createReadonlyCombo(page, null); systemType = SystemWidgetHelpers.createReadonlyCombo(page, null);
systemType.setItems(PasswordPersistenceManager.getInstance().getRegisteredSystemTypes()); systemType.setItems(systemTypeLabels);
if (originalSystemType != null) if (originalSystemType != null)
systemType.setText(originalSystemType); systemType.setText(originalSystemType.getLabel());
systemType.addModifyListener(this); systemType.addModifyListener(this);
// User ID prompt // User ID prompt
@ -133,8 +141,8 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
return false; return false;
} }
String sSystemType = systemType.getText(); int systemTypeIndex = systemType.getSelectionIndex();
if (sSystemType == null || sSystemType.trim().equals("")) //$NON-NLS-1$ if (systemTypeIndex<0)
{ {
setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD)); setErrorMessage(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COMM_PWD_BLANKFIELD));
okButton.setEnabled(false); okButton.setEnabled(false);
@ -179,7 +187,8 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
return false; return false;
} }
signonInfo = new SystemSignonInformation(hostname.getText(), userid.getText(), password.getText(), systemType.getText()); IRSESystemType systemType = systemTypes[systemTypeIndex];
signonInfo = new SystemSignonInformation(hostname.getText(), userid.getText(), password.getText(), systemType);
if (change) if (change)
{ {
@ -220,7 +229,7 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
/** /**
* Check if a password is already saved for the given hostname, user ID and system type * Check if a password is already saved for the given hostname, user ID and system type
*/ */
private boolean exists(String hostname, String userID, String systemType) private boolean exists(String hostname, String userID, IRSESystemType systemType)
{ {
SystemSignonInformation info; SystemSignonInformation info;
PasswordPersistenceManager manager = PasswordPersistenceManager.getInstance(); PasswordPersistenceManager manager = PasswordPersistenceManager.getInstance();
@ -266,7 +275,7 @@ public final class SystemPasswordPersistencePrompt extends SystemPromptDialog im
/** /**
* Set the input data to prepopulate the change dialog * Set the input data to prepopulate the change dialog
*/ */
public void setInputData(String systemtype, String hostname, String userid) public void setInputData(IRSESystemType systemtype, String hostname, String userid)
{ {
originalSystemType = systemtype; originalSystemType = systemtype;
originalHostname = hostname; originalHostname = hostname;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -13,10 +13,12 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.RSEPreferencesManager;
import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.model.SystemSignonInformation;
import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IConnectorService;
@ -178,7 +180,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
Label label = SystemWidgetHelpers.createLabel(composite_prompts, text); Label label = SystemWidgetHelpers.createLabel(composite_prompts, text);
GridData gd = new GridData(); GridData gd = new GridData();
label.setLayoutData(gd); label.setLayoutData(gd);
label = SystemWidgetHelpers.createLabel(composite_prompts, connectorService.getHostType()); label = SystemWidgetHelpers.createLabel(composite_prompts, connectorService.getHost().getSystemType().getLabel());
gd = new GridData(); gd = new GridData();
label.setLayoutData(gd); label.setLayoutData(gd);
@ -267,7 +269,7 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
originalUserId = connectorService.getUserId(); originalUserId = connectorService.getUserId();
userId = originalUserId; userId = originalUserId;
if (connectorService.supportsUserId() && (userId == null || userId.length() == 0)) { if (connectorService.supportsUserId() && (userId == null || userId.length() == 0)) {
userId = RSEPreferencesManager.getUserId(connectorService.getHostType()); userId = RSEPreferencesManager.getUserId(connectorService.getHost().getSystemType().getId());
} }
if (textUserId != null && userId != null) { if (textUserId != null && userId != null) {
textUserId.setText(userId); textUserId.setText(userId);
@ -493,8 +495,8 @@ public final class SystemPasswordPromptDialog extends SystemPromptDialog impleme
// If all inputs are OK then validate signon // If all inputs are OK then validate signon
if (getErrorMessage() == null && (signonValidator != null)) { if (getErrorMessage() == null && (signonValidator != null)) {
String hostName = connectorService.getHostName(); String hostName = connectorService.getHostName();
String hostType = connectorService.getHostType(); IRSESystemType systemType = connectorService.getHost().getSystemType();
ICredentials credentials = new SystemSignonInformation(hostName, userId, password, hostType); ICredentials credentials = new SystemSignonInformation(hostName, userId, password, systemType);
SystemMessage m = signonValidator.validate(credentials); SystemMessage m = signonValidator.validate(credentials);
setErrorMessage(m); setErrorMessage(m);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,11 +11,12 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.internal.ui.view.SystemActionViewerFilter; import org.eclipse.rse.internal.ui.view.SystemActionViewerFilter;
import org.eclipse.rse.internal.ui.view.SystemResourceSelectionForm; import org.eclipse.rse.internal.ui.view.SystemResourceSelectionForm;
@ -90,7 +91,7 @@ public abstract class SystemRemoteResourceDialog extends SystemPromptDialog
_inputProvider.setSystemConnection(connection, onlyConnection); _inputProvider.setSystemConnection(connection, onlyConnection);
} }
public void setSystemTypes(String[] types) public void setSystemTypes(IRSESystemType[] types)
{ {
_inputProvider.setSystemTypes(types); _inputProvider.setSystemTypes(types);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.ISystemPageCompleteListener; import org.eclipse.rse.ui.ISystemPageCompleteListener;
@ -38,7 +39,7 @@ import org.eclipse.swt.widgets.Shell;
* <ul> * <ul>
* <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)} * <li>{@link #setHost(IHost) or #setDefaultConnection(SystemConnection)}
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setSystemTypes(String[])} * <li>{@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setAutoExpandDepth(int)} * <li>{@link #setAutoExpandDepth(int)}
* <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)} * <li>{@link #setRootFolder(IHost, String)} or {@link #setRootFolder(IRemoteFile)} or {@link #setPreSelection(IRemoteFile)}
* <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)} * <li>{@link #setFileTypes(String[])} or {@link #setFileTypes(String)}
@ -104,22 +105,20 @@ public class SystemSelectConnectionDialog
form.setDefaultConnection(conn); form.setDefaultConnection(conn);
} }
/** /**
* Restrict to certain system types * Restrict to certain system types.
* @param systemTypes the system types to restrict what connections are shown and what types of connections * @param systemTypes the system types to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
form.setSystemTypes(systemTypes); form.setSystemTypes(systemTypes);
} }
/** /**
* Restrict to a certain system type * Restrict to a certain system type.
* @param systemType the system type to restrict what connections are shown and what types of connections * @param systemType the system type to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
form.setSystemType(systemType); form.setSystemType(systemType);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,13 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.propertypages; package org.eclipse.rse.ui.propertypages;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IConnectorService;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
@ -28,5 +29,5 @@ public interface ISystemConnectionWizardPropertyPage
public boolean applyValues(IConnectorService subsystem); public boolean applyValues(IConnectorService subsystem);
public void setSubSystemConfiguration(ISubSystemConfiguration factory); public void setSubSystemConfiguration(ISubSystemConfiguration factory);
public void setHostname(String hostname); public void setHostname(String hostname);
public void setSystemType(String systemType); public void setSystemType(IRSESystemType systemType);
} }

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.propertypages; package org.eclipse.rse.ui.propertypages;
@ -131,7 +131,7 @@ public final class SignonPreferencePage extends PreferencePage implements IWorkb
return ((SystemSignonInformation) element).getHostname(); return ((SystemSignonInformation) element).getHostname();
case 1: case 1:
return ((SystemSignonInformation) element).getSystemType(); return ((SystemSignonInformation) element).getSystemType().getLabel();
case 2: case 2:
return ((SystemSignonInformation) element).getUserId(); return ((SystemSignonInformation) element).getUserId();

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* - created and used RSEPreferencesManager * - created and used RSEPreferencesManager
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
@ -319,7 +320,7 @@ public class SystemTypeFieldEditor extends FieldEditor
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();
if (systemTypes == null || restoreDefaults) { if (systemTypes == null || restoreDefaults) {
for (int i = 0; i < types.length; i++) { for (int i = 0; i < types.length; i++) {
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(types[i].getName()); ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(types[i], false);
if (configurations != null && configurations.length > 0) { if (configurations != null && configurations.length > 0) {
list.add(types[i]); list.add(types[i]);
} }
@ -399,7 +400,7 @@ public class SystemTypeFieldEditor extends FieldEditor
else else
return; return;
keyValues.put(row.getLabel(), ""); //$NON-NLS-1$ keyValues.put(row.getId(), ""); //$NON-NLS-1$
tableViewer.update(row, null); tableViewer.update(row, null);
} }

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.widgets; package org.eclipse.rse.ui.widgets;
@ -22,6 +23,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.events.ISystemResourceChangeEvent; import org.eclipse.rse.core.events.ISystemResourceChangeEvent;
import org.eclipse.rse.core.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
import org.eclipse.rse.core.events.ISystemResourceChangeListener; import org.eclipse.rse.core.events.ISystemResourceChangeListener;
@ -92,13 +94,13 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
protected boolean listeningForConnectionEvents = false; protected boolean listeningForConnectionEvents = false;
private IHost[] connections = null; private IHost[] connections = null;
private SystemNewConnectionAction newConnectionAction = null; private SystemNewConnectionAction newConnectionAction = null;
private String[] restrictSystemTypesTo = null; private IRSESystemType[] restrictSystemTypesTo = null;
private int gridColumns = 2; private int gridColumns = 2;
//private static final int DEFAULT_COMBO_WIDTH = 300; //private static final int DEFAULT_COMBO_WIDTH = 300;
//private static final int DEFAULT_BUTTON_WIDTH = 80; //private static final int DEFAULT_BUTTON_WIDTH = 80;
private String label; private String label;
private String populateSystemType = null; /* used as criteria when refresh is done */ private IRSESystemType populateSystemType = null; /* used as criteria when refresh is done */
private String[] populateSystemTypes = null; /* used as criteria when refresh is done */ private IRSESystemType[] populateSystemTypes = null; /* used as criteria when refresh is done */
private ISubSystemConfiguration populateSSFactory = null; /* used as criteria when refresh is done */ private ISubSystemConfiguration populateSSFactory = null; /* used as criteria when refresh is done */
private String populateSSFactoryId = null; /* used as criteria when refresh is done */ private String populateSSFactoryId = null; /* used as criteria when refresh is done */
private String populateSSFactoryCategory = null; /* used as criteria when refresh is done */ private String populateSSFactoryCategory = null; /* used as criteria when refresh is done */
@ -112,10 +114,10 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
* @param defaultConnection the system connection to preselect. Pass null to preselect first connection. * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
* @param showNewButton true if a New... button is to be included in this composite * @param showNewButton true if a New... button is to be included in this composite
*/ */
public SystemHostCombo(Composite parent, int style, String systemType, IHost defaultConnection, boolean showNewButton) public SystemHostCombo(Composite parent, int style, IRSESystemType systemType, IHost defaultConnection, boolean showNewButton)
{ {
super(parent, style); super(parent, style);
restrictSystemTypesTo = new String[1]; restrictSystemTypesTo = new IRSESystemType[1];
restrictSystemTypesTo[0] = systemType; restrictSystemTypesTo[0] = systemType;
init(parent, showNewButton); init(parent, showNewButton);
populateSystemType = systemType; populateSystemType = systemType;
@ -131,7 +133,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
* @param defaultConnection the system connection to preselect. Pass null to preselect first connection. * @param defaultConnection the system connection to preselect. Pass null to preselect first connection.
* @param showNewButton true if a New... button is to be included in this composite * @param showNewButton true if a New... button is to be included in this composite
*/ */
public SystemHostCombo(Composite parent, int style, String[] systemTypes, IHost defaultConnection, boolean showNewButton) public SystemHostCombo(Composite parent, int style, IRSESystemType[] systemTypes, IHost defaultConnection, boolean showNewButton)
{ {
super(parent, style); super(parent, style);
restrictSystemTypesTo = systemTypes; restrictSystemTypesTo = systemTypes;
@ -217,15 +219,13 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
// some one has overriden ISubSystemConfiguration.getSystemTypes(), the // some one has overriden ISubSystemConfiguration.getSystemTypes(), the
// proxy cannot return the correct list anymore. This is especially important // proxy cannot return the correct list anymore. This is especially important
// if the systemType <--> subsystemConfiguration association is dynamic! // if the systemType <--> subsystemConfiguration association is dynamic!
String[] types = ssfProxies[idx].getSubSystemConfiguration().getSystemTypes(); IRSESystemType[] types = ssfProxies[idx].getSubSystemConfiguration().getSystemTypes();
for (int jdx = 0; jdx < types.length; jdx++) { for (int jdx = 0; jdx < types.length; jdx++) {
if (!vTypes.contains(types[jdx])) if (!vTypes.contains(types[jdx]))
vTypes.addElement(types[jdx]); vTypes.addElement(types[jdx]);
} }
} }
restrictSystemTypesTo = new String[vTypes.size()]; restrictSystemTypesTo = (IRSESystemType[])vTypes.toArray(new IRSESystemType[vTypes.size()]);
for (int idx = 0; idx < vTypes.size(); idx++)
restrictSystemTypesTo[idx] = (String)vTypes.elementAt(idx);
} }
init(parent, showNewButton, showLabel); init(parent, showNewButton, showLabel);
populateSSFactoryCategory = ssFactoryCategory; populateSSFactoryCategory = ssFactoryCategory;
@ -667,8 +667,8 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
* @param preSelectIfNoMatch true if we should preselect the first item if the given connection is not found * @param preSelectIfNoMatch true if we should preselect the first item if the given connection is not found
* @return true if given default connection was found and selected * @return true if given default connection was found and selected
*/ */
protected boolean populateConnectionCombo(Combo combo, String systemType, IHost defaultConnection, protected boolean populateConnectionCombo(Combo combo, IRSESystemType systemType,
boolean preSelectIfNoMatch) IHost defaultConnection, boolean preSelectIfNoMatch)
{ {
return populateConnectionCombo(combo, systemType, defaultConnection, preSelectIfNoMatch, false); return populateConnectionCombo(combo, systemType, defaultConnection, preSelectIfNoMatch, false);
} }
@ -686,7 +686,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
* @param appendToCombo indicates whether or not to append to combo with population or replace * @param appendToCombo indicates whether or not to append to combo with population or replace
* @return true if given default connection was found and selected * @return true if given default connection was found and selected
*/ */
protected boolean populateConnectionCombo(Combo combo, String systemType, IHost defaultConnection, protected boolean populateConnectionCombo(Combo combo, IRSESystemType systemType, IHost defaultConnection,
boolean preSelectIfNoMatch, boolean appendToCombo) boolean preSelectIfNoMatch, boolean appendToCombo)
{ {
boolean matchFound = false; boolean matchFound = false;
@ -751,7 +751,7 @@ public class SystemHostCombo extends Composite implements ISelectionProvider,
* @param systemTypes the system types to restrict the connection list to. Pass null or * for all system types * @param systemTypes the system types to restrict the connection list to. Pass null or * for all system types
* @param defaultConnection the default system connection to preselect. * @param defaultConnection the default system connection to preselect.
*/ */
protected void populateConnectionCombo(Combo combo, String[] systemTypes, IHost defaultConnection) protected void populateConnectionCombo(Combo combo, IRSESystemType[] systemTypes, IHost defaultConnection)
{ {
boolean match = false; boolean match = false;
boolean anyMatch = false; boolean anyMatch = false;

View file

@ -1,5 +1,5 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved. * Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley. * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
* *
* Contributors: * Contributors:
* {Name} (company) - description of contribution. * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.widgets; package org.eclipse.rse.ui.widgets;
@ -22,6 +22,7 @@ import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemPropertySheetForm; import org.eclipse.rse.internal.ui.view.SystemPropertySheetForm;
@ -52,7 +53,7 @@ import org.eclipse.swt.widgets.Text;
* <ul> * <ul>
* <li>{@link #setShowNewConnectionPrompt(boolean)} * <li>{@link #setShowNewConnectionPrompt(boolean)}
* <li>{@link #setDefaultConnection(IHost)} * <li>{@link #setDefaultConnection(IHost)}
* <li>{@link #setSystemTypes(String[])} * <li>{@link #setSystemTypes(IRSESystemType[])}
* <li>{@link #setShowPropertySheet(boolean)} * <li>{@link #setShowPropertySheet(boolean)}
* <li>{@link #setMultipleSelectionMode(boolean)} * <li>{@link #setMultipleSelectionMode(boolean)}
* </ul> * </ul>
@ -81,7 +82,7 @@ public class SystemSelectConnectionForm extends SystemBaseForm
protected Composite outerParent, ps_composite; protected Composite outerParent, ps_composite;
// inputs // inputs
protected String verbiage = null; protected String verbiage = null;
protected String[] systemTypes = null; protected IRSESystemType[] systemTypes = null;
protected IHost defaultConn; protected IHost defaultConn;
protected boolean allowNew = true; protected boolean allowNew = true;
protected boolean multipleSelectionMode; protected boolean multipleSelectionMode;
@ -109,7 +110,7 @@ public class SystemSelectConnectionForm extends SystemBaseForm
* @param msgLine A GUI widget capable of writing error messages to. * @param msgLine A GUI widget capable of writing error messages to.
* *
* @see #setShowNewConnectionPrompt(boolean) * @see #setShowNewConnectionPrompt(boolean)
* @see #setSystemTypes(String[]) * @see #setSystemTypes(IRSESystemType[])
*/ */
public SystemSelectConnectionForm(Shell shell, ISystemMessageLine msgLine) public SystemSelectConnectionForm(Shell shell, ISystemMessageLine msgLine)
{ {
@ -141,25 +142,23 @@ public class SystemSelectConnectionForm extends SystemBaseForm
allowNew = show; allowNew = show;
} }
/** /**
* Restrict to certain system types * Restrict to certain system types.
* @param systemTypes the system types to restrict what connections are shown and what types of connections * @param systemTypes the system types to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemTypes(String[] systemTypes) public void setSystemTypes(IRSESystemType[] systemTypes)
{ {
this.systemTypes = systemTypes; this.systemTypes = systemTypes;
} }
/** /**
* Restrict to one system type * Restrict to one system type.
* @param systemType the system type to restrict what connections are shown and what types of connections * @param systemType the system type to restrict what connections
* the user can create * are shown and what types of connections the user can create.
* @see org.eclipse.rse.core.IRSESystemType
*/ */
public void setSystemType(String systemType) public void setSystemType(IRSESystemType systemType)
{ {
systemTypes = new String[1]; if (systemType==null) setSystemTypes(null);
systemTypes[0] = systemType; setSystemTypes(new IRSESystemType[] {systemType});
} }
/** /**
* Set the message shown as the text at the top of the form. Default is "Select a connection" * Set the message shown as the text at the top of the form. Default is "Select a connection"

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Uwe Stieber (Wind River) - Reworked new connection wizard extension point.
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards; package org.eclipse.rse.ui.wizards;
@ -88,9 +89,7 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
IServiceSubSystemConfiguration currentFactory = (IServiceSubSystemConfiguration)getSubSystemConfiguration(); IServiceSubSystemConfiguration currentFactory = (IServiceSubSystemConfiguration)getSubSystemConfiguration();
IRSESystemType systemType = getMainPage() != null && getMainPage().getWizard() instanceof RSEDefaultNewConnectionWizard ? ((RSEDefaultNewConnectionWizard)getMainPage().getWizard()).getSystemType() : null; IRSESystemType systemType = getMainPage() != null && getMainPage().getWizard() instanceof RSEDefaultNewConnectionWizard ? ((RSEDefaultNewConnectionWizard)getMainPage().getWizard()).getSystemType() : null;
String systemTypeName = systemType != null ? systemType.getName() : null; IServiceSubSystemConfiguration[] factories = getServiceSubSystemConfigurations(systemType, currentFactory.getServiceType());
IServiceSubSystemConfiguration[] factories = getServiceSubSystemFactories(systemTypeName, currentFactory.getServiceType());
IHost dummyHost = null; IHost dummyHost = null;
if (getWizard() instanceof RSEDefaultNewConnectionWizard) if (getWizard() instanceof RSEDefaultNewConnectionWizard)
@ -119,22 +118,22 @@ public class SubSystemServiceWizardPage extends AbstractSystemNewConnectionWizar
return _serviceElements; return _serviceElements;
} }
protected IServiceSubSystemConfiguration[] getServiceSubSystemFactories(String systemType, Class serviceType) protected IServiceSubSystemConfiguration[] getServiceSubSystemConfigurations(IRSESystemType systemType, Class serviceType)
{ {
List results = new ArrayList(); List results = new ArrayList();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
ISubSystemConfiguration[] factories = sr.getSubSystemConfigurationsBySystemType(systemType); ISubSystemConfiguration[] configs = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < factories.length; i++) for (int i = 0; i < configs.length; i++)
{ {
ISubSystemConfiguration factory = factories[i]; ISubSystemConfiguration config = configs[i];
if (factory instanceof IServiceSubSystemConfiguration) if (config instanceof IServiceSubSystemConfiguration)
{ {
IServiceSubSystemConfiguration sfactory = (IServiceSubSystemConfiguration)factory; IServiceSubSystemConfiguration sconfig = (IServiceSubSystemConfiguration)config;
if (sfactory.getServiceType() == serviceType) if (sconfig.getServiceType() == serviceType)
{ {
results.add(sfactory); results.add(sconfig);
} }
} }
} }

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Uwe Stieber (Wind River) - Reworked new connection wizard extension point.
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
@ -162,13 +163,13 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
if (getSystemType() == null) { if (getSystemType() == null) {
pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE; pageTitle = SystemResources.RESID_NEWCONN_PAGE1_TITLE;
} else { } else {
String onlySystemType = getSystemType().getLabel(); IRSESystemType onlySystemType = getSystemType();
if (onlySystemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL)) { if (onlySystemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID)) {
pageTitle = SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE; pageTitle = SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE;
} else { } else {
pageTitle = SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE; pageTitle = SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE;
pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType); //$NON-NLS-1$ pageTitle = SystemMessage.sub(pageTitle, "&1", onlySystemType.getLabel()); //$NON-NLS-1$
} }
} }
@ -322,9 +323,9 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
if (ok) { if (ok) {
try { try {
String sysType = getSystemType() != null ? getSystemType().getName() : null; IRSESystemType systemType = getSystemType();
SystemConnectionForm form = mainPage.getSystemConnectionForm(); SystemConnectionForm form = mainPage.getSystemConnectionForm();
IHost conn = sr.createHost(form.getProfileName(), sysType, form.getConnectionName(), form.getHostName(), IHost conn = sr.createHost(form.getProfileName(), systemType, form.getConnectionName(), form.getHostName(),
form.getConnectionDescription(), form.getDefaultUserId(), form.getUserIdLocation(), form.getConnectionDescription(), form.getDefaultUserId(), form.getUserIdLocation(),
subsystemFactorySuppliedWizardPages); subsystemFactorySuppliedWizardPages);
@ -333,7 +334,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
// a tweak that is the result of UCD feedback. Phil // a tweak that is the result of UCD feedback. Phil
if ((conn != null) && SystemPerspectiveHelpers.isRSEPerspectiveActive()) { if ((conn != null) && SystemPerspectiveHelpers.isRSEPerspectiveActive()) {
if (sysType.equals(IRSESystemType.SYSTEMTYPE_ISERIES)) { if (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID)) {
ISubSystem[] objSubSystems = sr.getSubSystemsBySubSystemConfigurationCategory("nativefiles", conn); //$NON-NLS-1$ ISubSystem[] objSubSystems = sr.getSubSystemsBySubSystemConfigurationCategory("nativefiles", conn); //$NON-NLS-1$
if ((objSubSystems != null) && (objSubSystems.length > 0))// might be in product that doesn't have iSeries plugins if ((objSubSystems != null) && (objSubSystems.length > 0))// might be in product that doesn't have iSeries plugins
sr.expandSubSystem(objSubSystems[0]); sr.expandSubSystem(objSubSystems[0]);

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Reworked new connection wizard extension point. * Uwe Stieber (Wind River) - Reworked new connection wizard extension point.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
@ -71,7 +72,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends WizardPage implements
if (systemType != null) { if (systemType != null) {
// The page _always_ restrict the system connection form // The page _always_ restrict the system connection form
// to only one system type. // to only one system type.
getSystemConnectionForm().restrictSystemType(systemType.getName()); getSystemConnectionForm().restrictSystemType(systemType);
} }
} }
@ -164,7 +165,7 @@ public class RSEDefaultNewConnectionWizardMainPage extends WizardPage implements
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.ui.ISystemConnectionFormCaller#systemTypeSelected(java.lang.String, boolean) * @see org.eclipse.rse.ui.ISystemConnectionFormCaller#systemTypeSelected(java.lang.String, boolean)
*/ */
public void systemTypeSelected(String systemType, boolean duringInitialization) { public void systemTypeSelected(IRSESystemType systemType, boolean duringInitialization) {
// Not applicable: The Page is driving the system connection form and not the way around!!! // Not applicable: The Page is driving the system connection form and not the way around!!!
} }

View file

@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.internal.model; package org.eclipse.rse.ui.internal.model;
@ -26,7 +27,6 @@ import java.util.List;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.RSEPreferencesManager; import org.eclipse.rse.core.RSEPreferencesManager;
import org.eclipse.rse.core.model.Host; import org.eclipse.rse.core.model.Host;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
@ -34,7 +34,7 @@ import org.eclipse.rse.core.model.IRSEPersistableContainer;
import org.eclipse.rse.core.model.ISystemHostPool; import org.eclipse.rse.core.model.ISystemHostPool;
import org.eclipse.rse.core.model.ISystemProfile; import org.eclipse.rse.core.model.ISystemProfile;
import org.eclipse.rse.core.model.RSEModelObject; import org.eclipse.rse.core.model.RSEModelObject;
import org.eclipse.rse.internal.core.model.RSEModelResources; import org.eclipse.rse.internal.core.RSECoreMessages;
import org.eclipse.rse.internal.core.model.SystemProfileManager; import org.eclipse.rse.internal.core.model.SystemProfileManager;
import org.eclipse.rse.ui.RSESystemTypeAdapter; import org.eclipse.rse.ui.RSESystemTypeAdapter;
@ -148,59 +148,35 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
} }
} }
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
// CONNECTION METHODS... // CONNECTION METHODS...
// ------------------------------------------------------------------------------------- // -------------------------------------------------------------------------------------
/**
* Create a connection object, given only the minimal information. /*
* <p> * (non-Javadoc)
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. * @see org.eclipse.rse.core.model.ISystemHostPool#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String)
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/ */
public IHost createHost(String systemType, String aliasName, String hostName) public IHost createHost(IRSESystemType systemType, String aliasName, String hostName)
throws Exception throws Exception
{ {
return createHost(systemType,aliasName,hostName,null,null,IRSEUserIdConstants.USERID_LOCATION_HOST); return createHost(systemType,aliasName,hostName,null,null,IRSEUserIdConstants.USERID_LOCATION_HOST);
} }
/**
* Create a connection object, given all the possible attributes except default userId. /*
* <p> * (non-Javadoc)
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU. * @see org.eclipse.rse.core.model.ISystemHostPool#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/ */
public IHost createHost(String systemType, String aliasName, String hostName, String description) public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description)
throws Exception throws Exception
{ {
return createHost(systemType,aliasName,hostName,description,null,IRSEUserIdConstants.USERID_LOCATION_HOST); return createHost(systemType,aliasName,hostName,description,null,IRSEUserIdConstants.USERID_LOCATION_HOST);
} }
/**
* Create a connection object, given all the possible attributes. /*
* <p> * (non-Javadoc)
* The new connection is added to the list and saved to disk. * @see org.eclipse.rse.core.model.ISystemHostPool#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return SystemConnection object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
* @see IRSEUserIdConstants
*/ */
public IHost createHost(String systemType, String aliasName, String hostName, public IHost createHost(IRSESystemType systemType, String aliasName, String hostName,
String description,String defaultUserId,int defaultUserIdLocation) String description,String defaultUserId,int defaultUserIdLocation)
throws Exception throws Exception
{ {
@ -215,9 +191,8 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
ISystemProfile profile = getSystemProfile(); ISystemProfile profile = getSystemProfile();
// delegate the creation of the host object instance to the system type provider!!! // delegate the creation of the host object instance to the system type provider!!!
IRSESystemType systemTypeObject = RSECorePlugin.getDefault().getRegistry().getSystemType(systemType); if (systemType != null) {
if (systemTypeObject != null) { Object adapter = systemType.getAdapter(IRSESystemType.class);
Object adapter = systemTypeObject.getAdapter(IRSESystemType.class);
if (adapter instanceof RSESystemTypeAdapter) { if (adapter instanceof RSESystemTypeAdapter) {
conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile); conn = ((RSESystemTypeAdapter)adapter).createNewHostInstance(profile);
} }
@ -229,7 +204,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
addHost(conn); // only record internally if saved successfully addHost(conn); // only record internally if saved successfully
conn.setHostPool(this); conn.setHostPool(this);
conn.setAliasName(aliasName); conn.setAliasName(aliasName);
conn.setSystemType(systemTypeObject); conn.setSystemType(systemType);
// if default userID is null, and location is in the connection we should retrieve it and use it as the initial value. // if default userID is null, and location is in the connection we should retrieve it and use it as the initial value.
if (defaultUserId == null && defaultUserIdLocation == IRSEUserIdConstants.USERID_LOCATION_HOST) { if (defaultUserId == null && defaultUserIdLocation == IRSEUserIdConstants.USERID_LOCATION_HOST) {
defaultUserId = conn.getDefaultUserId(); defaultUserId = conn.getDefaultUserId();
@ -242,25 +217,12 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
} }
return conn; return conn;
} }
/**
* Update an existing connection given the new information. /*
* This method: * (non-Javadoc)
* <ul> * @see org.eclipse.rse.core.model.ISystemHostPool#updateHost(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
* <li>calls the setXXX methods on the given connection object, updating the information in it.
* <li>saves the connection to disk (renaming its folder if needed)
* </ul>
* <p>
* @param conn SystemConnection to be updated
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @see IRSEUserIdConstants
*/ */
public void updateHost(IHost conn, String systemType, public void updateHost(IHost conn, IRSESystemType systemType,
String aliasName, String hostName, String aliasName, String hostName,
String description,String defaultUserId, int defaultUserIdLocation) String description,String defaultUserId, int defaultUserIdLocation)
throws Exception throws Exception
@ -268,8 +230,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
boolean aliasNameChanged = !aliasName.equalsIgnoreCase(conn.getAliasName()); boolean aliasNameChanged = !aliasName.equalsIgnoreCase(conn.getAliasName());
if (aliasNameChanged) if (aliasNameChanged)
renameHost(conn,aliasName); renameHost(conn,aliasName);
IRSESystemType systemTypeObject = RSECorePlugin.getDefault().getRegistry().getSystemType(systemType); conn.setSystemType(systemType);
conn.setSystemType(systemTypeObject);
conn.setHostName(hostName); conn.setHostName(hostName);
if (defaultUserIdLocation != IRSEUserIdConstants.USERID_LOCATION_NOTSET) if (defaultUserIdLocation != IRSEUserIdConstants.USERID_LOCATION_NOTSET)
{ {
@ -443,7 +404,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
throws Exception throws Exception
{ {
IHost copy = IHost copy =
targetPool.createHost(conn.getSystemType().getName(), aliasName, targetPool.createHost(conn.getSystemType(), aliasName,
conn.getHostName(), conn.getDescription(), conn.getLocalDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_HOST); conn.getHostName(), conn.getDescription(), conn.getLocalDefaultUserId(), IRSEUserIdConstants.USERID_LOCATION_HOST);
return copy; return copy;
} }
@ -555,7 +516,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
public String getDescription() public String getDescription()
{ {
return RSEModelResources.RESID_MODELOBJECTS_HOSTPOOL_DESCRIPTION; return RSECoreMessages.RESID_MODELOBJECTS_HOSTPOOL_DESCRIPTION;
} }
/** /**
@ -646,7 +607,8 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool
// ------------------------- // -------------------------
/** /**
* Save all connections to disk. * Save all connections to disk.
* Attempts to save all of them, swallowing exceptions, then at the end throws the last exception caught. * Attempts to save all of them, swallowing exceptions,
* then at the end throws the last exception caught.
*/ */
public boolean commit() public boolean commit()
{ {

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.internal.model; package org.eclipse.rse.ui.internal.model;
@ -83,22 +84,6 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject,
this.systemTypesSet = true; this.systemTypesSet = true;
} }
/**
* @deprecated Use {@link #setSystemTypes(IRSESystemType[])}.
*/
public void setSystemTypes(String[] systemTypes) {
if (systemTypes != null) {
List types = new ArrayList();
for (int i = 0; i < systemTypes.length; i++) {
IRSESystemType type = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[i]);
if (type != null) types.add(type);
}
setSystemTypes((IRSESystemType[])types.toArray(new IRSESystemType[types.size()]));
} else {
setSystemTypes((IRSESystemType[])null);
}
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.ui.model.ISystemPromptableObject#getSystemTypes() * @see org.eclipse.rse.ui.model.ISystemPromptableObject#getSystemTypes()
*/ */
@ -280,9 +265,7 @@ public class SystemNewConnectionPromptObject implements ISystemPromptableObject,
action = new SystemNewConnectionAction(shell, false, false, null); action = new SystemNewConnectionAction(shell, false, false, null);
} }
if (systemTypes != null) { if (systemTypes != null) {
List systemTypeNames = new ArrayList(); action.restrictSystemTypes(systemTypes);
for (int i = 0; i < systemTypes.length; i++) systemTypeNames.add(systemTypes[i].getName());
action.restrictSystemTypes((String[])systemTypeNames.toArray(new String[systemTypeNames.size()]));
} }
try { try {

View file

@ -19,10 +19,12 @@
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Tobias Schwarz (Wind River) - [183134] getLocalHost() does not return Local * Tobias Schwarz (Wind River) - [183134] getLocalHost() does not return Local
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.internal.model; package org.eclipse.rse.ui.internal.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Vector; import java.util.Vector;
@ -36,6 +38,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.Viewer;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants; import org.eclipse.rse.core.IRSEUserIdConstants;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemAdapterHelpers; import org.eclipse.rse.core.SystemAdapterHelpers;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.events.ISystemModelChangeEvent; import org.eclipse.rse.core.events.ISystemModelChangeEvent;
@ -602,27 +605,12 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return factories; return factories;
} }
/* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystemConfigurationsBySystemType(org.eclipse.rse.core.IRSESystemType, boolean)
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicateServiceSubSystemFactories) {
return getSubSystemConfigurationsBySystemType(systemType != null ? systemType.getName() : null, filterDuplicateServiceSubSystemFactories);
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystemConfigurationsBySystemType(java.lang.String)
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType)
{
return getSubSystemConfigurationsBySystemType(systemType, false);
}
/** /**
* Return all subsystem factories which support the given system type. If the type is null, * Return all subsystem factories which support the given system type.
* returns all. * If the type is null, returns all.
* *
*/ */
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(String systemType, boolean filterDuplicateServiceSubSystemFactories) public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicateServiceSubSystemFactories)
{ {
List serviceTypesAdded = new ArrayList(); List serviceTypesAdded = new ArrayList();
List serviceImplsAdded = new ArrayList(); List serviceImplsAdded = new ArrayList();
@ -1260,7 +1248,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
{ {
for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) for (int idx = 0; idx < subsystemFactoryProxies.length; idx++)
{ {
// if (subsystemFactoryProxies[idx].appliesToSystemType(conn.getSystemType().getName())) // if (subsystemFactoryProxies[idx].appliesToSystemType(conn.getSystemType()))
// { // {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
@ -1416,7 +1404,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
{ {
for (int idx = 0; idx < subsystemFactoryProxies.length; idx++) for (int idx = 0; idx < subsystemFactoryProxies.length; idx++)
{ {
if (subsystemFactoryProxies[idx].appliesToSystemType(conn.getSystemType().getName()) && subsystemFactoryProxies[idx].isSubSystemConfigurationActive()) if (subsystemFactoryProxies[idx].appliesToSystemType(conn.getSystemType()) && subsystemFactoryProxies[idx].isSubSystemConfigurationActive())
{ {
ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration(); ISubSystemConfiguration factory = subsystemFactoryProxies[idx].getSubSystemConfiguration();
if (factory != null) if (factory != null)
@ -1660,7 +1648,8 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
public IHost getLocalHost() public IHost getLocalHost()
{ {
IHost localConn = null; IHost localConn = null;
IHost[] conns = getHostsBySystemType(IRSESystemType.SYSTEMTYPE_LOCAL); IRSESystemType localType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
IHost[] conns = getHostsBySystemType(localType);
if (conns != null && conns.length > 0) return conns[0]; if (conns != null && conns.length > 0) return conns[0];
else return localConn; else return localConn;
} }
@ -1674,7 +1663,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
Vector v = new Vector(); Vector v = new Vector();
for (int idx = 0; idx < pools.length; idx++) for (int idx = 0; idx < pools.length; idx++)
{ {
IHost[] conns = getHostsByProfile(getSystemProfileName(pools[idx])); IHost[] conns = getHostsByProfile(getSystemProfile(pools[idx]));
if (conns != null) if (conns != null)
for (int jdx = 0; jdx < conns.length; jdx++) for (int jdx = 0; jdx < conns.length; jdx++)
v.addElement(conns[jdx]); v.addElement(conns[jdx]);
@ -1684,16 +1673,20 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
allConns[idx] = (IHost) v.elementAt(idx); allConns[idx] = (IHost) v.elementAt(idx);
return allConns; return allConns;
} }
/**
* Return all connections in a given profile. /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsByProfile(org.eclipse.rse.core.model.ISystemProfile)
*/ */
public IHost[] getHostsByProfile(ISystemProfile profile) public IHost[] getHostsByProfile(ISystemProfile profile)
{ {
ISystemHostPool pool = getHostPool(profile); ISystemHostPool pool = getHostPool(profile);
return pool.getHosts(); return pool.getHosts();
} }
/**
* Return all connections in a given profile name. /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsByProfile(java.lang.String)
*/ */
public IHost[] getHostsByProfile(String profileName) public IHost[] getHostsByProfile(String profileName)
{ {
@ -1707,10 +1700,10 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return null; return null;
} }
} }
/**
* Return all connections for which there exists one or more subsystems owned /*
* by a given subsystem factory. * (non-Javadoc)
* @see #getSubSystemConfiguration(String) * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfiguration(org.eclipse.rse.core.subsystems.ISubSystemConfiguration)
*/ */
public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory) public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory)
{ {
@ -1733,23 +1726,19 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
return conns; return conns;
} }
/**
* Return all connections for which there exists one or more subsystems owned /*
* by a given subsystem factory, identified by factory Id * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfigurationId(java.lang.String)
*/ */
public IHost[] getHostsBySubSystemConfigurationId(String factoryId) public IHost[] getHostsBySubSystemConfigurationId(String factoryId)
{ {
return getHostsBySubSystemConfiguration(getSubSystemConfiguration(factoryId)); return getHostsBySubSystemConfiguration(getSubSystemConfiguration(factoryId));
} }
/**
* Return all connections for which there exists one or more subsystems owned /*
* by any child classes of a given subsystem factory category. * (non-Javadoc)
* <p> * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfigurationCategory(java.lang.String)
* This looks for a match on the "category" of the subsystem factory's xml declaration
* in its plugin.xml file. Thus, it is effecient as it need not bring to live a
* subsystem factory just to test its parent class type.
*
* @see ISubSystemConfigurationCategories
*/ */
public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory) public IHost[] getHostsBySubSystemConfigurationCategory(String factoryCategory)
{ {
@ -1803,64 +1792,44 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return (IHost[])connections.toArray(new IHost[connections.size()]); return (IHost[])connections.toArray(new IHost[connections.size()]);
} }
/** /*
* Return all connections for all active profiles, for the given system type. * (non-Javadoc)
* Never returns null! * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemTypes(org.eclipse.rse.core.IRSESystemType[])
*/ */
public IHost[] getHostsBySystemType(String systemType) public IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes)
{ {
List systemTypesList = Arrays.asList(systemTypes);
IHost[] connections = getHosts(); IHost[] connections = getHosts();
Vector v = new Vector(); Vector v = new Vector();
for (int idx = 0; idx < connections.length; idx++) for (int idx = 0; idx < connections.length; idx++)
{ {
if (systemType.equals(connections[idx].getSystemType().getName())) IRSESystemType systemType = connections[idx].getSystemType();
if (systemTypesList.contains(systemType)) {
v.addElement(connections[idx]); v.addElement(connections[idx]);
} }
IHost[] conns = new IHost[v.size()];
for (int idx = 0; idx < v.size(); idx++)
conns[idx] = (IHost) v.elementAt(idx);
return conns;
} }
/** return (IHost[])v.toArray(new IHost[v.size()]);
* Return all connections for all active profiles, for the given system types.
* Never returns null!
*/
public IHost[] getHostsBySystemTypes(String[] systemTypes)
{
IHost[] connections = getHosts();
Vector v = new Vector();
for (int idx = 0; idx < connections.length; idx++)
{
String systemType = connections[idx].getSystemType().getName();
boolean match = false;
for (int jdx = 0; !match && (jdx < systemTypes.length); jdx++)
if (systemType.equals(systemTypes[jdx]))
match = true;
if (match)
v.addElement(connections[idx]);
}
IHost[] conns = new IHost[v.size()];
for (int idx = 0; idx < v.size(); idx++)
conns[idx] = (IHost) v.elementAt(idx);
return conns;
} }
/** /*
* Return a SystemConnection object given a system profile containing it, * (non-Javadoc)
* and an connection name uniquely identifying it. * @see org.eclipse.rse.core.model.ISystemRegistry#getHost(org.eclipse.rse.core.model.ISystemProfile, java.lang.String)
*/ */
public IHost getHost(ISystemProfile profile, String connectionName) public IHost getHost(ISystemProfile profile, String connectionName)
{ {
return getHostPool(profile).getHost(connectionName); return getHostPool(profile).getHost(connectionName);
} }
/**
* Return the zero-based position of a SystemConnection object within its profile. /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostPosition(org.eclipse.rse.core.model.IHost)
*/ */
public int getHostPosition(IHost conn) public int getHostPosition(IHost conn)
{ {
ISystemHostPool pool = conn.getHostPool(); ISystemHostPool pool = conn.getHostPool();
return pool.getHostPosition(conn); return pool.getHostPosition(conn);
} }
/** /**
* Return the zero-based position of a SystemConnection object within all active profiles. * Return the zero-based position of a SystemConnection object within all active profiles.
*/ */
@ -1876,23 +1845,27 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return pos; return pos;
} }
/** /*
* Return the number of SystemConnection objects within the given profile * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostCount(java.lang.String)
*/ */
public int getHostCount(String profileName) public int getHostCount(String profileName)
{ {
return getHostPool(profileName).getHostCount(); return getHostPool(profileName).getHostCount();
} }
/**
* Return the number of SystemConnection objects within the given connection's owning profile /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostCountWithinProfile(org.eclipse.rse.core.model.IHost)
*/ */
public int getHostCountWithinProfile(IHost conn) public int getHostCountWithinProfile(IHost conn)
{ {
return conn.getHostPool().getHostCount(); return conn.getHostPool().getHostCount();
} }
/** /*
* Return the number of SystemConnection objects within all active profiles * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostCount()
*/ */
public int getHostCount() public int getHostCount()
{ {
@ -1905,9 +1878,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return total; return total;
} }
/** /*
* Return a vector of previously-used connection names in the given named profile. * (non-Javadoc)
* @return Vector of String objects. * @see org.eclipse.rse.core.model.ISystemRegistry#getHostAliasNames(java.lang.String)
*/ */
public Vector getHostAliasNames(String profileName) public Vector getHostAliasNames(String profileName)
{ {
@ -1920,16 +1893,19 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
return names; return names;
} }
/**
* Return a vector of previously-used connection names in the given profile. /*
* @return Vector of String objects. * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostAliasNames(org.eclipse.rse.core.model.ISystemProfile)
*/ */
public Vector getHostAliasNames(ISystemProfile profile) public Vector getHostAliasNames(ISystemProfile profile)
{ {
return getHostAliasNames(profile.getName()); return getHostAliasNames(profile.getName());
} }
/**
* Return a vector of previously-used connection names in all active profiles. /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostAliasNamesForAllActiveProfiles()
*/ */
public Vector getHostAliasNamesForAllActiveProfiles() public Vector getHostAliasNamesForAllActiveProfiles()
{ {
@ -1944,19 +1920,11 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return allNames; return allNames;
} }
/** /*
* Return array of all previously specified hostnames. * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostNames(org.eclipse.rse.core.IRSESystemType)
*/ */
public String[] getHostNames() public String[] getHostNames(IRSESystemType systemType)
{
return getHostNames(null);
}
/**
* Return array of previously specified hostnames for a given system type.
* After careful consideration, it is decided that if the system type is null,
* then no hostnames should be returned. Previously all for all types were returned.
*/
public String[] getHostNames(String systemType)
{ {
Vector v = new Vector(); Vector v = new Vector();
@ -1971,21 +1939,19 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
// in SystemConnectionForm. // in SystemConnectionForm.
if (conns[idx].getHostName() != null && !v.contains(conns[idx].getHostName())) if (conns[idx].getHostName() != null && !v.contains(conns[idx].getHostName()))
{ {
if (conns[idx].getSystemType().getName().equals(systemType)) if (conns[idx].getSystemType().equals(systemType))
v.addElement(conns[idx].getHostName()); v.addElement(conns[idx].getHostName());
} }
} }
} }
if ((systemType != null) && (systemType.equals(IRSESystemType.SYSTEMTYPE_LOCAL) && (v.size() == 0))) if ((systemType != null) && (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && (v.size() == 0)))
v.addElement("localhost"); //$NON-NLS-1$ v.addElement("localhost"); //$NON-NLS-1$
String[] names = new String[v.size()]; return (String[])v.toArray(new String[v.size()]);
for (int idx = 0; idx < names.length; idx++)
names[idx] = (String) v.elementAt(idx);
return names;
} }
/** /*
* Returns the clipboard used for copy actions * (non-Javadoc)
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#getSystemClipboard()
*/ */
public Clipboard getSystemClipboard() public Clipboard getSystemClipboard()
{ {
@ -2058,6 +2024,10 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
} }
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#getSystemClipboardObjects(int)
*/
public List getSystemClipboardObjects(int srcType) public List getSystemClipboardObjects(int srcType)
{ {
Clipboard clipboard = getSystemClipboard(); Clipboard clipboard = getSystemClipboard();
@ -2144,14 +2114,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return scratchpad; return scratchpad;
} }
/*
/** * (non-Javadoc)
* Convenience method to create a local connection, as it often that one is needed * @see org.eclipse.rse.core.model.ISystemRegistry#createLocalHost(org.eclipse.rse.core.model.ISystemProfile, java.lang.String, java.lang.String)
* for access to the local file system.
* @param profile - the profile to create this connection in. If null is passed, we first
* try to find the default private profile and use it, else we take the first active profile.
* @param name - the name to give this profile. Must be unique and non-null.
* @param userId - the user ID to use as the default for the subsystems. Can be null.
*/ */
public IHost createLocalHost(ISystemProfile profile, String name, String userId) public IHost createLocalHost(ISystemProfile profile, String name, String userId)
{ {
@ -2163,8 +2128,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
try try
{ {
IRSESystemType localType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
localConn = createHost( localConn = createHost(
profile.getName(), IRSESystemType.SYSTEMTYPE_LOCAL, profile.getName(), localType,
name, // connection name name, // connection name
"localhost", // hostname //$NON-NLS-1$ "localhost", // hostname //$NON-NLS-1$
"", // description //$NON-NLS-1$ "", // description //$NON-NLS-1$
@ -2181,36 +2147,13 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return localConn; return localConn;
} }
/** /*
* Create a connection object, given the connection pool and given all the possible attributes. * (non-Javadoc)
* <p> * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, org.eclipse.rse.core.model.ISystemNewConnectionWizardPage[])
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN
* THE PROFILE YOU SPECIFY. THE PROFILE IS ALSO SAVED TO DISK.
* <p>
* This method:
* <ul>
* <li>creates and saves a new connection within the given profile
* <li>calls all subsystem factories to give them a chance to create a subsystem instance
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* </ul>
* <p>
* @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
* @param newConnectionWizardPages when called from the New Connection wizard this is union of the list of additional
* wizard pages supplied by the subsystem factories that pertain to the specified system type. Else null.
* @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost( public IHost createHost(
String profileName, String profileName,
String systemType, IRSESystemType systemType,
String connectionName, String connectionName,
String hostName, String hostName,
String description, String description,
@ -2236,8 +2179,8 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
* </ul> * </ul>
* <p> * <p>
* @param profileName Name of the system profile the connection is to be added to. * @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system types
* systemTypes extension point. * defined via the 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 connection. Can be null.
@ -2252,7 +2195,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
*/ */
public IHost createHost( public IHost createHost(
String profileName, String profileName,
String systemType, IRSESystemType systemType,
String connectionName, String connectionName,
String hostName, String hostName,
String description, String description,
@ -2307,12 +2250,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return conn; return conn;
} }
/** /*
* Creates subsystems for a given host and subsystem configurations. * (non-Javadoc)
* @param host the host. * @see org.eclipse.rse.core.model.ISystemRegistry#createSubSystems(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.subsystems.ISubSystemConfiguration[])
* @param configurations the subsystem configurations.
* @return the array of subsystems corresponding to the array of given configurations.
* @since 2.0
*/ */
public ISubSystem[] createSubSystems(IHost host, ISubSystemConfiguration[] configurations) { public ISubSystem[] createSubSystems(IHost host, ISubSystemConfiguration[] configurations) {
@ -2330,7 +2270,6 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return subsystems; return subsystems;
} }
class FireNewHostEvents implements Runnable class FireNewHostEvents implements Runnable
{ {
private ISubSystem[] subSystems; private ISubSystem[] subSystems;
@ -2389,29 +2328,12 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
subPages[count++] = allPages[idx]; subPages[count++] = allPages[idx];
return subPages; return subPages;
} }
/**
* Create a connection object. This is a simplified version /*
* <p> * (non-Javadoc)
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
* THE PROFILE YOU SPECIFY. THE PROFILE IS ALSO SAVED TO DISK.
* <p>
* This method:
* <ul>
* <li>creates and saves a new connection within the given profile
* <li>calls all subsystem factories to give them a chance to create a subsystem instance
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* </ul>
* <p>
* @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost(String profileName, String systemType, String connectionName, String hostName, String description) public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description)
throws Exception throws Exception
{ {
return createHost(profileName, systemType, connectionName, hostName, description, true); return createHost(profileName, systemType, connectionName, hostName, description, true);
@ -2431,8 +2353,8 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
* </ul> * </ul>
* <p> * <p>
* @param profileName Name of the system profile the connection is to be added to. * @param profileName Name of the system profile the connection is to be added to.
* @param systemType system type matching one of the system type names defined via the * @param systemType system type matching one of the system types
* systemTypes extension point. * defined via the 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 connection. Can be null.
@ -2441,34 +2363,16 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
* because the connectionName is not unique. Call getLastException() if necessary. * because the connectionName is not unique. Call getLastException() if necessary.
* @since 2.0 * @since 2.0
*/ */
public IHost createHost(String profileName, String systemType, String connectionName, String hostName, String description, boolean createSubSystems) throws Exception public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, boolean createSubSystems) throws Exception
{ {
return createHost(profileName, systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, null); return createHost(profileName, systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, null);
} }
/** /*
* Create a connection object. This is a very simplified version that defaults to the user's * (non-Javadoc)
* private profile, or the first active profile if there is no private profile. * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU, IN
* THE DEFAULT PRIVATE PROFILE, WHICH IS SAVED TO DISK.
* <p>
* This method:
* <ul>
* <li>creates and saves a new connection within the given profile
* <li>calls all subsystem factories to give them a chance to create a subsystem instance
* <li>fires an ISystemResourceChangeEvent event of type EVENT_ADD to all registered listeners
* </ul>
* <p>
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @return SystemConnection object, or null if it failed to create. This is typically
* because the connectionName is not unique. Call getLastException() if necessary.
*/ */
public IHost createHost(String systemType, String connectionName, String hostName, String description) public IHost createHost(IRSESystemType systemType, String connectionName, String hostName, String description)
throws Exception throws Exception
{ {
ISystemProfile profile = getSystemProfileManager().getDefaultPrivateSystemProfile(); ISystemProfile profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
@ -2476,6 +2380,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
profile = getSystemProfileManager().getActiveSystemProfiles()[0]; profile = getSystemProfileManager().getActiveSystemProfiles()[0];
return createHost(profile.getName(), systemType, connectionName, hostName, description); return createHost(profile.getName(), systemType, connectionName, hostName, description);
} }
/** /**
* Return the previous connection as would be shown in the view * Return the previous connection as would be shown in the view
*/ */
@ -2498,30 +2403,12 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
return prevConn; return prevConn;
} }
/**
* Update an existing connection given the new information. /*
* This method: * (non-Javadoc)
* <ul> * @see org.eclipse.rse.core.model.ISystemRegistry#updateHost(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
* <li>calls the setXXX methods on the given connection object, updating the information in it.
* <li>save the connection's connection pool to disk
* <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.
* We must do this because a hostname changes fundamentally affects the connection,
* rendering any information currently displayed under
* that connection obsolete. That is, the user will have to reconnect.
* </ul>
* <p>
* @param conn SystemConnection to be updated
* @param systemType system type matching one of the system type names defined via the
* systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/ */
public void updateHost(IHost conn, String systemType, String connectionName, String hostName, String description, String defaultUserId, int defaultUserIdLocation) public void updateHost(IHost conn, IRSESystemType 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());
@ -2588,11 +2475,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
} }
/** /*
* Update the workoffline attribute for a connection. * (non-Javadoc)
* * @see org.eclipse.rse.core.model.ISystemRegistry#setHostOffline(org.eclipse.rse.core.model.IHost, boolean)
* @param conn SystemConnection to change
* @param offline true if connection should be set offline, false if it should be set online
*/ */
public void setHostOffline(IHost conn, boolean offline) public void setHostOffline(IHost conn, boolean offline)
{ {
@ -2604,17 +2489,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
} }
/** /*
* Delete an existing connection. * (non-Javadoc)
* <p> * @see org.eclipse.rse.core.model.ISystemRegistry#deleteHost(org.eclipse.rse.core.model.IHost)
* Lots to do here:
* <ul>
* <li>Delete all subsystem objects for this connection, including their file's on disk.
* <li>Delete this connection's private filter pool, if exists
* <li>Delete the connection from memory.
* <li>Delete the connection's folder from disk.
* </ul>
* Assumption: firing the delete event is done elsewhere. Specifically, the doDelete method of SystemView.
*/ */
public void deleteHost(IHost conn) public void deleteHost(IHost conn)
{ {
@ -2631,16 +2508,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
conn, null); conn, null);
} }
/** /*
* Renames an existing connection. * (non-Javadoc)
* <p> * @see org.eclipse.rse.core.model.ISystemRegistry#renameHost(org.eclipse.rse.core.model.IHost, java.lang.String)
* Lots to do here:
* <ul>
* <li>Reset the conn name for all subsystem objects for this connection
* <li>Rename the connection in memory.
* <li>Rename the connection's folder on disk.
* </ul>
* Assumption: firing the rename event is done elsewhere. Specifically, the doRename method of SystemView.
*/ */
public void renameHost(IHost conn, String newName) throws Exception public void renameHost(IHost conn, String newName) throws Exception
{ {
@ -2671,18 +2541,10 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
conn, oldName); conn, oldName);
} }
/** /*
* Move existing connections a given number of positions in the same profile. * (non-Javadoc)
* If the delta is negative, they are all moved up by the given amount. If * @see org.eclipse.rse.core.model.ISystemRegistry#moveHosts(java.lang.String, org.eclipse.rse.core.model.IHost[], int)
* positive, they are all moved down by the given amount.<p> * FIXME PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION?</b>
* <ul>
* <li>After the move, the pool containing the moved connection is saved to disk.
* <li>The connection's connection name must be unique in pool.
* <li>Fires a single ISystemResourceChangeEvent event of type EVENT_MOVE, if the pool is the private pool.
* </ul>
* <b>TODO PROBLEM: CAN'T RE-ORDER FOLDERS SO CAN WE SUPPORT THIS ACTION?</b>
* @param conns Array of SystemConnections to move.
* @param delta new zero-based position for the connection
*/ */
public void moveHosts(String profileName, IHost conns[], int delta) public void moveHosts(String profileName, IHost conns[], int delta)
{ {
@ -2701,13 +2563,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
conns[idx], null); conns[idx], null);
} }
/** /*
* Copy a SystemConnection. All subsystems are copied, and all connection data is copied. * (non-Javadoc)
* @param monitor Progress monitor to reflect each step of the operation * @see org.eclipse.rse.core.model.ISystemRegistry#copyHost(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.model.ISystemProfile, java.lang.String)
* @param conn The connection to copy
* @param targetProfile What profile to copy into
* @param newName Unique name to give copied profile
* @return new SystemConnection object
*/ */
public IHost copyHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception public IHost copyHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception
{ {
@ -2792,15 +2650,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return newConn; return newConn;
} }
/** /*
* Move a SystemConnection to another profile. All subsystems are moved, and all connection data is moved. * (non-Javadoc)
* This is actually accomplished by doing a copy operation first, and if successful deleting the original. * @see org.eclipse.rse.core.model.ISystemRegistry#moveHost(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.model.ISystemProfile, java.lang.String)
* @param monitor Progress monitor to reflect each step of the operation
* @param conn The connection to move
* @param targetProfile What profile to move into
* @param newName Unique name to give copied profile. Typically this is the same as the original name, but
* will be different on name collisions
* @return new SystemConnection object
*/ */
public IHost moveHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception public IHost moveHost(IProgressMonitor monitor, IHost conn, ISystemProfile targetProfile, String newName) throws Exception
{ {
@ -2823,7 +2675,8 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return newConn; return newConn;
} }
/** /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#isAnySubSystemSupportsConnect(org.eclipse.rse.core.model.IHost) * @see org.eclipse.rse.core.model.ISystemRegistry#isAnySubSystemSupportsConnect(org.eclipse.rse.core.model.IHost)
*/ */
public boolean isAnySubSystemSupportsConnect(IHost conn) { public boolean isAnySubSystemSupportsConnect(IHost conn) {
@ -2848,8 +2701,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return false; return false;
} }
/** /*
* Return true if any of the subsystems for the given connection are currently connected * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#isAnySubSystemConnected(org.eclipse.rse.core.model.IHost)
*/ */
public boolean isAnySubSystemConnected(IHost conn) public boolean isAnySubSystemConnected(IHost conn)
{ {
@ -2866,8 +2720,9 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
return any; return any;
} }
/** /*
* Return true if all of the subsystems for the given connection are currently connected * (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#areAllSubSystemsConnected(org.eclipse.rse.core.model.IHost)
*/ */
public boolean areAllSubSystemsConnected(IHost conn) public boolean areAllSubSystemsConnected(IHost conn)
{ {
@ -2886,8 +2741,10 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
return all; return all;
} }
/**
* Disconnect all subsystems for the given connection, if they are currently connected. /*
* (non-Javadoc)
* @see org.eclipse.rse.core.model.ISystemRegistry#disconnectAllSubSystems(org.eclipse.rse.core.model.IHost)
*/ */
public void disconnectAllSubSystems(IHost conn) public void disconnectAllSubSystems(IHost conn)
{ {
@ -2921,18 +2778,18 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
} }
/** /*
* Inform the world when the connection status changes for a subsystem within a connection. * (non-Javadoc)
* Update properties for the subsystem and its connection * @see org.eclipse.rse.core.model.ISystemRegistry#connectedStatusChange(org.eclipse.rse.core.subsystems.ISubSystem, boolean, boolean)
*/ */
public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected) public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected)
{ {
connectedStatusChange(subsystem, connected, wasConnected, true); connectedStatusChange(subsystem, connected, wasConnected, true);
} }
/** /*
* Inform the world when the connection status changes for a subsystem within a connection. * (non-Javadoc)
* Update properties for the subsystem and its connection * @see org.eclipse.rse.core.model.ISystemRegistry#connectedStatusChange(org.eclipse.rse.core.subsystems.ISubSystem, boolean, boolean, boolean)
*/ */
public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree) public void connectedStatusChange(ISubSystem subsystem, boolean connected, boolean wasConnected, boolean collapseTree)
{ {

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
@ -758,7 +759,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
/** /**
* Return the system types this subsystem factory supports. * Return the system types this subsystem factory supports.
*/ */
public String[] getSystemTypes() public IRSESystemType[] getSystemTypes()
{ {
return proxy.getSystemTypes(); return proxy.getSystemTypes();
} }
@ -931,7 +932,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
else else
{ {
// strange situation..log this // strange situation..log this
RSEUIPlugin.logInfo("renameSubSystemsByConnection for " + conn.getAliasName() + " has no subsystems" ); SystemBasePlugin.logInfo("renameSubSystemsByConnection for " + conn.getAliasName() + " has no subsystems" ); //$NON-NLS-1$ //$NON-NLS-2$
} }
try try
{ {
@ -1002,7 +1003,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
if (allActiveConnections != null) if (allActiveConnections != null)
{ {
for (int idx = 0; idx < allActiveConnections.length; idx++) for (int idx = 0; idx < allActiveConnections.length; idx++)
if (proxy.appliesToSystemType(allActiveConnections[idx].getSystemType().getName())) if (proxy.appliesToSystemType(allActiveConnections[idx].getSystemType()))
getSubSystems(allActiveConnections[idx], force); // will load from disk if not already loaded getSubSystems(allActiveConnections[idx], force); // will load from disk if not already loaded
} }
allSubSystemsRestored = true; allSubSystemsRestored = true;
@ -1042,7 +1043,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
boolean subsystemsRestored = subSystemsHaveBeenRestored(conn); boolean subsystemsRestored = subSystemsHaveBeenRestored(conn);
if (!subsystemsRestored && force) if (!subsystemsRestored && force)
{ {
RSEUIPlugin.logInfo("in SubSystemConfiguration.getSubSystems(conn, force) - not restored"); SystemBasePlugin.logInfo("in SubSystemConfiguration.getSubSystems(conn, force) - not restored"); //$NON-NLS-1$
/*FIXME - this should now be triggered by new persistence model /*FIXME - this should now be triggered by new persistence model
try try
{ {
@ -1064,7 +1065,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
} }
else if (!subsystemsRestored && !force) else if (!subsystemsRestored && !force)
{ {
RSEUIPlugin.logInfo("in SubSystemConfiguration.getSubSytems(conn, force) - returning empty array"); SystemBasePlugin.logInfo("in SubSystemConfiguration.getSubSytems(conn, force) - returning empty array"); //$NON-NLS-1$
return EMPTY_SUBSYSTEM_ARRAY; return EMPTY_SUBSYSTEM_ARRAY;
} }
else else
@ -2688,15 +2689,18 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
public IServerLauncherProperties createServerLauncher(IConnectorService connectorService) public IServerLauncherProperties createServerLauncher(IConnectorService connectorService)
{ {
IRemoteServerLauncher sl = new RemoteServerLauncher("Remote Server Launcher", connectorService); //$NON-NLS-1$ IRemoteServerLauncher sl = new RemoteServerLauncher("Remote Server Launcher", connectorService); //$NON-NLS-1$
String systemType = connectorService.getHostType(); IRSESystemType systemType = connectorService.getHost().getSystemType();
String systemTypeId = systemType.getId();
if (systemType.equals(IRSESystemType.SYSTEMTYPE_LINUX) || if (systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LINUX_ID)
systemType.equals(IRSESystemType.SYSTEMTYPE_POWER_LINUX) || || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_POWER_LINUX_ID)
systemType.equals(IRSESystemType.SYSTEMTYPE_ZSERIES_LINUX)) { || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_ZSERIES_LINUX_ID)
) {
sl.setServerScript(RemoteServerLauncherConstants.LINUX_REXEC_SCRIPT); sl.setServerScript(RemoteServerLauncherConstants.LINUX_REXEC_SCRIPT);
} }
else if (systemType.equals(IRSESystemType.SYSTEMTYPE_UNIX) || else if (systemTypeId.equals(IRSESystemType.SYSTEMTYPE_UNIX_ID)
systemType.equals(IRSESystemType.SYSTEMTYPE_AIX)) { || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_AIX_ID)
) {
sl.setServerScript(RemoteServerLauncherConstants.UNIX_REXEC_SCRIPT); sl.setServerScript(RemoteServerLauncherConstants.UNIX_REXEC_SCRIPT);
} }

View file

@ -7,10 +7,12 @@
* Contributors: * Contributors:
* David Dykstal (IBM) - 168977: refactoring IConnectorService * David Dykstal (IBM) - 168977: refactoring IConnectorService
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.subsystems; package org.eclipse.rse.ui.subsystems;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.PasswordPersistenceManager; import org.eclipse.rse.core.PasswordPersistenceManager;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.model.SystemSignonInformation; import org.eclipse.rse.core.model.SystemSignonInformation;
@ -175,7 +177,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
ISubSystem subsystem = getPrimarySubSystem(); ISubSystem subsystem = getPrimarySubSystem();
IHost host = subsystem.getHost(); IHost host = subsystem.getHost();
String hostName = host.getHostName(); String hostName = host.getHostName();
String hostType = host.getSystemType().getName(); IRSESystemType systemType = host.getSystemType();
savePassword = false; savePassword = false;
if (supportsUserId()) { if (supportsUserId()) {
boolean sameHost = hostName.equalsIgnoreCase(getConnectorService().getHostName()); boolean sameHost = hostName.equalsIgnoreCase(getConnectorService().getHostName());
@ -187,7 +189,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
if (supportsPassword()) { if (supportsPassword()) {
if (password == null) { if (password == null) {
PasswordPersistenceManager ppm = PasswordPersistenceManager.getInstance(); PasswordPersistenceManager ppm = PasswordPersistenceManager.getInstance();
SystemSignonInformation savedSignonInformation = ppm.find(hostType, hostName, userId); SystemSignonInformation savedSignonInformation = ppm.find(systemType, hostName, userId);
if (savedSignonInformation != null) { if (savedSignonInformation != null) {
password = savedSignonInformation.getPassword(); password = savedSignonInformation.getPassword();
savePassword = true; savePassword = true;
@ -253,7 +255,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
public final ICredentials getCredentials() { public final ICredentials getCredentials() {
IHost host = getConnectorService().getHost(); IHost host = getConnectorService().getHost();
String hostName = host.getHostName(); String hostName = host.getHostName();
String systemType = host.getSystemType().getName(); IRSESystemType systemType = host.getSystemType();
SystemSignonInformation result = new SystemSignonInformation(hostName, userId, password, systemType); SystemSignonInformation result = new SystemSignonInformation(hostName, userId, password, systemType);
return result; return result;
} }
@ -296,7 +298,7 @@ public class StandardCredentialsProvider extends AbstractCredentialsProvider {
matchingUserId = matchingUserId.toUpperCase(); matchingUserId = matchingUserId.toUpperCase();
} }
IConnectorService cs = getConnectorService(); IConnectorService cs = getConnectorService();
String systemType = cs.getHostType(); IRSESystemType systemType = cs.getHost().getSystemType();
String hostName = cs.getHostName(); String hostName = cs.getHostName();
SystemSignonInformation signonInformation = new SystemSignonInformation(hostName, matchingUserId, password, systemType); SystemSignonInformation signonInformation = new SystemSignonInformation(hostName, matchingUserId, password, systemType);
setSignonInformation(signonInformation); setSignonInformation(signonInformation);

View file

@ -1,5 +1,3 @@
package org.eclipse.rse.internal.useractions.ui.uda;
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
@ -9,8 +7,13 @@ package org.eclipse.rse.internal.useractions.ui.uda;
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.uda;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.rse.core.IRSESystemType;
/** /**
* This class represents a user action read from a user action extension point * This class represents a user action read from a user action extension point
@ -19,7 +22,8 @@ import org.eclipse.core.runtime.IConfigurationElement;
* IT IS NOT COMPLETE YET AND NOT SUPPORTED YET. * IT IS NOT COMPLETE YET AND NOT SUPPORTED YET.
*/ */
public class SystemUserActionExtension { public class SystemUserActionExtension {
private String types, id, vendor; private String types;
private String id, vendor;
private boolean allTypes; private boolean allTypes;
// SEE FILE plugin.xml.udaExtensionPoint.notused // SEE FILE plugin.xml.udaExtensionPoint.notused
@ -51,11 +55,13 @@ public class SystemUserActionExtension {
/** /**
* Return true if this extension's systemTypes attribute matches the given system type * Return true if this extension's systemTypes attribute matches the given system type
*/ */
public boolean appliesToSystemType(String type) { public boolean appliesToSystemType(IRSESystemType type) {
//System.out.println("INSIDE APPLIESTO FOR " + type + ". allTypes = " + allTypes + ". types = " + types); //System.out.println("INSIDE APPLIESTO FOR " + type + ". allTypes = " + allTypes + ". types = " + types);
if (allTypes) if (allTypes)
return true; return true;
else else {
return (types.indexOf(type) >= 0); //FIXME migrate to using ID
return (types.indexOf(type.getName()) >= 0);
}
} }
} }

View file

@ -1,5 +1,3 @@
package org.eclipse.rse.internal.useractions.ui.uda;
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2007 IBM Corporation and others. * Copyright (c) 2002, 2007 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
@ -9,12 +7,17 @@ package org.eclipse.rse.internal.useractions.ui.uda;
* *
* Contributors: * Contributors:
* IBM Corporation - initial API and implementation * IBM Corporation - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.internal.useractions.ui.uda;
import java.util.Vector; import java.util.Vector;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionRegistry; import org.eclipse.core.runtime.IExtensionRegistry;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.rse.core.IRSESystemType;
/** /**
* This class manages reading user action extension points. * This class manages reading user action extension points.
@ -52,7 +55,7 @@ public class SystemUserActionExtensionManager {
* Return list of user-actions defined by the given extension point, for the given * Return list of user-actions defined by the given extension point, for the given
* system type. * system type.
*/ */
public SystemUserActionExtension[] getUserActionExtensions(String systemType) { public SystemUserActionExtension[] getUserActionExtensions(IRSESystemType systemType) {
int count = 0; int count = 0;
if (!read) readExtensions(); if (!read) readExtensions();
if ((elements == null) || (elements.size() == 0)) return null; if ((elements == null) || (elements.size() == 0)) return null;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - initial API and implementation * Uwe Stieber (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.core.connection; package org.eclipse.rse.tests.core.connection;
@ -18,7 +19,7 @@ public interface IRSEConnectionProperties {
public final String ATTR_NAME = "name"; //$NON-NLS-1$ public final String ATTR_NAME = "name"; //$NON-NLS-1$
public final String ATTR_PROFILE_NAME = "profile_name"; //$NON-NLS-1$ public final String ATTR_PROFILE_NAME = "profile_name"; //$NON-NLS-1$
public final String ATTR_SYSTEM_TYPE = "system_type"; //$NON-NLS-1$ public final String ATTR_SYSTEM_TYPE_ID = "system_type_id"; //$NON-NLS-1$
public final String ATTR_ADDRESS = "address"; //$NON-NLS-1$ public final String ATTR_ADDRESS = "address"; //$NON-NLS-1$
public final String ATTR_USERID = "userid"; //$NON-NLS-1$ public final String ATTR_USERID = "userid"; //$NON-NLS-1$
public final String ATTR_PASSWORD = "password"; //$NON-NLS-1$ public final String ATTR_PASSWORD = "password"; //$NON-NLS-1$

View file

@ -1,5 +1,5 @@
/* ******************************************************************************* /********************************************************************************
* Copyright (c) 2006 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -8,11 +8,13 @@
* Don Yantzi (IBM) - initial contribution. * Don Yantzi (IBM) - initial contribution.
* David Dykstal (IBM) - initial contribution. * David Dykstal (IBM) - initial contribution.
* Uwe Stieber (Wind River) - refactoring and cleanup. * Uwe Stieber (Wind River) - refactoring and cleanup.
* *******************************************************************************/ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/
package org.eclipse.rse.tests.core.connection; package org.eclipse.rse.tests.core.connection;
import java.util.Properties; import java.util.Properties;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.tests.core.RSECoreTestCase; import org.eclipse.rse.tests.core.RSECoreTestCase;
import org.eclipse.rse.tests.internal.RSEConnectionManager; import org.eclipse.rse.tests.internal.RSEConnectionManager;
@ -43,7 +45,7 @@ public class RSEBaseConnectionTestCase extends RSECoreTestCase {
// Pre-create the local system connection properties // Pre-create the local system connection properties
Properties properties = new Properties(); Properties properties = new Properties();
properties.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE, "Local"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID, IRSESystemType.SYSTEMTYPE_LOCAL_ID);
properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, "localhost"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, "localhost"); //$NON-NLS-1$
properties.setProperty(IRSEConnectionProperties.ATTR_NAME, "Local"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_NAME, "Local"); //$NON-NLS-1$
localSystemConnectionProperties = getConnectionManager().loadConnectionProperties(properties, false); localSystemConnectionProperties = getConnectionManager().loadConnectionProperties(properties, false);

View file

@ -1,5 +1,5 @@
/* ******************************************************************************* /********************************************************************************
* Copyright (c) 2006 IBM Corporation and others. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -7,11 +7,13 @@
* Contributors: * Contributors:
* Don Yantzi (IBM) - initial contribution. * Don Yantzi (IBM) - initial contribution.
* David Dykstal (IBM) - initial contribution. * David Dykstal (IBM) - initial contribution.
* *******************************************************************************/ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/
package org.eclipse.rse.tests.core.connection; package org.eclipse.rse.tests.core.connection;
import java.util.Properties; import java.util.Properties;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.tests.RSETestsPlugin; import org.eclipse.rse.tests.RSETestsPlugin;
@ -37,7 +39,7 @@ public class RSEConnectionTestCase extends RSEBaseConnectionTestCase {
properties.setProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME, "TestProfile"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME, "TestProfile"); //$NON-NLS-1$
properties.setProperty(IRSEConnectionProperties.ATTR_NAME, "TestHost1"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_NAME, "TestHost1"); //$NON-NLS-1$
properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, "localhost"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_ADDRESS, "localhost"); //$NON-NLS-1$
properties.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE, "Unix"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID, IRSESystemType.SYSTEMTYPE_UNIX_ID);
properties.setProperty(IRSEConnectionProperties.ATTR_USERID, "userid"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_USERID, "userid"); //$NON-NLS-1$
properties.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, "password"); //$NON-NLS-1$ properties.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, "password"); //$NON-NLS-1$

View file

@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - initial API and implementation * Uwe Stieber (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.core.registries; package org.eclipse.rse.tests.core.registries;
@ -58,9 +59,9 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
IRSESystemType systemType = systemTypes[j]; IRSESystemType systemType = systemTypes[j];
assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$
if ("Local".equalsIgnoreCase(systemType.getName()) || "Windows".equalsIgnoreCase(systemType.getName())) { //$NON-NLS-1$ //$NON-NLS-2$ if ("Local".equalsIgnoreCase(systemType.getName()) || "Windows".equalsIgnoreCase(systemType.getName())) { //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} else { } else {
assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} }
} }
} }
@ -82,9 +83,9 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
IRSESystemType systemType = systemTypes[j]; IRSESystemType systemType = systemTypes[j];
assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$
if (systemType.getId().startsWith("org.eclipse.rse.tests.")) { //$NON-NLS-1$ if (systemType.getId().startsWith("org.eclipse.rse.tests.")) { //$NON-NLS-1$
assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} else { } else {
assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} }
} }
} }
@ -106,9 +107,9 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
IRSESystemType systemType = systemTypes[j]; IRSESystemType systemType = systemTypes[j];
assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$ assertNotNull("Invalid null value in list of registered system types!", systemType); //$NON-NLS-1$
if ("Unix".equalsIgnoreCase(systemType.getName()) || "Linux".equalsIgnoreCase(systemType.getName())) { //$NON-NLS-1$ //$NON-NLS-2$ if ("Unix".equalsIgnoreCase(systemType.getName()) || "Linux".equalsIgnoreCase(systemType.getName())) { //$NON-NLS-1$ //$NON-NLS-2$
assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} else { } else {
assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType.getName())); //$NON-NLS-1$ assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
} }
} }
} }

View file

@ -10,6 +10,7 @@
* David Dykstal (IBM) - initial contribution. * David Dykstal (IBM) - initial contribution.
* Uwe Stieber (Wind River) - refactoring and cleanup. * Uwe Stieber (Wind River) - refactoring and cleanup.
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.internal; package org.eclipse.rse.tests.internal;
@ -26,6 +27,7 @@ import junit.framework.Assert;
import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.rse.core.IRSESystemType;
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.RSECorePlugin;
@ -219,8 +221,9 @@ public class RSEConnectionManager implements IRSEConnectionManager {
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid user password name!", "unknown", password); //$NON-NLS-1$ //$NON-NLS-2$ Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid user password name!", "unknown", password); //$NON-NLS-1$ //$NON-NLS-2$
String address = properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS); String address = properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid remote system ip address or dns name!", "unknown", address); //$NON-NLS-1$ //$NON-NLS-2$ Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid remote system ip address or dns name!", "unknown", address); //$NON-NLS-1$ //$NON-NLS-2$
String systemType = properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE); String systemTypeId = properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID);
Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid system type!", "unknown", address); //$NON-NLS-1$ //$NON-NLS-2$ Assert.assertNotSame("FAILED(findOrCreateConnection): Invalid system type!", "unknown", systemTypeId); //$NON-NLS-1$ //$NON-NLS-2$
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(systemTypeId);
exception = null; exception = null;
cause = null; cause = null;

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2006 Wind River Systems, Inc. and others. * Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -7,6 +7,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - initial API and implementation * Uwe Stieber (Wind River) - initial API and implementation
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.internal; package org.eclipse.rse.tests.internal;
@ -21,6 +22,7 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.tests.RSETestsPlugin; import org.eclipse.rse.tests.RSETestsPlugin;
import org.eclipse.rse.tests.core.IRSECoreTestCaseProperties; import org.eclipse.rse.tests.core.IRSECoreTestCaseProperties;
import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil; import org.eclipse.rse.tests.core.RSEWaitAndDispatchUtil;
@ -180,21 +182,21 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertEquals("Property name does not match!", "test_windows", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property name does not match!", "test_windows", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property profile name does not match!", "junit_test_profile", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property profile name does not match!", "junit_test_profile", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property system type does not match!", "Windows", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", IRSESystemType.SYSTEMTYPE_WINDOWS_ID, properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property remote system address does not match!", "128.0.0.1", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property remote system address does not match!", "128.0.0.1", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property user id does not match!", "test_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "test_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "test_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "test_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$
// test the loading with partial connection information (with defauls) // test the loading with partial connection information (with defauls)
Properties props = new Properties(); Properties props = new Properties();
props.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE, "SSH Only"); //$NON-NLS-1$ props.setProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID, "org.eclipse.rse.systemtype.ssh"); //$NON-NLS-1$
props.setProperty(IRSEConnectionProperties.ATTR_USERID, "local_user"); //$NON-NLS-1$ props.setProperty(IRSEConnectionProperties.ATTR_USERID, "local_user"); //$NON-NLS-1$
props.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, "local_passwd"); //$NON-NLS-1$ props.setProperty(IRSEConnectionProperties.ATTR_PASSWORD, "local_passwd"); //$NON-NLS-1$
properties = getConnectionManager().loadConnectionProperties(props, true); properties = getConnectionManager().loadConnectionProperties(props, true);
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertEquals("Property name does not match!", "Local", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property name does not match!", "Local", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ //$NON-NLS-2$
assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$
assertEquals("Property system type does not match!", "SSH Only", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", "org.eclipse.rse.systemtype.ssh", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property remote system address does not match!", "localhost", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property remote system address does not match!", "localhost", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$
@ -204,7 +206,7 @@ public class RSEInternalFrameworkTestCase extends RSEBaseConnectionTestCase {
assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$ assertNotNull("Failed to load test connection properties from location " + location.toOSString(), properties); //$NON-NLS-1$
assertNull("Property name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$ assertNull("Property name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_NAME)); //$NON-NLS-1$
assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$ assertNull("Property profile name does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_PROFILE_NAME)); //$NON-NLS-1$
assertEquals("Property system type does not match!", "SSH Only", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property system type does not match!", "org.eclipse.rse.systemtype.ssh", properties.getProperty(IRSEConnectionProperties.ATTR_SYSTEM_TYPE_ID)); //$NON-NLS-1$ //$NON-NLS-2$
assertNull("Property remote system address does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$ assertNull("Property remote system address does not match!", properties.getProperty(IRSEConnectionProperties.ATTR_ADDRESS)); //$NON-NLS-1$
assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property user id does not match!", "local_user", properties.getProperty(IRSEConnectionProperties.ATTR_USERID)); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$ assertEquals("Property password does not match!", "local_passwd", properties.getProperty(IRSEConnectionProperties.ATTR_PASSWORD)); //$NON-NLS-1$ //$NON-NLS-2$

View file

@ -1,11 +1,12 @@
/******************************************************************************** /********************************************************************************
* Copyright (c) 2007 IBM Corporation. All rights reserved. * Copyright (c) 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* David Dykstal (IBM) - initial API and implementation. * David Dykstal (IBM) - initial API and implementation.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.tests.persistence; package org.eclipse.rse.tests.persistence;
@ -16,6 +17,7 @@ import java.util.List;
import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.jobs.IJobManager; import org.eclipse.core.runtime.jobs.IJobManager;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; 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.IPropertySet; import org.eclipse.rse.core.model.IPropertySet;
@ -172,7 +174,8 @@ public class PersistenceTest extends RSECoreTestCase {
assertNotNull(profile); assertNotNull(profile);
try { try {
registry.createHost("bogus", "Linux", "myhost", "myhost.mynet.mycompany.net", null); IRSESystemType linuxType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LINUX_ID);
registry.createHost("bogus", linuxType, "myhost", "myhost.mynet.mycompany.net", null);
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }

View file

@ -1,5 +1,5 @@
/* ****************************************************************************** /*******************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved. * Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms * This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is * of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html * available at http://www.eclipse.org/legal/epl-v10.html
@ -10,7 +10,8 @@
* Kushal Munir (IBM) - initial API and implementation. * Kushal Munir (IBM) - initial API and implementation.
* David Dykstal (IBM) - moved SystemPreferencesManager to a new package * David Dykstal (IBM) - moved SystemPreferencesManager to a new package
* - created and used RSEPreferencesManager * - created and used RSEPreferencesManager
* ******************************************************************************/ * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
*******************************************************************************/
package org.eclipse.rse.tests.preferences; package org.eclipse.rse.tests.preferences;
@ -73,7 +74,8 @@ public class PreferencesTest extends RSECoreTestCase {
String oldValue = RSEPreferencesManager.getDefaultUserId(systemType); String oldValue = RSEPreferencesManager.getDefaultUserId(systemType);
RSEPreferencesManager.setDefaultUserId(systemType, "bogus1"); //$NON-NLS-1$ RSEPreferencesManager.setDefaultUserId(systemType, "bogus1"); //$NON-NLS-1$
assertEquals("bogus1", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$ assertEquals("bogus1", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$
RSEPreferencesManager.setDefaultUserId("Local", "bogus2"); //$NON-NLS-1$ //$NON-NLS-2$ IRSESystemType localType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
RSEPreferencesManager.setDefaultUserId(localType, "bogus2"); //$NON-NLS-1$ //$NON-NLS-2$
assertEquals("bogus2", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$ assertEquals("bogus2", RSEPreferencesManager.getDefaultUserId(systemType)); //$NON-NLS-1$
RSEPreferencesManager.setDefaultUserId(systemType, oldValue); RSEPreferencesManager.setDefaultUserId(systemType, oldValue);
assertEquals(oldValue, RSEPreferencesManager.getDefaultUserId(systemType)); assertEquals(oldValue, RSEPreferencesManager.getDefaultUserId(systemType));

View file

@ -1,5 +1,5 @@
############################################################################### ###############################################################################
# Copyright (c) 2006 IBM Corporation and others. All rights reserved. # Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
@ -8,6 +8,7 @@
# Contributors: # Contributors:
# IBM Corporation - initial API and implementation # IBM Corporation - initial API and implementation
# Uwe Stieber (Wind River) - refactoring and cleanup. # Uwe Stieber (Wind River) - refactoring and cleanup.
# Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
############################################################################### ###############################################################################
# The default RSE host node label/name # The default RSE host node label/name
@ -20,7 +21,8 @@ name = Local
# The default test connection system type if not explicitly # The default test connection system type if not explicitly
# specified different (possible values: Unix, Linux, Local, Windows, SSH Only, FTP Only) # specified different (possible values: Unix, Linux, Local, Windows, SSH Only, FTP Only)
system_type = Local #system_type = Local
system_type_id = org.eclipse.rse.systemtype.local
# The default remote system ip address or dns name. # The default remote system ip address or dns name.
address = localhost address = localhost

Some files were not shown because too many files have changed in this diff Show more