mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-03 22:35:43 +02:00
[186640][api] Add IRSESystemTyep.isLocal(), isWindows(), getProperty(String, boolean)
This commit is contained in:
parent
7ef8f1b99f
commit
2aa9214149
35 changed files with 369 additions and 285 deletions
|
@ -13,6 +13,7 @@
|
|||
* Contributors:
|
||||
* David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
|
||||
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.StatusMonitor;
|
||||
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.SystemBasePlugin;
|
||||
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()
|
||||
{
|
||||
return true;
|
||||
|
@ -1350,8 +1307,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
|
|||
public boolean supportsPassword() {
|
||||
boolean result = super.supportsPassword();
|
||||
IHost host = getHost();
|
||||
String systemType = host.getSystemType().getName();
|
||||
if (systemType.equals(IRSESystemType.SYSTEMTYPE_WINDOWS)) {
|
||||
if (host.getSystemType().isWindows()) {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
|
@ -1362,9 +1318,7 @@ public class DStoreConnectorService extends StandardConnectorService implements
|
|||
*/
|
||||
public boolean supportsUserId() {
|
||||
boolean result = super.supportsUserId();
|
||||
IHost host = getHost();
|
||||
String systemType = host.getSystemType().getName();
|
||||
if (systemType.equals(IRSESystemType.SYSTEMTYPE_WINDOWS)) {
|
||||
if (getHost().getSystemType().isWindows()) {
|
||||
result = false;
|
||||
}
|
||||
return result;
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* 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;
|
||||
|
@ -360,7 +361,7 @@ public class RexecDstoreServer implements IServerLauncher
|
|||
this.propertyInfo = propertyInfo;
|
||||
// set path...
|
||||
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)
|
||||
cwd += separatorChar;
|
||||
// set script...
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* Contributors:
|
||||
* 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) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.
|
||||
* 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 {
|
||||
|
||||
|
@ -35,7 +37,7 @@ public interface IRSESystemType extends IAdaptable {
|
|||
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$
|
||||
|
||||
|
@ -133,9 +135,7 @@ public interface IRSESystemType extends IAdaptable {
|
|||
*/
|
||||
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$
|
||||
|
||||
/** 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". */
|
||||
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.
|
||||
* @return the id of the system type
|
||||
|
@ -182,6 +204,36 @@ public interface IRSESystemType extends IAdaptable {
|
|||
* @return the value associated with the given key or <code>null</code> if none
|
||||
*/
|
||||
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.
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* - updated to use new RSEPreferencesManager
|
||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.core;
|
||||
|
@ -32,7 +33,6 @@ import org.eclipse.core.runtime.CoreException;
|
|||
import org.eclipse.core.runtime.Platform;
|
||||
import org.eclipse.rse.core.model.SystemSignonInformation;
|
||||
import org.eclipse.rse.internal.core.RSECoreMessages;
|
||||
import org.osgi.framework.Bundle;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -78,28 +78,15 @@ public class PasswordPersistenceManager {
|
|||
/**
|
||||
* 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() {
|
||||
}
|
||||
public Bundle getDefiningBundle() {
|
||||
return null;
|
||||
}
|
||||
public String getDescription() {
|
||||
return getLabel();
|
||||
super(DEFAULT_ID, DEFAULT_ID, RSECoreMessages.DefaultSystemType_Label, null, null);
|
||||
}
|
||||
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;
|
||||
return DEFAULT_ID;
|
||||
}
|
||||
public String[] getSubsystemConfigurationIds() {
|
||||
return null;
|
||||
|
|
|
@ -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$
|
||||
}
|
||||
}
|
|
@ -19,6 +19,7 @@
|
|||
* David Dykstal (IBM) - 142806: refactoring persistence framework
|
||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.core.model;
|
||||
|
@ -215,7 +216,7 @@ public class Host extends RSEModelObject implements IHost {
|
|||
String systemTypeId = systemType.getId();
|
||||
boolean forceUC = systemTypeId.equals(IRSESystemType.SYSTEMTYPE_ISERIES_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);
|
||||
setUserIdCaseSensitive(caseSensitiveUID);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.core.model;
|
||||
|
@ -56,12 +57,16 @@ public class SystemStartHere
|
|||
* SAME AS: <code>getSystemRegistry().getConnectionsBySystemType(systemType)</code>
|
||||
* @param systemType One of the system types defined via system type extension point:
|
||||
* <ul>
|
||||
* <li>"iSeries" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID})
|
||||
* <li>"Windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID})
|
||||
* <li>"z/OS" ({@link IRSESystemType#SYSTEMTYPE_ZSERIES_ID})
|
||||
* <li>"Unix" ({@link IRSESystemType#SYSTEMTYPE_UNIX_ID})
|
||||
* <li>"Linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_ID})
|
||||
* <li>"Local" ({@link IRSESystemType#SYSTEMTYPE_LOCAL_ID})
|
||||
* <li>"org.eclipse.rse.systemtype.iseries" ({@link IRSESystemType#SYSTEMTYPE_ISERIES_ID})
|
||||
* <li>"org.eclipse.rse.systemtype.windows" ({@link IRSESystemType#SYSTEMTYPE_WINDOWS_ID})
|
||||
* <li>"org.eclipse.rse.systemtype.zseries" ({@link IRSESystemType#SYSTEMTYPE_ZSERIES_ID})
|
||||
* <li>"org.eclipse.rse.systemtype.unix" ({@link IRSESystemType#SYSTEMTYPE_UNIX_ID})
|
||||
* <li>"org.eclipse.rse.systemtype.linux" ({@link IRSESystemType#SYSTEMTYPE_LINUX_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>
|
||||
* @see org.eclipse.rse.core.IRSESystemType
|
||||
* @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemType(String)
|
||||
|
|
|
@ -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
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Uwe Stieber (Wind River) - Added system types provider extension.
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
package org.eclipse.rse.internal.core;
|
||||
|
||||
|
@ -146,7 +147,7 @@ public class RSECoreRegistry implements IRSECoreRegistry {
|
|||
IConfigurationElement element = elements[i];
|
||||
|
||||
if (element.getName().equals(ELEMENT_SYTEM_TYPE)) {
|
||||
IRSESystemType type = new RSESystemType(element);
|
||||
IRSESystemType type = new RSEStaticSystemType(element);
|
||||
if (!typeIds.contains(type.getId())) {
|
||||
types.add(type);
|
||||
typeIds.add(type.getId());
|
||||
|
|
|
@ -13,26 +13,24 @@
|
|||
* 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.internal.core;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.core.runtime.IConfigurationElement;
|
||||
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.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_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_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;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor for an object representing a 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);
|
||||
name = element.getAttribute(ATTR_NAME);
|
||||
if (id==null) {
|
||||
|
@ -94,27 +86,6 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
|
|||
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.
|
||||
* @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)
|
||||
* @see org.eclipse.rse.core.IRSESystemType#getSubsystemConfigurationIds()
|
||||
*/
|
||||
|
@ -186,10 +110,4 @@ public class RSESystemType extends PlatformObject implements IRSESystemType {
|
|||
return subsystemConfigurationIds;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
public String toString() {
|
||||
return getLabel() + " (" + getId() + ")"; //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
}
|
||||
}
|
|
@ -14,6 +14,7 @@
|
|||
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.jobs.Job;
|
||||
import org.eclipse.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.rse.core.IRSESystemType;
|
||||
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.subsystems.ISubSystem;
|
||||
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.ITextEditor;
|
||||
|
||||
|
||||
public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IPartListener, IResourceChangeListener, IResourceDeltaVisitor
|
||||
{
|
||||
|
||||
|
||||
private IRemoteFile remoteFile;
|
||||
private String remotePath;
|
||||
private IRemoteFileSubSystem subsystem;
|
||||
|
@ -294,10 +292,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
|||
if (remotePath == null)
|
||||
{
|
||||
// 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
|
||||
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 ? '\\' : '/';
|
||||
StringBuffer tempRemotePath = new StringBuffer(""); //$NON-NLS-1$
|
||||
|
@ -908,7 +906,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
|||
*/
|
||||
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);
|
||||
}
|
||||
|
@ -918,7 +916,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
|||
public String getActualHostFor(String remotePath)
|
||||
{
|
||||
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);
|
||||
if (!result.equals(hostname))
|
||||
|
@ -1319,7 +1317,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
|
|||
|
||||
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
|
||||
// RemoteSystemsTempFiles project first
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* 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) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.jface.dialogs.ProgressMonitorDialog;
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.rse.core.IRSESystemType;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
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.WorkbenchJob;
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
* changes to the remote files. */
|
||||
public abstract class SystemTempFileListener implements IResourceChangeListener
|
||||
{
|
||||
|
||||
private ArrayList _changedResources;
|
||||
private ArrayList _ignoredFiles = new ArrayList();
|
||||
private boolean _isSynching;
|
||||
|
@ -525,10 +525,10 @@ public abstract class SystemTempFileListener implements IResourceChangeListener
|
|||
if (uploadPath == null)
|
||||
{
|
||||
// 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
|
||||
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 ? '\\' : '/';
|
||||
StringBuffer remotePath = new StringBuffer(""); //$NON-NLS-1$
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* 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) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -47,7 +47,6 @@ import org.eclipse.swt.widgets.Shell;
|
|||
*/
|
||||
public class SystemUniversalTempFileListener extends SystemTempFileListener
|
||||
{
|
||||
|
||||
private static SystemUniversalTempFileListener _instance = null;
|
||||
|
||||
private ArrayList _editedFiles = new ArrayList();
|
||||
|
@ -133,7 +132,7 @@ public class SystemUniversalTempFileListener extends SystemTempFileListener
|
|||
else
|
||||
{
|
||||
// for mounting...
|
||||
if (fs.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$
|
||||
if (fs.getHost().getSystemType().isLocal())
|
||||
{
|
||||
boolean isMounted = properties.getRemoteFileMounted();
|
||||
if (isMounted)
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||
* Martin Oberhuber (Wind River) - [183824] Forward SystemMessageException from IRemoteFileSubsystem
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.ui.PlatformUI;
|
||||
|
||||
|
||||
/**
|
||||
* Utility class for doing file transfers on universal systems
|
||||
*/
|
||||
|
@ -353,7 +353,7 @@ public class UniversalFileTransferUtility
|
|||
IResource tempFolder = null;
|
||||
|
||||
if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
|
||||
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"))) //$NON-NLS-1$
|
||||
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -820,7 +820,7 @@ public class UniversalFileTransferUtility
|
|||
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER);
|
||||
|
||||
if (doCompressedTransfer && doSuperTransferProperty && !srcFileOrFolder.isRoot()
|
||||
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().getName().equals("Local"))) //$NON-NLS-1$
|
||||
&& !(srcFileOrFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal()))
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -923,7 +923,7 @@ public class UniversalFileTransferUtility
|
|||
{
|
||||
IHost connection = connections[i];
|
||||
IRemoteFileSubSystem anFS = RemoteFileUtility.getFileSubSystem(connection);
|
||||
if (anFS.getHost().getSystemType().getName().equals("Local")) //$NON-NLS-1$
|
||||
if (anFS.getHost().getSystemType().isLocal())
|
||||
{
|
||||
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();
|
||||
|
||||
if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
|
||||
|
@ -1353,7 +1353,7 @@ public class UniversalFileTransferUtility
|
|||
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 doSuperTransferPreference = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER);
|
||||
|
||||
|
@ -1777,7 +1777,7 @@ public class UniversalFileTransferUtility
|
|||
path = path.append(separator + actualHost + separator);
|
||||
|
||||
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());
|
||||
}
|
||||
|
@ -1957,7 +1957,7 @@ public class UniversalFileTransferUtility
|
|||
public static String getActualHostFor(ISubSystem subsystem, String remotePath)
|
||||
{
|
||||
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);
|
||||
return result;
|
||||
|
@ -1991,7 +1991,7 @@ public class UniversalFileTransferUtility
|
|||
protected static boolean isRemoteFileMounted(ISubSystem subsystem, String remotePath)
|
||||
{
|
||||
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);
|
||||
if (!result.equals(hostname))
|
||||
|
@ -2015,7 +2015,7 @@ public class UniversalFileTransferUtility
|
|||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
|
||||
* 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;
|
||||
|
@ -1535,7 +1536,7 @@ public class SystemViewRemoteFileAdapter
|
|||
{
|
||||
IHost connection = connections[i];
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.TableColumn;
|
||||
|
||||
|
||||
/**
|
||||
* Dialog for confirming killing of a process or group of processes. User
|
||||
* selects the type of signal to be sent to the process.
|
||||
|
@ -128,7 +127,7 @@ public class SystemKillDialog extends SystemPromptDialog
|
|||
if (promptLabel == null) {
|
||||
Object input = getInputObject();
|
||||
|
||||
if (input != null && input instanceof IStructuredSelection) {
|
||||
if (input instanceof IStructuredSelection) {
|
||||
int size = ((IStructuredSelection)input).size();
|
||||
|
||||
if (size > 1) {
|
||||
|
|
|
@ -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
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* 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;
|
||||
|
@ -137,7 +138,7 @@ public class FileClassifier extends Thread
|
|||
{
|
||||
_systemSupportsClassify = false;
|
||||
}
|
||||
else if (osName.equals("z/OS")) { //$NON-NLS-1$
|
||||
else if (osName.equals("z/os")) { //$NON-NLS-1$
|
||||
_systemSupportsClassFilesOnly = true;
|
||||
}
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* 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) - [174945] Remove obsolete icons from rse.shells.ui
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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$
|
||||
if ((cmdSubSystem.getHost().getSystemType().equals("Local") && System.getProperty("os.name").toLowerCase().startsWith("win")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
|| cmdSubSystem.getHost().getSystemType().equals("Windows")) //$NON-NLS-1$
|
||||
if (cmdSubSystem.getHost().getSystemType().isWindows())
|
||||
{
|
||||
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* Martin Oberhuber (Wind River) - [180562] dont implement ISystemThemeConstants
|
||||
* 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) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.shells.ui.view;
|
||||
|
@ -378,9 +379,7 @@ FocusListener
|
|||
ISubSystem cmdSubSystem = adapter.getSubSystem(element);
|
||||
|
||||
String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$
|
||||
if (cmdSubSystem.getHost().getSystemType().getName().equals("Local") //$NON-NLS-1$
|
||||
&& System.getProperty("os.name").toLowerCase().startsWith("win") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|| cmdSubSystem.getHost().getSystemType().getName().equals("Windows")) //$NON-NLS-1$
|
||||
if (cmdSubSystem.getHost().getSystemType().isWindows())
|
||||
{
|
||||
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
|
||||
}
|
||||
|
@ -397,9 +396,7 @@ FocusListener
|
|||
ISubSystem cmdSubSystem = adapter.getSubSystem(element);
|
||||
|
||||
String cdCmd = "cd " + PathUtility.enQuoteUnix(path); //$NON-NLS-1$
|
||||
if (cmdSubSystem.getHost().getSystemType().getName().equals("Local") //$NON-NLS-1$
|
||||
&& System.getProperty("os.name").toLowerCase().startsWith("win") //$NON-NLS-1$ //$NON-NLS-2$
|
||||
|| cmdSubSystem.getHost().getSystemType().getName().equals("Windows")) //$NON-NLS-1$
|
||||
if (cmdSubSystem.getHost().getSystemType().isWindows())
|
||||
{
|
||||
cdCmd = "cd /d \"" + path + '\"'; //$NON-NLS-1$
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
* 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) - [174945] Remove obsolete icons from rse.shells.ui
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.internal.shells.ui.view;
|
||||
|
@ -520,7 +521,7 @@ public class SystemCommandsViewPart
|
|||
for (int i = 0; i < connections.length; 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);
|
||||
if (cmdSubSystems.length == 1)
|
||||
|
@ -647,7 +648,7 @@ public class SystemCommandsViewPart
|
|||
for (int i = 0; i < connections.length; 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);
|
||||
if (cmdSubSystems.length > 0)
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* 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;
|
||||
|
@ -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.ui.RSEUIPlugin;
|
||||
|
||||
|
||||
public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandShell
|
||||
{
|
||||
|
||||
|
||||
protected String _id;
|
||||
protected String _name;
|
||||
protected String _type;
|
||||
|
@ -47,8 +45,6 @@ public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandSh
|
|||
protected IRemoteCmdSubSystem _cmdSubSystem;
|
||||
protected ArrayList _cmdHistory;
|
||||
protected IProject _project;
|
||||
|
||||
|
||||
|
||||
public RemoteCommandShell(IRemoteCmdSubSystem cmdSubSystem)
|
||||
{
|
||||
|
@ -294,10 +290,7 @@ public abstract class RemoteCommandShell implements IAdaptable, IRemoteCommandSh
|
|||
|
||||
protected boolean isWindows()
|
||||
{
|
||||
String type = getCommandSubSystem().getHost().getSystemType().getName();
|
||||
|
||||
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$
|
||||
return getCommandSubSystem().getHost().getSystemType().isWindows();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
|
||||
* 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;
|
||||
|
@ -51,7 +52,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
|
|||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
||||
|
||||
/**
|
||||
* This is the abstraction of a subsystem specialized for remote execution of
|
||||
* commands.
|
||||
|
@ -59,7 +59,6 @@ import org.eclipse.swt.widgets.Shell;
|
|||
|
||||
public abstract class RemoteCmdSubSystem extends SubSystem implements IRemoteCmdSubSystem, ICommunicationsListener
|
||||
{
|
||||
|
||||
private static String COMMAND_SHELLS_MEMENTO = "commandshells"; //$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()
|
||||
{
|
||||
String type = getSystemType();
|
||||
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$
|
||||
return getHost().getSystemType().isWindows();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
* Contributors:
|
||||
* 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) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.RemoteCmdSubSystem;
|
||||
|
||||
|
||||
|
||||
public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements IShellServiceSubSystem
|
||||
{
|
||||
protected String _userHome = null;
|
||||
protected IShellService _hostService;
|
||||
|
||||
|
||||
public ShellServiceSubSystem(IHost host, IConnectorService connectorService, IShellService hostService)
|
||||
{
|
||||
super(host, connectorService);
|
||||
|
@ -62,14 +60,15 @@ public final class ShellServiceSubSystem extends RemoteCmdSubSystem implements I
|
|||
{
|
||||
if (_userHome == null)
|
||||
{
|
||||
if (getSystemType().equals(IRSESystemType.SYSTEMTYPE_WINDOWS))
|
||||
{
|
||||
_userHome = "c:\\"; //$NON-NLS-1$
|
||||
}
|
||||
else if (getSystemType().equals(IRSESystemType.SYSTEMTYPE_LOCAL))
|
||||
IRSESystemType type = getHost().getSystemType();
|
||||
if (type.isLocal())
|
||||
{
|
||||
_userHome = System.getProperty("user.home"); //$NON-NLS-1$
|
||||
}
|
||||
else if (type.isWindows())
|
||||
{
|
||||
_userHome = "c:\\"; //$NON-NLS-1$
|
||||
}
|
||||
else
|
||||
{
|
||||
// Assume UNIX compatible file system
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* 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;
|
||||
|
@ -20,7 +21,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
|
|||
import org.eclipse.core.runtime.IStatus;
|
||||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.rse.core.IRSESystemType;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.internal.ui.SystemResources;
|
||||
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.swt.widgets.Shell;
|
||||
|
||||
//import org.eclipse.rse.core.ui.SystemMessage;
|
||||
|
||||
|
||||
/**
|
||||
* This is the action for connecting to the remote subsystem
|
||||
*/
|
||||
|
@ -49,7 +46,7 @@ public class SystemConnectAction extends SystemBaseAction
|
|||
public IStatus run(IProgressMonitor monitor)
|
||||
{
|
||||
try {
|
||||
if (_subsystem.getHost().getSystemType().getId().equals(IRSESystemType.SYSTEMTYPE_WINDOWS_ID))
|
||||
if (_subsystem.getHost().getSystemType().isWindows())
|
||||
_subsystem.connect(monitor, false);
|
||||
else
|
||||
_subsystem.connect(monitor, true);
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
*
|
||||
* Contributors:
|
||||
* 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;
|
||||
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.rse.core.IRSESystemType;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.model.IHost;
|
||||
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
|
||||
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
|
||||
setChecked(false);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* 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) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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
|
||||
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
|
||||
sr.setHostOffline(conn, false);
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* 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;
|
||||
|
@ -712,7 +713,7 @@ public class SystemViewConnectionAdapter
|
|||
if (element instanceof IHost)
|
||||
{
|
||||
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();
|
||||
return !sr.isAnySubSystemConnected((IHost)element);
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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
|
||||
if (systemType != null)
|
||||
{
|
||||
if (systemType.equals("iSeries")) //$NON-NLS-1$
|
||||
if (systemType.getId().equals(IRSESystemType.SYSTEMTYPE_ISERIES_ID))
|
||||
{
|
||||
nameTextField.setTextLimit(128);
|
||||
valueTextField.setTextLimit(1024);
|
||||
}
|
||||
else if (systemType.equals("Windows")) //$NON-NLS-1$
|
||||
else if (systemType.isWindows())
|
||||
{
|
||||
nameTextField.setTextLimit(300);
|
||||
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;
|
||||
|
|
|
@ -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
|
||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||
* 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.
|
||||
*
|
||||
* Contributors:
|
||||
* {Name} (company) - description of contribution.
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.dialogs;
|
||||
|
@ -145,7 +145,7 @@ public class SystemDeleteDialog extends SystemPromptDialog
|
|||
if (promptLabel == null) {
|
||||
Object input = getInputObject();
|
||||
|
||||
if (input != null && input instanceof IStructuredSelection) {
|
||||
if (input instanceof IStructuredSelection) {
|
||||
int size = ((IStructuredSelection)input).size();
|
||||
|
||||
if (size > 1) {
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
|
||||
* 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;
|
||||
|
@ -1450,6 +1451,29 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
|
|||
}
|
||||
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$
|
||||
{
|
||||
ISubSystem ss = getSubSystem(target);
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*
|
||||
* Contributors:
|
||||
* Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.widgets;
|
||||
|
@ -366,7 +367,7 @@ public class EnvironmentVariablesForm extends SystemBaseForm implements Selectio
|
|||
new EnvironmentVariablesPromptDialog(
|
||||
getShell(),
|
||||
SystemResources.RESID_SUBSYSTEM_ENVVAR_ADD_TITLE,
|
||||
systemType.getName(),
|
||||
systemType,
|
||||
invalidNameChars,
|
||||
getVariableNames(),
|
||||
false);
|
||||
|
@ -518,7 +519,7 @@ public class EnvironmentVariablesForm extends SystemBaseForm implements Selectio
|
|||
EnvironmentVariablesPromptDialog(
|
||||
getShell(),
|
||||
SystemResources.RESID_SUBSYSTEM_ENVVAR_CHANGE_TITLE,
|
||||
systemType.getName(),
|
||||
systemType,
|
||||
invalidNameChars,
|
||||
getVariableNames(),
|
||||
true);
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
* 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) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
********************************************************************************/
|
||||
|
||||
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.messages.SystemMessageDialog;
|
||||
|
||||
|
||||
/**
|
||||
* Standard RSE new connection wizard implementation.
|
||||
*/
|
||||
|
@ -165,7 +165,7 @@ public class RSEDefaultNewConnectionWizard extends RSEAbstractNewConnectionWizar
|
|||
} else {
|
||||
IRSESystemType onlySystemType = getSystemType();
|
||||
|
||||
if (onlySystemType.getId().equals(IRSESystemType.SYSTEMTYPE_LOCAL_ID)) {
|
||||
if (onlySystemType.isLocal()) {
|
||||
pageTitle = SystemResources.RESID_NEWCONN_PAGE1_LOCAL_TITLE;
|
||||
} else {
|
||||
pageTitle = SystemResources.RESID_NEWCONN_PAGE1_REMOTE_TITLE;
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* 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;
|
||||
|
@ -108,13 +109,11 @@ import org.eclipse.ui.part.PluginTransfer;
|
|||
import org.eclipse.ui.part.PluginTransferData;
|
||||
import org.eclipse.ui.part.ResourceTransfer;
|
||||
|
||||
|
||||
/**
|
||||
* Registry for all connections.
|
||||
*/
|
||||
public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvider
|
||||
{
|
||||
|
||||
private static Exception lastException = null;
|
||||
private static SystemRegistry registry = 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$
|
||||
return (String[])v.toArray(new String[v.size()]);
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@
|
|||
* Martin Oberhuber (Wind River) - [183165] Do not implement constant interfaces
|
||||
* Martin Oberhuber (Wind River) - [182454] improve getAbsoluteName() documentation
|
||||
* 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;
|
||||
|
@ -920,19 +921,6 @@ public abstract class SubSystem extends RSEModelObject
|
|||
// 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
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* Uwe Stieber (Wind River) - initial API and implementation
|
||||
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
|
||||
* Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
|
||||
* Martin Oberhuber (Wind River) - [186640] Add IRSESystemTyep.isLocal()
|
||||
*******************************************************************************/
|
||||
package org.eclipse.rse.tests.core.registries;
|
||||
|
||||
|
@ -59,7 +60,7 @@ public class SubSystemConfigurationProxyTestCase extends RSECoreTestCase {
|
|||
for (int j = 0; j < systemTypes.length; j++) {
|
||||
IRSESystemType systemType = systemTypes[j];
|
||||
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$
|
||||
} else {
|
||||
assertFalse("Proxy is expected not to be applicable, but returned to be!", proxy.appliesToSystemType(systemType)); //$NON-NLS-1$
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
* Martin Oberhuber (Wind River) - initial API and implementation
|
||||
* 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) - [186640] Add IRSESystemTyep.isLocal()
|
||||
*******************************************************************************/
|
||||
package org.eclipse.rse.tests.subsystems.files;
|
||||
|
||||
|
@ -65,11 +66,7 @@ public class FileServiceTest extends RSEBaseConnectionTestCase {
|
|||
}
|
||||
|
||||
public boolean isWindows() {
|
||||
String systemTypeId = fss.getHost().getSystemType().getName();
|
||||
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$
|
||||
return fss.getHost().getSystemType().isWindows();
|
||||
}
|
||||
|
||||
public String getTestFileName() {
|
||||
|
|
Loading…
Add table
Reference in a new issue