1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-04 14:55:41 +02:00

[186640][api] Add IRSESystemTyep.isLocal(), isWindows(), getProperty(String, boolean)

This commit is contained in:
Martin Oberhuber 2007-05-11 20:28:10 +00:00
parent 7ef8f1b99f
commit 2aa9214149
35 changed files with 369 additions and 285 deletions

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.connectorservice.dstore; package org.eclipse.rse.connectorservice.dstore;
@ -44,7 +45,6 @@ import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener; import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener;
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor;
import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory;
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.comm.ISystemKeystoreProvider; import org.eclipse.rse.core.comm.ISystemKeystoreProvider;
@ -1291,49 +1291,6 @@ public class DStoreConnectorService extends StandardConnectorService implements
} }
} }
// /**
// * @see org.eclipse.rse.core.subsystems.AbstractConnectorService#getPasswordInformation()
// */
// public SystemSignonInformation getPasswordInformation()
// {
// // For Windows we want to avoid the signon prompt (because we never
// // really authenticate with the remote system and this would be deceiving
// // for the end user
//
// if (getPrimarySubSystem().getHost().getSystemType().getName().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
// {
// String userid = getPrimarySubSystem().getUserId();
// if (userid == null)
// {
// userid = "remoteuser"; //$NON-NLS-1$
// }
// SystemSignonInformation info = new SystemSignonInformation(getPrimarySubSystem().getHost().getHostName(),
// userid, "", IRSESystemType.SYSTEMTYPE_WINDOWS); //$NON-NLS-1$
// return info;
// }
// else
// {
// return super.getPasswordInformation();
// }
// }
// /**
// * @see AbstractConnectorService#hasPassword(boolean)
// */
// public boolean isPasswordCached()
// {
// // For Windows we never prompt for userid / password so we don't need
// // to clear the password cache
// if (getPrimarySubSystem().getHost().getSystemType().getName().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
// {
// return false;
// }
// else
// {
// return super.isPasswordCached();
// }
// }
public boolean supportsRemoteServerLaunching() public boolean supportsRemoteServerLaunching()
{ {
return true; return true;
@ -1350,8 +1307,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
public boolean supportsPassword() { public boolean supportsPassword() {
boolean result = super.supportsPassword(); boolean result = super.supportsPassword();
IHost host = getHost(); IHost host = getHost();
String systemType = host.getSystemType().getName(); if (host.getSystemType().isWindows()) {
if (systemType.equals(IRSESystemType.SYSTEMTYPE_WINDOWS)) {
result = false; result = false;
} }
return result; return result;
@ -1362,9 +1318,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
*/ */
public boolean supportsUserId() { public boolean supportsUserId() {
boolean result = super.supportsUserId(); boolean result = super.supportsUserId();
IHost host = getHost(); if (getHost().getSystemType().isWindows()) {
String systemType = host.getSystemType().getName();
if (systemType.equals(IRSESystemType.SYSTEMTYPE_WINDOWS)) {
result = false; result = false;
} }
return result; return result;

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.connectorservice.dstore; package org.eclipse.rse.internal.connectorservice.dstore;
@ -360,7 +361,7 @@ public class RexecDstoreServer implements IServerLauncher
this.propertyInfo = propertyInfo; this.propertyInfo = propertyInfo;
// set path... // set path...
this.cwd = ((IRemoteServerLauncher)propertyInfo).getServerPath(); this.cwd = ((IRemoteServerLauncher)propertyInfo).getServerPath();
char separatorChar = signonInfo.getSystemType().equals("Windows") ? '\\' : '/'; //$NON-NLS-1$ char separatorChar = signonInfo.getSystemType().isWindows() ? '\\' : '/'; //$NON-NLS-1$
if (cwd.length() > 0 && cwd.charAt(cwd.length() - 1) != separatorChar) if (cwd.length() > 0 && cwd.charAt(cwd.length() - 1) != separatorChar)
cwd += separatorChar; cwd += separatorChar;
// set script... // set script...

View file

@ -13,6 +13,7 @@
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Extended system type -> subsystemConfiguration association. * Uwe Stieber (Wind River) - Extended system type -> subsystemConfiguration association.
* Martin Oberhuber (Wind River) - [185098] Provide constants for all well-known system types * Martin Oberhuber (Wind River) - [185098] Provide constants for all well-known system types
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -24,7 +25,8 @@ import org.osgi.framework.Bundle;
* Interface for a system type. Constants are defined for various system types. * Interface for a system type. Constants are defined for various system types.
* These constants are kept in sync with definitions in plugin.xml. * These constants are kept in sync with definitions in plugin.xml.
* *
* This interface is not intended to be implemented by clients. * This interface is not intended to be implemented directly by clients.
* Clients should extend the abstract base class {@link RSESystemType} instead.
*/ */
public interface IRSESystemType extends IAdaptable { public interface IRSESystemType extends IAdaptable {
@ -35,7 +37,7 @@ public interface IRSESystemType extends IAdaptable {
public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$ public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$
/** /**
* Linus system type, "org.eclipse.rse.systemtype.linux". * Linux system type, "org.eclipse.rse.systemtype.linux".
*/ */
public static final String SYSTEMTYPE_LINUX_ID = "org.eclipse.rse.systemtype.linux"; //$NON-NLS-1$ public static final String SYSTEMTYPE_LINUX_ID = "org.eclipse.rse.systemtype.linux"; //$NON-NLS-1$
@ -133,9 +135,7 @@ public interface IRSESystemType extends IAdaptable {
*/ */
public static final String SYSTEMTYPE_WINDOWS = "Windows"; //$NON-NLS-1$ public static final String SYSTEMTYPE_WINDOWS = "Windows"; //$NON-NLS-1$
/** /** Windows system type, "org.eclipse.rse.systemtype.windows". */
* Windows system type, "org.eclipse.rse.systemtype.windows".
*/
public static final String SYSTEMTYPE_WINDOWS_ID = "org.eclipse.rse.systemtype.windows"; //$NON-NLS-1$ public static final String SYSTEMTYPE_WINDOWS_ID = "org.eclipse.rse.systemtype.windows"; //$NON-NLS-1$
/** Discovery system type, "org.eclipse.rse.systemtype.discovery". */ /** Discovery system type, "org.eclipse.rse.systemtype.discovery". */
@ -147,6 +147,28 @@ public interface IRSESystemType extends IAdaptable {
/** Telnet Only system type, "org.eclipse.rse.systemtype.telnet". */ /** Telnet Only system type, "org.eclipse.rse.systemtype.telnet". */
public static final String SYSTEMTYPE_TELNET_ONLY_ID = "org.eclipse.rse.systemtype.telnet"; //$NON-NLS-1$ public static final String SYSTEMTYPE_TELNET_ONLY_ID = "org.eclipse.rse.systemtype.telnet"; //$NON-NLS-1$
/**
* System type Property Key (value: "isWindows") indicating whether
* a system type is declared in plugin.xml to refers to a Windows
* system.
* On a Windows system, the following properties are expected:
* <ul>
* <li>File system is not case sensitive</li>
* <li>File system has root drives</li>
* <li>Symbolic links are not supported</li>
* <li>"cmd" is used as the default shell</li>
* </ul>
* @see #getProperty(String, boolean)
*/
public static final String PROPERTY_IS_WINDOWS = "isWindows"; //$NON-NLS-1$
/**
* System type Property Key (value: "isCaseSensitive") indicating
* whether a given system type is in general case sensitive.
* @see #getProperty(String, boolean)
*/
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
/** /**
* Returns the id of the system type. * Returns the id of the system type.
* @return the id of the system type * @return the id of the system type
@ -183,6 +205,36 @@ public interface IRSESystemType extends IAdaptable {
*/ */
public String getProperty(String key); public String getProperty(String key);
/**
* Returns the boolean property of this system type with the given key.
* The default value is returned if there is no such key.
*
* @param key the name of the property to return
* @param defaultValue the default value to expect if the property is not set
* @return the boolean value associated with the given key or the specified default value
*/
public boolean getProperty(String key, boolean defaultValue);
/**
* Tests whether the system type refers to the local system.
* This is a shortcut for getId().equals(SYSTEMTYPE_LOCAL_ID)
* Extenders (contributors of custom system types) may override.
* @return true if the system type refers to the local system.
*/
public boolean isLocal();
/**
* Tests whether the system type refers to the Windows system.
* This is a shortcut for
* <pre>
* getId().equals(SYSTEMTYPE_WINDOWS_ID) ||
* isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")
* </pre>
* Extenders (contributors of custom system types) may override.
* @return true if the system type refers to a Windows system.
*/
public boolean isWindows();
/** /**
* Returns the bundle which is responsible for the definition of this system type. * Returns the bundle which is responsible for the definition of this system type.
* Typically this is used as a base for searching for images and other files * Typically this is used as a base for searching for images and other files

View file

@ -15,6 +15,7 @@
* - updated to use new RSEPreferencesManager * - updated to use new RSEPreferencesManager
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core; package org.eclipse.rse.core;
@ -32,7 +33,6 @@ 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.eclipse.rse.internal.core.RSECoreMessages;
import org.osgi.framework.Bundle;
/** /**
@ -78,28 +78,15 @@ public class PasswordPersistenceManager {
/** /**
* Default System Type * Default System Type
*/ */
private static class DefaultSystemType implements IRSESystemType private static class DefaultSystemType extends RSESystemType implements IRSESystemType
{ {
private static final String DEFAULT_ID = "DEFAULT"; //$NON-NLS-1$
private DefaultSystemType() { private DefaultSystemType() {
} super(DEFAULT_ID, DEFAULT_ID, RSECoreMessages.DefaultSystemType_Label, null, null);
public Bundle getDefiningBundle() {
return null;
}
public String getDescription() {
return getLabel();
} }
public String getId() { public String getId() {
//TODO consider a space character at the beginning to ensure uniqueness //TODO consider a space character at the beginning to ensure uniqueness
return "DEFAULT"; //$NON-NLS-1$ return DEFAULT_ID;
}
public String getLabel() {
return RSECoreMessages.DefaultSystemType_Label;
}
public String getName() {
return getId();
}
public String getProperty(String key) {
return null;
} }
public String[] getSubsystemConfigurationIds() { public String[] getSubsystemConfigurationIds() {
return null; return null;

View file

@ -0,0 +1,178 @@
/********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation and others. 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
*
* 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:
* Uwe Stieber (Wind River) - Dynamic system type provider extension.
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/
package org.eclipse.rse.core;
import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.PlatformObject;
import org.osgi.framework.Bundle;
/**
* Abstract base class holding core functionality of a system type.
*
* Extenders must override {@link IRSESystemType#getSubsystemConfigurationIds()}
* according to their strategy of finding subsystem configuration id's that
* match their system type.
*
* Extenders may override any other method.
*/
public abstract class RSESystemType extends PlatformObject implements IRSESystemType {
protected String id = null;
protected String name = null;
protected String label = null;
protected String description = null;
protected Bundle definingBundle = null;
protected Map properties;
/**
* Default constructor.
* Only subclasses may call this if set the id, name, label,
* description and properties attributes themselves.
*/
protected RSESystemType()
{
super();
}
/**
* Constructor for an object representing a system type.
* @param id unique id of this system type. Must be system unique.
* @param name a name of this system type to be used for internal checks.
* @param label a user-visible label of this system type.
* May be <code>null</code> and falls back to the name in this case.
* @param description a user-visible description of this system type.
* May be <code>null</code> and falls back to the label in this case.
*/
public RSESystemType(String id, String name, String label, String description, Bundle definingBundle)
{
super();
this.id = id;
this.name = name;
this.label = label == null ? name : label;
this.description = description == null ? "" : description; //$NON-NLS-1$
this.definingBundle = definingBundle;
this.properties = new HashMap();
}
/**
* 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();
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getId()
*/
public String getId() {
return id;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getLabel()
*/
public String getLabel() {
// For default RSE system types, the UI label is equal to the
// name. Therefore, fallback to the name if the label is not
// explicitly set.
if (label == null) return getName();
return label;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getNameOfSystemTypeDeprecated()
*/
public String getName() {
return name;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getDescription()
*/
public String getDescription() {
return description;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getDefiningBundle()
*/
public Bundle getDefiningBundle() {
return definingBundle;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getProperty(java.lang.String)
*/
public String getProperty(String key) {
return (String) (properties.get(key));
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getProperty(java.lang.String, boolean)
*/
public boolean getProperty(String key, boolean defaultValue) {
Object val = properties.get(key);
if (val instanceof String) {
return Boolean.valueOf((String)val).booleanValue();
}
return defaultValue;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#isLocal()
*/
public boolean isLocal() {
return IRSESystemType.SYSTEMTYPE_LOCAL_ID.equals(getId());
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#isLocal()
*/
public boolean isWindows() {
return IRSESystemType.SYSTEMTYPE_WINDOWS_ID.equals(getId())
|| (isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")) //$NON-NLS-1$ //$NON-NLS-2$
|| getProperty(IRSESystemType.PROPERTY_IS_WINDOWS, false);
}
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
return getLabel() + " (" + getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
}

View file

@ -19,6 +19,7 @@
* David Dykstal (IBM) - 142806: refactoring persistence framework * David Dykstal (IBM) - 142806: refactoring persistence framework
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -215,7 +216,7 @@ public class Host extends RSEModelObject implements IHost {
String systemTypeId = systemType.getId(); String systemTypeId = systemType.getId();
boolean forceUC = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID); boolean forceUC = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID);
boolean caseSensitiveUID = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_UNIX_ID) || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LINUX_ID) boolean caseSensitiveUID = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_UNIX_ID) || systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LINUX_ID)
|| (systemTypeId.equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && !System.getProperty("os.name").toLowerCase().startsWith("windows")); //$NON-NLS-1$ //$NON-NLS-2$ || (systemType.isLocal() && !systemType.isWindows());
setForceUserIdToUpperCase(forceUC); setForceUserIdToUpperCase(forceUC);
setUserIdCaseSensitive(caseSensitiveUID); setUserIdCaseSensitive(caseSensitiveUID);
} }

View file

@ -14,6 +14,7 @@
* 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 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.model; package org.eclipse.rse.core.model;
@ -56,12 +57,16 @@ 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" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID}) * <li>"org.eclipse.rse.systemtype.iseries" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID})
* <li>"Windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID}) * <li>"org.eclipse.rse.systemtype.windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID})
* <li>"z/OS" ({@link IRSESystemType#SYSTEMTYPE_ZSERIES_ID}) * <li>"org.eclipse.rse.systemtype.zseries" ({@link IRSESystemType#SYSTEMTYPE_ZSERIES_ID})
* <li>"Unix" ({@link IRSESystemType#SYSTEMTYPE_UNIX_ID}) * <li>"org.eclipse.rse.systemtype.unix" ({@link IRSESystemType#SYSTEMTYPE_UNIX_ID})
* <li>"Linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_ID}) * <li>"org.eclipse.rse.systemtype.linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_ID})
* <li>"Local" ({@link IRSESystemType#SYSTEMTYPE_LOCAL_ID}) * <li>"org.eclipse.rse.systemtype.aix" ({@link IRSESystemType#SYSTEMTYPE_AIX_ID})
* <li>"org.eclipse.rse.systemtype.local" ({@link IRSESystemType#SYSTEMTYPE_LOCAL_ID})
* <li>"org.eclipse.rse.systemtype.ftp" ({@link IRSESystemType#SYSTEMTYPE_FTP_ID})
* <li>"org.eclipse.rse.systemtype.ssh" ({@link IRSESystemType#SYSTEMTYPE_SSH_ID})
* <li>"org.eclipse.rse.systemtype.telnet" ({@link IRSESystemType#SYSTEMTYPE_TELNET_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)

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
@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Uwe Stieber (Wind River) - Added system types provider extension. * Uwe Stieber (Wind River) - Added system types provider extension.
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core; package org.eclipse.rse.internal.core;
@ -146,7 +147,7 @@ public class RSECoreRegistry implements IRSECoreRegistry {
IConfigurationElement element = elements[i]; IConfigurationElement element = elements[i];
if (element.getName().equals(ELEMENT_SYTEM_TYPE)) { if (element.getName().equals(ELEMENT_SYTEM_TYPE)) {
IRSESystemType type = new RSESystemType(element); IRSESystemType type = new RSEStaticSystemType(element);
if (!typeIds.contains(type.getId())) { if (!typeIds.contains(type.getId())) {
types.add(type); types.add(type);
typeIds.add(type.getId()); typeIds.add(type.getId());

View file

@ -13,26 +13,24 @@
* 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 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.core; package org.eclipse.rse.internal.core;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map;
import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.PlatformObject;
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.eclipse.rse.core.RSECorePlugin;
import org.osgi.framework.Bundle; import org.eclipse.rse.core.RSESystemType;
/** /**
* Class representing a system type. * Class representing a system type statically contributed through plugin.xml.
*/ */
public class RSESystemType extends PlatformObject implements IRSESystemType { public class RSEStaticSystemType extends RSESystemType {
private static final String ATTR_ID = "id"; //$NON-NLS-1$ private static final String ATTR_ID = "id"; //$NON-NLS-1$
private static final String ATTR_NAME = "name"; //$NON-NLS-1$ private static final String ATTR_NAME = "name"; //$NON-NLS-1$
@ -44,20 +42,14 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
private static final String ATTR_VALUE = "value"; //$NON-NLS-1$ private static final String ATTR_VALUE = "value"; //$NON-NLS-1$
private static final String ATTR_SUBSYSTEMCONFIGURATIONS = "subsystemConfigurationIds"; //$NON-NLS-1$ private static final String ATTR_SUBSYSTEMCONFIGURATIONS = "subsystemConfigurationIds"; //$NON-NLS-1$
private String id = null;
private String name = null;
private String label = null;
private String description = null;
private Map properties;
private Bundle definingBundle = null;
private String[] subsystemConfigurationIds; private String[] subsystemConfigurationIds;
/** /**
* Constructor for an object representing a system type. * Constructor for an object representing a system type.
* @param element the configuration element describing the system type * @param element the configuration element describing the system type
*/ */
public RSESystemType(IConfigurationElement element) { public RSEStaticSystemType(IConfigurationElement element) {
super();
id = element.getAttribute(ATTR_ID); id = element.getAttribute(ATTR_ID);
name = element.getAttribute(ATTR_NAME); name = element.getAttribute(ATTR_NAME);
if (id==null) { if (id==null) {
@ -94,27 +86,6 @@ 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
@ -132,53 +103,6 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
} }
} }
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getId()
*/
public String getId() {
return id;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getLabel()
*/
public String getLabel() {
// For default RSE system types, the UI label is equal to the
// name. Therefore, fallback to the name if the label is not
// explicitly set.
if (label == null) return getName();
return label;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getNameOfSystemTypeDeprecated()
*/
public String getName() {
return name;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getDescription()
*/
public String getDescription() {
return description;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getProperty(java.lang.String)
*/
public String getProperty(String key) {
return (String) (properties.get(key));
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getDefiningBundle()
*/
public Bundle getDefiningBundle() {
return definingBundle;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.core.IRSESystemType#getSubsystemConfigurationIds() * @see org.eclipse.rse.core.IRSESystemType#getSubsystemConfigurationIds()
*/ */
@ -186,10 +110,4 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
return subsystemConfigurationIds; return subsystemConfigurationIds;
} }
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
public String toString() {
return getLabel() + " (" + getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
}
} }

View file

@ -14,6 +14,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) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -40,8 +41,8 @@ import org.eclipse.core.runtime.Path;
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.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog;
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.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.files.ui.actions.SystemDownloadConflictAction; import org.eclipse.rse.internal.files.ui.actions.SystemDownloadConflictAction;
@ -80,11 +81,8 @@ import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider; import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor; import org.eclipse.ui.texteditor.ITextEditor;
public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IPartListener, IResourceChangeListener, IResourceDeltaVisitor public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IPartListener, IResourceChangeListener, IResourceDeltaVisitor
{ {
private IRemoteFile remoteFile; private IRemoteFile remoteFile;
private String remotePath; private String remotePath;
private IRemoteFileSubSystem subsystem; private IRemoteFileSubSystem subsystem;
@ -294,10 +292,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
if (remotePath == null) if (remotePath == null)
{ {
// derive the path from the temporary file path // derive the path from the temporary file path
IHost connection = fs.getHost(); IRSESystemType systemType = fs.getHost().getSystemType();
// on windows systems, we need to take into account drives and different separators // on windows systems, we need to take into account drives and different separators
boolean isWindows = connection.getSystemType().getName().equals("Local") || fs.getHost().getSystemType().getName().equals("Windows"); //$NON-NLS-1$ //$NON-NLS-2$ boolean isWindows = systemType.isWindows();
char fileSeparator = isWindows ? '\\' : '/'; char fileSeparator = isWindows ? '\\' : '/';
StringBuffer tempRemotePath = new StringBuffer(""); //$NON-NLS-1$ StringBuffer tempRemotePath = new StringBuffer(""); //$NON-NLS-1$
@ -908,7 +906,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
*/ */
public String getWorkspaceRemotePath(String remotePath) public String getWorkspaceRemotePath(String remotePath)
{ {
if (subsystem != null && subsystem.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (subsystem != null && subsystem.getHost().getSystemType().isLocal())
{ {
return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath); return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath);
} }
@ -918,7 +916,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
public String getActualHostFor(String remotePath) public String getActualHostFor(String remotePath)
{ {
String hostname = subsystem.getHost().getHostName(); String hostname = subsystem.getHost().getHostName();
if (subsystem != null && subsystem.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (subsystem != null && subsystem.getHost().getSystemType().isLocal())
{ {
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath); String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath);
if (!result.equals(hostname)) if (!result.equals(hostname))
@ -1319,7 +1317,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
try try
{ {
if (remoteFile.getSystemConnection().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (remoteFile.getSystemConnection().getSystemType().isLocal())
{ {
// Open local files "in-place", i.e. don't copy them to the // Open local files "in-place", i.e. don't copy them to the
// RemoteSystemsTempFiles project first // RemoteSystemsTempFiles project first

View file

@ -14,6 +14,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) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -33,6 +34,7 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog;
import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableContext;
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.events.ISystemResourceChangeEvents; import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
@ -55,14 +57,12 @@ import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.progress.UIJob; import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.progress.WorkbenchJob; import org.eclipse.ui.progress.WorkbenchJob;
/** /**
* This class manages listening for resource changes within our temp file project * This class manages listening for resource changes within our temp file project
* It is used for listening to saves made in the editor so that we can upload * It is used for listening to saves made in the editor so that we can upload
* changes to the remote files. */ * changes to the remote files. */
public abstract class SystemTempFileListener implements IResourceChangeListener public abstract class SystemTempFileListener implements IResourceChangeListener
{ {
private ArrayList _changedResources; private ArrayList _changedResources;
private ArrayList _ignoredFiles = new ArrayList(); private ArrayList _ignoredFiles = new ArrayList();
private boolean _isSynching; private boolean _isSynching;
@ -525,10 +525,10 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
if (uploadPath == null) if (uploadPath == null)
{ {
// derive the path from the temporary file path // derive the path from the temporary file path
IHost connection = fs.getHost(); IRSESystemType systemType = fs.getHost().getSystemType();
// on windows systems, we need to take into account drives and different separators // on windows systems, we need to take into account drives and different separators
boolean isWindows = connection.getSystemType().getName().equals("Local") || fs.getHost().getSystemType().getName().equals("Windows"); //$NON-NLS-1$ //$NON-NLS-2$ boolean isWindows = systemType.isWindows();
char fileSeparator = isWindows ? '\\' : '/'; char fileSeparator = isWindows ? '\\' : '/';
StringBuffer remotePath = new StringBuffer(""); //$NON-NLS-1$ StringBuffer remotePath = new StringBuffer(""); //$NON-NLS-1$

View file

@ -14,6 +14,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) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -38,7 +39,6 @@ import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
* This class manages listening for resource changes within our temp file project * This class manages listening for resource changes within our temp file project
* It is used for listening to saves made in the editor so that we can upload * It is used for listening to saves made in the editor so that we can upload
@ -47,7 +47,6 @@ import org.eclipse.swt.widgets.Shell;
*/ */
public class SystemUniversalTempFileListener extends SystemTempFileListener public class SystemUniversalTempFileListener extends SystemTempFileListener
{ {
private static SystemUniversalTempFileListener _instance = null; private static SystemUniversalTempFileListener _instance = null;
private ArrayList _editedFiles = new ArrayList(); private ArrayList _editedFiles = new ArrayList();
@ -133,7 +132,7 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener
else else
{ {
// for mounting... // for mounting...
if (fs.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (fs.getHost().getSystemType().isLocal())
{ {
boolean isMounted = properties.getRemoteFileMounted(); boolean isMounted = properties.getRemoteFileMounted();
if (isMounted) if (isMounted)

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.files.ui.resources; package org.eclipse.rse.files.ui.resources;
@ -81,7 +82,6 @@ import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI; import org.eclipse.ui.PlatformUI;
/** /**
* Utility class for doing file transfers on universal systems * Utility class for doing file transfers on universal systems
*/ */
@ -353,7 +353,7 @@ public class UniversalFileTransferUtility
IResource tempFolder = null; IResource tempFolder = null;
if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot() if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"))) //$NON-NLS-1$ && !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
{ {
try try
{ {
@ -820,7 +820,7 @@ public class UniversalFileTransferUtility
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER); boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER);
if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot() if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"))) //$NON-NLS-1$ && !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
{ {
try try
{ {
@ -923,7 +923,7 @@ public class UniversalFileTransferUtility
{ {
IHost connection = connections[i]; IHost connection = connections[i];
IRemoteFileSubSystem anFS = RemoteFileUtility.getFileSubSystem(connection); IRemoteFileSubSystem anFS = RemoteFileUtility.getFileSubSystem(connection);
if (anFS.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (anFS.getHost().getSystemType().isLocal())
{ {
return anFS; return anFS;
} }
@ -1138,7 +1138,7 @@ public class UniversalFileTransferUtility
} }
boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"); //$NON-NLS-1$ boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive(); boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal) if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
@ -1353,7 +1353,7 @@ public class UniversalFileTransferUtility
directory.refreshLocal(IResource.DEPTH_ONE, monitor); directory.refreshLocal(IResource.DEPTH_ONE, monitor);
boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"); //$NON-NLS-1$ boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive(); boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
boolean doSuperTransferPreference = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER); boolean doSuperTransferPreference = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER);
@ -1777,7 +1777,7 @@ public class UniversalFileTransferUtility
path = path.append(separator + actualHost + separator); path = path.append(separator + actualHost + separator);
String absolutePath = srcFileOrFolder.getAbsolutePath(); String absolutePath = srcFileOrFolder.getAbsolutePath();
if (srcFileOrFolder.getSystemConnection().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (srcFileOrFolder.getSystemConnection().getSystemType().isLocal())
{ {
absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath()); absolutePath = editMgr.getWorkspacePathFor(actualHost, srcFileOrFolder.getAbsolutePath());
} }
@ -1957,7 +1957,7 @@ public class UniversalFileTransferUtility
public static String getActualHostFor(ISubSystem subsystem, String remotePath) public static String getActualHostFor(ISubSystem subsystem, String remotePath)
{ {
String hostname = subsystem.getHost().getHostName(); String hostname = subsystem.getHost().getHostName();
if (subsystem.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (subsystem.getHost().getSystemType().isLocal())
{ {
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath); String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath);
return result; return result;
@ -1991,7 +1991,7 @@ public class UniversalFileTransferUtility
protected static boolean isRemoteFileMounted(ISubSystem subsystem, String remotePath) protected static boolean isRemoteFileMounted(ISubSystem subsystem, String remotePath)
{ {
String hostname = subsystem.getHost().getHostName(); String hostname = subsystem.getHost().getHostName();
if (subsystem.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (subsystem.getHost().getSystemType().isLocal())
{ {
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath); String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath);
if (!result.equals(hostname)) if (!result.equals(hostname))
@ -2015,7 +2015,7 @@ public class UniversalFileTransferUtility
protected static String getWorkspaceRemotePath(ISubSystem subsystem, String remotePath) { protected static String getWorkspaceRemotePath(ISubSystem subsystem, String remotePath) {
if (subsystem != null && subsystem.getHost().getSystemType().getName().equals("Local")) { //$NON-NLS-1$ if (subsystem != null && subsystem.getHost().getSystemType().isLocal()) {
return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath); return SystemRemoteEditManager.getInstance().getWorkspacePathFor(subsystem.getHost().getHostName(), remotePath);
} }

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem * Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.files.ui.view; package org.eclipse.rse.internal.files.ui.view;
@ -1535,7 +1536,7 @@ public class SystemViewRemoteFileAdapter
{ {
IHost connection = connections[i]; IHost connection = connections[i];
IRemoteFileSubSystem anFS = RemoteFileUtility.getFileSubSystem(connection); IRemoteFileSubSystem anFS = RemoteFileUtility.getFileSubSystem(connection);
if ( anFS != null && IRSESystemType.SYSTEMTYPE_LOCAL_ID.equals(anFS.getHost().getSystemType().getId())) if ( anFS != null && anFS.getHost().getSystemType().isLocal())
{ {
return anFS; return anFS;
} }

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.processes.ui.dialogs; package org.eclipse.rse.internal.processes.ui.dialogs;
@ -47,7 +47,6 @@ import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn; import org.eclipse.swt.widgets.TableColumn;
/** /**
* Dialog for confirming killing of a process or group of processes. User * Dialog for confirming killing of a process or group of processes. User
* selects the type of signal to be sent to the process. * selects the type of signal to be sent to the process.
@ -128,7 +127,7 @@ public class SystemKillDialog extends SystemPromptDialog
if (promptLabel == null) { if (promptLabel == null) {
Object input = getInputObject(); Object input = getInputObject();
if (input != null && input instanceof IStructuredSelection) { if (input instanceof IStructuredSelection) {
int size = ((IStructuredSelection)input).size(); int size = ((IStructuredSelection)input).size();
if (size > 1) { if (size > 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
@ -12,6 +12,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) - [186640] Fix case sensitive issue comparing z/OS
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.dstore.universal.miners.filesystem; package org.eclipse.rse.internal.dstore.universal.miners.filesystem;
@ -137,7 +138,7 @@ public class FileClassifier extends Thread
{ {
_systemSupportsClassify = false; _systemSupportsClassify = false;
} }
else if (osName.equals("z/OS")) { //$NON-NLS-1$ else if (osName.equals("z/os")) { //$NON-NLS-1$
_systemSupportsClassFilesOnly = true; _systemSupportsClassFilesOnly = true;
} }

View file

@ -14,6 +14,7 @@
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.shells.ui.actions; package org.eclipse.rse.internal.shells.ui.actions;
@ -518,8 +519,7 @@ public class SystemCommandAction extends SystemBaseAction
} }
String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$ String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$
if ((cmdSubSystem.getHost().getSystemType().equals("Local") && System.getProperty("os.name").toLowerCase().startsWith("win")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ if (cmdSubSystem.getHost().getSystemType().isWindows())
|| cmdSubSystem.getHost().getSystemType().equals("Windows")) //$NON-NLS-1$
{ {
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$ cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
} }

View file

@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [180562] dont implement ISystemThemeConstants * Martin Oberhuber (Wind River) - [180562] dont implement ISystemThemeConstants
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.shells.ui.view; package org.eclipse.rse.internal.shells.ui.view;
@ -378,9 +379,7 @@ FocusListener
ISubSystem cmdSubSystem = adapter.getSubSystem(element); ISubSystem cmdSubSystem = adapter.getSubSystem(element);
String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$ String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$
if (cmdSubSystem.getHost().getSystemType().getName().equals("Local") //$NON-NLS-1$ if (cmdSubSystem.getHost().getSystemType().isWindows())
&& System.getProperty("os.name").toLowerCase().startsWith("win") //$NON-NLS-1$ //$NON-NLS-2$
|| cmdSubSystem.getHost().getSystemType().getName().equals("Windows")) //$NON-NLS-1$
{ {
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$ cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
} }
@ -397,9 +396,7 @@ FocusListener
ISubSystem cmdSubSystem = adapter.getSubSystem(element); ISubSystem cmdSubSystem = adapter.getSubSystem(element);
String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$ String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$
if (cmdSubSystem.getHost().getSystemType().getName().equals("Local") //$NON-NLS-1$ if (cmdSubSystem.getHost().getSystemType().isWindows())
&& System.getProperty("os.name").toLowerCase().startsWith("win") //$NON-NLS-1$ //$NON-NLS-2$
|| cmdSubSystem.getHost().getSystemType().getName().equals("Windows")) //$NON-NLS-1$
{ {
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$ cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
} }

View file

@ -15,6 +15,7 @@
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui * Martin Oberhuber (Wind River) - [174945] Remove obsolete icons from rse.shells.ui
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.shells.ui.view; package org.eclipse.rse.internal.shells.ui.view;
@ -520,7 +521,7 @@ public class SystemCommandsViewPart
for (int i = 0; i < connections.length; i++) for (int i = 0; i < connections.length; i++)
{ {
IHost connection = connections[i]; IHost connection = connections[i];
if (registry.isAnySubSystemConnected(connection) || connection.getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (registry.isAnySubSystemConnected(connection) || connection.getSystemType().isLocal())
{ {
IRemoteCmdSubSystem[] cmdSubSystems = RemoteCommandHelpers.getCmdSubSystems(connection); IRemoteCmdSubSystem[] cmdSubSystems = RemoteCommandHelpers.getCmdSubSystems(connection);
if (cmdSubSystems.length == 1) if (cmdSubSystems.length == 1)
@ -647,7 +648,7 @@ public class SystemCommandsViewPart
for (int i = 0; i < connections.length; i++) for (int i = 0; i < connections.length; i++)
{ {
IHost connection = connections[i]; IHost connection = connections[i];
if (registry.isAnySubSystemConnected(connection) || connection.getSystemType().getName().equals("Local")) //$NON-NLS-1$ if (registry.isAnySubSystemConnected(connection) || connection.getSystemType().isLocal())
{ {
IRemoteCmdSubSystem[] cmdSubSystems = RemoteCommandHelpers.getCmdSubSystems(connection); IRemoteCmdSubSystem[] cmdSubSystems = RemoteCommandHelpers.getCmdSubSystems(connection);
if (cmdSubSystems.length > 0) if (cmdSubSystems.length > 0)

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.subsystems.shells.core.model; package org.eclipse.rse.subsystems.shells.core.model;
@ -33,11 +34,8 @@ import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell;
import org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandShell public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandShell
{ {
protected String _id; protected String _id;
protected String _name; protected String _name;
protected String _type; protected String _type;
@ -48,8 +46,6 @@ public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandSh
protected ArrayList _cmdHistory; protected ArrayList _cmdHistory;
protected IProject _project; protected IProject _project;
public RemoteCommandShell(IRemoteCmdSubSystem cmdSubSystem) public RemoteCommandShell(IRemoteCmdSubSystem cmdSubSystem)
{ {
_output = new ArrayList(); _output = new ArrayList();
@ -294,10 +290,7 @@ public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandSh
protected boolean isWindows() protected boolean isWindows()
{ {
String type = getCommandSubSystem().getHost().getSystemType().getName(); return getCommandSubSystem().getHost().getSystemType().isWindows();
return (type.equals("Windows") || //$NON-NLS-1$
type.equals("Local") && System.getProperty("os.name").toLowerCase().startsWith("win")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
} }

View file

@ -14,6 +14,7 @@
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.subsystems.shells.core.subsystems; package org.eclipse.rse.subsystems.shells.core.subsystems;
@ -51,7 +52,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
* This is the abstraction of a subsystem specialized for remote execution of * This is the abstraction of a subsystem specialized for remote execution of
* commands. * commands.
@ -59,7 +59,6 @@ import org.eclipse.swt.widgets.Shell;
public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmdSubSystem, ICommunicationsListener public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmdSubSystem, ICommunicationsListener
{ {
private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$NON-NLS-1$ private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$NON-NLS-1$
private static String ENVIRONMENT_VARS = "EnvironmentVariables"; //$NON-NLS-1$ private static String ENVIRONMENT_VARS = "EnvironmentVariables"; //$NON-NLS-1$
@ -316,9 +315,7 @@ public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmd
public boolean isWindows() public boolean isWindows()
{ {
String type = getSystemType(); return getHost().getSystemType().isWindows();
return (type.equals("Windows") || type.equals("Local") //$NON-NLS-1$ //$NON-NLS-2$
&& System.getProperty("os.name").toLowerCase().startsWith("win")); //$NON-NLS-1$ //$NON-NLS-2$
} }
/** /**

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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem; package org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem;
@ -34,14 +35,11 @@ import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCmdSubSystem;
import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell; import org.eclipse.rse.subsystems.shells.core.subsystems.IRemoteCommandShell;
import org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem; import org.eclipse.rse.subsystems.shells.core.subsystems.RemoteCmdSubSystem;
public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements IShellServiceSubSystem public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements IShellServiceSubSystem
{ {
protected String _userHome = null; protected String _userHome = null;
protected IShellService _hostService; protected IShellService _hostService;
public ShellServiceSubSystem(IHost host, IConnectorService connectorService, IShellService hostService) public ShellServiceSubSystem(IHost host, IConnectorService connectorService, IShellService hostService)
{ {
super(host, connectorService); super(host, connectorService);
@ -62,14 +60,15 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I
{ {
if (_userHome == null) if (_userHome == null)
{ {
if (getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS)) IRSESystemType type = getHost().getSystemType();
{ if (type.isLocal())
_userHome = "c:\\"; //$NON-NLS-1$
}
else if (getSystemType().equals(IRSESystemType.SYSTEMTYPE_LOCAL))
{ {
_userHome = System.getProperty("user.home"); //$NON-NLS-1$ _userHome = System.getProperty("user.home"); //$NON-NLS-1$
} }
else if (type.isWindows())
{
_userHome = "c:\\"; //$NON-NLS-1$
}
else else
{ {
// Assume UNIX compatible file system // Assume UNIX compatible file system

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.actions; package org.eclipse.rse.internal.ui.actions;
@ -20,7 +21,6 @@ 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.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.internal.ui.SystemResources; import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.ui.ISystemContextMenuConstants; import org.eclipse.rse.ui.ISystemContextMenuConstants;
@ -28,9 +28,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.actions.SystemBaseAction; import org.eclipse.rse.ui.actions.SystemBaseAction;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
//import org.eclipse.rse.core.ui.SystemMessage;
/** /**
* This is the action for connecting to the remote subsystem * This is the action for connecting to the remote subsystem
*/ */
@ -49,7 +46,7 @@ public class SystemConnectAction extends SystemBaseAction
public IStatus run(IProgressMonitor monitor) public IStatus run(IProgressMonitor monitor)
{ {
try { try {
if (_subsystem.getHost().getSystemType().getId().equals(IRSESystemType.SYSTEMTYPE_WINDOWS_ID)) if (_subsystem.getHost().getSystemType().isWindows())
_subsystem.connect(monitor, false); _subsystem.connect(monitor, false);
else else
_subsystem.connect(monitor, true); _subsystem.connect(monitor, true);

View file

@ -12,12 +12,12 @@
* *
* 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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.actions; package org.eclipse.rse.internal.ui.actions;
import org.eclipse.jface.viewers.IStructuredSelection; import org.eclipse.jface.viewers.IStructuredSelection;
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.core.model.ISystemRegistry; import org.eclipse.rse.core.model.ISystemRegistry;
@ -102,7 +102,7 @@ public class SystemWorkOfflineAction extends SystemBaseAction
} }
// 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) && !conn.getSystemType().isLocal())
{ {
// backout changes, likely because user cancelled the disconnect // backout changes, likely because user cancelled the disconnect
setChecked(false); setChecked(false);

View file

@ -14,6 +14,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) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.propertypages; package org.eclipse.rse.internal.ui.propertypages;
@ -131,7 +132,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_ID.equals(conn.getSystemType().getId())) if(sr.isAnySubSystemConnected(conn) && !conn.getSystemType().isLocal())
{ {
// backout changes, likely because user cancelled the disconnect // backout changes, likely because user cancelled the disconnect
sr.setHostOffline(conn, false); sr.setHostOffline(conn, false);

View file

@ -21,6 +21,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.ui.view; package org.eclipse.rse.internal.ui.view;
@ -712,7 +713,7 @@ public class SystemViewConnectionAdapter
if (element instanceof IHost) if (element instanceof IHost)
{ {
IHost sysCon = (IHost) element; IHost sysCon = (IHost) element;
if (sysCon.getSystemType().getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID)) return existsMoreThanOneLocalConnection(); if (sysCon.getSystemType().isLocal()) return existsMoreThanOneLocalConnection();
ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry(); ISystemRegistry sr = RSEUIPlugin.getTheSystemRegistry();
return !sr.isAnySubSystemConnected((IHost)element); return !sr.isAnySubSystemConnected((IHost)element);
} }

View file

@ -12,6 +12,7 @@
* *
* Contributors: * Contributors:
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
@ -108,24 +109,16 @@ public class EnvironmentVariablesPromptDialog extends SystemPromptDialog impleme
// Set name and value limits for known system types // Set name and value limits for known system types
if (systemType != null) if (systemType != null)
{ {
if (systemType.equals("iSeries")) //$NON-NLS-1$ if (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID))
{ {
nameTextField.setTextLimit(128); nameTextField.setTextLimit(128);
valueTextField.setTextLimit(1024); valueTextField.setTextLimit(1024);
} }
else if (systemType.equals("Windows")) //$NON-NLS-1$ else if (systemType.isWindows())
{ {
nameTextField.setTextLimit(300); nameTextField.setTextLimit(300);
valueTextField.setTextLimit(1024); valueTextField.setTextLimit(1024);
} }
else if (systemType.equals("Local")) //$NON-NLS-1$
{
if (System.getProperty("os.name").toLowerCase().indexOf("win") != -1) //$NON-NLS-1$ //$NON-NLS-2$
{
nameTextField.setTextLimit(300);
valueTextField.setTextLimit(1024);
}
}
} }
return parent; return parent;

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.dialogs; package org.eclipse.rse.ui.dialogs;
@ -145,7 +145,7 @@ public class SystemDeleteDialog extends SystemPromptDialog
if (promptLabel == null) { if (promptLabel == null) {
Object input = getInputObject(); Object input = getInputObject();
if (input != null && input instanceof IStructuredSelection) { if (input instanceof IStructuredSelection) {
int size = ((IStructuredSelection)input).size(); int size = ((IStructuredSelection)input).size();
if (size > 1) { if (size > 1) {

View file

@ -16,6 +16,7 @@
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.view; package org.eclipse.rse.ui.view;
@ -1450,6 +1451,29 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
} }
return false; return false;
} }
else if (name.equalsIgnoreCase("systemTypeId")) //$NON-NLS-1$
{
ISubSystem ss = getSubSystem(target);
String[] values = tokenize(value);
if (ss == null)
{
if (!(target instanceof IHost))
return false;
String connSysTypeId = ((IHost)target).getSystemType().getId();
for (int idx=0; idx<values.length; idx++)
{
if (connSysTypeId.equals(values[idx]))
return true;
}
return false;
}
for (int idx=0; idx<values.length; idx++)
{
if (ss.getHost().getSystemType().getId().equals(values[idx]))
return true;
}
return false;
}
else if (name.equalsIgnoreCase("subsystemFactoryId")) //$NON-NLS-1$ else if (name.equalsIgnoreCase("subsystemFactoryId")) //$NON-NLS-1$
{ {
ISubSystem ss = getSubSystem(target); ISubSystem ss = getSubSystem(target);

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) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.widgets; package org.eclipse.rse.ui.widgets;
@ -366,7 +367,7 @@ public class EnvironmentVariablesForm extends SystemBaseForm implements Selectio
new EnvironmentVariablesPromptDialog( new EnvironmentVariablesPromptDialog(
getShell(), getShell(),
SystemResources.RESID_SUBSYSTEM_ENVVAR_ADD_TITLE, SystemResources.RESID_SUBSYSTEM_ENVVAR_ADD_TITLE,
systemType.getName(), systemType,
invalidNameChars, invalidNameChars,
getVariableNames(), getVariableNames(),
false); false);
@ -518,7 +519,7 @@ public class EnvironmentVariablesForm extends SystemBaseForm implements Selectio
EnvironmentVariablesPromptDialog( EnvironmentVariablesPromptDialog(
getShell(), getShell(),
SystemResources.RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE, SystemResources.RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE,
systemType.getName(), systemType,
invalidNameChars, invalidNameChars,
getVariableNames(), getVariableNames(),
true); true);

View file

@ -14,6 +14,7 @@
* 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 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
@ -48,7 +49,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemConnectionForm; import org.eclipse.rse.ui.SystemConnectionForm;
import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.rse.ui.messages.SystemMessageDialog;
/** /**
* Standard RSE new connection wizard implementation. * Standard RSE new connection wizard implementation.
*/ */
@ -165,7 +165,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
} else { } else {
IRSESystemType onlySystemType = getSystemType(); IRSESystemType onlySystemType = getSystemType();
if (onlySystemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID)) { if (onlySystemType.isLocal()) {
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;

View file

@ -22,6 +22,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.ui.internal.model; package org.eclipse.rse.ui.internal.model;
@ -108,13 +109,11 @@ import org.eclipse.ui.part.PluginTransfer;
import org.eclipse.ui.part.PluginTransferData; import org.eclipse.ui.part.PluginTransferData;
import org.eclipse.ui.part.ResourceTransfer; import org.eclipse.ui.part.ResourceTransfer;
/** /**
* Registry for all connections. * Registry for all connections.
*/ */
public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvider public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvider
{ {
private static Exception lastException = null; private static Exception lastException = null;
private static SystemRegistry registry = null; private static SystemRegistry registry = null;
private SystemResourceChangeManager listenerManager = null; private SystemResourceChangeManager listenerManager = null;
@ -1943,7 +1942,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
} }
} }
} }
if ((systemType != null) && (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID) && (v.size() == 0))) if ((systemType != null) && (systemType.isLocal() && (v.size() == 0)))
v.addElement("localhost"); //$NON-NLS-1$ v.addElement("localhost"); //$NON-NLS-1$
return (String[])v.toArray(new String[v.size()]); return (String[])v.toArray(new String[v.size()]);
} }

View file

@ -20,6 +20,7 @@
* Martin Oberhuber (Wind River) - [183165] Do not implement constant interfaces * Martin Oberhuber (Wind River) - [183165] Do not implement constant interfaces
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation * Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.core.subsystems; package org.eclipse.rse.core.subsystems;
@ -920,19 +921,6 @@ public abstract class SubSystem extends RSEModelObject
// Utility methods... // Utility methods...
// ------------------ // ------------------
/**
* Return the system type for this connection.
* FIXME Return an IRSESystemType instead
* @deprecated
*/
public String getSystemType()
{
IHost conn = getHost();
if (conn == null || conn.getSystemType()==null)
return null;
else
return conn.getSystemType().getName();
}
/** /**
* Return the host name for the connection this system's subsystem is associated with * Return the host name for the connection this system's subsystem is associated with
*/ */

View file

@ -9,6 +9,7 @@
* 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 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.core.registries; package org.eclipse.rse.tests.core.registries;
@ -59,7 +60,7 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
for (int j = 0; j < systemTypes.length; j++) { for (int j = 0; j < systemTypes.length; j++) {
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 (systemType.isLocal() || systemType.isWindows()) {
assertTrue("Proxy is expected to be applicable, but returned not to be!", proxy.appliesToSystemType(systemType)); //$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)); //$NON-NLS-1$ assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$

View file

@ -9,6 +9,7 @@
* Martin Oberhuber (Wind River) - initial API and implementation * Martin Oberhuber (Wind River) - initial API and implementation
* 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) - [186128] Move IProgressMonitor last in all API * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.tests.subsystems.files; package org.eclipse.rse.tests.subsystems.files;
@ -65,11 +66,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
} }
public boolean isWindows() { public boolean isWindows() {
String systemTypeId = fss.getHost().getSystemType().getName(); return fss.getHost().getSystemType().isWindows();
if (systemTypeId.equals("Local")) { //$NON-NLS-1$
return System.getProperty("os.name").toLowerCase().startsWith("win"); //$NON-NLS-1$ //$NON-NLS-2$
}
return systemTypeId.toLowerCase().startsWith("windows"); //$NON-NLS-1$
} }
public String getTestFileName() { public String getTestFileName() {