mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-28 18:53:20 +02:00
[cleanup] Add @noimplement and similar API Tools Javadoc Markup
This commit is contained in:
parent
ee32242b1a
commit
14af215d50
25 changed files with 1349 additions and 1320 deletions
|
@ -18,10 +18,11 @@ package org.eclipse.rse.core;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for RSE core registry. Clients should use this interface as the starting point for querying and
|
* Interface for RSE core registry. Clients should use this interface as the
|
||||||
* manipulating model objects in the RSE framework.
|
* starting point for querying and manipulating model objects in the RSE
|
||||||
*
|
* framework.
|
||||||
* This interface is not intended to be implemented by clients.
|
*
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface IRSECoreRegistry {
|
public interface IRSECoreRegistry {
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ public interface IRSECoreRegistry {
|
||||||
* @deprecated Use {@link #getSystemTypeById(String)}.
|
* @deprecated Use {@link #getSystemTypeById(String)}.
|
||||||
*/
|
*/
|
||||||
public IRSESystemType getSystemType(String name);
|
public IRSESystemType getSystemType(String name);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a system type object given by the id.
|
* Returns a system type object given by the id.
|
||||||
*
|
*
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -29,10 +29,11 @@ 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.
|
||||||
* <p>
|
* <p>
|
||||||
* This interface is not intended to be implemented by clients. System type
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* implementations must subclass {@link AbstractRSESystemType} rather than
|
* System type implementations must subclass
|
||||||
* implementing this interface directly.
|
* {@link AbstractRSESystemType} rather than implementing this
|
||||||
* </p>
|
* interface directly.
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
public interface IRSESystemType extends IAdaptable {
|
public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_LINUX_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_LINUX_ID}.
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Linux system type, "org.eclipse.rse.systemtype.linux".
|
* Linux system type, "org.eclipse.rse.systemtype.linux".
|
||||||
*/
|
*/
|
||||||
|
@ -52,7 +53,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_POWER_LINUX_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_POWER_LINUX_ID}.
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Power Linux type, "org.eclipse.rse.systemtype.linux.power".
|
* Power Linux type, "org.eclipse.rse.systemtype.linux.power".
|
||||||
*/
|
*/
|
||||||
|
@ -68,7 +69,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Power Linux type, "org.eclipse.rse.systemtype.linux.zseries".
|
* Power Linux type, "org.eclipse.rse.systemtype.linux.zseries".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_ZSERIES_LINUX_ID = "org.eclipse.rse.systemtype.linux.zSeries"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_ZSERIES_LINUX_ID = "org.eclipse.rse.systemtype.linux.zSeries"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unix system type, "Unix".
|
* Unix system type, "Unix".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_UNIX_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_UNIX_ID}.
|
||||||
|
@ -79,7 +80,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Unix system type, "org.eclipse.rse.systemtype.unix".
|
* Unix system type, "org.eclipse.rse.systemtype.unix".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_UNIX_ID = "org.eclipse.rse.systemtype.unix"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_UNIX_ID = "org.eclipse.rse.systemtype.unix"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* AIX system type, "AIX".
|
* AIX system type, "AIX".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_AIX_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_AIX_ID}.
|
||||||
|
@ -90,7 +91,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* AIX system type, "org.eclipse.rse.systemtype.aix".
|
* AIX system type, "org.eclipse.rse.systemtype.aix".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_AIX_ID = "org.eclipse.rse.systemtype.aix"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_AIX_ID = "org.eclipse.rse.systemtype.aix"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PASE system type, "PASE".
|
* PASE system type, "PASE".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_PASE_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_PASE_ID}.
|
||||||
|
@ -101,7 +102,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* PASE system type, "org.eclipse.rse.systemtype.PASE".
|
* PASE system type, "org.eclipse.rse.systemtype.PASE".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_PASE_ID = "org.eclipse.rse.systemtype.iseries.PASE"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_PASE_ID = "org.eclipse.rse.systemtype.iseries.PASE"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iSeries system type, "iSeries".
|
* iSeries system type, "iSeries".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_ISERIES_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_ISERIES_ID}.
|
||||||
|
@ -112,7 +113,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* iSeries system type, "org.eclipse.rse.systemtype.iseries".
|
* iSeries system type, "org.eclipse.rse.systemtype.iseries".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_ISERIES_ID = "org.eclipse.rse.systemtype.iseries"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_ISERIES_ID = "org.eclipse.rse.systemtype.iseries"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Local system type, "Local".
|
* Local system type, "Local".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_LOCAL_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_LOCAL_ID}.
|
||||||
|
@ -123,7 +124,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Local system type, "org.eclipse.rse.systemtype.local".
|
* Local system type, "org.eclipse.rse.systemtype.local".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_LOCAL_ID = "org.eclipse.rse.systemtype.local"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_LOCAL_ID = "org.eclipse.rse.systemtype.local"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* z/OS system type, "z/OS".
|
* z/OS system type, "z/OS".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_ZSERIES_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_ZSERIES_ID}.
|
||||||
|
@ -134,7 +135,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* z/OS system type, "org.eclipse.rse.systemtype.zseries".
|
* z/OS system type, "org.eclipse.rse.systemtype.zseries".
|
||||||
*/
|
*/
|
||||||
public static final String SYSTEMTYPE_ZSERIES_ID = "org.eclipse.rse.systemtype.zseries"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_ZSERIES_ID = "org.eclipse.rse.systemtype.zseries"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Windows system type, "Windows".
|
* Windows system type, "Windows".
|
||||||
* @deprecated Use {@link #SYSTEMTYPE_WINDOWS_ID}.
|
* @deprecated Use {@link #SYSTEMTYPE_WINDOWS_ID}.
|
||||||
|
@ -143,7 +144,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
/** 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". */
|
||||||
public static final String SYSTEMTYPE_DISCOVERY_ID = "org.eclipse.rse.systemtype.discovery"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_DISCOVERY_ID = "org.eclipse.rse.systemtype.discovery"; //$NON-NLS-1$
|
||||||
/** FTP Only system type, "org.eclipse.rse.systemtype.ftp". */
|
/** FTP Only system type, "org.eclipse.rse.systemtype.ftp". */
|
||||||
|
@ -152,9 +153,9 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
public static final String SYSTEMTYPE_SSH_ONLY_ID = "org.eclipse.rse.systemtype.ssh"; //$NON-NLS-1$
|
public static final String SYSTEMTYPE_SSH_ONLY_ID = "org.eclipse.rse.systemtype.ssh"; //$NON-NLS-1$
|
||||||
/** 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: "isLocal") indicating whether
|
* System type Property Key (value: "isLocal") indicating whether
|
||||||
* a system type is declared in plugin.xml to refers to the local
|
* a system type is declared in plugin.xml to refers to the local
|
||||||
* system.
|
* system.
|
||||||
* On a the local system, the following properties are expected:
|
* On a the local system, the following properties are expected:
|
||||||
|
@ -165,13 +166,13 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @see #testProperty(String, boolean)
|
* @see #testProperty(String, boolean)
|
||||||
*/
|
*/
|
||||||
public static final String PROPERTY_IS_LOCAL = "isLocal"; //$NON-NLS-1$
|
public static final String PROPERTY_IS_LOCAL = "isLocal"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System type Property Key (value: "isWindows") indicating whether
|
* System type Property Key (value: "isWindows") indicating whether
|
||||||
* a system type is declared in plugin.xml to refers to a Windows
|
* a system type is declared in plugin.xml to refers to a Windows
|
||||||
* system.
|
* system.
|
||||||
* <p>
|
* <p>
|
||||||
* This is an "aggregate" property consisting of several smaller
|
* This is an "aggregate" property consisting of several smaller
|
||||||
* properties like isCaseSensitive. In the future, we'll want more
|
* properties like isCaseSensitive. In the future, we'll want more
|
||||||
* fine granular properties to check against. On a Windows system,
|
* fine granular properties to check against. On a Windows system,
|
||||||
* the following properties are expected:
|
* the following properties are expected:
|
||||||
|
@ -187,14 +188,14 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @see #testProperty(String, boolean)
|
* @see #testProperty(String, boolean)
|
||||||
*/
|
*/
|
||||||
public static final String PROPERTY_IS_WINDOWS = "isWindows"; //$NON-NLS-1$
|
public static final String PROPERTY_IS_WINDOWS = "isWindows"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* System type Property Key (value: "isCaseSensitive") indicating
|
* System type Property Key (value: "isCaseSensitive") indicating
|
||||||
* whether a given system type is in general case sensitive.
|
* whether a given system type is in general case sensitive.
|
||||||
* @see #testProperty(String, boolean)
|
* @see #testProperty(String, boolean)
|
||||||
*/
|
*/
|
||||||
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
|
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
|
||||||
|
@ -203,11 +204,11 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the translatable label for use in the UI.
|
* Returns the translatable label for use in the UI.
|
||||||
*
|
*
|
||||||
* @return The UI label or <code>null</code> if not set.
|
* @return The UI label or <code>null</code> if not set.
|
||||||
*/
|
*/
|
||||||
public String getLabel();
|
public String getLabel();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name of the system type.
|
* Returns the name of the system type.
|
||||||
* @return the name of the system type
|
* @return the name of the system type
|
||||||
|
@ -230,7 +231,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @return the value associated with the given key or <code>null</code> if none
|
* @return the value associated with the given key or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
public String getProperty(String key);
|
public String getProperty(String key);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether the given boolean property matches the expected value
|
* Tests whether the given boolean property matches the expected value
|
||||||
* for this system type.
|
* for this system type.
|
||||||
|
@ -238,7 +239,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Clients can use their own properties with system types, but should
|
* Clients can use their own properties with system types, but should
|
||||||
* use reverse DNS notation to qualify their property keys (e.g.
|
* use reverse DNS notation to qualify their property keys (e.g.
|
||||||
* <code>com.acme.isFoobarSystem</code>. Property keys without qualifying
|
* <code>com.acme.isFoobarSystem</code>. Property keys without qualifying
|
||||||
* namespace are reserved for RSE internal use.
|
* namespace are reserved for RSE internal use.
|
||||||
*
|
*
|
||||||
* @param key the name of the property to return
|
* @param key the name of the property to return
|
||||||
* @param expectedValue the expected boolean value of the property.
|
* @param expectedValue the expected boolean value of the property.
|
||||||
|
@ -247,7 +248,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* is not set or does not match.
|
* is not set or does not match.
|
||||||
*/
|
*/
|
||||||
public boolean testProperty(String key, boolean expectedValue);
|
public boolean testProperty(String key, boolean expectedValue);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests whether the system type is currently enabled.
|
* Tests whether the system type is currently enabled.
|
||||||
*
|
*
|
||||||
|
@ -259,7 +260,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* Implementers of custom system types (which are registered by a SystemTypeProvider)
|
* Implementers of custom system types (which are registered by a SystemTypeProvider)
|
||||||
* can override this method to provide more advanced enabled checks e.g. based on
|
* can override this method to provide more advanced enabled checks e.g. based on
|
||||||
* license availability.
|
* license availability.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if the system type is currently enabled, or <code>false</code> otherwise.
|
* @return <code>true</code> if the system type is currently enabled, or <code>false</code> otherwise.
|
||||||
*/
|
*/
|
||||||
public boolean isEnabled();
|
public boolean isEnabled();
|
||||||
|
@ -267,11 +268,11 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Tests whether the system type refers to the local system.
|
* Tests whether the system type refers to the local system.
|
||||||
* This is a shortcut for
|
* This is a shortcut for
|
||||||
* <pre>
|
* <pre>
|
||||||
* getId().equals(SYSTEMTYPE_LOCAL_ID) ||
|
* getId().equals(SYSTEMTYPE_LOCAL_ID) ||
|
||||||
* || testProperty(PROPERTY_IS_LOCAL, true)
|
* || testProperty(PROPERTY_IS_LOCAL, true)
|
||||||
* </pre>
|
* </pre>
|
||||||
* See {@link #PROPERTY_IS_LOCAL} for properties expected on
|
* See {@link #PROPERTY_IS_LOCAL} for properties expected on
|
||||||
* a Local system.
|
* a Local system.
|
||||||
* Extenders (contributors of custom system types) may override.
|
* Extenders (contributors of custom system types) may override.
|
||||||
* @return true if the system type refers to the local system.
|
* @return true if the system type refers to the local system.
|
||||||
|
@ -281,14 +282,14 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
/**
|
/**
|
||||||
* Tests whether the system type refers to the Windows system.
|
* Tests whether the system type refers to the Windows system.
|
||||||
* This is a shortcut for
|
* This is a shortcut for
|
||||||
* <pre>
|
* <pre>
|
||||||
* getId().equals(SYSTEMTYPE_WINDOWS_ID)
|
* getId().equals(SYSTEMTYPE_WINDOWS_ID)
|
||||||
* || isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")
|
* || isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")
|
||||||
* || testProperty(PROPERTY_IS_WINDOWS, true)
|
* || testProperty(PROPERTY_IS_WINDOWS, true)
|
||||||
* </pre>
|
* </pre>
|
||||||
* See {@link #PROPERTY_IS_WINDOWS} for properties expected on
|
* See {@link #PROPERTY_IS_WINDOWS} for properties expected on
|
||||||
* a Windows system. This is an "aggregate" property consisting
|
* a Windows system. This is an "aggregate" property consisting
|
||||||
* of several smaller properties like isCaseSensitive. In the
|
* of several smaller properties like isCaseSensitive. In the
|
||||||
* future, we'll want more fine granular properties to check against.
|
* future, we'll want more fine granular properties to check against.
|
||||||
* Extenders (contributors of custom system types) may override.
|
* Extenders (contributors of custom system types) may override.
|
||||||
* @return true if the system type refers to a Windows system.
|
* @return true if the system type refers to a Windows system.
|
||||||
|
@ -297,16 +298,16 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
* that are needed in presenting the system type.
|
* that are needed in presenting the system type.
|
||||||
*
|
*
|
||||||
* @return the bundle which defines this system type or <code>null</code> if none
|
* @return the bundle which defines this system type or <code>null</code> if none
|
||||||
*/
|
*/
|
||||||
public Bundle getDefiningBundle();
|
public Bundle getDefiningBundle();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of fully qualified known subsystem configuration id's that
|
* Returns a list of fully qualified known subsystem configuration id's that
|
||||||
* this system type wants to be registered against.
|
* this system type wants to be registered against.
|
||||||
* More subsystem configurations can be added through the <tt>subsystemConfigurations</tt>
|
* More subsystem configurations can be added through the <tt>subsystemConfigurations</tt>
|
||||||
* extension point.
|
* extension point.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -316,9 +317,9 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
*
|
*
|
||||||
* @return The list of subsystem configuration id's. May be empty,
|
* @return The list of subsystem configuration id's. May be empty,
|
||||||
* but never <code>null</code>.
|
* but never <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public String[] getSubsystemConfigurationIds();
|
public String[] getSubsystemConfigurationIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new <code>IHost</code> object instance. This method is
|
* Creates a new <code>IHost</code> object instance. This method is
|
||||||
* called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
|
* called from {@link SystemHostPool#createHost(IRSESystemType, String, String, String, String, int)}.
|
||||||
|
@ -326,5 +327,5 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
* @param profile The system profile to associate with the host.
|
* @param profile The system profile to associate with the host.
|
||||||
* @return A new <code>IHost</code> object instance.
|
* @return A new <code>IHost</code> object instance.
|
||||||
*/
|
*/
|
||||||
public IHost createNewHostInstance(ISystemProfile profile);
|
public IHost createNewHostInstance(ISystemProfile profile);
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -22,14 +22,14 @@ import org.eclipse.rse.core.IRSESystemType;
|
||||||
import org.eclipse.rse.core.IRSEUserIdConstants;
|
import org.eclipse.rse.core.IRSEUserIdConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An ordered list of connections ({@link IHost} objects), owned by an {@link ISystemProfile}.
|
* An ordered list of connections ({@link IHost} objects), owned by an
|
||||||
|
* {@link ISystemProfile}.
|
||||||
* <p>
|
* <p>
|
||||||
* Implementations of this interface are expected to be thread-safe in the sense
|
* Implementations of this interface are expected to be thread-safe in the sense
|
||||||
* that integrity of the host list is maintained even if multiple threads call
|
* that integrity of the host list is maintained even if multiple threads call
|
||||||
* multiple methods in this interface concurrently.
|
* multiple methods in this interface concurrently.
|
||||||
* </p><p>
|
|
||||||
* This interface is not intended to be implemented by clients.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemHostPool extends IRSEPersistableContainer {
|
public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
|
|
||||||
|
@ -62,48 +62,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
*/
|
*/
|
||||||
public IHost[] getHosts();
|
public IHost[] getHosts();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given only the minimal information.
|
* Create a connection object, given only the minimal information.
|
||||||
* <p>
|
* <p>
|
||||||
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @return IHost object, or null if it failed to create
|
* @return IHost object, or null if it failed to create
|
||||||
* because the aliasName is not unique. All other errors throw an exception.
|
* because the aliasName is not unique. All other errors throw an exception.
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given all the possible attributes except default userId.
|
* Create a connection object, given all the possible attributes except default userId.
|
||||||
* <p>
|
* <p>
|
||||||
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @return IHost object, or <code>null</code> if it failed to create
|
* @return IHost object, or <code>null</code> if it failed to create
|
||||||
* because the aliasName is not unique. All other errors throw an exception.
|
* because the aliasName is not unique. All other errors throw an exception.
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given all the possible attributes.
|
* Create a connection object, given all the possible attributes.
|
||||||
* <p>
|
* <p>
|
||||||
* The new connection is added to the list and saved to disk.
|
* The new connection is added to the list and saved to disk.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems.
|
* @param defaultUserId userId to use as the default for the subsystems.
|
||||||
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
|
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
|
||||||
* @return IHost object, or <code>null</code> if it failed to create
|
* @return IHost object, or <code>null</code> if it failed to create
|
||||||
* because the aliasName is not unique.
|
* because the aliasName is not unique.
|
||||||
* @see IRSEUserIdConstants
|
* @see IRSEUserIdConstants
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemType extension point.
|
* defined via the systemType extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems.
|
* @param defaultUserId userId to use as the default for the subsystems.
|
||||||
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
|
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
|
||||||
|
@ -126,29 +126,29 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
*/
|
*/
|
||||||
public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a connection object, given its alias name.
|
* Return a connection object, given its alias name.
|
||||||
*
|
*
|
||||||
* Can be used to test if an alias name is already used (non-null return).
|
* Can be used to test if an alias name is already used (non-null return).
|
||||||
*
|
*
|
||||||
* @param aliasName unique aliasName (case insensitive) to search on.
|
* @param aliasName unique aliasName (case insensitive) to search on.
|
||||||
* @return IHost object with unique aliasName, or null if
|
* @return IHost object with unique aliasName, or null if
|
||||||
* no connection object with this name exists.
|
* no connection object with this name exists.
|
||||||
*/
|
*/
|
||||||
public IHost getHost(String aliasName);
|
public IHost getHost(String aliasName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the connection at the given zero-based offset.
|
* Return the connection at the given zero-based offset.
|
||||||
* @param pos zero-based offset of requested connection in the connection list.
|
* @param pos zero-based offset of requested connection in the connection list.
|
||||||
* @return IHost object requested.
|
* @return IHost object requested.
|
||||||
*/
|
*/
|
||||||
public IHost getHost(int pos);
|
public IHost getHost(int pos);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a new connection to the list.
|
* Add a new connection to the list.
|
||||||
* <p>
|
* <p>
|
||||||
* This method will not ensure that the added connection's alias name is
|
* This method will not ensure that the added connection's alias name is
|
||||||
* different (case-insensitive) than all other existing alias names.
|
* different (case-insensitive) than all other existing alias names.
|
||||||
* Clients are responsible for maintaining this invariant.
|
* Clients are responsible for maintaining this invariant.
|
||||||
* </p>
|
* </p>
|
||||||
* @param conn Connection to add. Must not be <code>null</code>.
|
* @param conn Connection to add. Must not be <code>null</code>.
|
||||||
|
@ -163,7 +163,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Delete the connection in memory
|
* <li>Delete the connection in memory
|
||||||
* <li>Delete the underlying folder
|
* <li>Delete the underlying folder
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* @param conn IHost object to remove
|
* @param conn IHost object to remove
|
||||||
*/
|
*/
|
||||||
|
@ -212,7 +212,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move existing connections a given number of positions in the same pool.
|
* Move existing connections a given number of positions in the same pool.
|
||||||
* If the delta is negative, they are all moved up (left) by the given amount. If
|
* If the delta is negative, they are all moved up (left) by the given amount. If
|
||||||
* positive, they are all moved down (right) by the given amount.<p>
|
* positive, they are all moved down (right) by the given amount.<p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>After the move, the pool containing the moved connection is saved to disk.
|
* <li>After the move, the pool containing the moved connection is saved to disk.
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -52,29 +52,27 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
|
||||||
import org.eclipse.rse.internal.core.RSECoreRegistry;
|
import org.eclipse.rse.internal.core.RSECoreRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry or front door for all remote system connections.
|
* Registry or front door for all remote system connections. There is a
|
||||||
* There is a singleton of the class implementation of this interface.
|
* singleton of the class implementation of this interface. To get it, call the
|
||||||
* To get it, call the {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
|
* {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
|
||||||
* <p>
|
* <p>
|
||||||
* The idea here is that connections are grouped by system profile. At any
|
* The idea here is that connections are grouped by system profile. At any time,
|
||||||
* time, there is a user-specified number of profiles "active" and connections
|
* there is a user-specified number of profiles "active" and connections from
|
||||||
* from each active profile are worked with.
|
* each active profile are worked with.
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* This interface is not intended to be implemented by clients.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
|
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the SystemFilterStartHere singleton instance.
|
* Get the SystemFilterStartHere singleton instance.
|
||||||
* @return the SystemFilterStartHere singleton instance.
|
* @return the SystemFilterStartHere singleton instance.
|
||||||
*/
|
*/
|
||||||
public ISystemFilterStartHere getSystemFilterStartHere();
|
public ISystemFilterStartHere getSystemFilterStartHere();
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// SUBSYSTEM FACTORY METHODS...
|
// SUBSYSTEM FACTORY METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Public method to retrieve list of subsystem factory proxies registered by extension points.
|
* Public method to retrieve list of subsystem factory proxies registered by extension points.
|
||||||
|
@ -124,7 +122,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* @return an array of subsystem configurations meeting the criteria
|
* @return an array of subsystem configurations meeting the criteria
|
||||||
*/
|
*/
|
||||||
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicates, boolean activate);
|
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicates, boolean activate);
|
||||||
|
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// SYSTEMVIEWINPUTPROVIDER METHODS...
|
// SYSTEMVIEWINPUTPROVIDER METHODS...
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
@ -141,11 +139,11 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
/**
|
/**
|
||||||
* This method is called by the connection adapter when deciding to show a plus-sign
|
* This method is called by the connection adapter when deciding to show a plus-sign
|
||||||
* or not beside a connection.
|
* or not beside a connection.
|
||||||
* @param selectedConnection the connection being shown in the viewer
|
* @param selectedConnection the connection being shown in the viewer
|
||||||
* @return true if this connection has children to be shown.
|
* @return true if this connection has children to be shown.
|
||||||
*/
|
*/
|
||||||
public boolean hasConnectionChildren(IHost selectedConnection);
|
public boolean hasConnectionChildren(IHost selectedConnection);
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// PROFILE METHODS...
|
// PROFILE METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
@ -175,7 +173,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* @param profile Source profile to copy
|
* @param profile Source profile to copy
|
||||||
* @param newName Unique name to give copied profile
|
* @param newName Unique name to give copied profile
|
||||||
* @param makeActive whether to make the copied profile active or not
|
* @param makeActive whether to make the copied profile active or not
|
||||||
* @param monitor Progress monitor to reflect each step of the operation
|
* @param monitor Progress monitor to reflect each step of the operation
|
||||||
* @return new SystemProfile object
|
* @return new SystemProfile object
|
||||||
*/
|
*/
|
||||||
public ISystemProfile copySystemProfile(ISystemProfile profile, String newName, boolean makeActive, IProgressMonitor monitor) throws Exception;
|
public ISystemProfile copySystemProfile(ISystemProfile profile, String newName, boolean makeActive, IProgressMonitor monitor) throws Exception;
|
||||||
|
@ -199,7 +197,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public void deleteSystemProfile(ISystemProfile profile) throws Exception;
|
public void deleteSystemProfile(ISystemProfile profile) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Make or unmake the given profile active.
|
* Make or unmake the given profile active.
|
||||||
* The default private profile cannot be deactivated and such
|
* The default private profile cannot be deactivated and such
|
||||||
* a request will be ignored.
|
* a request will be ignored.
|
||||||
*/
|
*/
|
||||||
|
@ -219,7 +217,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
/**
|
/**
|
||||||
* Return list of subsystem objects for a given host.
|
* Return list of subsystem objects for a given host.
|
||||||
* @param host the host for which to return the subsystems that are currently known.
|
* @param host the host for which to return the subsystems that are currently known.
|
||||||
* @return an array of subsystem objects known to this host.
|
* @return an array of subsystem objects known to this host.
|
||||||
*/
|
*/
|
||||||
public ISubSystem[] getSubSystems(IHost host);
|
public ISubSystem[] getSubSystems(IHost host);
|
||||||
|
|
||||||
|
@ -242,7 +240,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* @return list of matching subsystems
|
* @return list of matching subsystems
|
||||||
*/
|
*/
|
||||||
public ISubSystem[] getSubsystems(IHost host, Class subsystemInterface);
|
public ISubSystem[] getSubsystems(IHost host, Class subsystemInterface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get those subsystems that are registered against a given connection,
|
* Get those subsystems that are registered against a given connection,
|
||||||
* which are service subsystems with the given serviceType.
|
* which are service subsystems with the given serviceType.
|
||||||
|
@ -277,11 +275,11 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public String getAbsoluteNameForConnection(IHost host);
|
public String getAbsoluteNameForConnection(IHost host);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a list of subsystem objects for given connection, owned by a subsystem factory
|
* Get a list of subsystem objects for given connection, owned by a subsystem factory
|
||||||
* that is of the given category. Array will never be null but may be length zero.
|
* that is of the given category. Array will never be null but may be length zero.
|
||||||
* <p>
|
* <p>
|
||||||
* This looks for a match on the "category" of the subsystem factory's xml declaration
|
* This looks for a match on the "category" of the subsystem factory's xml declaration
|
||||||
* in its plugin.xml file.
|
* in its plugin.xml file.
|
||||||
*
|
*
|
||||||
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
|
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
|
||||||
* @deprecated use {@link #getSubSystemConfigurationProxiesByCategory(String)}
|
* @deprecated use {@link #getSubSystemConfigurationProxiesByCategory(String)}
|
||||||
|
@ -304,7 +302,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* Return the first connection to the local host we can find.
|
* Return the first connection to the local host we can find.
|
||||||
*
|
*
|
||||||
* While we always create a default one in the user's profile, it is possible that
|
* While we always create a default one in the user's profile, it is possible that
|
||||||
* this profile is not active or the connection was deleted. However, since any
|
* this profile is not active or the connection was deleted. However, since any
|
||||||
* connection to the local host will usually do, we just search all active profiles
|
* connection to the local host will usually do, we just search all active profiles
|
||||||
* until we find one, and return it. <br>
|
* until we find one, and return it. <br>
|
||||||
* If no connection to the local host can be found, this will return <code>null</code>.
|
* If no connection to the local host can be found, this will return <code>null</code>.
|
||||||
|
@ -337,7 +335,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* <p>
|
* <p>
|
||||||
* This looks for a match on the "category" of the subsystem
|
* This looks for a match on the "category" of the subsystem
|
||||||
* configuration's xml declaration in its plugin.xml file.
|
* configuration's xml declaration in its plugin.xml file.
|
||||||
* Thus, it is efficient as it need not bring to life a
|
* Thus, it is efficient as it need not bring to life a
|
||||||
* subsystem configuration just to test its parent class type.
|
* subsystem configuration just to test its parent class type.
|
||||||
*
|
*
|
||||||
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
|
* @see org.eclipse.rse.core.model.ISubSystemConfigurationCategories
|
||||||
|
@ -354,7 +352,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* @return The list of connections or an empty array.
|
* @return The list of connections or an empty array.
|
||||||
*/
|
*/
|
||||||
public IHost[] getHostsBySystemType(IRSESystemType systemType);
|
public IHost[] getHostsBySystemType(IRSESystemType systemType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return all connections for all active profiles, for the given system types.
|
* Return all connections for all active profiles, for the given system types.
|
||||||
*
|
*
|
||||||
|
@ -364,7 +362,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes);
|
public IHost[] getHostsBySystemTypes(IRSESystemType[] systemTypes);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a SystemConnection object given a system profile containing it,
|
* Return a SystemConnection object given a system profile containing it,
|
||||||
* and a connection name uniquely identifying it.
|
* and a connection name uniquely identifying it.
|
||||||
*/
|
*/
|
||||||
public IHost getHost(ISystemProfile profile, String connectionName);
|
public IHost getHost(ISystemProfile profile, String connectionName);
|
||||||
|
@ -381,7 +379,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public int getHostCount(ISystemProfile profile);
|
public int getHostCount(ISystemProfile profile);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the number of SystemConnection objects within the given
|
* Return the number of SystemConnection objects within the given
|
||||||
* connection's owning profile.
|
* connection's owning profile.
|
||||||
*/
|
*/
|
||||||
public int getHostCountWithinProfile(IHost conn);
|
public int getHostCountWithinProfile(IHost conn);
|
||||||
|
@ -421,7 +419,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public IHost createLocalHost(ISystemProfile profile, String name, String userId);
|
public IHost createLocalHost(ISystemProfile profile, String name, String userId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a host object, sometimes called a "connection",
|
* Create a host object, sometimes called a "connection",
|
||||||
* given the containing profile and given all the possible attributes.
|
* given the containing profile and given all the possible attributes.
|
||||||
* The profile is then scheduled to be persisted.
|
* The profile is then scheduled to be persisted.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -496,8 +494,8 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* because the connectionName is not unique. Call getLastException() if necessary.
|
* because the connectionName is not unique. Call getLastException() if necessary.
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
|
public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a host object. The resulting host object is added to the list of existing host objects
|
* Create a host object. The resulting host object is added to the list of existing host objects
|
||||||
* in the specified profile.
|
* in the specified profile.
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -518,32 +516,32 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public IHost createHost(String profileName, IRSESystemType systemType, String hostName, String hostAddress, String description, boolean createSubSystems) throws Exception;
|
public IHost createHost(String profileName, IRSESystemType systemType, String hostName, String hostAddress, String description, boolean createSubSystems) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing host given the new information.
|
* Update an existing host given the new information.
|
||||||
* This method:
|
* This method:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>calls the setXXX methods on the given host object, updating the information in it.
|
* <li>calls the setXXX methods on the given host object, updating the information in it.
|
||||||
* <li>save the host's host pool to disk
|
* <li>save the host's host pool to disk
|
||||||
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
|
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
|
||||||
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
|
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
|
||||||
* We must do this because a host name changes fundamentally affects the connection,
|
* We must do this because a host name changes fundamentally affects the connection,
|
||||||
* rendering any information currently displayed under
|
* rendering any information currently displayed under
|
||||||
* that host obsolete.
|
* that host obsolete.
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* @param host the host to be updated
|
* @param host the host to be updated
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param connectionName unique connection name.
|
* @param connectionName unique connection name.
|
||||||
* @param hostName ip name of host.
|
* @param hostName ip name of host.
|
||||||
* @param description optional description of the host. Can be null.
|
* @param description optional description of the host. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems under this host.
|
* @param defaultUserId userId to use as the default for the subsystems under this host.
|
||||||
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
|
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
|
||||||
* that tells us where to set the user Id
|
* that tells us where to set the user Id
|
||||||
*/
|
*/
|
||||||
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
|
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
|
||||||
String hostName, String description,
|
String hostName, String description,
|
||||||
String defaultUserId, int defaultUserIdLocation);
|
String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates subsystems for a given host and subsystem configurations.
|
* Creates subsystems for a given host and subsystem configurations.
|
||||||
* @param host the host.
|
* @param host the host.
|
||||||
|
@ -562,7 +560,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public void setHostOffline(IHost conn, boolean offline);
|
public void setHostOffline(IHost conn, boolean offline);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete an existing connection.
|
* Delete an existing connection.
|
||||||
* <p>
|
* <p>
|
||||||
* Lots to do here:
|
* Lots to do here:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -575,7 +573,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public void deleteHost(IHost conn);
|
public void deleteHost(IHost conn);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renames an existing connection.
|
* Renames an existing connection.
|
||||||
* <p>
|
* <p>
|
||||||
* Lots to do here:
|
* Lots to do here:
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -589,7 +587,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move existing connections a given number of positions in the same profile.
|
* Move existing connections a given number of positions in the same profile.
|
||||||
* If the delta is negative, they are all moved up by the given amount. If
|
* If the delta is negative, they are all moved up by the given amount. If
|
||||||
* positive, they are all moved down by the given amount.<p>
|
* positive, they are all moved down by the given amount.<p>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>After the move, the pool containing the moved connection is saved to disk.
|
* <li>After the move, the pool containing the moved connection is saved to disk.
|
||||||
|
@ -618,7 +616,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* and if successful deleting the original.
|
* and if successful deleting the original.
|
||||||
* @param conn The connection to move
|
* @param conn The connection to move
|
||||||
* @param targetProfile What profile to move into
|
* @param targetProfile What profile to move into
|
||||||
* @param newName Unique name to give copied profile. Typically this is the same as the original name, but
|
* @param newName Unique name to give copied profile. Typically this is the same as the original name, but
|
||||||
* will be different on name collisions
|
* will be different on name collisions
|
||||||
* @param monitor Progress monitor to reflect each step of the operation
|
* @param monitor Progress monitor to reflect each step of the operation
|
||||||
* @return new SystemConnection object
|
* @return new SystemConnection object
|
||||||
|
@ -666,7 +664,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// RESOURCE EVENT METHODS...
|
// RESOURCE EVENT METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register your interest in being told when a system resource such as a connection is changed.
|
* Register your interest in being told when a system resource such as a connection is changed.
|
||||||
|
@ -696,7 +694,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// MODEL RESOURCE EVENT METHODS...
|
// MODEL RESOURCE EVENT METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register your interest in being told when an RSE model resource is changed.
|
* Register your interest in being told when an RSE model resource is changed.
|
||||||
|
@ -728,7 +726,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
// REMOTE RESOURCE EVENT METHODS...
|
// REMOTE RESOURCE EVENT METHODS...
|
||||||
// --------------------------------
|
// --------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register your interest in being told when a remote resource is changed.
|
* Register your interest in being told when a remote resource is changed.
|
||||||
|
@ -752,14 +750,14 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* You would not normally call this as the methods in this class call it when appropriate.
|
* You would not normally call this as the methods in this class call it when appropriate.
|
||||||
*/
|
*/
|
||||||
public void fireEvent(ISystemRemoteChangeEvent event);
|
public void fireEvent(ISystemRemoteChangeEvent event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify all listeners of a change to a remote resource such as a file.
|
* Notify all listeners of a change to a remote resource such as a file.
|
||||||
* This one takes the information needed and creates the event for you.
|
* This one takes the information needed and creates the event for you.
|
||||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||||
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
||||||
*/
|
*/
|
||||||
|
@ -771,10 +769,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||||
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
||||||
* @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
|
* @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
|
||||||
* This saves sending a separate event to reveal and select the new created resource on a create event, for example.
|
* This saves sending a separate event to reveal and select the new created resource on a create event, for example.
|
||||||
*/
|
*/
|
||||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Object originatingViewer);
|
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Object originatingViewer);
|
||||||
|
@ -786,7 +784,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// PREFERENCE EVENT METHODS...
|
// PREFERENCE EVENT METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register your interest in being told when a system preference changes
|
* Register your interest in being told when a system preference changes
|
||||||
|
@ -805,7 +803,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public void fireEvent(ISystemPreferenceChangeEvent event);
|
public void fireEvent(ISystemPreferenceChangeEvent event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify a specific listener of a change to a system preference
|
* Notify a specific listener of a change to a system preference
|
||||||
*/
|
*/
|
||||||
public void fireEvent(ISystemPreferenceChangeListener l, ISystemPreferenceChangeEvent event);
|
public void fireEvent(ISystemPreferenceChangeListener l, ISystemPreferenceChangeEvent event);
|
||||||
|
|
||||||
|
@ -825,14 +823,17 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks all filters for this subsystem as stale to prevent caching
|
* Marks all filters for this subsystem as stale to prevent caching
|
||||||
* @param subsystem
|
*
|
||||||
|
* @param subsystem the subsystem to work on
|
||||||
*/
|
*/
|
||||||
public void invalidateFiltersFor(ISubSystem subsystem);
|
public void invalidateFiltersFor(ISubSystem subsystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks all filters for this subsystem the contain resourceParent as stale to prevent caching
|
* Marks all filters for this subsystem that contain resourceParent as stale
|
||||||
* @param resourceParent
|
* to prevent caching
|
||||||
* @param subsystem
|
*
|
||||||
|
* @param resourceParent a remote resource object
|
||||||
|
* @param subsystem the subsystem to work on
|
||||||
*/
|
*/
|
||||||
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);
|
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);
|
||||||
|
|
||||||
|
@ -844,10 +845,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// SAVE / RESTORE METHODS...
|
// SAVE / RESTORE METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save everything!
|
* Save everything!
|
||||||
*/
|
*/
|
||||||
public boolean save();
|
public boolean save();
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -36,11 +36,10 @@ import org.eclipse.rse.services.IService;
|
||||||
/**
|
/**
|
||||||
* Subsystem Configuration interface.
|
* Subsystem Configuration interface.
|
||||||
*
|
*
|
||||||
* <p>
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* This interface is not intended to be implemented by clients. Subsystem
|
* Subsystem configuration implementations must subclass
|
||||||
* configuration implementations must subclass SubSystemConfiguration
|
* SubSystemConfiguration rather than implementing this interface
|
||||||
* rather than implementing this interface directly.
|
* directly.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer {
|
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer {
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
@ -53,7 +52,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* Reset for a full refresh from disk, such as after a team synch.
|
* Reset for a full refresh from disk, such as after a team synch.
|
||||||
*/
|
*/
|
||||||
public void reset();
|
public void reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves all the filter pool managers for all the profiles, active or not.
|
* Retrieves all the filter pool managers for all the profiles, active or not.
|
||||||
* This allows cross references from
|
* This allows cross references from
|
||||||
|
@ -146,7 +145,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
*/
|
*/
|
||||||
public boolean supportsQuickFilters();
|
public boolean supportsQuickFilters();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if filters of this subsystem factory support dropping into.
|
* Return true if filters of this subsystem factory support dropping into.
|
||||||
*/
|
*/
|
||||||
public boolean supportsDropInFilters();
|
public boolean supportsDropInFilters();
|
||||||
|
@ -155,7 +154,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* Return true if deferred queries are supported.
|
* Return true if deferred queries are supported.
|
||||||
*
|
*
|
||||||
* Deferred queries work such that when a filter or element
|
* Deferred queries work such that when a filter or element
|
||||||
* children query is made, a WorkbenchJob is started to
|
* children query is made, a WorkbenchJob is started to
|
||||||
* perform the query in a background thread. The query can
|
* perform the query in a background thread. The query can
|
||||||
* take time to complete, but a negative side-effect of this
|
* take time to complete, but a negative side-effect of this
|
||||||
* is that it will always take time to complete.
|
* is that it will always take time to complete.
|
||||||
|
@ -168,15 +167,15 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* The default implementation returns <code>true</code>, indicating
|
* The default implementation returns <code>true</code>, indicating
|
||||||
* that deferred queries are supported for filters, and delegates
|
* that deferred queries are supported for filters, and delegates
|
||||||
* the check for model elements to the ISystemViewElementAdapter.
|
* the check for model elements to the ISystemViewElementAdapter.
|
||||||
*
|
*
|
||||||
* @return <code>true</code> if deferred queries are supported.
|
* @return <code>true</code> if deferred queries are supported.
|
||||||
*/
|
*/
|
||||||
public boolean supportsDeferredQueries();
|
public boolean supportsDeferredQueries();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if filters of this subsystem factory provide a custom implementation of drop support.
|
* Return true if filters of this subsystem factory provide a custom implementation of drop support.
|
||||||
* By default, the filter reference adapter treats a drop on a filter as an update to the list of filter
|
* By default, the filter reference adapter treats a drop on a filter as an update to the list of filter
|
||||||
* strings for a filter. For things like files, it is more desirable to treat the drop as a physical
|
* strings for a filter. For things like files, it is more desirable to treat the drop as a physical
|
||||||
* resource copy, so in that case, custom drop makes sense.
|
* resource copy, so in that case, custom drop makes sense.
|
||||||
*
|
*
|
||||||
* By default this returns false.
|
* By default this returns false.
|
||||||
|
@ -190,7 +189,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
public boolean supportsFileTypes();
|
public boolean supportsFileTypes();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell us if this subsystem factory supports targets, which are destinations for
|
* Tell us if this subsystem factory supports targets, which are destinations for
|
||||||
* pushes and builds. Normally only true for file system factories.
|
* pushes and builds. Normally only true for file system factories.
|
||||||
*/
|
*/
|
||||||
public boolean supportsTargets();
|
public boolean supportsTargets();
|
||||||
|
@ -198,8 +197,8 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
/**
|
/**
|
||||||
* Tell us if this subsystem factory supports server launch properties, which allow the user
|
* Tell us if this subsystem factory supports server launch properties, which allow the user
|
||||||
* to configure how the server-side code for these subsystems are started. There is a Server
|
* to configure how the server-side code for these subsystems are started. There is a Server
|
||||||
* Launch Setting property page, with a pluggable composite, where users can configure these
|
* Launch Setting property page, with a pluggable composite, where users can configure these
|
||||||
* properties.
|
* properties.
|
||||||
* <br> By default we return false here. This is overridden in UniversalFileSubSystemConfiguration though.
|
* <br> By default we return false here. This is overridden in UniversalFileSubSystemConfiguration though.
|
||||||
*/
|
*/
|
||||||
public boolean supportsServerLaunchProperties(IHost host);
|
public boolean supportsServerLaunchProperties(IHost host);
|
||||||
|
@ -213,7 +212,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
public boolean supportsServerLaunchType(ServerLaunchType serverLaunchType);
|
public boolean supportsServerLaunchType(ServerLaunchType serverLaunchType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Tell us if filter strings are case sensitive.
|
* Tell us if filter strings are case sensitive.
|
||||||
* <p>Returns false in default implementation.
|
* <p>Returns false in default implementation.
|
||||||
*/
|
*/
|
||||||
public boolean isCaseSensitive();
|
public boolean isCaseSensitive();
|
||||||
|
@ -328,12 +327,12 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* (and their folders).
|
* (and their folders).
|
||||||
* </p><p>
|
* </p><p>
|
||||||
* Must be called AFTER changing the profile's name!!
|
* Must be called AFTER changing the profile's name!!
|
||||||
* </p>
|
* </p>
|
||||||
* @param oldProfileName the old profile name.
|
* @param oldProfileName the old profile name.
|
||||||
* @param newProfileName the new profile name.
|
* @param newProfileName the new profile name.
|
||||||
*/
|
*/
|
||||||
public void renameSubSystemProfile(String oldProfileName, String newProfileName);
|
public void renameSubSystemProfile(String oldProfileName, String newProfileName);
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// SUBSYSTEM METHODS...
|
// SUBSYSTEM METHODS...
|
||||||
|
@ -341,7 +340,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by SystemRegistry's renameSystemProfile method to ensure we update our
|
* Called by SystemRegistry's renameSystemProfile method to ensure we update our
|
||||||
* subsystem names within each subsystem.
|
* subsystem names within each subsystem.
|
||||||
* This should be invoked after changing the profile's name.
|
* This should be invoked after changing the profile's name.
|
||||||
* @param subsystem the subsystem to be updated
|
* @param subsystem the subsystem to be updated
|
||||||
* @param oldProfileName the old profile name
|
* @param oldProfileName the old profile name
|
||||||
|
@ -350,7 +349,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
public void renameSubSystemProfile(ISubSystem subsystem, String oldProfileName, String newProfileName);
|
public void renameSubSystemProfile(ISubSystem subsystem, String oldProfileName, String newProfileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by SystemRegistry's renameSystemProfile method to pre-test if we are going to run into errors on a
|
* Called by SystemRegistry's renameSystemProfile method to pre-test if we are going to run into errors on a
|
||||||
* profile rename, due to file or folder in use.
|
* profile rename, due to file or folder in use.
|
||||||
*/
|
*/
|
||||||
public void preTestRenameSubSystemProfile(String oldProfileName) throws Exception;
|
public void preTestRenameSubSystemProfile(String oldProfileName) throws Exception;
|
||||||
|
@ -392,14 +391,14 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* return the connector service specified in {@link #setConnectorService(IHost, IConnectorService)}.
|
* return the connector service specified in {@link #setConnectorService(IHost, IConnectorService)}.
|
||||||
* @param host the host for which to create or retrieve the connector service
|
* @param host the host for which to create or retrieve the connector service
|
||||||
* @return the connector service associated with this host. This can return null if there
|
* @return the connector service associated with this host. This can return null if there
|
||||||
* is no connector service associated with this configuration. It is recommended that
|
* is no connector service associated with this configuration. It is recommended that
|
||||||
* there be a connector service if {@link #supportsSubSystemConnect()} is true.
|
* there be a connector service if {@link #supportsSubSystemConnect()} is true.
|
||||||
*/
|
*/
|
||||||
public IConnectorService getConnectorService(IHost host);
|
public IConnectorService getConnectorService(IHost host);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the connector service for a particular host.
|
* Sets the connector service for a particular host.
|
||||||
* This is usually mangaged by a connector service manager known
|
* This is usually mangaged by a connector service manager known
|
||||||
* to this configuration.
|
* to this configuration.
|
||||||
* This must be implemented by service subsystem configurations.
|
* This must be implemented by service subsystem configurations.
|
||||||
* Service subsystems allow a connector service to be changed.
|
* Service subsystems allow a connector service to be changed.
|
||||||
|
@ -442,7 +441,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
* When a subsystem is created, and {@link #supportsServerLaunchProperties(IHost)}
|
* When a subsystem is created, and {@link #supportsServerLaunchProperties(IHost)}
|
||||||
* returns true, this method is called to create the server launcher instance
|
* returns true, this method is called to create the server launcher instance
|
||||||
* associated with the subsystem. The default implementation is to create an
|
* associated with the subsystem. The default implementation is to create an
|
||||||
* instance of {@link IRemoteServerLauncher}, but override to create your own
|
* instance of {@link IRemoteServerLauncher}, but override to create your own
|
||||||
* ServerLauncher instance if you have your own class.
|
* ServerLauncher instance if you have your own class.
|
||||||
*/
|
*/
|
||||||
public IServerLauncherProperties createServerLauncher(IConnectorService connectorService);
|
public IServerLauncherProperties createServerLauncher(IConnectorService connectorService);
|
||||||
|
@ -525,19 +524,19 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
/**
|
/**
|
||||||
* A subsystem configuration has a filter pool manager for each profile.
|
* A subsystem configuration has a filter pool manager for each profile.
|
||||||
* Get the filter pool manager for the given profile.
|
* Get the filter pool manager for the given profile.
|
||||||
* @param profile The system profile for which to get the manager.
|
* @param profile The system profile for which to get the manager.
|
||||||
* @param force if true then create the default filters for this subsystem configuration in this profile. This should only be
|
* @param force if true then create the default filters for this subsystem configuration in this profile. This should only be
|
||||||
* done during initial subsystem creation, not during subsystem restore.
|
* done during initial subsystem creation, not during subsystem restore.
|
||||||
* @return a filter pool manager
|
* @return a filter pool manager
|
||||||
*/
|
*/
|
||||||
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force);
|
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A subsystem configuration has a filter pool manager for each profile.
|
* A subsystem configuration has a filter pool manager for each profile.
|
||||||
* Get the filter pool manager for the given profile.
|
* Get the filter pool manager for the given profile.
|
||||||
* Do not force the creation of default filter pools.
|
* Do not force the creation of default filter pools.
|
||||||
* Fully equivalent to getFilterPoolManager(profile, false).
|
* Fully equivalent to getFilterPoolManager(profile, false).
|
||||||
* @param profile The system profile for which to get the manager.
|
* @param profile The system profile for which to get the manager.
|
||||||
* @return a filter pool manager
|
* @return a filter pool manager
|
||||||
*/
|
*/
|
||||||
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile);
|
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile);
|
||||||
|
@ -640,14 +639,14 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <i><b>Private</b>. Do not call or use.</i><br>
|
* <i><b>Private</b>. Do not call or use.</i><br>
|
||||||
* @generated This field/method will be replaced during code generation
|
* @generated This field/method will be replaced during code generation
|
||||||
* @return The list of SubSystemList references
|
* @return The list of SubSystemList references
|
||||||
*/
|
*/
|
||||||
java.util.List getSubSystemList();
|
java.util.List getSubSystemList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <i><b>Private</b>. Do not call or use.</i><br>
|
* <i><b>Private</b>. Do not call or use.</i><br>
|
||||||
* @generated This field/method will be replaced during code generation
|
* @generated This field/method will be replaced during code generation
|
||||||
* @return The list of FilterPoolManagerList references
|
* @return The list of FilterPoolManagerList references
|
||||||
*/
|
*/
|
||||||
java.util.List getFilterPoolManagerList();
|
java.util.List getFilterPoolManagerList();
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -39,8 +39,7 @@ import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
||||||
import org.eclipse.rse.logging.Logger;
|
import org.eclipse.rse.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A filter pool manager manages filter pools.
|
* A filter pool manager manages filter pools. It is used to
|
||||||
* It is used to
|
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Get a list of existing filter pools
|
* <li>Get a list of existing filter pools
|
||||||
* <li>Create filter pools
|
* <li>Create filter pools
|
||||||
|
@ -49,11 +48,11 @@ import org.eclipse.rse.logging.Logger;
|
||||||
* <li>Rename filter pools
|
* <li>Rename filter pools
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* The filter pool manager ensures that
|
* The filter pool manager ensures that changes to filters and pools are
|
||||||
* changes to filters and pools are
|
|
||||||
* committed and events are fired properly.
|
* committed and events are fired properly.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
|
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
|
||||||
private ISystemFilterPoolManagerProvider caller = null;
|
private ISystemFilterPoolManagerProvider caller = null;
|
||||||
|
@ -122,7 +121,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
|
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
|
||||||
|
|
||||||
protected List pools = new ArrayList(3);
|
protected List pools = new ArrayList(3);
|
||||||
// protected List pools = null;
|
// protected List pools = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -149,10 +148,10 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
* per manager, the name of the file is derived from this. For other save policies,
|
* per manager, the name of the file is derived from this. For other save policies,
|
||||||
* the name is not used.
|
* the name is not used.
|
||||||
* @param allowNestedFilters true if filters inside filter pools in this manager are
|
* @param allowNestedFilters true if filters inside filter pools in this manager are
|
||||||
* to allow nested filters. This is the default, but can be overridden at the
|
* to allow nested filters. This is the default, but can be overridden at the
|
||||||
* individual filter pool level.
|
* individual filter pool level.
|
||||||
*/
|
*/
|
||||||
public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger,
|
public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger,
|
||||||
ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters) {
|
ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters) {
|
||||||
SystemFilterPoolManager mgr = new SystemFilterPoolManager(profile);
|
SystemFilterPoolManager mgr = new SystemFilterPoolManager(profile);
|
||||||
mgr.initialize(logger, caller, name, allowNestedFilters);
|
mgr.initialize(logger, caller, name, allowNestedFilters);
|
||||||
|
@ -166,7 +165,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
initialize(logger, caller, name); // core data
|
initialize(logger, caller, name); // core data
|
||||||
}
|
}
|
||||||
setSupportsNestedFilters(allowNestedFilters); // cascade it down
|
setSupportsNestedFilters(allowNestedFilters); // cascade it down
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -214,7 +213,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
return isSupportsNestedFilters();
|
return isSupportsNestedFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return attribute indicating if filters managed by this manager support nested duplicate filter strings.
|
* Return attribute indicating if filters managed by this manager support nested duplicate filter strings.
|
||||||
* Same as isSupportsDuplicateFilterStrings()
|
* Same as isSupportsDuplicateFilterStrings()
|
||||||
*/
|
*/
|
||||||
|
@ -240,11 +239,11 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set attribute indicating if filters managed by this manager support duplicate filter strings, by default.
|
* Set attribute indicating if filters managed by this manager support duplicate filter strings, by default.
|
||||||
* Cascaded down to all pools, and all filters in all pools.
|
* Cascaded down to all pools, and all filters in all pools.
|
||||||
* Alternatively, just call it on the particular pool or filter it applies to.
|
* Alternatively, just call it on the particular pool or filter it applies to.
|
||||||
*/
|
*/
|
||||||
public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) {
|
public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) {
|
||||||
// as generated by emf...
|
// as generated by emf...
|
||||||
setSupportsDuplicateFilterStringsGen(newSupportsDuplicateFilterStrings);
|
setSupportsDuplicateFilterStringsGen(newSupportsDuplicateFilterStrings);
|
||||||
|
|
||||||
// our own stuff..
|
// our own stuff..
|
||||||
|
@ -279,13 +278,13 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set attribute indicating if filters managed by this manager support case-sensitive filter strings, by default.
|
* Set attribute indicating if filters managed by this manager support case-sensitive filter strings, by default.
|
||||||
* Cascaded down to all pools, and all filters in all pools.
|
* Cascaded down to all pools, and all filters in all pools.
|
||||||
* Alternatively, just call it on the particular pool or filter it applies to.
|
* Alternatively, just call it on the particular pool or filter it applies to.
|
||||||
*/
|
*/
|
||||||
public void setStringsCaseSensitive(boolean newStringsCaseSensitive) {
|
public void setStringsCaseSensitive(boolean newStringsCaseSensitive) {
|
||||||
// as generated by emf...
|
// as generated by emf...
|
||||||
setStringsCaseSensitiveGen(newStringsCaseSensitive);
|
setStringsCaseSensitiveGen(newStringsCaseSensitive);
|
||||||
// our special code...
|
// our special code...
|
||||||
ISystemFilterPool[] pools = getSystemFilterPools();
|
ISystemFilterPool[] pools = getSystemFilterPools();
|
||||||
for (int idx = 0; idx < pools.length; idx++) {
|
for (int idx = 0; idx < pools.length; idx++) {
|
||||||
pools[idx].setStringsCaseSensitive(newStringsCaseSensitive);
|
pools[idx].setStringsCaseSensitive(newStringsCaseSensitive);
|
||||||
|
@ -330,17 +329,17 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
|
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
|
||||||
pools.toArray(result);
|
pools.toArray(result);
|
||||||
return result;
|
return result;
|
||||||
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
|
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
|
||||||
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
|
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
|
||||||
// List pools = getPools();
|
// List pools = getPools();
|
||||||
// poolArray = new ISystemFilterPool[pools.size()];
|
// poolArray = new ISystemFilterPool[pools.size()];
|
||||||
// Iterator i = pools.iterator();
|
// Iterator i = pools.iterator();
|
||||||
// int idx = 0;
|
// int idx = 0;
|
||||||
// while (i.hasNext())
|
// while (i.hasNext())
|
||||||
// poolArray[idx++] = (ISystemFilterPool) i.next();
|
// poolArray[idx++] = (ISystemFilterPool) i.next();
|
||||||
// //System.out.println("Pool array created. length = "+poolArray.length);
|
// //System.out.println("Pool array created. length = "+poolArray.length);
|
||||||
// }
|
// }
|
||||||
// return poolArray;
|
// return poolArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -357,12 +356,12 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call this to invalidate array cache after any activity
|
* Call this to invalidate array cache after any activity
|
||||||
*/
|
*/
|
||||||
// private void invalidatePoolCache() {
|
// private void invalidatePoolCache() {
|
||||||
// poolArray = null;
|
// poolArray = null;
|
||||||
// poolNames = null;
|
// poolNames = null;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filter pool.
|
* Create a new filter pool.
|
||||||
|
@ -393,9 +392,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
pool.setSystemFilterPoolManager(this);
|
pool.setSystemFilterPoolManager(this);
|
||||||
pool.setStringsCaseSensitive(areStringsCaseSensitive());
|
pool.setStringsCaseSensitive(areStringsCaseSensitive());
|
||||||
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
|
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
|
||||||
// List pools = getPools();
|
// List pools = getPools();
|
||||||
pools.add(pool);
|
pools.add(pool);
|
||||||
// invalidatePoolCache();
|
// invalidatePoolCache();
|
||||||
commit(pool);
|
commit(pool);
|
||||||
if ((caller != null) && !suspendCallbacks) {
|
if ((caller != null) && !suspendCallbacks) {
|
||||||
caller.filterEventFilterPoolCreated(pool);
|
caller.filterEventFilterPoolCreated(pool);
|
||||||
|
@ -405,7 +404,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a given filter pool. Dependending on the save policy, the
|
* Delete a given filter pool. Dependending on the save policy, the
|
||||||
* appropriate file or folder on disk will also be deleted.
|
* appropriate file or folder on disk will also be deleted.
|
||||||
* <p>
|
* <p>
|
||||||
* Does the following:
|
* Does the following:
|
||||||
|
@ -460,8 +459,8 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
*/
|
*/
|
||||||
public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception {
|
public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception {
|
||||||
/*
|
/*
|
||||||
* The default implementation returns true. Persistence providers should be able to handle this
|
* The default implementation returns true. Persistence providers should be able to handle this
|
||||||
* circumstance regardless. If a pool can be renamed internally, it should be able to be
|
* circumstance regardless. If a pool can be renamed internally, it should be able to be
|
||||||
* renamed in its persistent form.
|
* renamed in its persistent form.
|
||||||
*/
|
*/
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
|
@ -522,7 +521,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Performs a {@link #copySystemFilterPool(ISystemFilterPoolManager, ISystemFilterPool, String) copySystemFilterPool} operation.
|
* <li>Performs a {@link #copySystemFilterPool(ISystemFilterPoolManager, ISystemFilterPool, String) copySystemFilterPool} operation.
|
||||||
* <li>If copy is successful, updates all references to reference the new copy.
|
* <li>If copy is successful, updates all references to reference the new copy.
|
||||||
* <li>If copy is successful, deletes original filter pool in this manager
|
* <li>If copy is successful, deletes original filter pool in this manager
|
||||||
* <li>If this final delete fails, deletes the copied version and restore original references
|
* <li>If this final delete fails, deletes the copied version and restore original references
|
||||||
* <li>Asks target manager to save to disk
|
* <li>Asks target manager to save to disk
|
||||||
* <li>Saves this manager to disk
|
* <li>Saves this manager to disk
|
||||||
|
@ -543,7 +542,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
|
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
|
||||||
//SystemFilterPool fp = fpRef.getReferencedFilterPool();
|
//SystemFilterPool fp = fpRef.getReferencedFilterPool();
|
||||||
ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager();
|
ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager();
|
||||||
fprMgr.resetSystemFilterPoolReference(fpRef, newPool); // reset the referenced pool
|
fprMgr.resetSystemFilterPoolReference(fpRef, newPool); // reset the referenced pool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -555,7 +554,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
if (refs[idx] instanceof ISystemFilterPoolReference) {
|
if (refs[idx] instanceof ISystemFilterPoolReference) {
|
||||||
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
|
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
|
||||||
ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager();
|
ISystemFilterPoolReferenceManager fprMgr = fpRef.getFilterPoolReferenceManager();
|
||||||
fprMgr.resetSystemFilterPoolReference(fpRef, oldPool); // reset the referenced pool
|
fprMgr.resetSystemFilterPoolReference(fpRef, oldPool); // reset the referenced pool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -623,7 +622,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
// FILTER METHODS
|
// FILTER METHODS
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String, boolean)
|
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String, boolean)
|
||||||
*/
|
*/
|
||||||
|
@ -633,7 +632,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, type, promptable);
|
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, type, promptable);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String)
|
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List, java.lang.String)
|
||||||
*/
|
*/
|
||||||
|
@ -641,7 +640,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilter result = createSystemFilter(parent, aliasName, filterStrings, type, false);
|
ISystemFilter result = createSystemFilter(parent, aliasName, filterStrings, type, false);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List)
|
* @see org.eclipse.rse.core.filters.ISystemFilterPoolManager#createSystemFilter(org.eclipse.rse.core.filters.ISystemFilterContainer, java.lang.String, java.util.List)
|
||||||
*/
|
*/
|
||||||
|
@ -652,7 +651,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new system filter within the given filter container (either a filter pool, or
|
* Creates a new system filter within the given filter container (either a filter pool, or
|
||||||
* a filter). This creates the filter, and then saves the filter pool.
|
* a filter). This creates the filter, and then saves the filter pool.
|
||||||
* <p>Calls back to inform provider of this event (filterEventFilterCreated)
|
* <p>Calls back to inform provider of this event (filterEventFilterCreated)
|
||||||
* @param parent The parent which is either a SystemFilterPool or a SystemFilter
|
* @param parent The parent which is either a SystemFilterPool or a SystemFilter
|
||||||
* @param aliasName The name to give the new filter. Must be unique for this pool.
|
* @param aliasName The name to give the new filter. Must be unique for this pool.
|
||||||
|
@ -665,7 +664,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new system filter that is typed.
|
* Creates a new system filter that is typed.
|
||||||
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but
|
* Same as {@link #createSystemFilter(ISystemFilterContainer, String, String[])} but
|
||||||
* takes a filter type as an additional parameter.
|
* takes a filter type as an additional parameter.
|
||||||
* <p>
|
* <p>
|
||||||
* A filter's type is an arbitrary string that is not interpreted or used by the base framework. This
|
* A filter's type is an arbitrary string that is not interpreted or used by the base framework. This
|
||||||
|
@ -684,7 +683,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new system filter that is typed and promptable
|
* Creates a new system filter that is typed and promptable
|
||||||
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but
|
* Same as {@link #createSystemFilter(ISystemFilterContainer, String ,String[], String)} but
|
||||||
* takes a boolean indicating if it is promptable.
|
* takes a boolean indicating if it is promptable.
|
||||||
* <p>
|
* <p>
|
||||||
* A promptable filter is one in which the user is prompted for information at expand time.
|
* A promptable filter is one in which the user is prompted for information at expand time.
|
||||||
|
@ -701,7 +700,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, type, promptable);
|
ISystemFilter newFilter = doCreateSystemFilter(parent, aliasName, filterStrings, type, promptable);
|
||||||
return newFilter;
|
return newFilter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a system filter.
|
* Creates a system filter.
|
||||||
* @param parent the owning parent of this filter, must be a filter pool or a filter capable of nesting
|
* @param parent the owning parent of this filter, must be a filter pool or a filter capable of nesting
|
||||||
|
@ -754,7 +753,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renames a filter. This is better than filter.setName(String newName) as it
|
* Renames a filter. This is better than filter.setName(String newName) as it
|
||||||
* saves the parent pool to disk.
|
* saves the parent pool to disk.
|
||||||
* <p>
|
* <p>
|
||||||
* Does the following:
|
* Does the following:
|
||||||
|
@ -873,7 +872,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move existing filters a given number of positions in the same container.
|
* Move existing filters a given number of positions in the same container.
|
||||||
* If the delta is negative, they are all moved up by the given amount. If
|
* If the delta is negative, they are all moved up by the given amount. If
|
||||||
* positive, they are all moved down by the given amount.<p>
|
* positive, they are all moved down by the given amount.<p>
|
||||||
* <p>
|
* <p>
|
||||||
* Does the following:
|
* Does the following:
|
||||||
|
@ -1092,7 +1091,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Move existing filter strings a given number of positions in the same filter
|
* Move existing filter strings a given number of positions in the same filter
|
||||||
* If the delta is negative, they are all moved up by the given amount. If
|
* If the delta is negative, they are all moved up by the given amount. If
|
||||||
* positive, they are all moved down by the given amount.<p>
|
* positive, they are all moved down by the given amount.<p>
|
||||||
* <p>
|
* <p>
|
||||||
* Does the following:
|
* Does the following:
|
||||||
|
@ -1159,7 +1158,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
// ONE FILE PER FILTER
|
// ONE FILE PER FILTER
|
||||||
case SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER:
|
case SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER:
|
||||||
return ((SystemFilterPoolImpl)pool).getSaveFile();
|
return ((SystemFilterPoolImpl)pool).getSaveFile();
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -1208,7 +1207,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
*
|
*
|
||||||
* @param message Message to be written to the log file
|
* @param message Message to be written to the log file
|
||||||
*
|
*
|
||||||
* @param exception Any exception that generated the error condition,
|
* @param exception Any exception that generated the error condition,
|
||||||
* this will be used to print a stack trace in the log file.
|
* this will be used to print a stack trace in the log file.
|
||||||
*/
|
*/
|
||||||
public void logError(String message, Throwable exception) {
|
public void logError(String message, Throwable exception) {
|
||||||
|
@ -1225,7 +1224,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
/**
|
/**
|
||||||
* Helper method for logging debug messages
|
* Helper method for logging debug messages
|
||||||
*
|
*
|
||||||
* @param prefix typically the name of the class issuing the debug message. Pass in either
|
* @param prefix typically the name of the class issuing the debug message. Pass in either
|
||||||
* retrieved using this.getClass() (for non-static methods)
|
* retrieved using this.getClass() (for non-static methods)
|
||||||
* or using MyClass.class (for static methods)
|
* or using MyClass.class (for static methods)
|
||||||
*
|
*
|
||||||
|
@ -1258,14 +1257,14 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated This field/method will be replaced during code generation
|
* @generated This field/method will be replaced during code generation
|
||||||
*/
|
*/
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated This field/method will be replaced during code generation
|
* @generated This field/method will be replaced during code generation
|
||||||
*/
|
*/
|
||||||
public boolean isSupportsNestedFilters() {
|
public boolean isSupportsNestedFilters() {
|
||||||
return supportsNestedFilters;
|
return supportsNestedFilters;
|
||||||
|
@ -1279,7 +1278,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @generated This field/method will be replaced during code generation
|
* @generated This field/method will be replaced during code generation
|
||||||
*/
|
*/
|
||||||
public boolean isSupportsDuplicateFilterStrings() {
|
public boolean isSupportsDuplicateFilterStrings() {
|
||||||
return supportsDuplicateFilterStrings;
|
return supportsDuplicateFilterStrings;
|
||||||
|
@ -1319,7 +1318,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save all the filter pools to disk.
|
* Save all the filter pools to disk.
|
||||||
* Uses the save policy specified in this manager's factory method.
|
* Uses the save policy specified in this manager's factory method.
|
||||||
*/
|
*/
|
||||||
public boolean commit() {
|
public boolean commit() {
|
||||||
|
@ -1340,7 +1339,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
public IRSEPersistableContainer getPersistableParent() {
|
public IRSEPersistableContainer getPersistableParent() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IRSEPersistableContainer[] getPersistableChildren() {
|
public IRSEPersistableContainer[] getPersistableChildren() {
|
||||||
return IRSEPersistableContainer.NO_CHILDREN;
|
return IRSEPersistableContainer.NO_CHILDREN;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -17,40 +17,39 @@
|
||||||
package org.eclipse.rse.files.ui.resources;
|
package org.eclipse.rse.files.ui.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface defines a remote path. It is not intended to be implemented by
|
* This interface defines a remote path.
|
||||||
* clients.
|
*
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemRemotePath {
|
public interface ISystemRemotePath {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the profile name.
|
* Get the profile name.
|
||||||
* @return the profile name
|
* @return the profile name
|
||||||
*/
|
*/
|
||||||
public String getProfileName();
|
public String getProfileName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the connection name.
|
* Get the connection name.
|
||||||
* @return the connection name
|
* @return the connection name
|
||||||
*/
|
*/
|
||||||
public String getConnectionName();
|
public String getConnectionName();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the path of the resource on the server.
|
* Get the path of the resource on the server.
|
||||||
* @return the path of the resource on the server
|
* @return the path of the resource on the server
|
||||||
*/
|
*/
|
||||||
public String getPath();
|
public String getPath();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the complete string representation of the remote path.
|
* Returns the complete string representation of the remote path.
|
||||||
* @return complete string representation of the remote path
|
* @return complete string representation of the remote path
|
||||||
*/
|
*/
|
||||||
public String toString();
|
public String toString();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether this path equals the given object.
|
* Returns whether this path equals the given object.
|
||||||
* This is system dependent.
|
* This is system dependent.
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object obj);
|
public boolean equals(Object obj);
|
||||||
}
|
}
|
File diff suppressed because it is too large
Load diff
|
@ -7,8 +7,8 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -23,18 +23,18 @@ import org.eclipse.rse.files.ui.resources.ISystemRemoteMarker;
|
||||||
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
|
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an internal implementation of the ISystemRemoteMarker interface.
|
* This class is an internal implementation of the ISystemRemoteMarker
|
||||||
* It is not intended to be implemented by clients.
|
* interface.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemRemoteMarker implements ISystemRemoteMarker {
|
public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource with which this marker is associated.
|
* Resource with which this marker is associated.
|
||||||
*/
|
*/
|
||||||
protected ISystemRemoteResource resource;
|
protected ISystemRemoteResource resource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The marker id.
|
* The marker id.
|
||||||
*/
|
*/
|
||||||
|
@ -45,7 +45,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public SystemRemoteMarker(ISystemRemoteResource resource, long id) {
|
public SystemRemoteMarker(ISystemRemoteResource resource, long id) {
|
||||||
this.resource = resource;
|
this.resource = resource;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,12 +54,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
public void delete() {
|
public void delete() {
|
||||||
SystemRemoteMarkerManager.getInstance().removeMarker(getResource(), getId());
|
SystemRemoteMarkerManager.getInstance().removeMarker(getResource(), getId());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#equals(Object)
|
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#equals(Object)
|
||||||
*/
|
*/
|
||||||
public boolean equals(Object object) {
|
public boolean equals(Object object) {
|
||||||
|
|
||||||
if (!(object instanceof ISystemRemoteMarker)) {
|
if (!(object instanceof ISystemRemoteMarker)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
public boolean exists() {
|
public boolean exists() {
|
||||||
return getInfo() != null;
|
return getInfo() != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the marker info.
|
* Get the marker info.
|
||||||
* @return the marker info.
|
* @return the marker info.
|
||||||
|
@ -89,12 +89,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public Object getAttribute(String attributeName) {
|
public Object getAttribute(String attributeName) {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info.getAttribute(attributeName);
|
return info.getAttribute(attributeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -102,17 +102,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public int getAttribute(String attributeName, int defaultValue) {
|
public int getAttribute(String attributeName, int defaultValue) {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object value = info.getAttribute(attributeName);
|
Object value = info.getAttribute(attributeName);
|
||||||
|
|
||||||
if ((value != null) && (value instanceof Integer)) {
|
if ((value != null) && (value instanceof Integer)) {
|
||||||
return ((Integer)value).intValue();
|
return ((Integer)value).intValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,17 +121,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public String getAttribute(String attributeName, String defaultValue) {
|
public String getAttribute(String attributeName, String defaultValue) {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object value = info.getAttribute(attributeName);
|
Object value = info.getAttribute(attributeName);
|
||||||
|
|
||||||
if ((value != null) && (value instanceof String)) {
|
if ((value != null) && (value instanceof String)) {
|
||||||
return (String)value;
|
return (String)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,17 +140,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public boolean getAttribute(String attributeName, boolean defaultValue) {
|
public boolean getAttribute(String attributeName, boolean defaultValue) {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object value = info.getAttribute(attributeName);
|
Object value = info.getAttribute(attributeName);
|
||||||
|
|
||||||
if ((value != null) && (value instanceof Integer)) {
|
if ((value != null) && (value instanceof Integer)) {
|
||||||
return ((Boolean)value).booleanValue();
|
return ((Boolean)value).booleanValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
return defaultValue;
|
return defaultValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,11 +159,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public Map getAttributes() {
|
public Map getAttributes() {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info.getAttributes();
|
return info.getAttributes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -172,11 +172,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public Object[] getAttributes(String[] attributeNames) {
|
public Object[] getAttributes(String[] attributeNames) {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return new Object[0];
|
return new Object[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
return info.getAttributes(attributeNames);
|
return info.getAttributes(attributeNames);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -185,11 +185,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public long getCreationTime() {
|
public long getCreationTime() {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info.getCreationTime();
|
return info.getCreationTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
public long getId() {
|
public long getId() {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#getResource()
|
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#getResource()
|
||||||
*/
|
*/
|
||||||
|
@ -212,11 +212,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public String getType() {
|
public String getType() {
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
|
|
||||||
if (info == null) {
|
if (info == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info.getType();
|
return info.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -225,11 +225,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
*/
|
*/
|
||||||
public boolean isSubtypeOf(String superType) {
|
public boolean isSubtypeOf(String superType) {
|
||||||
String type = getType();
|
String type = getType();
|
||||||
|
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return SystemRemoteMarkerManager.getInstance().getCache().isSubtype(type, superType);
|
return SystemRemoteMarkerManager.getInstance().getCache().isSubtype(type, superType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
info.setAttribute(attributeName, value);
|
info.setAttribute(attributeName, value);
|
||||||
|
|
||||||
if (manager.isPersistent(info)) {
|
if (manager.isPersistent(info)) {
|
||||||
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
info.setAttributes(attributeNames, values);
|
info.setAttributes(attributeNames, values);
|
||||||
|
|
||||||
if (manager.isPersistent(info)) {
|
if (manager.isPersistent(info)) {
|
||||||
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
||||||
}
|
}
|
||||||
|
@ -280,7 +280,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
|
||||||
SystemRemoteMarkerInfo info = getInfo();
|
SystemRemoteMarkerInfo info = getInfo();
|
||||||
info.setAttributes(attributes);
|
info.setAttributes(attributes);
|
||||||
|
|
||||||
if (manager.isPersistent(info)) {
|
if (manager.isPersistent(info)) {
|
||||||
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,25 +25,28 @@ import org.eclipse.ui.IWorkbench;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard workbench wizard for exporting resources from the workspace
|
* Standard workbench wizard for exporting resources from the workspace to the
|
||||||
* to the local file system.
|
* local file system.
|
||||||
* <p>
|
* <p>
|
||||||
* This class may be instantiated and used without further configuration;
|
* This class may be instantiated and used without further configuration.
|
||||||
* this class is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Example:
|
* Example:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* IWizard wizard = new RemoteExportWizard();
|
* IWizard wizard = new RemoteExportWizard();
|
||||||
* wizard.init(workbench, selection);
|
* wizard.init(workbench, selection);
|
||||||
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
||||||
* dialog.open();
|
* dialog.open();
|
||||||
* </pre>
|
* </pre>
|
||||||
* During the call to <code>open</code>, the wizard dialog is presented to the
|
*
|
||||||
* user. When the user hits Finish, the user-selected workspace resources
|
* During the call to <code>open</code>, the wizard dialog is presented to
|
||||||
* are exported to the user-specified location in the local file system,
|
* the user. When the user hits Finish, the user-selected workspace resources
|
||||||
* the dialog closes, and the call to <code>open</code> returns.
|
* are exported to the user-specified location in the local file system, the
|
||||||
|
* dialog closes, and the call to <code>open</code> returns.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
|
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
|
||||||
private IStructuredSelection selection;
|
private IStructuredSelection selection;
|
||||||
|
|
|
@ -52,11 +52,10 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
|
||||||
|
|
||||||
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
|
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
|
||||||
/**
|
/**
|
||||||
* An operation which does the actual work of copying objects from the local file
|
* An operation which does the actual work of copying objects from the local
|
||||||
* system into the workspace.
|
* file system into the workspace.
|
||||||
* <p>
|
*
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
private static final int POLICY_DEFAULT = 0;
|
private static final int POLICY_DEFAULT = 0;
|
||||||
|
@ -84,7 +83,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* Creates a new operation that recursively imports the entire contents of the
|
* Creates a new operation that recursively imports the entire contents of the
|
||||||
* specified root file system object.
|
* specified root file system object.
|
||||||
* <p>
|
* <p>
|
||||||
* The <code>source</code> parameter represents the root file system object to
|
* The <code>source</code> parameter represents the root file system object to
|
||||||
* import. All contents of this object are imported. Valid types for this parameter
|
* import. All contents of this object are imported. Valid types for this parameter
|
||||||
* are determined by the supplied <code>IImportStructureProvider</code>.
|
* are determined by the supplied <code>IImportStructureProvider</code>.
|
||||||
* </p>
|
* </p>
|
||||||
|
@ -95,8 +94,8 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* The default import behavior is to recreate the complete container structure
|
* The default import behavior is to recreate the complete container structure
|
||||||
* for the contents of the root file system object in their destination.
|
* for the contents of the root file system object in their destination.
|
||||||
* If <code>setCreateContainerStructure</code> is set to false then the container
|
* If <code>setCreateContainerStructure</code> is set to false then the container
|
||||||
* structure created is relative to the root file system object.
|
* structure created is relative to the root file system object.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -120,8 +119,8 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* operation solely to determine the destination container structure of the file system
|
* operation solely to determine the destination container structure of the file system
|
||||||
* objects being imported.
|
* objects being imported.
|
||||||
* <p>
|
* <p>
|
||||||
* The <code>source</code> parameter represents the root file system object to
|
* The <code>source</code> parameter represents the root file system object to
|
||||||
* import. Valid types for this parameter are determined by the supplied
|
* import. Valid types for this parameter are determined by the supplied
|
||||||
* <code>IImportStructureProvider</code>. The contents of the source which
|
* <code>IImportStructureProvider</code>. The contents of the source which
|
||||||
* are to be imported are specified in the <code>filesToImport</code>
|
* are to be imported are specified in the <code>filesToImport</code>
|
||||||
* parameter.
|
* parameter.
|
||||||
|
@ -138,7 +137,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* <p>
|
* <p>
|
||||||
* The default import behavior is to recreate the complete container structure
|
* The default import behavior is to recreate the complete container structure
|
||||||
* for the file system objects in their destination. If <code>setCreateContainerStructure</code>
|
* for the file system objects in their destination. If <code>setCreateContainerStructure</code>
|
||||||
* is set to <code>false</code>, then the container structure created for each of
|
* is set to <code>false</code>, then the container structure created for each of
|
||||||
* the file system objects is relative to the supplied root file system object.
|
* the file system objects is relative to the supplied root file system object.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -173,13 +172,13 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* and the provider in turn calls specific methods on the source object.
|
* and the provider in turn calls specific methods on the source object.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* The <code>filesToImport</code> parameter specifies what file system objects
|
* The <code>filesToImport</code> parameter specifies what file system objects
|
||||||
* are to be imported.
|
* are to be imported.
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* The default import behavior is to recreate the complete container structure
|
* The default import behavior is to recreate the complete container structure
|
||||||
* for the file system objects in their destination. If <code>setCreateContainerStructure</code>
|
* for the file system objects in their destination. If <code>setCreateContainerStructure</code>
|
||||||
* is set to <code>false</code>, then no container structure is created for each of
|
* is set to <code>false</code>, then no container structure is created for each of
|
||||||
* the file system objects.
|
* the file system objects.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
|
@ -227,7 +226,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
*/
|
*/
|
||||||
private IContainer createFromRoot(IPath path) throws CoreException {
|
private IContainer createFromRoot(IPath path) throws CoreException {
|
||||||
int segmentCount = path.segmentCount();
|
int segmentCount = path.segmentCount();
|
||||||
//Assume the project exists
|
//Assume the project exists
|
||||||
IContainer currentFolder = ((IWorkspaceRoot) destinationContainer).getProject(path.segment(0));
|
IContainer currentFolder = ((IWorkspaceRoot) destinationContainer).getProject(path.segment(0));
|
||||||
for (int i = 1; i < segmentCount; i++) {
|
for (int i = 1; i < segmentCount; i++) {
|
||||||
currentFolder = currentFolder.getFolder(new Path(path.segment(i)));
|
currentFolder = currentFolder.getFolder(new Path(path.segment(i)));
|
||||||
|
@ -257,7 +256,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
*
|
*
|
||||||
* @param targetResource the resource that should not exist
|
* @param targetResource the resource that should not exist
|
||||||
* @param policy determines how the resource is imported
|
* @param policy determines how the resource is imported
|
||||||
* @return <code>true</code> if the resource does not exist, and
|
* @return <code>true</code> if the resource does not exist, and
|
||||||
* <code>false</code> if it does exist
|
* <code>false</code> if it does exist
|
||||||
*/
|
*/
|
||||||
boolean ensureTargetDoesNotExist(IResource targetResource, int policy) {
|
boolean ensureTargetDoesNotExist(IResource targetResource, int policy) {
|
||||||
|
@ -596,7 +595,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
*/
|
*/
|
||||||
boolean queryOverwrite(IPath resourcePath) throws OperationCanceledException {
|
boolean queryOverwrite(IPath resourcePath) throws OperationCanceledException {
|
||||||
String overwriteAnswer = overwriteCallback.queryOverwrite(resourcePath.makeRelative().toString());
|
String overwriteAnswer = overwriteCallback.queryOverwrite(resourcePath.makeRelative().toString());
|
||||||
if (overwriteAnswer.equals(IOverwriteQuery.CANCEL)) //throw new OperationCanceledException(UniversalSystemPlugin.getString("customs.emptyString"));
|
if (overwriteAnswer.equals(IOverwriteQuery.CANCEL)) //throw new OperationCanceledException(UniversalSystemPlugin.getString("customs.emptyString"));
|
||||||
throw new OperationCanceledException(""); //$NON-NLS-1$
|
throw new OperationCanceledException(""); //$NON-NLS-1$
|
||||||
if (overwriteAnswer.equals(IOverwriteQuery.NO)) {
|
if (overwriteAnswer.equals(IOverwriteQuery.NO)) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -634,7 +633,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
* Sets whether imported file system objects should automatically overwrite
|
* Sets whether imported file system objects should automatically overwrite
|
||||||
* existing workbench resources when a conflict occurs.
|
* existing workbench resources when a conflict occurs.
|
||||||
*
|
*
|
||||||
* @param value <code>true</code> to automatically overwrite, and
|
* @param value <code>true</code> to automatically overwrite, and
|
||||||
* <code>false</code> otherwise
|
* <code>false</code> otherwise
|
||||||
*/
|
*/
|
||||||
public void setOverwriteResources(boolean value) {
|
public void setOverwriteResources(boolean value) {
|
||||||
|
|
|
@ -28,22 +28,25 @@ import org.eclipse.ui.IWorkbench;
|
||||||
* Standard workbench wizard for importing resources from the local file system
|
* Standard workbench wizard for importing resources from the local file system
|
||||||
* into the workspace.
|
* into the workspace.
|
||||||
* <p>
|
* <p>
|
||||||
* This class may be instantiated and used without further configuration;
|
* This class may be instantiated and used without further configuration.
|
||||||
* this class is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Example:
|
* Example:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* IWizard wizard = new RemoteImportWizard();
|
* IWizard wizard = new RemoteImportWizard();
|
||||||
* wizard.init(workbench, selection);
|
* wizard.init(workbench, selection);
|
||||||
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
||||||
* dialog.open();
|
* dialog.open();
|
||||||
* </pre>
|
* </pre>
|
||||||
* During the call to <code>open</code>, the wizard dialog is presented to the
|
*
|
||||||
* user. When the user hits Finish, the user-selected files are imported
|
* During the call to <code>open</code>, the wizard dialog is presented to
|
||||||
|
* the user. When the user hits Finish, the user-selected files are imported
|
||||||
* into the workspace, the dialog closes, and the call to <code>open</code>
|
* into the workspace, the dialog closes, and the call to <code>open</code>
|
||||||
* returns.
|
* returns.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
|
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
|
||||||
private IWorkbench workbench;
|
private IWorkbench workbench;
|
||||||
|
@ -117,9 +120,9 @@ public class RemoteImportWizard extends AbstractSystemWizard implements IImportW
|
||||||
public boolean performFinish() {
|
public boolean performFinish() {
|
||||||
return mainPage.finish();
|
return mainPage.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean performCancel() {
|
public boolean performCancel() {
|
||||||
mainPage.cancel();
|
mainPage.cancel();
|
||||||
return super.performCancel();
|
return super.performCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2004, 2007 IBM Corporation. All rights reserved.
|
* Copyright (c) 2004, 2007 IBM Corporation. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -41,12 +41,13 @@ import org.eclipse.rse.internal.services.clientserver.java.StringInfo;
|
||||||
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
|
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a basic class file parser that returns a package name from a class file.
|
* This is a basic class file parser that returns a package name from a class
|
||||||
|
* file.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class BasicClassFileParser {
|
public class BasicClassFileParser {
|
||||||
|
|
||||||
//private long magic;
|
//private long magic;
|
||||||
//private int minor_version;
|
//private int minor_version;
|
||||||
//private int major_version;
|
//private int major_version;
|
||||||
|
@ -62,7 +63,7 @@ public class BasicClassFileParser {
|
||||||
private MethodInfo[] methods;
|
private MethodInfo[] methods;
|
||||||
private int attributes_count;
|
private int attributes_count;
|
||||||
private InputStream stream;
|
private InputStream stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constuctor.
|
* Constuctor.
|
||||||
* @param stream the input stream to parse.
|
* @param stream the input stream to parse.
|
||||||
|
@ -70,104 +71,104 @@ public class BasicClassFileParser {
|
||||||
public BasicClassFileParser(InputStream stream) {
|
public BasicClassFileParser(InputStream stream) {
|
||||||
this.stream = stream;
|
this.stream = stream;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the package.
|
* Returns the package.
|
||||||
* @return the package.
|
* @return the package.
|
||||||
*/
|
*/
|
||||||
public String getQualifiedClassName() {
|
public String getQualifiedClassName() {
|
||||||
|
|
||||||
ClassInfo info = (ClassInfo)(getCPInfo(this_class));
|
ClassInfo info = (ClassInfo)(getCPInfo(this_class));
|
||||||
|
|
||||||
int nameIndex = info.getNameIndex();
|
int nameIndex = info.getNameIndex();
|
||||||
String name = getString(nameIndex);
|
String name = getString(nameIndex);
|
||||||
|
|
||||||
return name.replace('/', '.');
|
return name.replace('/', '.');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether there is a <code>public static void main(String[])</code> method.
|
* Returns whether there is a <code>public static void main(String[])</code> method.
|
||||||
* @return <code>true</code> if there is, otherwise <code>false</code>.
|
* @return <code>true</code> if there is, otherwise <code>false</code>.
|
||||||
*/
|
*/
|
||||||
public boolean isExecutable() {
|
public boolean isExecutable() {
|
||||||
|
|
||||||
for (int i = 0; i < methods_count; i++) {
|
for (int i = 0; i < methods_count; i++) {
|
||||||
MethodInfo info = methods[i];
|
MethodInfo info = methods[i];
|
||||||
|
|
||||||
// first ensure method name is "main"
|
// first ensure method name is "main"
|
||||||
int nameIndex = info.getNameIndex();
|
int nameIndex = info.getNameIndex();
|
||||||
String name = getString(nameIndex);
|
String name = getString(nameIndex);
|
||||||
|
|
||||||
if (name.equals("main")) { //$NON-NLS-1$
|
if (name.equals("main")) { //$NON-NLS-1$
|
||||||
|
|
||||||
// check access flags for public and static
|
// check access flags for public and static
|
||||||
int accessFlags = info.getAccessFlags();
|
int accessFlags = info.getAccessFlags();
|
||||||
|
|
||||||
if ((accessFlags & 0x000F) == 0x0009) {
|
if ((accessFlags & 0x000F) == 0x0009) {
|
||||||
|
|
||||||
// now check descriptor for parameter and return value
|
// now check descriptor for parameter and return value
|
||||||
int descriptorIndex = info.getDescriptorIndex();
|
int descriptorIndex = info.getDescriptorIndex();
|
||||||
String descriptor = getString(descriptorIndex);
|
String descriptor = getString(descriptorIndex);
|
||||||
|
|
||||||
if (descriptor.equals("([Ljava/lang/String;)V")) { //$NON-NLS-1$
|
if (descriptor.equals("([Ljava/lang/String;)V")) { //$NON-NLS-1$
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses a class file.
|
* Parses a class file.
|
||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
public void parse() throws IOException {
|
public void parse() throws IOException {
|
||||||
|
|
||||||
EnhancedDataInputStream dataStream = new EnhancedDataInputStream(stream);
|
EnhancedDataInputStream dataStream = new EnhancedDataInputStream(stream);
|
||||||
|
|
||||||
/*magic = */ dataStream.readUnsignedInt();
|
/*magic = */ dataStream.readUnsignedInt();
|
||||||
/*minor_version =*/ dataStream.readUnsignedShort();
|
/*minor_version =*/ dataStream.readUnsignedShort();
|
||||||
/*major_version =*/ dataStream.readUnsignedShort();
|
/*major_version =*/ dataStream.readUnsignedShort();
|
||||||
constant_pool_count = dataStream.readUnsignedShort();
|
constant_pool_count = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
readConstantPool(dataStream);
|
readConstantPool(dataStream);
|
||||||
|
|
||||||
/*access_flags =*/ dataStream.readUnsignedShort();
|
/*access_flags =*/ dataStream.readUnsignedShort();
|
||||||
|
|
||||||
this_class = dataStream.readUnsignedShort();
|
this_class = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
/*super_class =*/ dataStream.readUnsignedShort();
|
/*super_class =*/ dataStream.readUnsignedShort();
|
||||||
|
|
||||||
interfaces_count = dataStream.readUnsignedShort();
|
interfaces_count = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
readInterfaces(dataStream);
|
readInterfaces(dataStream);
|
||||||
|
|
||||||
fields_count = dataStream.readUnsignedShort();
|
fields_count = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
readFields(dataStream);
|
readFields(dataStream);
|
||||||
|
|
||||||
methods_count = dataStream.readUnsignedShort();
|
methods_count = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
readMethods(dataStream);
|
readMethods(dataStream);
|
||||||
|
|
||||||
dataStream.close();
|
dataStream.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the constant pool.
|
* Reads the constant pool.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
protected void readConstantPool(EnhancedDataInputStream dataStream) throws IOException {
|
protected void readConstantPool(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
|
|
||||||
constant_pool = new ArrayList();
|
constant_pool = new ArrayList();
|
||||||
|
|
||||||
for (int i = 0; i < constant_pool_count-1; i++) {
|
for (int i = 0; i < constant_pool_count-1; i++) {
|
||||||
AbstractCPInfo info = readConstantInfo(dataStream);
|
AbstractCPInfo info = readConstantInfo(dataStream);
|
||||||
constant_pool.add(i, info);
|
constant_pool.add(i, info);
|
||||||
|
|
||||||
// each long or double info takes two spaces, so fill in the next entry with an empty object
|
// each long or double info takes two spaces, so fill in the next entry with an empty object
|
||||||
// this entry is not usable according to the VM Specification
|
// this entry is not usable according to the VM Specification
|
||||||
if (info instanceof LongInfo || info instanceof DoubleInfo) {
|
if (info instanceof LongInfo || info instanceof DoubleInfo) {
|
||||||
|
@ -176,7 +177,7 @@ public class BasicClassFileParser {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the constant info.
|
* Gets the constant info.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
|
@ -185,68 +186,68 @@ public class BasicClassFileParser {
|
||||||
*/
|
*/
|
||||||
protected AbstractCPInfo readConstantInfo(EnhancedDataInputStream dataStream) throws IOException {
|
protected AbstractCPInfo readConstantInfo(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
short tag = (short)(dataStream.readUnsignedByte());
|
short tag = (short)(dataStream.readUnsignedByte());
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
||||||
case IClassFileConstants.CONSTANT_CLASS: {
|
case IClassFileConstants.CONSTANT_CLASS: {
|
||||||
int nameIndex = dataStream.readUnsignedShort();
|
int nameIndex = dataStream.readUnsignedShort();
|
||||||
return new ClassInfo(tag, nameIndex);
|
return new ClassInfo(tag, nameIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_FIELD_REF: {
|
case IClassFileConstants.CONSTANT_FIELD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_METHOD_REF: {
|
case IClassFileConstants.CONSTANT_METHOD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
|
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_STRING: {
|
case IClassFileConstants.CONSTANT_STRING: {
|
||||||
int stringIndex = dataStream.readUnsignedShort();
|
int stringIndex = dataStream.readUnsignedShort();
|
||||||
return new StringInfo(tag, stringIndex);
|
return new StringInfo(tag, stringIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_INTEGER: {
|
case IClassFileConstants.CONSTANT_INTEGER: {
|
||||||
long bytes = dataStream.readUnsignedInt();
|
long bytes = dataStream.readUnsignedInt();
|
||||||
return new IntegerInfo(tag, bytes);
|
return new IntegerInfo(tag, bytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_FLOAT: {
|
case IClassFileConstants.CONSTANT_FLOAT: {
|
||||||
long bytes = dataStream.readUnsignedInt();
|
long bytes = dataStream.readUnsignedInt();
|
||||||
return new FloatInfo(tag, bytes);
|
return new FloatInfo(tag, bytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_LONG: {
|
case IClassFileConstants.CONSTANT_LONG: {
|
||||||
long highBytes = dataStream.readUnsignedInt();
|
long highBytes = dataStream.readUnsignedInt();
|
||||||
long lowBytes = dataStream.readUnsignedInt();
|
long lowBytes = dataStream.readUnsignedInt();
|
||||||
return new LongInfo(tag, highBytes, lowBytes);
|
return new LongInfo(tag, highBytes, lowBytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_DOUBLE: {
|
case IClassFileConstants.CONSTANT_DOUBLE: {
|
||||||
long highBytes = dataStream.readUnsignedInt();
|
long highBytes = dataStream.readUnsignedInt();
|
||||||
long lowBytes = dataStream.readUnsignedInt();
|
long lowBytes = dataStream.readUnsignedInt();
|
||||||
return new DoubleInfo(tag, highBytes, lowBytes);
|
return new DoubleInfo(tag, highBytes, lowBytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
|
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
|
||||||
int nameIndex = dataStream.readUnsignedShort();
|
int nameIndex = dataStream.readUnsignedShort();
|
||||||
int descriptorIndex = dataStream.readUnsignedShort();
|
int descriptorIndex = dataStream.readUnsignedShort();
|
||||||
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
|
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_UTF8: {
|
case IClassFileConstants.CONSTANT_UTF8: {
|
||||||
int length = dataStream.readUnsignedShort();
|
int length = dataStream.readUnsignedShort();
|
||||||
short[] bytes = new short[length];
|
short[] bytes = new short[length];
|
||||||
|
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
bytes[i] = (short)(dataStream.readUnsignedByte());
|
bytes[i] = (short)(dataStream.readUnsignedByte());
|
||||||
}
|
|
||||||
|
|
||||||
return new UTF8Info(tag, length, bytes);
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return new UTF8Info(tag, length, bytes);
|
||||||
|
}
|
||||||
|
default: {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -257,24 +258,24 @@ public class BasicClassFileParser {
|
||||||
*/
|
*/
|
||||||
protected void readInterfaces(EnhancedDataInputStream dataStream) throws IOException {
|
protected void readInterfaces(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
interfaces = new int[interfaces_count];
|
interfaces = new int[interfaces_count];
|
||||||
|
|
||||||
for (int i = 0; i < interfaces_count; i++) {
|
for (int i = 0; i < interfaces_count; i++) {
|
||||||
interfaces[i] = dataStream.readUnsignedShort();
|
interfaces[i] = dataStream.readUnsignedShort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the fields.
|
* Reads the fields.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
protected void readFields(EnhancedDataInputStream dataStream) throws IOException {
|
protected void readFields(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
|
|
||||||
for (int i = 0; i < fields_count; i++) {
|
for (int i = 0; i < fields_count; i++) {
|
||||||
readField(dataStream);
|
readField(dataStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a field.
|
* Reads a field.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
|
@ -285,47 +286,47 @@ public class BasicClassFileParser {
|
||||||
/*int nameIndex = */ dataStream.readUnsignedShort();
|
/*int nameIndex = */ dataStream.readUnsignedShort();
|
||||||
/*int descriptorIndex =*/ dataStream.readUnsignedShort();
|
/*int descriptorIndex =*/ dataStream.readUnsignedShort();
|
||||||
int attributesCount = dataStream.readUnsignedShort();
|
int attributesCount = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
for (int i = 0; i < attributesCount; i++) {
|
for (int i = 0; i < attributesCount; i++) {
|
||||||
readAttribute(dataStream);
|
readAttribute(dataStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads the methods.
|
* Reads the methods.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
protected void readMethods(EnhancedDataInputStream dataStream) throws IOException {
|
protected void readMethods(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
|
|
||||||
methods = new MethodInfo[methods_count];
|
methods = new MethodInfo[methods_count];
|
||||||
|
|
||||||
for (int i = 0; i < methods_count; i++) {
|
for (int i = 0; i < methods_count; i++) {
|
||||||
methods[i] = readMethod(dataStream);
|
methods[i] = readMethod(dataStream);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads a method.
|
* Reads a method.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
* @throws IOException if an I/O error occurs.
|
* @throws IOException if an I/O error occurs.
|
||||||
*/
|
*/
|
||||||
protected MethodInfo readMethod(EnhancedDataInputStream dataStream) throws IOException {
|
protected MethodInfo readMethod(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
|
|
||||||
int accessFlags = dataStream.readUnsignedShort();
|
int accessFlags = dataStream.readUnsignedShort();
|
||||||
int nameIndex = dataStream.readUnsignedShort();
|
int nameIndex = dataStream.readUnsignedShort();
|
||||||
int descriptorIndex = dataStream.readUnsignedShort();
|
int descriptorIndex = dataStream.readUnsignedShort();
|
||||||
int attributesCount = dataStream.readUnsignedShort();
|
int attributesCount = dataStream.readUnsignedShort();
|
||||||
|
|
||||||
for (int i = 0; i < attributesCount; i++) {
|
for (int i = 0; i < attributesCount; i++) {
|
||||||
readAttribute(dataStream);
|
readAttribute(dataStream);
|
||||||
}
|
}
|
||||||
|
|
||||||
return new MethodInfo(accessFlags, nameIndex, descriptorIndex, attributes_count, null);
|
return new MethodInfo(accessFlags, nameIndex, descriptorIndex, attributes_count, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads an attribute.
|
* Reads an attribute.
|
||||||
* @param dataStream the data stream.
|
* @param dataStream the data stream.
|
||||||
|
@ -334,14 +335,14 @@ public class BasicClassFileParser {
|
||||||
protected AbstractAttributeInfo readAttribute(EnhancedDataInputStream dataStream) throws IOException {
|
protected AbstractAttributeInfo readAttribute(EnhancedDataInputStream dataStream) throws IOException {
|
||||||
dataStream.skip(2);
|
dataStream.skip(2);
|
||||||
long length = dataStream.readUnsignedInt();
|
long length = dataStream.readUnsignedInt();
|
||||||
|
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
dataStream.skip(length);
|
dataStream.skip(length);
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the entry at the constant pool index.
|
* Returns the entry at the constant pool index.
|
||||||
* @param index the index.
|
* @param index the index.
|
||||||
|
@ -350,7 +351,7 @@ public class BasicClassFileParser {
|
||||||
protected AbstractCPInfo getCPInfo(int index) {
|
protected AbstractCPInfo getCPInfo(int index) {
|
||||||
return (AbstractCPInfo)(constant_pool.get(index-1));
|
return (AbstractCPInfo)(constant_pool.get(index-1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the name given an index to the constant pool table.
|
* Returns the name given an index to the constant pool table.
|
||||||
* The entry at the index must be a UTF8 string entry
|
* The entry at the index must be a UTF8 string entry
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
|
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -24,10 +24,10 @@ import java.io.InputStream;
|
||||||
/**
|
/**
|
||||||
* Singleton class for obtaining various information about class files.
|
* Singleton class for obtaining various information about class files.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class ClassFileUtil {
|
public class ClassFileUtil {
|
||||||
|
|
||||||
private static ClassFileUtil instance;
|
private static ClassFileUtil instance;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,20 +36,20 @@ public class ClassFileUtil {
|
||||||
private ClassFileUtil() {
|
private ClassFileUtil() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the singleton instance.
|
* Returns the singleton instance.
|
||||||
* @return the singleton instance.
|
* @return the singleton instance.
|
||||||
*/
|
*/
|
||||||
public static final ClassFileUtil getInstance() {
|
public static final ClassFileUtil getInstance() {
|
||||||
|
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new ClassFileUtil();
|
instance = new ClassFileUtil();
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the class with the given path is runnable, i.e. whether it contains <code>public
|
* Returns whether the class with the given path is runnable, i.e. whether it contains <code>public
|
||||||
* static void main (String[])</code> method.
|
* static void main (String[])</code> method.
|
||||||
|
@ -61,7 +61,7 @@ public class ClassFileUtil {
|
||||||
File classFile = new File(classFilePath);
|
File classFile = new File(classFilePath);
|
||||||
return isRunnable(classFile);
|
return isRunnable(classFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the class is runnable, i.e. whether it contains <code>public
|
* Returns whether the class is runnable, i.e. whether it contains <code>public
|
||||||
* static void main (String[])</code> method.
|
* static void main (String[])</code> method.
|
||||||
|
@ -72,8 +72,8 @@ public class ClassFileUtil {
|
||||||
public boolean isRunnable(File classFile) throws IOException {
|
public boolean isRunnable(File classFile) throws IOException {
|
||||||
FileInputStream stream = new FileInputStream(classFile);
|
FileInputStream stream = new FileInputStream(classFile);
|
||||||
return isRunnable(stream);
|
return isRunnable(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the class represented by the given input stream is runnable,
|
* Returns whether the class represented by the given input stream is runnable,
|
||||||
* i.e. whether it contains <code>public static void main (String[])</code> method.
|
* i.e. whether it contains <code>public static void main (String[])</code> method.
|
||||||
|
@ -86,7 +86,7 @@ public class ClassFileUtil {
|
||||||
parser.parse();
|
parser.parse();
|
||||||
return parser.isExecutable();
|
return parser.isExecutable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the qualified class name for the file with the given path.
|
* Gets the qualified class name for the file with the given path.
|
||||||
* @param classFilePath the class file path.
|
* @param classFilePath the class file path.
|
||||||
|
@ -96,7 +96,7 @@ public class ClassFileUtil {
|
||||||
File classFile = new File(classFilePath);
|
File classFile = new File(classFilePath);
|
||||||
return getQualifiedClassName(classFile);
|
return getQualifiedClassName(classFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the qualified class name.
|
* Gets the qualified class name.
|
||||||
* @param classFile the class file.
|
* @param classFile the class file.
|
||||||
|
@ -106,7 +106,7 @@ public class ClassFileUtil {
|
||||||
FileInputStream stream = new FileInputStream(classFile);
|
FileInputStream stream = new FileInputStream(classFile);
|
||||||
return getQualifiedClassName(stream);
|
return getQualifiedClassName(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the qualified class name for the class represented by the given input stream.
|
* Gets the qualified class name for the class represented by the given input stream.
|
||||||
* @param stream the input stream representing a class.
|
* @param stream the input stream representing a class.
|
||||||
|
|
|
@ -37,22 +37,24 @@ import org.eclipse.rse.services.IService;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A IFileService is an abstraction of a file service that runs over some sort of connection.
|
* A IFileService is an abstraction of a file service that runs over some sort
|
||||||
* It can be shared among multiple instances of a subsystem. At some point this file
|
* of connection. It can be shared among multiple instances of a subsystem. At
|
||||||
* service layer may become official API but for now it is experimental. Each
|
* some point this file service layer may become official API but for now it is
|
||||||
* subsystem is currently responsible for layering an abstraction over whatever it
|
* experimental. Each subsystem is currently responsible for layering an
|
||||||
* wants to construct as a service.
|
* abstraction over whatever it wants to construct as a service.
|
||||||
* <p>
|
* <p>
|
||||||
* This is a very bare bones definition. A real definition would probably have changed
|
* This is a very bare bones definition. A real definition would probably have
|
||||||
* terminology, use URI's rather than Strings, and have much more robust error handling.
|
* changed terminology, use URI's rather than Strings, and have much more robust
|
||||||
* </p><p>
|
* error handling.
|
||||||
* Implementers of this interface will have to either be instantiated, initialized, or
|
|
||||||
* somehow derive a connection as part of its state.
|
|
||||||
* </p><p>
|
|
||||||
* This interface is not intended to be implemented by clients. File service
|
|
||||||
* implementations must subclass {@link AbstractFileService} rather than implementing
|
|
||||||
* this interface directly.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* Implementers of this interface will have to either be instantiated,
|
||||||
|
* initialized, or somehow derive a connection as part of its state.
|
||||||
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
|
* File service implementations must subclass
|
||||||
|
* {@link AbstractFileService} rather than implementing this
|
||||||
|
* interface directly.
|
||||||
*/
|
*/
|
||||||
public interface IFileService extends IService
|
public interface IFileService extends IService
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -23,10 +23,13 @@ import org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMappin
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal class. Clients must not instantiate or subclass it.
|
* An internal class.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemFileTransferModeMapping implements ISystemFileTransferModeMapping, Cloneable {
|
public class SystemFileTransferModeMapping implements ISystemFileTransferModeMapping, Cloneable {
|
||||||
|
|
||||||
public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
|
public static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
|
||||||
private String name;
|
private String name;
|
||||||
private String extension;
|
private String extension;
|
||||||
|
@ -40,21 +43,21 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
|
||||||
public SystemFileTransferModeMapping(String extension) {
|
public SystemFileTransferModeMapping(String extension) {
|
||||||
this("*", extension); //$NON-NLS-1$
|
this("*", extension); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for SystemFileTransferModeMapping.
|
* Constructor for SystemFileTransferModeMapping.
|
||||||
* @param name the name. If the name is <code>null</code> or if it is an empty string, it is set to <code>*</code>.
|
* @param name the name. If the name is <code>null</code> or if it is an empty string, it is set to <code>*</code>.
|
||||||
* @param extension the extension. Can be <code>null</code>.
|
* @param extension the extension. Can be <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public SystemFileTransferModeMapping(String name, String extension) {
|
public SystemFileTransferModeMapping(String name, String extension) {
|
||||||
|
|
||||||
if ((name == null) || (name.length() < 1)) {
|
if ((name == null) || (name.length() < 1)) {
|
||||||
setName("*"); //$NON-NLS-1$
|
setName("*"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setName(name);
|
setName(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
setExtension(extension);
|
setExtension(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +74,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
|
||||||
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getLabel()
|
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getLabel()
|
||||||
*/
|
*/
|
||||||
public String getLabel() {
|
public String getLabel() {
|
||||||
|
|
||||||
if (extension != null) {
|
if (extension != null) {
|
||||||
return (name + "." + extension); //$NON-NLS-1$
|
return (name + "." + extension); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
@ -103,35 +106,35 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
|
||||||
public boolean isText() {
|
public boolean isText() {
|
||||||
return !isBinary();
|
return !isBinary();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether transfer mode is binary
|
* Set whether transfer mode is binary
|
||||||
*/
|
*/
|
||||||
public void setAsBinary() {
|
public void setAsBinary() {
|
||||||
isBinary = true;
|
isBinary = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set whether transfer mode is text
|
* Set whether transfer mode is text
|
||||||
*/
|
*/
|
||||||
public void setAsText() {
|
public void setAsText() {
|
||||||
isBinary = false;
|
isBinary = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the name
|
* Set the name
|
||||||
*/
|
*/
|
||||||
public void setName(String name) {
|
public void setName(String name) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the extension
|
* Set the extension
|
||||||
*/
|
*/
|
||||||
public void setExtension(String extension) {
|
public void setExtension(String extension) {
|
||||||
this.extension = extension;
|
this.extension = extension;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the priority - the smaller the number, the higher priority
|
* Set the priority - the smaller the number, the higher priority
|
||||||
* @param priority priority to set.
|
* @param priority priority to set.
|
||||||
|
@ -139,7 +142,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
|
||||||
public void setPriority(int priority) {
|
public void setPriority(int priority) {
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getPriority()
|
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getPriority()
|
||||||
|
@ -148,7 +151,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
|
||||||
{
|
{
|
||||||
return this.priority;
|
return this.priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clone this object.
|
* Clone this object.
|
||||||
*
|
*
|
||||||
|
|
|
@ -7,8 +7,8 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -49,17 +49,20 @@ import org.eclipse.ui.XMLMemento;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal class. Clients must not instantiate or subclass it.
|
* An internal class.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRegistry {
|
public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRegistry {
|
||||||
|
|
||||||
private static SystemFileTransferModeRegistry instance;
|
private static SystemFileTransferModeRegistry instance;
|
||||||
|
|
||||||
private HashMap typeModeMappings;
|
private HashMap typeModeMappings;
|
||||||
|
|
||||||
private RSEUIPlugin plugin;
|
private RSEUIPlugin plugin;
|
||||||
|
|
||||||
// Constants for reading from and writing to xml file
|
// Constants for reading from and writing to xml file
|
||||||
private static final String FILENAME = "fileTransferMode.xml"; //$NON-NLS-1$
|
private static final String FILENAME = "fileTransferMode.xml"; //$NON-NLS-1$
|
||||||
private static final String ENCODING = SystemEncodingUtil.ENCODING_UTF_8;
|
private static final String ENCODING = SystemEncodingUtil.ENCODING_UTF_8;
|
||||||
|
@ -70,7 +73,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$
|
private static final String MODE_ATTRIBUTE = "mode"; //$NON-NLS-1$
|
||||||
private static final String BINARY_VALUE = "binary"; //$NON-NLS-1$
|
private static final String BINARY_VALUE = "binary"; //$NON-NLS-1$
|
||||||
private static final String TEXT_VALUE = "text"; //$NON-NLS-1$
|
private static final String TEXT_VALUE = "text"; //$NON-NLS-1$
|
||||||
private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
|
private static final String PRIORITY_ATTRIBUTE = "priority"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor for SystemFileTransferModeRegistry
|
* Constructor for SystemFileTransferModeRegistry
|
||||||
|
@ -80,20 +83,20 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
this.plugin = RSEUIPlugin.getDefault();
|
this.plugin = RSEUIPlugin.getDefault();
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the singleton instance
|
* Get the singleton instance
|
||||||
*/
|
*/
|
||||||
public static SystemFileTransferModeRegistry getInstance() {
|
public static SystemFileTransferModeRegistry getInstance() {
|
||||||
|
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new SystemFileTransferModeRegistry();
|
instance = new SystemFileTransferModeRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete's the existing file associations and reinitializes with defaults
|
* Delete's the existing file associations and reinitializes with defaults
|
||||||
*/
|
*/
|
||||||
|
@ -102,16 +105,16 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
deleteAssociations();
|
deleteAssociations();
|
||||||
initialize();
|
initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the registry from storage.
|
* Initialize the registry from storage.
|
||||||
*/
|
*/
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
|
|
||||||
// load our current associations (if any)
|
// load our current associations (if any)
|
||||||
loadAssociations();
|
loadAssociations();
|
||||||
|
|
||||||
|
|
||||||
// get reference to the extension registry
|
// get reference to the extension registry
|
||||||
IExtensionRegistry extRegistry = Platform.getExtensionRegistry();
|
IExtensionRegistry extRegistry = Platform.getExtensionRegistry();
|
||||||
|
|
||||||
|
@ -131,9 +134,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
String type = element.getAttribute("type"); //$NON-NLS-1$
|
String type = element.getAttribute("type"); //$NON-NLS-1$
|
||||||
|
|
||||||
if (type != null && !type.equals("")) { //$NON-NLS-1$
|
if (type != null && !type.equals("")) { //$NON-NLS-1$
|
||||||
|
|
||||||
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(extension);
|
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(extension);
|
||||||
|
|
||||||
// add extension to list of text types
|
// add extension to list of text types
|
||||||
if (type.equalsIgnoreCase("text")) { //$NON-NLS-1$
|
if (type.equalsIgnoreCase("text")) { //$NON-NLS-1$
|
||||||
mapping.setAsText();
|
mapping.setAsText();
|
||||||
|
@ -142,7 +145,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
|
if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
|
||||||
mapping.setAsBinary();
|
mapping.setAsBinary();
|
||||||
}
|
}
|
||||||
|
|
||||||
int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
|
int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
|
||||||
String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
|
String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
|
||||||
try
|
try
|
||||||
|
@ -152,10 +155,10 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
mapping.setPriority(priority);
|
mapping.setPriority(priority);
|
||||||
|
|
||||||
String key = getMappingKey(mapping);
|
String key = getMappingKey(mapping);
|
||||||
if (!typeModeMappings.containsKey(key)){
|
if (!typeModeMappings.containsKey(key)){
|
||||||
typeModeMappings.put(key, mapping);
|
typeModeMappings.put(key, mapping);
|
||||||
|
@ -164,7 +167,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
SystemFileTransferModeMapping existingMapping = (SystemFileTransferModeMapping)typeModeMappings.get(key);
|
SystemFileTransferModeMapping existingMapping = (SystemFileTransferModeMapping)typeModeMappings.get(key);
|
||||||
int existingPriority = existingMapping.getPriority();
|
int existingPriority = existingMapping.getPriority();
|
||||||
if (priority < existingPriority){
|
if (priority < existingPriority){
|
||||||
|
|
||||||
// change properties of existing mapping to that of new priority
|
// change properties of existing mapping to that of new priority
|
||||||
if (mapping.isBinary() && existingMapping.isText()){
|
if (mapping.isBinary() && existingMapping.isText()){
|
||||||
existingMapping.setAsBinary();
|
existingMapping.setAsBinary();
|
||||||
|
@ -172,19 +175,19 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
else if (mapping.isText() && existingMapping.isBinary()){
|
else if (mapping.isText() && existingMapping.isBinary()){
|
||||||
existingMapping.setAsText();
|
existingMapping.setAsText();
|
||||||
}
|
}
|
||||||
|
|
||||||
existingMapping.setPriority(priority);
|
existingMapping.setPriority(priority);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ISystemFileTransferModeRegistry#getModeMappings()
|
* @see ISystemFileTransferModeRegistry#getModeMappings()
|
||||||
*/
|
*/
|
||||||
|
@ -194,8 +197,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
sortedMappings.toArray(array);
|
sortedMappings.toArray(array);
|
||||||
return array;
|
return array;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The mappings are kept in a hash map for fast lookup. Sorting is
|
* The mappings are kept in a hash map for fast lookup. Sorting is
|
||||||
* typically only needed for certain dialogs/choices etc.
|
* typically only needed for certain dialogs/choices etc.
|
||||||
|
@ -213,23 +216,23 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
List result = new ArrayList(s);
|
List result = new ArrayList(s);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets new mode mappings
|
* Sets new mode mappings
|
||||||
*/
|
*/
|
||||||
public void setModeMappings(SystemFileTransferModeMapping[] newMappings) {
|
public void setModeMappings(SystemFileTransferModeMapping[] newMappings) {
|
||||||
typeModeMappings = new HashMap();
|
typeModeMappings = new HashMap();
|
||||||
|
|
||||||
for (int i = 0; i < newMappings.length; i++) {
|
for (int i = 0; i < newMappings.length; i++) {
|
||||||
SystemFileTransferModeMapping mapping = newMappings[i];
|
SystemFileTransferModeMapping mapping = newMappings[i];
|
||||||
typeModeMappings.put(getMappingKey(mapping), mapping);
|
typeModeMappings.put(getMappingKey(mapping), mapping);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a key given the mapping
|
* Return a key given the mapping
|
||||||
*/
|
*/
|
||||||
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
|
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
|
||||||
return mapping.getLabel().toLowerCase();
|
return mapping.getLabel().toLowerCase();
|
||||||
|
@ -297,26 +300,26 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
*/
|
*/
|
||||||
public boolean isText(IRemoteFile remoteFile) {
|
public boolean isText(IRemoteFile remoteFile) {
|
||||||
return isText(remoteFile.getName());
|
return isText(remoteFile.getName());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the mode mapping given a file name
|
* Get the mode mapping given a file name
|
||||||
*/
|
*/
|
||||||
private SystemFileTransferModeMapping getMapping(String fileName) {
|
private SystemFileTransferModeMapping getMapping(String fileName) {
|
||||||
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(fileName.toLowerCase()));
|
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(fileName.toLowerCase()));
|
||||||
|
|
||||||
if (mapping == null) {
|
if (mapping == null) {
|
||||||
mapping = createMappingFromModeMappings(fileName);
|
mapping = createMappingFromModeMappings(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapping == null) {
|
if (mapping == null) {
|
||||||
return getDefaultMapping(fileName);
|
return getDefaultMapping(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
private SystemFileTransferModeMapping createMappingFromModeMappings(String fileName)
|
private SystemFileTransferModeMapping createMappingFromModeMappings(String fileName)
|
||||||
{
|
{
|
||||||
// get file extension
|
// get file extension
|
||||||
|
@ -325,7 +328,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
|
|
||||||
String name = null;
|
String name = null;
|
||||||
String extension = null;
|
String extension = null;
|
||||||
|
|
||||||
// if there is no extension
|
// if there is no extension
|
||||||
if ((extIndex == -1) || (extIndex == (fileName.length() - 1))) {
|
if ((extIndex == -1) || (extIndex == (fileName.length() - 1))) {
|
||||||
name = fileName;
|
name = fileName;
|
||||||
|
@ -333,45 +336,45 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
else {
|
else {
|
||||||
name = fileName.substring(0, extIndex);
|
name = fileName.substring(0, extIndex);
|
||||||
extension = fileName.substring(extIndex + 1);
|
extension = fileName.substring(extIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if the name and extension combination exists already
|
// check if the name and extension combination exists already
|
||||||
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(name, extension))));
|
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(name, extension))));
|
||||||
|
|
||||||
// if not, check only for the extension
|
// if not, check only for the extension
|
||||||
if (mapping == null) {
|
if (mapping == null) {
|
||||||
mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(extension))));
|
mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(extension))));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mapping == null) {
|
if (mapping == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SystemFileTransferModeMapping fileMapping = new SystemFileTransferModeMapping(name, extension);
|
SystemFileTransferModeMapping fileMapping = new SystemFileTransferModeMapping(name, extension);
|
||||||
|
|
||||||
if (mapping.isText())
|
if (mapping.isText())
|
||||||
{
|
{
|
||||||
fileMapping.setAsText();
|
fileMapping.setAsText();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fileMapping.setAsBinary();
|
fileMapping.setAsBinary();
|
||||||
}
|
}
|
||||||
|
|
||||||
return fileMapping;
|
return fileMapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return whether to automatically detect, use binary or text during file transfer
|
* Return whether to automatically detect, use binary or text during file transfer
|
||||||
* for unspecified file types
|
* for unspecified file types
|
||||||
*/
|
*/
|
||||||
public static int getFileTransferModeDefaultPreference()
|
public static int getFileTransferModeDefaultPreference()
|
||||||
{
|
{
|
||||||
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
|
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
|
||||||
return store.getInt(ISystemFilePreferencesConstants.FILETRANSFERMODEDEFAULT);
|
return store.getInt(ISystemFilePreferencesConstants.FILETRANSFERMODEDEFAULT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a default mapping given an extension. Should never return null.
|
* Get a default mapping given an extension. Should never return null.
|
||||||
*/
|
*/
|
||||||
|
@ -381,13 +384,13 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
// DY int extIndex = fileName.indexOf('.');
|
// DY int extIndex = fileName.indexOf('.');
|
||||||
int extIndex = fileName.lastIndexOf('.');
|
int extIndex = fileName.lastIndexOf('.');
|
||||||
String name, extension;
|
String name, extension;
|
||||||
|
|
||||||
// if there is no extension
|
// if there is no extension
|
||||||
// DY 04-23-2002 changed from default binary to default text for files that
|
// DY 04-23-2002 changed from default binary to default text for files that
|
||||||
// a) Have no extension
|
// a) Have no extension
|
||||||
// b) Ends with a period
|
// b) Ends with a period
|
||||||
// c) Start with a '.' i.e. .bash_history
|
// c) Start with a '.' i.e. .bash_history
|
||||||
if ((extIndex == -1) || (extIndex == (fileName.length() - 1)) || (extIndex == 0))
|
if ((extIndex == -1) || (extIndex == (fileName.length() - 1)) || (extIndex == 0))
|
||||||
{
|
{
|
||||||
name = fileName;
|
name = fileName;
|
||||||
extension = null;
|
extension = null;
|
||||||
|
@ -395,15 +398,15 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
name = fileName.substring(0, extIndex);
|
name = fileName.substring(0, extIndex);
|
||||||
extension = fileName.substring(extIndex + 1);
|
extension = fileName.substring(extIndex + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
|
|
||||||
|
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
|
||||||
// default
|
|
||||||
|
// default
|
||||||
int defaultFileTransferMode = getFileTransferModeDefaultPreference();
|
int defaultFileTransferMode = getFileTransferModeDefaultPreference();
|
||||||
|
|
||||||
if (defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY)
|
if (defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY)
|
||||||
{
|
{
|
||||||
mapping.setAsBinary();
|
mapping.setAsBinary();
|
||||||
|
@ -415,50 +418,50 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
|
|
||||||
return mapping;
|
return mapping;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the saved associations to the registry
|
* Load the saved associations to the registry
|
||||||
*
|
*
|
||||||
* @return true if operation successful, false otherwise
|
* @return true if operation successful, false otherwise
|
||||||
*/
|
*/
|
||||||
public boolean loadAssociations() {
|
public boolean loadAssociations() {
|
||||||
|
|
||||||
typeModeMappings = new HashMap();
|
typeModeMappings = new HashMap();
|
||||||
|
|
||||||
String location = getFileLocation();
|
String location = getFileLocation();
|
||||||
|
|
||||||
File file = new File(location);
|
File file = new File(location);
|
||||||
|
|
||||||
if (!file.exists())
|
if (!file.exists())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
FileInputStream stream = null;
|
FileInputStream stream = null;
|
||||||
InputStreamReader reader = null;
|
InputStreamReader reader = null;
|
||||||
|
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
stream = new FileInputStream(file);
|
stream = new FileInputStream(file);
|
||||||
reader = new InputStreamReader(stream, ENCODING);
|
reader = new InputStreamReader(stream, ENCODING);
|
||||||
XMLMemento memento = XMLMemento.createReadRoot(reader);
|
XMLMemento memento = XMLMemento.createReadRoot(reader);
|
||||||
IMemento[] mementos = memento.getChildren(INFO_NODE);
|
IMemento[] mementos = memento.getChildren(INFO_NODE);
|
||||||
|
|
||||||
for (int i = 0; i < mementos.length; i++) {
|
for (int i = 0; i < mementos.length; i++) {
|
||||||
String name = mementos[i].getString(NAME_ATTRIBUTE);
|
String name = mementos[i].getString(NAME_ATTRIBUTE);
|
||||||
String extension = mementos[i].getString(EXTENSION_ATTRIBUTE);
|
String extension = mementos[i].getString(EXTENSION_ATTRIBUTE);
|
||||||
String mode = mementos[i].getString(MODE_ATTRIBUTE);
|
String mode = mementos[i].getString(MODE_ATTRIBUTE);
|
||||||
|
|
||||||
|
|
||||||
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
|
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
|
||||||
|
|
||||||
if (mode.equals(TEXT_VALUE)) {
|
if (mode.equals(TEXT_VALUE)) {
|
||||||
mapping.setAsText();
|
mapping.setAsText();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mapping.setAsBinary();
|
mapping.setAsBinary();
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Integer priorityInt = mementos[i].getInteger(PRIORITY_ATTRIBUTE);
|
Integer priorityInt = mementos[i].getInteger(PRIORITY_ATTRIBUTE);
|
||||||
|
@ -468,13 +471,13 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typeModeMappings.put(getMappingKey(mapping), mapping);
|
typeModeMappings.put(getMappingKey(mapping), mapping);
|
||||||
}
|
}
|
||||||
|
|
||||||
result = true;
|
result = true;
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
@ -482,9 +485,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (reader != null)
|
if (reader != null)
|
||||||
reader.close();
|
reader.close();
|
||||||
}
|
}
|
||||||
|
@ -492,27 +495,27 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
SystemBasePlugin.logError("Could not close reader for transfer mode xml file", e); //$NON-NLS-1$
|
SystemBasePlugin.logError("Could not close reader for transfer mode xml file", e); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteAssociations()
|
private void deleteAssociations()
|
||||||
{
|
{
|
||||||
String location = getFileLocation();
|
String location = getFileLocation();
|
||||||
File assFile = new File(location);
|
File assFile = new File(location);
|
||||||
assFile.delete();
|
assFile.delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the contents of the registry
|
* Save the contents of the registry
|
||||||
*/
|
*/
|
||||||
public void saveAssociations() {
|
public void saveAssociations() {
|
||||||
|
|
||||||
String location = getFileLocation();
|
String location = getFileLocation();
|
||||||
|
|
||||||
XMLMemento memento = XMLMemento.createWriteRoot(ROOT_NODE);
|
XMLMemento memento = XMLMemento.createWriteRoot(ROOT_NODE);
|
||||||
|
|
||||||
Iterator iter = typeModeMappings.values().iterator();
|
Iterator iter = typeModeMappings.values().iterator();
|
||||||
|
|
||||||
while (iter.hasNext()) {
|
while (iter.hasNext()) {
|
||||||
|
@ -520,25 +523,25 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
IMemento infoMemento = memento.createChild(INFO_NODE);
|
IMemento infoMemento = memento.createChild(INFO_NODE);
|
||||||
infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
|
infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
|
||||||
infoMemento.putString(EXTENSION_ATTRIBUTE, mapping.getExtension());
|
infoMemento.putString(EXTENSION_ATTRIBUTE, mapping.getExtension());
|
||||||
infoMemento.putString(MODE_ATTRIBUTE, mapping.isBinary() ? BINARY_VALUE : TEXT_VALUE);
|
infoMemento.putString(MODE_ATTRIBUTE, mapping.isBinary() ? BINARY_VALUE : TEXT_VALUE);
|
||||||
infoMemento.putInteger(PRIORITY_ATTRIBUTE, mapping.getPriority());
|
infoMemento.putInteger(PRIORITY_ATTRIBUTE, mapping.getPriority());
|
||||||
}
|
}
|
||||||
|
|
||||||
FileOutputStream stream = null;
|
FileOutputStream stream = null;
|
||||||
OutputStreamWriter writer = null;
|
OutputStreamWriter writer = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
stream = new FileOutputStream(location);
|
stream = new FileOutputStream(location);
|
||||||
writer = new OutputStreamWriter(stream, ENCODING);
|
writer = new OutputStreamWriter(stream, ENCODING);
|
||||||
memento.save(writer);
|
memento.save(writer);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
SystemBasePlugin.logError("Could not write to transfer mode xml file", e); //$NON-NLS-1$
|
SystemBasePlugin.logError("Could not write to transfer mode xml file", e); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
if (writer != null)
|
if (writer != null)
|
||||||
writer.close();
|
writer.close();
|
||||||
}
|
}
|
||||||
|
@ -547,8 +550,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the file location
|
* Get the file location
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -35,7 +35,8 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf
|
||||||
/**
|
/**
|
||||||
* Public utility class for dealing with remote file subsystems.
|
* Public utility class for dealing with remote file subsystems.
|
||||||
*
|
*
|
||||||
* Clients may use this class, but not instantiate or subclass it.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteFileUtility
|
public class RemoteFileUtility
|
||||||
{
|
{
|
||||||
|
@ -52,7 +53,7 @@ public class RemoteFileUtility
|
||||||
ISubSystem[] sses = sr.getSubSystems(connection);
|
ISubSystem[] sses = sr.getSubSystems(connection);
|
||||||
for (int i = 0; i < sses.length; i++)
|
for (int i = 0; i < sses.length; i++)
|
||||||
{
|
{
|
||||||
if (sses[i] instanceof IRemoteFileSubSystem)
|
if (sses[i] instanceof IRemoteFileSubSystem)
|
||||||
{
|
{
|
||||||
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
|
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
|
||||||
return subSystem;
|
return subSystem;
|
||||||
|
@ -60,7 +61,7 @@ public class RemoteFileUtility
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the list of file subsystems associated with a connection.
|
* Return the list of file subsystems associated with a connection.
|
||||||
* @param connection the connection to query.
|
* @param connection the connection to query.
|
||||||
|
@ -73,7 +74,7 @@ public class RemoteFileUtility
|
||||||
ISubSystem[] sses = sr.getSubSystems(connection);
|
ISubSystem[] sses = sr.getSubSystems(connection);
|
||||||
for (int i = 0; i < sses.length; i++)
|
for (int i = 0; i < sses.length; i++)
|
||||||
{
|
{
|
||||||
if (sses[i] instanceof IRemoteFileSubSystem)
|
if (sses[i] instanceof IRemoteFileSubSystem)
|
||||||
{
|
{
|
||||||
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
|
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
|
||||||
results.add(subSystem);
|
results.add(subSystem);
|
||||||
|
@ -81,34 +82,34 @@ public class RemoteFileUtility
|
||||||
}
|
}
|
||||||
return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]);
|
return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the first remote file subsystem configuration associated with a system type.
|
* Return the first remote file subsystem configuration associated with a system type.
|
||||||
* @param systemType the system type to query.
|
* @param systemType the system type to query.
|
||||||
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
|
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
|
||||||
* no file subsystem is configured with the given system type.
|
* no file subsystem is configured with the given system type.
|
||||||
*/
|
*/
|
||||||
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
|
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
|
||||||
{
|
{
|
||||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||||
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
|
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
|
||||||
for (int i = 0; i < sses.length; i++)
|
for (int i = 0; i < sses.length; i++)
|
||||||
|
{
|
||||||
|
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
|
||||||
{
|
{
|
||||||
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
|
return (IRemoteFileSubSystemConfiguration)sses[i];
|
||||||
{
|
|
||||||
return (IRemoteFileSubSystemConfiguration)sses[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
}
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
/**
|
|
||||||
* Return the global SystemFileTransferModeRegistry.
|
/**
|
||||||
* @return the global SystemFileTransferModeRegistry.
|
* Return the global SystemFileTransferModeRegistry.
|
||||||
*/
|
* @return the global SystemFileTransferModeRegistry.
|
||||||
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
|
*/
|
||||||
{
|
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
|
||||||
return SystemFileTransferModeRegistry.getInstance();
|
{
|
||||||
}
|
return SystemFileTransferModeRegistry.getInstance();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,8 +7,8 @@
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -30,19 +30,18 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
|
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class, which
|
||||||
* which allows the input array to be changed dynamically.
|
* allows the input array to be changed dynamically.
|
||||||
* <p>
|
* <p>
|
||||||
* A cell editor that presents a list of items in a combo box.
|
* A cell editor that presents a list of items in a combo box. The cell editor's
|
||||||
* The cell editor's value is the zero-based index of the selected
|
* value is the zero-based index of the selected item.
|
||||||
* item.
|
|
||||||
* <p>
|
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemComboBoxCellEditor extends CellEditor
|
public class SystemComboBoxCellEditor extends CellEditor
|
||||||
{
|
{
|
||||||
private boolean readOnly = false;
|
private boolean readOnly = false;
|
||||||
/**
|
/**
|
||||||
* The list of items to present in the combo box.
|
* The list of items to present in the combo box.
|
||||||
*/
|
*/
|
||||||
|
@ -58,42 +57,42 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
*/
|
*/
|
||||||
private CCombo comboBox;
|
private CCombo comboBox;
|
||||||
/**
|
/**
|
||||||
* Creates a new cell editor with a combo containing the given
|
* Creates a new cell editor with a combo containing the given
|
||||||
* list of choices and parented under the given control. The cell
|
* list of choices and parented under the given control. The cell
|
||||||
* editor value is the zero-based index of the selected item.
|
* editor value is the zero-based index of the selected item.
|
||||||
* Initially, the cell editor has no cell validator and
|
* Initially, the cell editor has no cell validator and
|
||||||
* the first item in the list is selected.
|
* the first item in the list is selected.
|
||||||
*
|
*
|
||||||
* @param parent the parent control
|
* @param parent the parent control
|
||||||
* @param items the list of strings for the combo box
|
* @param items the list of strings for the combo box
|
||||||
*/
|
*/
|
||||||
public SystemComboBoxCellEditor(Composite parent, String[] items)
|
public SystemComboBoxCellEditor(Composite parent, String[] items)
|
||||||
{
|
{
|
||||||
super(parent);
|
super(parent);
|
||||||
selection = 0;
|
selection = 0;
|
||||||
if (items != null)
|
if (items != null)
|
||||||
setItems(items);
|
setItems(items);
|
||||||
else
|
else
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Creates a new cell editor with a combo containing the given
|
* Creates a new cell editor with a combo containing the given
|
||||||
* list of choices and parented under the given control. The cell
|
* list of choices and parented under the given control. The cell
|
||||||
* editor value is the zero-based index of the selected item.
|
* editor value is the zero-based index of the selected item.
|
||||||
* Initially, the cell editor has no cell validator and
|
* Initially, the cell editor has no cell validator and
|
||||||
* the first item in the list is selected.
|
* the first item in the list is selected.
|
||||||
*
|
*
|
||||||
* @param parent the parent control
|
* @param parent the parent control
|
||||||
* //@param whether or not this is readonly
|
* //@param whether or not this is readonly
|
||||||
*/
|
*/
|
||||||
//public SystemComboBoxCellEditor(Composite parent, boolean readOnly)
|
//public SystemComboBoxCellEditor(Composite parent, boolean readOnly)
|
||||||
public SystemComboBoxCellEditor(Composite parent)
|
public SystemComboBoxCellEditor(Composite parent)
|
||||||
{
|
{
|
||||||
super(parent);
|
super(parent);
|
||||||
selection = 0;
|
selection = 0;
|
||||||
//this.readOnly = readOnly;
|
//this.readOnly = readOnly;
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Change the input items
|
* Change the input items
|
||||||
*/
|
*/
|
||||||
|
@ -101,17 +100,17 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
{
|
{
|
||||||
this.items = items;
|
this.items = items;
|
||||||
populateComboBoxItems();
|
populateComboBoxItems();
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Method declared on CellEditor.
|
* Method declared on CellEditor.
|
||||||
*/
|
*/
|
||||||
protected Control createControl(Composite parent)
|
protected Control createControl(Composite parent)
|
||||||
{
|
{
|
||||||
if (!readOnly)
|
if (!readOnly)
|
||||||
comboBox = new CCombo(parent, SWT.NONE);
|
comboBox = new CCombo(parent, SWT.NONE);
|
||||||
else
|
else
|
||||||
comboBox = new CCombo(parent, SWT.READ_ONLY);
|
comboBox = new CCombo(parent, SWT.READ_ONLY);
|
||||||
comboBox.setFont(parent.getFont());
|
comboBox.setFont(parent.getFont());
|
||||||
|
|
||||||
comboBox.addKeyListener(new KeyAdapter() {
|
comboBox.addKeyListener(new KeyAdapter() {
|
||||||
|
@ -122,24 +121,24 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
|
|
||||||
comboBox.addSelectionListener(new SelectionAdapter() {
|
comboBox.addSelectionListener(new SelectionAdapter() {
|
||||||
public void widgetSelected(SelectionEvent event) {
|
public void widgetSelected(SelectionEvent event) {
|
||||||
|
|
||||||
// DKM - only process this when there is a selection change
|
// DKM - only process this when there is a selection change
|
||||||
// fix for defect 138324
|
// fix for defect 138324
|
||||||
if (selection == comboBox.getSelectionIndex() && comboBox.getText().equals(comboBox.getItem(comboBox.getSelectionIndex())))
|
if (selection == comboBox.getSelectionIndex() && comboBox.getText().equals(comboBox.getItem(comboBox.getSelectionIndex())))
|
||||||
return; // no change
|
return; // no change
|
||||||
|
|
||||||
// must set the selection before getting value
|
// must set the selection before getting value
|
||||||
selection = comboBox.getSelectionIndex();
|
selection = comboBox.getSelectionIndex();
|
||||||
Object newValue = doGetValue();
|
Object newValue = doGetValue();
|
||||||
|
|
||||||
|
|
||||||
boolean newValidState = isCorrect(newValue);
|
boolean newValidState = isCorrect(newValue);
|
||||||
if (newValidState) {
|
if (newValidState) {
|
||||||
doSetValue(newValue);
|
doSetValue(newValue);
|
||||||
} else {
|
} else {
|
||||||
// try to insert the current value into the error message.
|
// try to insert the current value into the error message.
|
||||||
setErrorMessage(
|
setErrorMessage(
|
||||||
NLS.bind(getErrorMessage(), items[selection]));
|
NLS.bind(getErrorMessage(), items[selection]));
|
||||||
}
|
}
|
||||||
fireApplyEditorValue();
|
fireApplyEditorValue();
|
||||||
}
|
}
|
||||||
|
@ -163,14 +162,14 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
* @return the zero-based index of the current selection wrapped
|
* @return the zero-based index of the current selection wrapped
|
||||||
* as an <code>Integer</code>
|
* as an <code>Integer</code>
|
||||||
*/
|
*/
|
||||||
protected Object doGetValue()
|
protected Object doGetValue()
|
||||||
{
|
{
|
||||||
return new Integer(selection);
|
return new Integer(selection);
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Method declared on CellEditor.
|
* Method declared on CellEditor.
|
||||||
*/
|
*/
|
||||||
protected void doSetFocus()
|
protected void doSetFocus()
|
||||||
{
|
{
|
||||||
comboBox.setFocus();
|
comboBox.setFocus();
|
||||||
}
|
}
|
||||||
|
@ -179,10 +178,10 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
* this <code>CellEditor</code> framework method
|
* this <code>CellEditor</code> framework method
|
||||||
* accepts a zero-based index of a selection.
|
* accepts a zero-based index of a selection.
|
||||||
*
|
*
|
||||||
* @param value the zero-based index of the selection wrapped
|
* @param value the zero-based index of the selection wrapped
|
||||||
* as an <code>Integer</code>
|
* as an <code>Integer</code>
|
||||||
*/
|
*/
|
||||||
protected void doSetValue(Object value)
|
protected void doSetValue(Object value)
|
||||||
{
|
{
|
||||||
if (!(value instanceof Integer))
|
if (!(value instanceof Integer))
|
||||||
{
|
{
|
||||||
|
@ -193,11 +192,11 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
if (item.equals(value))
|
if (item.equals(value))
|
||||||
{
|
{
|
||||||
selection = i;
|
selection = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Assert.isTrue(comboBox != null && (value instanceof Integer));
|
//Assert.isTrue(comboBox != null && (value instanceof Integer));
|
||||||
int newselection = ((Integer) value).intValue();
|
int newselection = ((Integer) value).intValue();
|
||||||
if (newselection != selection)
|
if (newselection != selection)
|
||||||
|
@ -213,9 +212,9 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
/**
|
/**
|
||||||
* Add the items to the combo box.
|
* Add the items to the combo box.
|
||||||
*/
|
*/
|
||||||
private void populateComboBoxItems()
|
private void populateComboBoxItems()
|
||||||
{
|
{
|
||||||
if (comboBox != null && items != null)
|
if (comboBox != null && items != null)
|
||||||
{
|
{
|
||||||
comboBox.removeAll();
|
comboBox.removeAll();
|
||||||
for (int i = 0; i < items.length; i++)
|
for (int i = 0; i < items.length; i++)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -65,7 +65,7 @@ import org.eclipse.ui.part.ResourceTransfer;
|
||||||
/**
|
/**
|
||||||
* Registry and control center for RSE UI related operations.
|
* Registry and control center for RSE UI related operations.
|
||||||
*
|
*
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemRegistryUI implements ISystemRegistryUI {
|
public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
{
|
{
|
||||||
SystemPerspectiveHelpers.openRSEPerspective();
|
SystemPerspectiveHelpers.openRSEPerspective();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandHost(org.eclipse.rse.core.model.IHost)
|
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandHost(org.eclipse.rse.core.model.IHost)
|
||||||
|
@ -138,7 +138,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandSubSystem(org.eclipse.rse.core.subsystems.ISubSystem)
|
* @see org.eclipse.rse.ui.model.ISystemRegistryUI#expandSubSystem(org.eclipse.rse.core.subsystems.ISubSystem)
|
||||||
|
@ -207,7 +207,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
public void clearRunnableContext()
|
public void clearRunnableContext()
|
||||||
{
|
{
|
||||||
//this.currentRunnableContext = null;
|
//this.currentRunnableContext = null;
|
||||||
//this.currentRunnableContextShell = null;
|
//this.currentRunnableContextShell = null;
|
||||||
popRunnableContext();
|
popRunnableContext();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +256,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
previousRunnableContextShells.remove(disposedShells.elementAt(idx));
|
previousRunnableContextShells.remove(disposedShells.elementAt(idx));
|
||||||
previousRunnableContexts.remove(disposedContexts.elementAt(idx));
|
previousRunnableContexts.remove(disposedContexts.elementAt(idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
return currentRunnableContext;
|
return currentRunnableContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,7 +289,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
}
|
}
|
||||||
clipboard = new Clipboard(display);
|
clipboard = new Clipboard(display);
|
||||||
}
|
}
|
||||||
|
|
||||||
return clipboard;
|
return clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,21 +305,21 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
|
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
|
||||||
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
|
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
|
||||||
{
|
{
|
||||||
int profileDelim = str.indexOf("."); //$NON-NLS-1$
|
int profileDelim = str.indexOf("."); //$NON-NLS-1$
|
||||||
if (profileDelim != -1)
|
if (profileDelim != -1)
|
||||||
{
|
{
|
||||||
String profileId = str.substring(0, profileDelim);
|
String profileId = str.substring(0, profileDelim);
|
||||||
String connectionId = str.substring(profileDelim + 1, str.length());
|
String connectionId = str.substring(profileDelim + 1, str.length());
|
||||||
ISystemProfile profile = registry.getSystemProfile(profileId);
|
ISystemProfile profile = registry.getSystemProfile(profileId);
|
||||||
return registry.getHost(profile, connectionId);
|
return registry.getHost(profile, connectionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
|
int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
|
||||||
|
|
||||||
String subSystemId = str.substring(0, subsystemDelim);
|
String subSystemId = str.substring(0, subsystemDelim);
|
||||||
String srcKey = str.substring(subsystemDelim + 1, str.length());
|
String srcKey = str.substring(subsystemDelim + 1, str.length());
|
||||||
|
|
||||||
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
|
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
|
||||||
ISubSystem subSystem = registry.getSubSystem(subSystemId);
|
ISubSystem subSystem = registry.getSubSystem(subSystemId);
|
||||||
if (subSystem != null)
|
if (subSystem != null)
|
||||||
|
@ -364,26 +364,26 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
Clipboard clipboard = getSystemClipboard();
|
Clipboard clipboard = getSystemClipboard();
|
||||||
ArrayList srcObjects = new ArrayList();
|
ArrayList srcObjects = new ArrayList();
|
||||||
Object object = null;
|
Object object = null;
|
||||||
|
|
||||||
if (srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
|
if (srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
|
||||||
{
|
{
|
||||||
|
|
||||||
// determine the source objects
|
// determine the source objects
|
||||||
object = clipboard.getContents(PluginTransfer.getInstance());
|
object = clipboard.getContents(PluginTransfer.getInstance());
|
||||||
|
|
||||||
if (object instanceof PluginTransferData)
|
if (object instanceof PluginTransferData)
|
||||||
{
|
{
|
||||||
// RSE transfer
|
// RSE transfer
|
||||||
PluginTransferData data = (PluginTransferData) object;
|
PluginTransferData data = (PluginTransferData) object;
|
||||||
byte[] result = data.getData();
|
byte[] result = data.getData();
|
||||||
|
|
||||||
//StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
|
//StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
|
||||||
String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
|
String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
|
||||||
|
|
||||||
for (int i = 0;i < tokens.length; i++)
|
for (int i = 0;i < tokens.length; i++)
|
||||||
{
|
{
|
||||||
String srcStr = tokens[i];
|
String srcStr = tokens[i];
|
||||||
|
|
||||||
Object srcObject = getObjectFor(srcStr);
|
Object srcObject = getObjectFor(srcStr);
|
||||||
srcObjects.add(srcObject);
|
srcObjects.add(srcObject);
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else if (srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
|
else if (srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
|
||||||
{
|
{
|
||||||
// Local File transfer
|
// Local File transfer
|
||||||
|
@ -438,11 +438,11 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
*/
|
*/
|
||||||
public SystemScratchpad getSystemScratchPad()
|
public SystemScratchpad getSystemScratchPad()
|
||||||
{
|
{
|
||||||
if (scratchpad == null)
|
if (scratchpad == null)
|
||||||
{
|
{
|
||||||
scratchpad = new SystemScratchpad();
|
scratchpad = new SystemScratchpad();
|
||||||
}
|
}
|
||||||
return scratchpad;
|
return scratchpad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
}
|
}
|
||||||
if (SystemPreferencesManager.getShowFilterPools())
|
if (SystemPreferencesManager.getShowFilterPools())
|
||||||
{
|
{
|
||||||
registry.fireEvent(new SystemResourceChangeEvent(registry, ISystemResourceChangeEvents.EVENT_REFRESH, registry));
|
registry.fireEvent(new SystemResourceChangeEvent(registry, ISystemResourceChangeEvents.EVENT_REFRESH, registry));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -513,8 +513,8 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
if ((factory!=null)&&factory.supportsFilters())
|
if ((factory!=null)&&factory.supportsFilters())
|
||||||
factory.setShowFilterStrings(show);
|
factory.setShowFilterStrings(show);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
/**
|
/**
|
||||||
* Reflect the user changing the preference for showing new connection prompt
|
* Reflect the user changing the preference for showing new connection prompt
|
||||||
|
@ -526,7 +526,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// RESOURCE EVENT METHODS...
|
// RESOURCE EVENT METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
/********************************************************************************
|
/********************************************************************************
|
||||||
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
||||||
* This program and the accompanying materials are made available under the terms
|
* This program and the accompanying materials are made available under the terms
|
||||||
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
* available at http://www.eclipse.org/legal/epl-v10.html
|
* available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Initial Contributors:
|
* Initial Contributors:
|
||||||
* The following IBM employees contributed to the Remote System Explorer
|
* The following IBM employees contributed to the Remote System Explorer
|
||||||
* component that contains this file: David McKnight, Kushal Munir,
|
* component that contains this file: David McKnight, Kushal Munir,
|
||||||
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
|
@ -31,16 +31,15 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry and control center for RSE UI related operations.
|
* Registry and control center for RSE UI related operations.
|
||||||
* <p>
|
*
|
||||||
* This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public interface ISystemRegistryUI extends ISystemShellProvider {
|
public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
|
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
// UI METHODS...
|
// UI METHODS...
|
||||||
// ----------------------------------
|
// ----------------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Show the RSE perspective if it is not already showing
|
* Show the RSE perspective if it is not already showing
|
||||||
*/
|
*/
|
||||||
|
@ -58,10 +57,10 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
*/
|
*/
|
||||||
public void expandSubSystem(ISubSystem subsystem);
|
public void expandSubSystem(ISubSystem subsystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the clipboard used for copy actions
|
* Returns the clipboard used for copy actions
|
||||||
*/
|
*/
|
||||||
public Clipboard getSystemClipboard();
|
public Clipboard getSystemClipboard();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of objects on the system clipboard
|
* Returns the list of objects on the system clipboard
|
||||||
|
@ -115,7 +114,7 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
public void setRunnableContext(Shell shell, IRunnableContext context);
|
public void setRunnableContext(Shell shell, IRunnableContext context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Clear the current active runnable context to be used for a progress monitor.
|
* Clear the current active runnable context to be used for a progress monitor.
|
||||||
* Be sure to call this from you dispose method.
|
* Be sure to call this from you dispose method.
|
||||||
*/
|
*/
|
||||||
public void clearRunnableContext();
|
public void clearRunnableContext();
|
||||||
|
@ -129,21 +128,21 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
|
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
// RESOURCE EVENT METHODS...
|
// RESOURCE EVENT METHODS...
|
||||||
// ----------------------------
|
// ----------------------------
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify all listeners of a change to a system resource such as a connection.
|
* Notify all listeners of a change to a system resource such as a connection.
|
||||||
* You would not normally call this as the methods in this class call it when appropriate.
|
* You would not normally call this as the methods in this class call it when appropriate.
|
||||||
* <p>
|
* <p>
|
||||||
* This version calls fireEvent at the next reasonable opportunity, leveraging SWT's
|
* This version calls fireEvent at the next reasonable opportunity, leveraging SWT's
|
||||||
* Display.asyncExec() method.
|
* Display.asyncExec() method.
|
||||||
*/
|
*/
|
||||||
public void postEvent(ISystemResourceChangeEvent event);
|
public void postEvent(ISystemResourceChangeEvent event);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notify a specific listener of a change to a system resource such as a connection.
|
* Notify a specific listener of a change to a system resource such as a connection.
|
||||||
* <p>
|
* <p>
|
||||||
* This version calls fireEvent at the next reasonable opportunity, leveraging SWT's
|
* This version calls fireEvent at the next reasonable opportunity, leveraging SWT's
|
||||||
* Display.asyncExec() method.
|
* Display.asyncExec() method.
|
||||||
*/
|
*/
|
||||||
public void postEvent(ISystemResourceChangeListener listener, ISystemResourceChangeEvent event);
|
public void postEvent(ISystemResourceChangeListener listener, ISystemResourceChangeEvent event);
|
||||||
|
|
|
@ -15,12 +15,10 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pagebook is a composite control where only a single control is visible
|
* A pagebook is a composite control where only a single control is visible at a
|
||||||
* at a time. It is similar to a notebook, but without tabs.
|
* time. It is similar to a notebook, but without tabs.
|
||||||
* <p>
|
*
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public class PageBook extends Composite {
|
public class PageBook extends Composite {
|
||||||
private StackLayout fLayout;
|
private StackLayout fLayout;
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
* Martin Oberhuber (Wind River) - fixed copyright headers and beautified
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
@ -17,18 +17,19 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the terminal view as seen by a terminal connection.
|
* Represents the terminal view as seen by a terminal connection.
|
||||||
*
|
|
||||||
* <p> Not to be implemented by clients.
|
|
||||||
* @author Michael Scharf
|
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
|
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
|
||||||
* part of a work in progress. There is no guarantee that this API will
|
* part of a work in progress. There is no guarantee that this API will work or
|
||||||
* work or that it will remain the same. Please do not use this API without
|
* that it will remain the same. Please do not use this API without consulting
|
||||||
* consulting with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
|
* with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a>
|
||||||
|
* team.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Michael Scharf
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalControl {
|
public interface ITerminalControl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the current state of the connection
|
* @return the current state of the connection
|
||||||
*/
|
*/
|
||||||
|
@ -38,7 +39,7 @@ public interface ITerminalControl {
|
||||||
* @param state
|
* @param state
|
||||||
*/
|
*/
|
||||||
void setState(TerminalState state);
|
void setState(TerminalState state);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A shell to show dialogs.
|
* A shell to show dialogs.
|
||||||
* @return the shell in which the terminal is shown.
|
* @return the shell in which the terminal is shown.
|
||||||
|
@ -48,7 +49,7 @@ public interface ITerminalControl {
|
||||||
/**
|
/**
|
||||||
* Show a text in the terminal. If puts newlines at the beginning and the end.
|
* Show a text in the terminal. If puts newlines at the beginning and the end.
|
||||||
* @param text
|
* @param text
|
||||||
* TODO: Michael Scharf: Is this really needed?
|
* TODO: Michael Scharf: Is this really needed?
|
||||||
*/
|
*/
|
||||||
void displayTextInTerminal(String text);
|
void displayTextInTerminal(String text);
|
||||||
|
|
||||||
|
@ -71,5 +72,5 @@ public interface ITerminalControl {
|
||||||
* TODO: Michael Scharf: Should be replaced by a better error notification mechanism!
|
* TODO: Michael Scharf: Should be replaced by a better error notification mechanism!
|
||||||
*/
|
*/
|
||||||
void setMsg(String msg);
|
void setMsg(String msg);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,24 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.terminal.model;
|
package org.eclipse.tm.terminal.model;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A writable matrix of characters and {@link Style}. This is intended to be the
|
* A writable matrix of characters and {@link Style}. This is intended to be
|
||||||
* low level representation of the text of a Terminal. Higher layers are responsible
|
* the low level representation of the text of a Terminal. Higher layers are
|
||||||
* to fill the text and styles into this representation.
|
* responsible to fill the text and styles into this representation.
|
||||||
*
|
* <p>
|
||||||
* <p><b>Note: </b> Implementations of this interface has to be thread safe.
|
* <b>Note: </b> Implementations of this interface has to be thread safe.
|
||||||
* <p><b>Note: </b> This interface is not intended to be implemented by clients.
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
|
|
||||||
|
@ -61,30 +62,30 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* @param style the style or null
|
* @param style the style or null
|
||||||
*/
|
*/
|
||||||
void setChars(int line, int column, char[] chars, int start, int len, Style style);
|
void setChars(int line, int column, char[] chars, int start, int len, Style style);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cleans the entire line.
|
* Cleans the entire line.
|
||||||
* @param line
|
* @param line
|
||||||
*/
|
*/
|
||||||
void cleanLine(int line);
|
void cleanLine(int line);
|
||||||
// /**
|
// /**
|
||||||
// * @param line
|
// * @param line
|
||||||
// * @return true if this line belongs to the previous line but is simply
|
// * @return true if this line belongs to the previous line but is simply
|
||||||
// * wrapped.
|
// * wrapped.
|
||||||
// */
|
// */
|
||||||
// boolean isWrappedLine(int line);
|
// boolean isWrappedLine(int line);
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Makes this line an extension to the previous line. Wrapped lines get folded back
|
// * Makes this line an extension to the previous line. Wrapped lines get folded back
|
||||||
// * when the width of the terminal changes
|
// * when the width of the terminal changes
|
||||||
// * @param line
|
// * @param line
|
||||||
// * @param extendsPreviousLine
|
// * @param extendsPreviousLine
|
||||||
// */
|
// */
|
||||||
// void setWrappedLine(int line, boolean extendsPreviousLine);
|
// void setWrappedLine(int line, boolean extendsPreviousLine);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars
|
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars
|
||||||
* and <code>null</code> {@link Style}
|
* and <code>null</code> {@link Style}
|
||||||
* <p>To illustrate shift, here is some sample data:
|
* <p>To illustrate shift, here is some sample data:
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -100,7 +101,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* 0 aaaa
|
* 0 aaaa
|
||||||
* 1 cccc
|
* 1 cccc
|
||||||
* 2 dddd
|
* 2 dddd
|
||||||
* 3
|
* 3
|
||||||
* 4 eeee
|
* 4 eeee
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -108,7 +109,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* Shift a region of 3 lines <b>down</b> by one line <code>shift(1,3,1)</code>
|
* Shift a region of 3 lines <b>down</b> by one line <code>shift(1,3,1)</code>
|
||||||
* <pre>
|
* <pre>
|
||||||
* 0 aaaa
|
* 0 aaaa
|
||||||
* 1
|
* 1
|
||||||
* 2 bbbb
|
* 2 bbbb
|
||||||
* 3 cccc
|
* 3 cccc
|
||||||
* 4 eeee
|
* 4 eeee
|
||||||
|
@ -119,7 +120,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* Negative number means scroll down, positive scroll up (see example above).
|
* Negative number means scroll down, positive scroll up (see example above).
|
||||||
*/
|
*/
|
||||||
void scroll(int startLine, int size, int shift);
|
void scroll(int startLine, int size, int shift);
|
||||||
|
|
||||||
/**Adds a new line to the terminal. If maxHeigth is reached, the entire terminal
|
/**Adds a new line to the terminal. If maxHeigth is reached, the entire terminal
|
||||||
* will be scrolled. Else a line will be added.
|
* will be scrolled. Else a line will be added.
|
||||||
*/
|
*/
|
||||||
|
@ -145,7 +146,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* @param length
|
* @param length
|
||||||
*/
|
*/
|
||||||
void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length);
|
void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length);
|
||||||
|
|
||||||
void setCursorLine(int line);
|
void setCursorLine(int line);
|
||||||
void setCursorColumn(int column);
|
void setCursorColumn(int column);
|
||||||
}
|
}
|
|
@ -1,11 +1,11 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
* http://www.eclipse.org/legal/epl-v10.html
|
* http://www.eclipse.org/legal/epl-v10.html
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Michael Scharf (Wind River) - initial API and implementation
|
* Michael Scharf (Wind River) - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.terminal.model;
|
package org.eclipse.tm.terminal.model;
|
||||||
|
@ -13,62 +13,73 @@ package org.eclipse.tm.terminal.model;
|
||||||
/**
|
/**
|
||||||
* This class maintains a snapshot of an instance of {@link ITerminalTextData}.
|
* This class maintains a snapshot of an instance of {@link ITerminalTextData}.
|
||||||
* While the {@link ITerminalTextData} continues changing, the snapshot remains
|
* While the {@link ITerminalTextData} continues changing, the snapshot remains
|
||||||
* unchanged until the next snapshot is taken by calling {@link #updateSnapshot(boolean)}.
|
* unchanged until the next snapshot is taken by calling
|
||||||
* This is important, because the {@link ITerminalTextData} might get
|
* {@link #updateSnapshot(boolean)}. This is important, because the
|
||||||
* modified by another thread. Suppose you would want to draw the content of
|
* {@link ITerminalTextData} might get modified by another thread. Suppose you
|
||||||
* the {@link ITerminalTextData} using the following loop:
|
* would want to draw the content of the {@link ITerminalTextData} using the
|
||||||
|
* following loop:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* for(int line=0;line<term.getHeight();line++)
|
* for (int line = 0; line < term.getHeight(); line++)
|
||||||
* for(int column=0; column<term.getWidth();column++)
|
* for (int column = 0; column < term.getWidth(); column++)
|
||||||
* drawCharacter(column,line,term.getChar(column,line),term.getStyle(column,line));
|
* drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line));
|
||||||
* </pre>
|
* </pre>
|
||||||
* This might fail because the background thread could change the dimensions of the
|
*
|
||||||
* {@link ITerminalTextData} while you iterate the loop. One solution would be to
|
* This might fail because the background thread could change the dimensions of
|
||||||
* put a <code>synchronized(term){}</code> statement around the code. This has
|
* the {@link ITerminalTextData} while you iterate the loop. One solution would
|
||||||
* two problems: 1. you would have to know about the internals of the synchronisation
|
* be to put a <code>synchronized(term){}</code> statement around the code.
|
||||||
* of {@link ITerminalTextData}. 2. The other thread that changes {@link ITerminalTextData}
|
* This has two problems: 1. you would have to know about the internals of the
|
||||||
* is blocked while the potentially slow drawing is done.
|
* synchronisation of {@link ITerminalTextData}. 2. The other thread that
|
||||||
|
* changes {@link ITerminalTextData} is blocked while the potentially slow
|
||||||
|
* drawing is done.
|
||||||
* <p>
|
* <p>
|
||||||
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to draw
|
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to
|
||||||
* the content. There is no danger that the data structure get changed while
|
* draw the content. There is no danger that the data structure get changed
|
||||||
* you draw. There are also methods to find out what has changed to minimize
|
* while you draw. There are also methods to find out what has changed to
|
||||||
* the number of lines that get redrawn.</p>
|
* minimize the number of lines that get redrawn.
|
||||||
*
|
|
||||||
* <p><b>Drawing optimization</b>: To optimize redrawing of changed lines, this class keeps
|
|
||||||
* track of lines that have changed since the previous snapshot.</p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* // iterate over the potentially changed lines
|
|
||||||
* for(int line=snap.getFirstChangedLine();line<=snap.getLastChangedLine();line++)
|
|
||||||
* // redraw only if the line has changed
|
|
||||||
* if(snap.hasLineChanged(line))
|
|
||||||
* for(int column=0; column<snap.getWidth();column++)
|
|
||||||
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* <p><b>Scroll optimization:</b> Often new lines are appended at the bottom of the
|
|
||||||
* terminal and the rest of the lines are scrolled up. In this case all lines would be
|
|
||||||
* marked as changed. To optimize for this
|
|
||||||
* case, {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
|
|
||||||
* the <code>detectScrolling</code> parameter. The object will keep track of scrolling.
|
|
||||||
* The UI must <b>first</b> handle the scrolling and then use the {@link #hasLineChanged(int)}
|
|
||||||
* method to determine scrolling:
|
|
||||||
* <pre>
|
|
||||||
* // scroll the visible region of the UI <b>before</b> drawing the changed lines.
|
|
||||||
* doUIScrolling(snap.getScrollChangeY(),snap.getScrollChangeN(),snap.getScrollChangeShift());
|
|
||||||
* // iterate over the potentially changed lines
|
|
||||||
* for(int line=snap.getFirstChangedLine();line<=snap.getFirstChangedLine();line++)
|
|
||||||
* // redraw only if the line has changed
|
|
||||||
* if(snap.hasLineChanged(line))
|
|
||||||
* for(int column=0; column<snap.getWidth();column++)
|
|
||||||
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
|
|
||||||
* </pre>
|
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p><b>Note</b>: This interface is not intended to be implemented by clients.</p>
|
* <p>
|
||||||
* <p><b>Threading Note</b>: This class is not thread save! All methods have to be called by
|
* <b>Drawing optimization</b>: To optimize redrawing of changed lines, this
|
||||||
* the a same thread, that created the instance by calling
|
* class keeps track of lines that have changed since the previous snapshot.
|
||||||
* {@link ITerminalTextDataReadOnly#makeSnapshot()}. </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* // iterate over the potentially changed lines
|
||||||
|
* for (int line = snap.getFirstChangedLine(); line <= snap.getLastChangedLine(); line++)
|
||||||
|
* // redraw only if the line has changed
|
||||||
|
* if (snap.hasLineChanged(line))
|
||||||
|
* for (int column = 0; column < snap.getWidth(); column++)
|
||||||
|
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* <b>Scroll optimization:</b> Often new lines are appended at the bottom of
|
||||||
|
* the terminal and the rest of the lines are scrolled up. In this case all
|
||||||
|
* lines would be marked as changed. To optimize for this case,
|
||||||
|
* {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
|
||||||
|
* the <code>detectScrolling</code> parameter. The object will keep track of
|
||||||
|
* scrolling. The UI must <b>first</b> handle the scrolling and then use the
|
||||||
|
* {@link #hasLineChanged(int)} method to determine scrolling:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* // scroll the visible region of the UI <b>before</b> drawing the changed lines.
|
||||||
|
* doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift());
|
||||||
|
* // iterate over the potentially changed lines
|
||||||
|
* for (int line = snap.getFirstChangedLine(); line <= snap.getFirstChangedLine(); line++)
|
||||||
|
* // redraw only if the line has changed
|
||||||
|
* if (snap.hasLineChanged(line))
|
||||||
|
* for (int column = 0; column < snap.getWidth(); column++)
|
||||||
|
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
|
||||||
|
* </pre>
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* <b>Threading Note</b>: This class is not thread safe! All methods have to be
|
||||||
|
* called by the a same thread, that created the instance by calling
|
||||||
|
* {@link ITerminalTextDataReadOnly#makeSnapshot()}.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
/**
|
/**
|
||||||
|
@ -79,7 +90,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
* is called and a new snapshot needs to be updated again.
|
* is called and a new snapshot needs to be updated again.
|
||||||
* <p>
|
* <p>
|
||||||
* A typical terminal view would not update the snapshot immediately
|
* A typical terminal view would not update the snapshot immediately
|
||||||
* after the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} has been called. It would introduce a
|
* after the {@link #snapshotOutOfDate(ITerminalTextDataSnapshot)} has been called. It would introduce a
|
||||||
* delay to update the UI (and the snapshot} 10 or 20 times per second.
|
* delay to update the UI (and the snapshot} 10 or 20 times per second.
|
||||||
*
|
*
|
||||||
* <p>Make sure you don't spend too much time in this method.
|
* <p>Make sure you don't spend too much time in this method.
|
||||||
|
@ -94,7 +105,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
}
|
}
|
||||||
void addListener(SnapshotOutOfDateListener listener);
|
void addListener(SnapshotOutOfDateListener listener);
|
||||||
void removeListener(SnapshotOutOfDateListener listener);
|
void removeListener(SnapshotOutOfDateListener listener);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ends the listening to the {@link ITerminalTextData}. After this
|
* Ends the listening to the {@link ITerminalTextData}. After this
|
||||||
* has been called no new snapshot data is collected.
|
* has been called no new snapshot data is collected.
|
||||||
|
@ -115,11 +126,11 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
void setInterestWindow(int startLine, int size);
|
void setInterestWindow(int startLine, int size);
|
||||||
int getInterestWindowStartLine();
|
int getInterestWindowStartLine();
|
||||||
int getInterestWindowSize();
|
int getInterestWindowSize();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new snapshot of the {@link ITerminalTextData}. It will efficiently
|
* Create a new snapshot of the {@link ITerminalTextData}. It will efficiently
|
||||||
* copy the data of the {@link ITerminalTextData} into an internal representation.
|
* copy the data of the {@link ITerminalTextData} into an internal representation.
|
||||||
* The snapshot also keeps track of the changes since the previous snapshot.
|
* The snapshot also keeps track of the changes since the previous snapshot.
|
||||||
* <p>With the methods {@link #getFirstChangedLine()}, {@link #getLastChangedLine()} and
|
* <p>With the methods {@link #getFirstChangedLine()}, {@link #getLastChangedLine()} and
|
||||||
* {@link #hasLineChanged(int)}
|
* {@link #hasLineChanged(int)}
|
||||||
* you can find out what has changed in the current snapshot since the previous snapshot.
|
* you can find out what has changed in the current snapshot since the previous snapshot.
|
||||||
|
@ -134,9 +145,9 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The first line changed in this snapshot compared
|
* @return The first line changed in this snapshot compared
|
||||||
* to the previous snapshot.
|
* to the previous snapshot.
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> If no line has changed, this
|
* <p><b>Note:</b> If no line has changed, this
|
||||||
* returns {@link Integer#MAX_VALUE}
|
* returns {@link Integer#MAX_VALUE}
|
||||||
*
|
*
|
||||||
* <p><b>Note:</b> if {@link #updateSnapshot(boolean)} has been called with <code>true</code>,
|
* <p><b>Note:</b> if {@link #updateSnapshot(boolean)} has been called with <code>true</code>,
|
||||||
|
@ -171,11 +182,11 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
* @return true if the line has changed since the previous snapshot
|
* @return true if the line has changed since the previous snapshot
|
||||||
*/
|
*/
|
||||||
boolean hasLineChanged(int line);
|
boolean hasLineChanged(int line);
|
||||||
|
|
||||||
boolean hasDimensionsChanged();
|
boolean hasDimensionsChanged();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if the terminal has changed (and not just the
|
* @return true if the terminal has changed (and not just the
|
||||||
* window of interest)
|
* window of interest)
|
||||||
*/
|
*/
|
||||||
boolean hasTerminalChanged();
|
boolean hasTerminalChanged();
|
||||||
|
@ -203,7 +214,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
* to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)}
|
* to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)}
|
||||||
*/
|
*/
|
||||||
int getScrollWindowShift();
|
int getScrollWindowShift();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The {@link ITerminalTextData} on that this instance is observing.
|
* @return The {@link ITerminalTextData} on that this instance is observing.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue