1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-28 19:35:36 +02:00

[cleanup] Add @noimplement and similar API Tools Javadoc Markup

This commit is contained in:
Martin Oberhuber 2008-03-28 14:27:50 +00:00
parent ee32242b1a
commit 14af215d50
25 changed files with 1349 additions and 1320 deletions

View file

@ -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
* manipulating model objects in the RSE framework.
*
* This interface is not intended to be implemented by clients.
* Interface for RSE core registry. Clients should use this interface as the
* starting point for querying and manipulating model objects in the RSE
* framework.
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IRSECoreRegistry {
@ -45,7 +46,7 @@ public interface IRSECoreRegistry {
* @deprecated Use {@link #getSystemTypeById(String)}.
*/
public IRSESystemType getSystemType(String name);
/**
* Returns a system type object given by the id.
*

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -29,10 +29,11 @@ import org.osgi.framework.Bundle;
* Interface for a system type. Constants are defined for various system types.
* These constants are kept in sync with definitions in plugin.xml.
* <p>
* This interface is not intended to be implemented by clients. System type
* implementations must subclass {@link AbstractRSESystemType} rather than
* implementing this interface directly.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* System type implementations must subclass
* {@link AbstractRSESystemType} rather than implementing this
* interface directly.
* </p>
*/
public interface IRSESystemType extends IAdaptable {
@ -41,7 +42,7 @@ public interface IRSESystemType extends IAdaptable {
* @deprecated Use {@link #SYSTEMTYPE_LINUX_ID}.
*/
public static final String SYSTEMTYPE_LINUX = "Linux"; //$NON-NLS-1$
/**
* Linux system type, "org.eclipse.rse.systemtype.linux".
*/
@ -52,7 +53,7 @@ public interface IRSESystemType extends IAdaptable {
* @deprecated Use {@link #SYSTEMTYPE_POWER_LINUX_ID}.
*/
public static final String SYSTEMTYPE_POWER_LINUX = "Power Linux"; //$NON-NLS-1$
/**
* 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".
*/
public static final String SYSTEMTYPE_ZSERIES_LINUX_ID = "org.eclipse.rse.systemtype.linux.zSeries"; //$NON-NLS-1$
/**
* Unix system type, "Unix".
* @deprecated Use {@link #SYSTEMTYPE_UNIX_ID}.
@ -79,7 +80,7 @@ public interface IRSESystemType extends IAdaptable {
* Unix system type, "org.eclipse.rse.systemtype.unix".
*/
public static final String SYSTEMTYPE_UNIX_ID = "org.eclipse.rse.systemtype.unix"; //$NON-NLS-1$
/**
* AIX system type, "AIX".
* @deprecated Use {@link #SYSTEMTYPE_AIX_ID}.
@ -90,7 +91,7 @@ public interface IRSESystemType extends IAdaptable {
* AIX system type, "org.eclipse.rse.systemtype.aix".
*/
public static final String SYSTEMTYPE_AIX_ID = "org.eclipse.rse.systemtype.aix"; //$NON-NLS-1$
/**
* PASE system type, "PASE".
* @deprecated Use {@link #SYSTEMTYPE_PASE_ID}.
@ -101,7 +102,7 @@ public interface IRSESystemType extends IAdaptable {
* PASE system type, "org.eclipse.rse.systemtype.PASE".
*/
public static final String SYSTEMTYPE_PASE_ID = "org.eclipse.rse.systemtype.iseries.PASE"; //$NON-NLS-1$
/**
* iSeries system type, "iSeries".
* @deprecated Use {@link #SYSTEMTYPE_ISERIES_ID}.
@ -112,7 +113,7 @@ public interface IRSESystemType extends IAdaptable {
* iSeries system type, "org.eclipse.rse.systemtype.iseries".
*/
public static final String SYSTEMTYPE_ISERIES_ID = "org.eclipse.rse.systemtype.iseries"; //$NON-NLS-1$
/**
* Local system type, "Local".
* @deprecated Use {@link #SYSTEMTYPE_LOCAL_ID}.
@ -123,7 +124,7 @@ public interface IRSESystemType extends IAdaptable {
* Local system type, "org.eclipse.rse.systemtype.local".
*/
public static final String SYSTEMTYPE_LOCAL_ID = "org.eclipse.rse.systemtype.local"; //$NON-NLS-1$
/**
* z/OS system type, "z/OS".
* @deprecated Use {@link #SYSTEMTYPE_ZSERIES_ID}.
@ -134,7 +135,7 @@ public interface IRSESystemType extends IAdaptable {
* z/OS system type, "org.eclipse.rse.systemtype.zseries".
*/
public static final String SYSTEMTYPE_ZSERIES_ID = "org.eclipse.rse.systemtype.zseries"; //$NON-NLS-1$
/**
* Windows system type, "Windows".
* @deprecated Use {@link #SYSTEMTYPE_WINDOWS_ID}.
@ -143,7 +144,7 @@ public interface IRSESystemType extends IAdaptable {
/** Windows system type, "org.eclipse.rse.systemtype.windows". */
public static final String SYSTEMTYPE_WINDOWS_ID = "org.eclipse.rse.systemtype.windows"; //$NON-NLS-1$
/** Discovery system type, "org.eclipse.rse.systemtype.discovery". */
public static final String SYSTEMTYPE_DISCOVERY_ID = "org.eclipse.rse.systemtype.discovery"; //$NON-NLS-1$
/** 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$
/** Telnet Only system type, "org.eclipse.rse.systemtype.telnet". */
public static final String SYSTEMTYPE_TELNET_ONLY_ID = "org.eclipse.rse.systemtype.telnet"; //$NON-NLS-1$
/**
* System type Property Key (value: "isLocal") indicating whether
/**
* System type Property Key (value: "isLocal") indicating whether
* a system type is declared in plugin.xml to refers to the local
* system.
* On a the local system, the following properties are expected:
@ -165,13 +166,13 @@ public interface IRSESystemType extends IAdaptable {
* @see #testProperty(String, boolean)
*/
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
* system.
* <p>
* This is an "aggregate" property consisting of several smaller
* <p>
* This is an "aggregate" property consisting of several smaller
* properties like isCaseSensitive. In the future, we'll want more
* fine granular properties to check against. On a Windows system,
* the following properties are expected:
@ -187,14 +188,14 @@ public interface IRSESystemType extends IAdaptable {
* @see #testProperty(String, boolean)
*/
public static final String PROPERTY_IS_WINDOWS = "isWindows"; //$NON-NLS-1$
/**
* System type Property Key (value: "isCaseSensitive") indicating
* whether a given system type is in general case sensitive.
* @see #testProperty(String, boolean)
*/
public static final String PROPERTY_IS_CASE_SENSITIVE = "isCaseSensitive"; //$NON-NLS-1$
/**
* Returns the id of the system type.
* @return the id of the system type
@ -203,11 +204,11 @@ public interface IRSESystemType extends IAdaptable {
/**
* Returns the translatable label for use in the UI.
*
*
* @return The UI label or <code>null</code> if not set.
*/
public String getLabel();
/**
* Returns 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
*/
public String getProperty(String key);
/**
* Tests whether the given boolean property matches the expected value
* for this system type.
@ -238,7 +239,7 @@ public interface IRSESystemType extends IAdaptable {
* Clients can use their own properties with system types, but should
* use reverse DNS notation to qualify their property keys (e.g.
* <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 expectedValue the expected boolean value of the property.
@ -247,7 +248,7 @@ public interface IRSESystemType extends IAdaptable {
* is not set or does not match.
*/
public boolean testProperty(String key, boolean expectedValue);
/**
* 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)
* can override this method to provide more advanced enabled checks e.g. based on
* license availability.
*
*
* @return <code>true</code> if the system type is currently enabled, or <code>false</code> otherwise.
*/
public boolean isEnabled();
@ -267,11 +268,11 @@ public interface IRSESystemType extends IAdaptable {
/**
* Tests whether the system type refers to the local system.
* This is a shortcut for
* <pre>
* getId().equals(SYSTEMTYPE_LOCAL_ID) ||
* <pre>
* getId().equals(SYSTEMTYPE_LOCAL_ID) ||
* || testProperty(PROPERTY_IS_LOCAL, true)
* </pre>
* See {@link #PROPERTY_IS_LOCAL} for properties expected on
* See {@link #PROPERTY_IS_LOCAL} for properties expected on
* a Local system.
* Extenders (contributors of custom system types) may override.
* @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.
* This is a shortcut for
* <pre>
* <pre>
* getId().equals(SYSTEMTYPE_WINDOWS_ID)
* || isLocal() && System.getProperty("os.name").toLowerCase().startsWith("win")
* || testProperty(PROPERTY_IS_WINDOWS, true)
* </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
* 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.
* Extenders (contributors of custom system types) may override.
* @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.
* 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.
*
* @return the bundle which defines this system type or <code>null</code> if none
*/
public Bundle getDefiningBundle();
/**
* 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>
* extension point.
* <p>
@ -316,9 +317,9 @@ public interface IRSESystemType extends IAdaptable {
*
* @return The list of subsystem configuration id's. May be empty,
* but never <code>null</code>.
*/
*/
public String[] getSubsystemConfigurationIds();
/**
* Creates a new <code>IHost</code> object instance. This method is
* 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.
* @return A new <code>IHost</code> object instance.
*/
public IHost createNewHostInstance(ISystemProfile profile);
public IHost createNewHostInstance(ISystemProfile profile);
}

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -22,14 +22,14 @@ import org.eclipse.rse.core.IRSESystemType;
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>
* 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.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemHostPool extends IRSEPersistableContainer {
@ -62,48 +62,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
*/
public IHost[] getHosts();
/**
* Create a connection object, given only the minimal information.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @return IHost object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
/**
* Create a connection object, given only the minimal information.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @return IHost object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
/**
* Create a connection object, given all the possible attributes except default userId.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
/**
* Create a connection object, given all the possible attributes except default userId.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
/**
* Create a connection object, given all the possible attributes.
* <p>
* The new connection is added to the list and saved to disk.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique.
* @see IRSEUserIdConstants
*/
/**
* Create a connection object, given all the possible attributes.
* <p>
* The new connection is added to the list and saved to disk.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique.
* @see IRSEUserIdConstants
*/
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
* defined via the systemType extension point.
* @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 defaultUserId userId to use as the default for the subsystems.
* @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);
/**
* Return a connection object, given its alias name.
*
* Can be used to test if an alias name is already used (non-null return).
*
* @param aliasName unique aliasName (case insensitive) to search on.
* @return IHost object with unique aliasName, or null if
* no connection object with this name exists.
*/
/**
* Return a connection object, given its alias name.
*
* Can be used to test if an alias name is already used (non-null return).
*
* @param aliasName unique aliasName (case insensitive) to search on.
* @return IHost object with unique aliasName, or null if
* no connection object with this name exists.
*/
public IHost getHost(String aliasName);
/**
* Return the connection at the given zero-based offset.
* @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);
/**
* Add a new connection to the list.
* <p>
* This method will not ensure that the added connection's alias name is
* different (case-insensitive) than all other existing alias names.
* This method will not ensure that the added connection's alias name is
* different (case-insensitive) than all other existing alias names.
* Clients are responsible for maintaining this invariant.
* </p>
* @param conn Connection to add. Must not be <code>null</code>.
@ -163,7 +163,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
* <ul>
* <li>Delete the connection in memory
* <li>Delete the underlying folder
* </ul>
* </ul>
* <p>
* @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.
* 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>
* <ul>
* <li>After the move, the pool containing the moved connection is saved to disk.

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -52,29 +52,27 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.core.RSECoreRegistry;
/**
* Registry or front door for all remote system connections.
* There is a singleton of the class implementation of this interface.
* To get it, call the {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
* Registry or front door for all remote system connections. There is a
* singleton of the class implementation of this interface. To get it, call the
* {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
* <p>
* The idea here is that connections are grouped by system profile. At any
* time, there is a user-specified number of profiles "active" and connections
* from each active profile are worked with.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* The idea here is that connections are grouped by system profile. At any time,
* there is a user-specified number of profiles "active" and connections from
* each active profile are worked with.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
/**
* Get the SystemFilterStartHere singleton instance.
* Get the SystemFilterStartHere singleton instance.
* @return the SystemFilterStartHere singleton instance.
*/
public ISystemFilterStartHere getSystemFilterStartHere();
// ----------------------------
// SUBSYSTEM FACTORY METHODS...
// ----------------------------
// ----------------------------
/**
* 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
*/
public ISubSystemConfiguration[] getSubSystemConfigurationsBySystemType(IRSESystemType systemType, boolean filterDuplicates, boolean activate);
// ----------------------------------
// 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
* 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.
*/
public boolean hasConnectionChildren(IHost selectedConnection);
// ----------------------------
// PROFILE METHODS...
// ----------------------------
@ -175,7 +173,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
* @param profile Source profile to copy
* @param newName Unique name to give copied profile
* @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
*/
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;
/**
* Make or unmake the given profile active.
* Make or unmake the given profile active.
* The default private profile cannot be deactivated and such
* 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.
* @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);
@ -242,7 +240,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
* @return list of matching subsystems
*/
public ISubSystem[] getSubsystems(IHost host, Class subsystemInterface);
/**
* Get those subsystems that are registered against a given connection,
* which are service subsystems with the given serviceType.
@ -277,11 +275,11 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
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.
* <p>
* 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
* @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.
*
* 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
* until we find one, and return it. <br>
* 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>
* This looks for a match on the "category" of the subsystem
* 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.
*
* @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.
*/
public IHost[] getHostsBySystemType(IRSESystemType systemType);
/**
* 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);
/**
* 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.
*/
public IHost getHost(ISystemProfile profile, String connectionName);
@ -381,7 +379,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
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.
*/
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);
/**
* 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.
* The profile is then scheduled to be persisted.
* <p>
@ -496,8 +494,8 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
* because the connectionName is not unique. Call getLastException() if necessary.
*/
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
* in the specified profile.
* <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;
/**
* Update an existing host given the new information.
* This method:
* <ul>
* <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>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.
* We must do this because a host name changes fundamentally affects the connection,
* rendering any information currently displayed under
* that host obsolete.
* </ul>
* <p>
* @param host the host to be updated
* Update an existing host given the new information.
* This method:
* <ul>
* <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>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.
* We must do this because a host name changes fundamentally affects the connection,
* rendering any information currently displayed under
* that host obsolete.
* </ul>
* <p>
* @param host the host to be updated
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the host. Can be null.
* @param defaultUserId userId to use as the default for the subsystems under this host.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
String hostName, String description,
String defaultUserId, int defaultUserIdLocation);
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the host. Can be null.
* @param defaultUserId userId to use as the default for the subsystems under this host.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
String hostName, String description,
String defaultUserId, int defaultUserIdLocation);
/**
* Creates subsystems for a given host and subsystem configurations.
* @param host the host.
@ -562,7 +560,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
public void setHostOffline(IHost conn, boolean offline);
/**
* Delete an existing connection.
* Delete an existing connection.
* <p>
* Lots to do here:
* <ul>
@ -575,7 +573,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
public void deleteHost(IHost conn);
/**
* Renames an existing connection.
* Renames an existing connection.
* <p>
* Lots to do here:
* <ul>
@ -589,7 +587,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
/**
* 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>
* <ul>
* <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.
* @param conn The connection to move
* @param targetProfile What profile to move into
* @param newName Unique name to give copied profile. Typically this is the same as the original name, but
* @param newName Unique name to give copied profile. Typically this is the same as the original name, but
* will be different on name collisions
* @param monitor Progress monitor to reflect each step of the operation
* @return new SystemConnection object
@ -666,7 +664,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
// ----------------------------
// RESOURCE EVENT METHODS...
// ----------------------------
// ----------------------------
/**
* 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...
// ----------------------------
// ----------------------------
/**
* 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...
// --------------------------------
// --------------------------------
/**
* 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.
*/
public void fireEvent(ISystemRemoteChangeEvent event);
/**
* 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.
* @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 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.
* @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 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 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.
* @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.
*/
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...
// ----------------------------
// ----------------------------
/**
* 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);
/**
* 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);
@ -825,14 +823,17 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
/**
* 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);
/**
* Marks all filters for this subsystem the contain resourceParent as stale to prevent caching
* @param resourceParent
* @param subsystem
* Marks all filters for this subsystem that contain resourceParent as stale
* to prevent caching
*
* @param resourceParent a remote resource object
* @param subsystem the subsystem to work on
*/
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);
@ -844,10 +845,10 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
// ----------------------------
// SAVE / RESTORE METHODS...
// ----------------------------
// ----------------------------
/**
* Save everything!
* Save everything!
*/
public boolean save();

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -36,11 +36,10 @@ import org.eclipse.rse.services.IService;
/**
* Subsystem Configuration interface.
*
* <p>
* This interface is not intended to be implemented by clients. Subsystem
* configuration implementations must subclass SubSystemConfiguration
* rather than implementing this interface directly.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* Subsystem configuration implementations must subclass
* SubSystemConfiguration rather than implementing this interface
* directly.
*/
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.
*/
public void reset();
/**
* Retrieves all the filter pool managers for all the profiles, active or not.
* This allows cross references from
@ -146,7 +145,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
*/
public boolean supportsQuickFilters();
/**
/**
* Return true if filters of this subsystem factory support dropping into.
*/
public boolean supportsDropInFilters();
@ -155,7 +154,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
* Return true if deferred queries are supported.
*
* 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
* take time to complete, but a negative side-effect of this
* 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
* that deferred queries are supported for filters, and delegates
* the check for model elements to the ISystemViewElementAdapter.
*
*
* @return <code>true</code> if deferred queries are supported.
*/
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
* 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.
*
* By default this returns false.
@ -190,7 +189,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
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.
*/
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
* 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
* properties.
* Launch Setting property page, with a pluggable composite, where users can configure these
* properties.
* <br> By default we return false here. This is overridden in UniversalFileSubSystemConfiguration though.
*/
public boolean supportsServerLaunchProperties(IHost host);
@ -213,7 +212,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
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.
*/
public boolean isCaseSensitive();
@ -328,12 +327,12 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
* (and their folders).
* </p><p>
* Must be called AFTER changing the profile's name!!
* </p>
* </p>
* @param oldProfileName the old profile name.
* @param newProfileName the new profile name.
*/
public void renameSubSystemProfile(String oldProfileName, String newProfileName);
// ---------------------------------
// SUBSYSTEM METHODS...
@ -341,7 +340,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
/**
* 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.
* @param subsystem the subsystem to be updated
* @param oldProfileName the old profile name
@ -350,7 +349,7 @@ public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvide
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.
*/
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)}.
* @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
* 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.
*/
public IConnectorService getConnectorService(IHost host);
/**
* Sets the connector service for a particular host.
* This is usually mangaged by a connector service manager known
* Sets the connector service for a particular host.
* This is usually mangaged by a connector service manager known
* to this configuration.
* This must be implemented by service subsystem configurations.
* 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)}
* returns true, this method is called to create the server launcher instance
* 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.
*/
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.
* Get the filter pool manager for the given profile.
* @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 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
* done during initial subsystem creation, not during subsystem restore.
* @return a filter pool manager
*/
public ISystemFilterPoolManager getFilterPoolManager(ISystemProfile profile, boolean force);
/**
* A subsystem configuration has a filter pool manager for each profile.
* Get the filter pool manager for the given profile.
* Do not force the creation of default filter pools.
* 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
*/
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>
* @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
*/
java.util.List getSubSystemList();
/**
* <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
*/
java.util.List getFilterPoolManagerList();

View file

@ -7,8 +7,8 @@
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -39,8 +39,7 @@ import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
import org.eclipse.rse.logging.Logger;
/**
* A filter pool manager manages filter pools.
* It is used to
* A filter pool manager manages filter pools. It is used to
* <ul>
* <li>Get a list of existing filter pools
* <li>Create filter pools
@ -49,11 +48,11 @@ import org.eclipse.rse.logging.Logger;
* <li>Rename filter pools
* </ul>
* <p>
* The filter pool manager ensures that
* changes to filters and pools are
* The filter pool manager ensures that changes to filters and pools are
* committed and events are fired properly.
* <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 {
private ISystemFilterPoolManagerProvider caller = null;
@ -122,7 +121,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
protected List pools = new ArrayList(3);
// protected List pools = null;
// protected List pools = null;
/**
* 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,
* the name is not used.
* @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.
*/
public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger,
public static ISystemFilterPoolManager createSystemFilterPoolManager(ISystemProfile profile, Logger logger,
ISystemFilterPoolManagerProvider caller, String name, boolean allowNestedFilters) {
SystemFilterPoolManager mgr = new SystemFilterPoolManager(profile);
mgr.initialize(logger, caller, name, allowNestedFilters);
@ -166,7 +165,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
if (!initialized) {
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 attribute indicating if filters managed by this manager support nested duplicate filter strings.
* 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.
* 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.
*/
public void setSupportsDuplicateFilterStrings(boolean newSupportsDuplicateFilterStrings) {
// as generated by emf...
// as generated by emf...
setSupportsDuplicateFilterStringsGen(newSupportsDuplicateFilterStrings);
// 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.
* 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.
*/
public void setStringsCaseSensitive(boolean newStringsCaseSensitive) {
// as generated by emf...
setStringsCaseSensitiveGen(newStringsCaseSensitive);
// our special code...
// our special code...
ISystemFilterPool[] pools = getSystemFilterPools();
for (int idx = 0; idx < pools.length; idx++) {
pools[idx].setStringsCaseSensitive(newStringsCaseSensitive);
@ -330,17 +329,17 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
pools.toArray(result);
return result;
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
// List pools = getPools();
// poolArray = new ISystemFilterPool[pools.size()];
// Iterator i = pools.iterator();
// int idx = 0;
// while (i.hasNext())
// poolArray[idx++] = (ISystemFilterPool) i.next();
// //System.out.println("Pool array created. length = "+poolArray.length);
// }
// return poolArray;
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
// List pools = getPools();
// poolArray = new ISystemFilterPool[pools.size()];
// Iterator i = pools.iterator();
// int idx = 0;
// while (i.hasNext())
// poolArray[idx++] = (ISystemFilterPool) i.next();
// //System.out.println("Pool array created. length = "+poolArray.length);
// }
// 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() {
// poolArray = null;
// poolNames = null;
// }
// private void invalidatePoolCache() {
// poolArray = null;
// poolNames = null;
// }
/**
* Create a new filter pool.
@ -393,9 +392,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
pool.setSystemFilterPoolManager(this);
pool.setStringsCaseSensitive(areStringsCaseSensitive());
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
// List pools = getPools();
// List pools = getPools();
pools.add(pool);
// invalidatePoolCache();
// invalidatePoolCache();
commit(pool);
if ((caller != null) && !suspendCallbacks) {
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.
* <p>
* Does the following:
@ -460,8 +459,8 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
*/
public boolean preTestRenameFilterPool(ISystemFilterPool pool) throws Exception {
/*
* 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
* 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
* renamed in its persistent form.
*/
boolean ok = true;
@ -522,7 +521,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
* <ul>
* <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, 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>Asks target manager to save to disk
* <li>Saves this manager to disk
@ -543,7 +542,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
//SystemFilterPool fp = fpRef.getReferencedFilterPool();
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) {
ISystemFilterPoolReference fpRef = (ISystemFilterPoolReference) refs[idx];
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
// ---------------------------------
/* (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)
*/
@ -633,7 +632,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
ISystemFilter result = doCreateSystemFilter(parent, aliasName, filterStringsArray, type, promptable);
return result;
}
/* (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)
*/
@ -641,7 +640,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
ISystemFilter result = createSystemFilter(parent, aliasName, filterStrings, type, false);
return result;
}
/* (non-Javadoc)
* @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
* 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)
* @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.
@ -665,7 +664,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* 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.
* <p>
* 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
* 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.
* <p>
* 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);
return newFilter;
}
/**
* Creates a system filter.
* @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.
* <p>
* 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.
* 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>
* <p>
* 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
* 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>
* <p>
* Does the following:
@ -1159,7 +1158,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
// ONE FILE PER FILTER
case SystemFilterConstants.SAVE_POLICY_ONE_FILE_PER_FILTER:
return ((SystemFilterPoolImpl)pool).getSaveFile();
}
}
*/
return null;
}
@ -1208,7 +1207,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
*
* @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.
*/
public void logError(String message, Throwable exception) {
@ -1225,7 +1224,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/**
* 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)
* 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() {
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() {
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() {
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.
*/
public boolean commit() {
@ -1340,7 +1339,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
public IRSEPersistableContainer getPersistableParent() {
return null;
}
public IRSEPersistableContainer[] getPersistableChildren() {
return IRSEPersistableContainer.NO_CHILDREN;
}

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -17,40 +17,39 @@
package org.eclipse.rse.files.ui.resources;
/**
* This interface defines a remote path. It is not intended to be implemented by
* clients.
* This interface defines a remote path.
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRemotePath {
/**
* Get the profile name.
* @return the profile name
*/
public String getProfileName();
/**
* Get the connection name.
* @return the connection name
*/
public String getConnectionName();
/**
* Get the path of the resource on the server.
* @return the path of the resource on the server
*/
public String getPath();
/**
* Returns the complete string representation of the remote path.
* @return complete string representation of the remote path
*/
public String toString();
/**
* Returns whether this path equals the given object.
* This is system dependent.
*/
public boolean equals(Object obj);
public boolean equals(Object obj);
}

View file

@ -7,8 +7,8 @@
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -23,18 +23,18 @@ import org.eclipse.rse.files.ui.resources.ISystemRemoteMarker;
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
/**
* This class is an internal implementation of the ISystemRemoteMarker interface.
* It is not intended to be implemented by clients.
* This class is an internal implementation of the ISystemRemoteMarker
* interface.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class SystemRemoteMarker implements ISystemRemoteMarker {
/**
* Resource with which this marker is associated.
*/
protected ISystemRemoteResource resource;
/**
* The marker id.
*/
@ -45,7 +45,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public SystemRemoteMarker(ISystemRemoteResource resource, long id) {
this.resource = resource;
this.id = id;
this.id = id;
}
/**
@ -54,12 +54,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public void delete() {
SystemRemoteMarkerManager.getInstance().removeMarker(getResource(), getId());
}
/**
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#equals(Object)
*/
public boolean equals(Object object) {
if (!(object instanceof ISystemRemoteMarker)) {
return false;
}
@ -75,7 +75,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public boolean exists() {
return getInfo() != null;
}
/**
* Get the marker info.
* @return the marker info.
@ -89,12 +89,12 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Object getAttribute(String attributeName) {
SystemRemoteMarkerInfo info = getInfo();
if (info == 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) {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return defaultValue;
}
Object value = info.getAttribute(attributeName);
if ((value != null) && (value instanceof Integer)) {
return ((Integer)value).intValue();
}
return defaultValue;
}
@ -121,17 +121,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public String getAttribute(String attributeName, String defaultValue) {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return defaultValue;
}
Object value = info.getAttribute(attributeName);
if ((value != null) && (value instanceof String)) {
return (String)value;
}
return defaultValue;
}
@ -140,17 +140,17 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public boolean getAttribute(String attributeName, boolean defaultValue) {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return defaultValue;
}
Object value = info.getAttribute(attributeName);
if ((value != null) && (value instanceof Integer)) {
return ((Boolean)value).booleanValue();
}
return defaultValue;
}
@ -159,11 +159,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Map getAttributes() {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return null;
}
return info.getAttributes();
}
@ -172,11 +172,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public Object[] getAttributes(String[] attributeNames) {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return new Object[0];
}
return info.getAttributes(attributeNames);
}
@ -185,11 +185,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public long getCreationTime() {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return -1;
}
return info.getCreationTime();
}
@ -199,7 +199,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
public long getId() {
return id;
}
/**
* @see org.eclipse.rse.files.ui.resources.ISystemRemoteMarker#getResource()
*/
@ -212,11 +212,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public String getType() {
SystemRemoteMarkerInfo info = getInfo();
if (info == null) {
return null;
}
return info.getType();
}
@ -225,11 +225,11 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
*/
public boolean isSubtypeOf(String superType) {
String type = getType();
if (type == null) {
return false;
}
return SystemRemoteMarkerManager.getInstance().getCache().isSubtype(type, superType);
}
@ -247,7 +247,7 @@ public class SystemRemoteMarker implements ISystemRemoteMarker {
SystemRemoteMarkerManager manager = SystemRemoteMarkerManager.getInstance();
SystemRemoteMarkerInfo info = getInfo();
info.setAttribute(attributeName, value);
if (manager.isPersistent(info)) {
((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();
SystemRemoteMarkerInfo info = getInfo();
info.setAttributes(attributeNames, values);
if (manager.isPersistent(info)) {
((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();
SystemRemoteMarkerInfo info = getInfo();
info.setAttributes(attributes);
if (manager.isPersistent(info)) {
((SystemRemoteResource)resource).getResourceInfo().set(ISystemRemoteCoreConstants.M_MARKERS_DIRTY); // need to change this
}

View file

@ -25,25 +25,28 @@ import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
/**
* Standard workbench wizard for exporting resources from the workspace
* to the local file system.
* Standard workbench wizard for exporting resources from the workspace to the
* local file system.
* <p>
* This class may be instantiated and used without further configuration;
* this class is not intended to be subclassed.
* This class may be instantiated and used without further configuration.
* </p>
* <p>
* Example:
*
* <pre>
* IWizard wizard = new RemoteExportWizard();
* wizard.init(workbench, selection);
* WizardDialog dialog = new WizardDialog(shell, wizard);
* dialog.open();
* </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
* are exported to the user-specified location in the local file system,
* the dialog closes, and the call to <code>open</code> returns.
*
* 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
* are exported to the user-specified location in the local file system, the
* dialog closes, and the call to <code>open</code> returns.
* </p>
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
private IStructuredSelection selection;

View file

@ -52,11 +52,10 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
/**
* An operation which does the actual work of copying objects from the local file
* system into the workspace.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
* An operation which does the actual work of copying objects from the local
* file system into the workspace.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
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
* specified root file system object.
* <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
* are determined by the supplied <code>IImportStructureProvider</code>.
* </p>
@ -95,8 +94,8 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* </p>
* <p>
* The default import behavior is to recreate the complete container structure
* for the contents of the root file system object in their destination.
* If <code>setCreateContainerStructure</code> is set to false then the container
* for the contents of the root file system object in their destination.
* If <code>setCreateContainerStructure</code> is set to false then the container
* structure created is relative to the root file system object.
* </p>
*
@ -120,8 +119,8 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* operation solely to determine the destination container structure of the file system
* objects being imported.
* <p>
* The <code>source</code> parameter represents the root file system object to
* import. Valid types for this parameter are determined by the supplied
* The <code>source</code> parameter represents the root file system object to
* import. Valid types for this parameter are determined by the supplied
* <code>IImportStructureProvider</code>. The contents of the source which
* are to be imported are specified in the <code>filesToImport</code>
* parameter.
@ -138,7 +137,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* <p>
* The default import behavior is to recreate the complete container structure
* 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.
* </p>
*
@ -173,13 +172,13 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* and the provider in turn calls specific methods on the source object.
* </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.
* </p>
* <p>
* The default import behavior is to recreate the complete container structure
* 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.
* </p>
*
@ -227,7 +226,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
*/
private IContainer createFromRoot(IPath path) throws CoreException {
int segmentCount = path.segmentCount();
//Assume the project exists
//Assume the project exists
IContainer currentFolder = ((IWorkspaceRoot) destinationContainer).getProject(path.segment(0));
for (int i = 1; i < segmentCount; 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 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
*/
boolean ensureTargetDoesNotExist(IResource targetResource, int policy) {
@ -596,7 +595,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
*/
boolean queryOverwrite(IPath resourcePath) throws OperationCanceledException {
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$
if (overwriteAnswer.equals(IOverwriteQuery.NO)) {
return false;
@ -634,7 +633,7 @@ public class RemoteFileImportOperation extends WorkspaceModifyOperation {
* Sets whether imported file system objects should automatically overwrite
* 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
*/
public void setOverwriteResources(boolean value) {

View file

@ -28,22 +28,25 @@ import org.eclipse.ui.IWorkbench;
* Standard workbench wizard for importing resources from the local file system
* into the workspace.
* <p>
* This class may be instantiated and used without further configuration;
* this class is not intended to be subclassed.
* This class may be instantiated and used without further configuration.
* </p>
* <p>
* Example:
*
* <pre>
* IWizard wizard = new RemoteImportWizard();
* wizard.init(workbench, selection);
* WizardDialog dialog = new WizardDialog(shell, wizard);
* dialog.open();
* </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>
* returns.
* </p>
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
private IWorkbench workbench;
@ -117,9 +120,9 @@ public class RemoteImportWizard extends AbstractSystemWizard implements IImportW
public boolean performFinish() {
return mainPage.finish();
}
public boolean performCancel() {
mainPage.cancel();
return super.performCancel();
}
public boolean performCancel() {
mainPage.cancel();
return super.performCancel();
}
}

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2004, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -41,12 +41,13 @@ import org.eclipse.rse.internal.services.clientserver.java.StringInfo;
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>
* This class is not intended to be subclassed by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class BasicClassFileParser {
//private long magic;
//private int minor_version;
//private int major_version;
@ -62,7 +63,7 @@ public class BasicClassFileParser {
private MethodInfo[] methods;
private int attributes_count;
private InputStream stream;
/**
* Constuctor.
* @param stream the input stream to parse.
@ -70,104 +71,104 @@ public class BasicClassFileParser {
public BasicClassFileParser(InputStream stream) {
this.stream = stream;
}
/**
* Returns the package.
* @return the package.
*/
public String getQualifiedClassName() {
ClassInfo info = (ClassInfo)(getCPInfo(this_class));
int nameIndex = info.getNameIndex();
String name = getString(nameIndex);
return name.replace('/', '.');
}
/**
* Returns whether there is a <code>public static void main(String[])</code> method.
* @return <code>true</code> if there is, otherwise <code>false</code>.
*/
public boolean isExecutable() {
for (int i = 0; i < methods_count; i++) {
MethodInfo info = methods[i];
// first ensure method name is "main"
int nameIndex = info.getNameIndex();
String name = getString(nameIndex);
if (name.equals("main")) { //$NON-NLS-1$
// check access flags for public and static
int accessFlags = info.getAccessFlags();
if ((accessFlags & 0x000F) == 0x0009) {
// now check descriptor for parameter and return value
int descriptorIndex = info.getDescriptorIndex();
String descriptor = getString(descriptorIndex);
if (descriptor.equals("([Ljava/lang/String;)V")) { //$NON-NLS-1$
return true;
}
}
}
}
return false;
}
/**
* Parses a class file.
* @throws IOException if an I/O error occurs.
*/
public void parse() throws IOException {
EnhancedDataInputStream dataStream = new EnhancedDataInputStream(stream);
/*magic = */ dataStream.readUnsignedInt();
/*minor_version =*/ dataStream.readUnsignedShort();
/*major_version =*/ dataStream.readUnsignedShort();
constant_pool_count = dataStream.readUnsignedShort();
readConstantPool(dataStream);
/*access_flags =*/ dataStream.readUnsignedShort();
this_class = dataStream.readUnsignedShort();
/*super_class =*/ dataStream.readUnsignedShort();
interfaces_count = dataStream.readUnsignedShort();
readInterfaces(dataStream);
fields_count = dataStream.readUnsignedShort();
readFields(dataStream);
methods_count = dataStream.readUnsignedShort();
readMethods(dataStream);
dataStream.close();
}
/**
* Reads the constant pool.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readConstantPool(EnhancedDataInputStream dataStream) throws IOException {
constant_pool = new ArrayList();
for (int i = 0; i < constant_pool_count-1; i++) {
AbstractCPInfo info = readConstantInfo(dataStream);
AbstractCPInfo info = readConstantInfo(dataStream);
constant_pool.add(i, info);
// 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
if (info instanceof LongInfo || info instanceof DoubleInfo) {
@ -176,7 +177,7 @@ public class BasicClassFileParser {
}
}
}
/**
* Gets the constant info.
* @param dataStream the data stream.
@ -185,68 +186,68 @@ public class BasicClassFileParser {
*/
protected AbstractCPInfo readConstantInfo(EnhancedDataInputStream dataStream) throws IOException {
short tag = (short)(dataStream.readUnsignedByte());
switch (tag) {
case IClassFileConstants.CONSTANT_CLASS: {
int nameIndex = dataStream.readUnsignedShort();
return new ClassInfo(tag, nameIndex);
}
case IClassFileConstants.CONSTANT_FIELD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_STRING: {
int stringIndex = dataStream.readUnsignedShort();
return new StringInfo(tag, stringIndex);
}
case IClassFileConstants.CONSTANT_INTEGER: {
long bytes = dataStream.readUnsignedInt();
return new IntegerInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_FLOAT: {
long bytes = dataStream.readUnsignedInt();
return new FloatInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_LONG: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new LongInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_DOUBLE: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new DoubleInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
}
case IClassFileConstants.CONSTANT_UTF8: {
int length = dataStream.readUnsignedShort();
short[] bytes = new short[length];
for (int i = 0; i < length; i++) {
bytes[i] = (short)(dataStream.readUnsignedByte());
}
return new UTF8Info(tag, length, bytes);
}
default: {
return null;
case IClassFileConstants.CONSTANT_CLASS: {
int nameIndex = dataStream.readUnsignedShort();
return new ClassInfo(tag, nameIndex);
}
case IClassFileConstants.CONSTANT_FIELD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_STRING: {
int stringIndex = dataStream.readUnsignedShort();
return new StringInfo(tag, stringIndex);
}
case IClassFileConstants.CONSTANT_INTEGER: {
long bytes = dataStream.readUnsignedInt();
return new IntegerInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_FLOAT: {
long bytes = dataStream.readUnsignedInt();
return new FloatInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_LONG: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new LongInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_DOUBLE: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new DoubleInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
}
case IClassFileConstants.CONSTANT_UTF8: {
int length = dataStream.readUnsignedShort();
short[] bytes = new short[length];
for (int i = 0; i < length; i++) {
bytes[i] = (short)(dataStream.readUnsignedByte());
}
return new UTF8Info(tag, length, bytes);
}
default: {
return null;
}
}
}
@ -257,24 +258,24 @@ public class BasicClassFileParser {
*/
protected void readInterfaces(EnhancedDataInputStream dataStream) throws IOException {
interfaces = new int[interfaces_count];
for (int i = 0; i < interfaces_count; i++) {
interfaces[i] = dataStream.readUnsignedShort();
}
}
/**
* Reads the fields.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readFields(EnhancedDataInputStream dataStream) throws IOException {
for (int i = 0; i < fields_count; i++) {
readField(dataStream);
}
}
/**
* Reads a field.
* @param dataStream the data stream.
@ -285,47 +286,47 @@ public class BasicClassFileParser {
/*int nameIndex = */ dataStream.readUnsignedShort();
/*int descriptorIndex =*/ dataStream.readUnsignedShort();
int attributesCount = dataStream.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
readAttribute(dataStream);
}
return null;
}
/**
* Reads the methods.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected void readMethods(EnhancedDataInputStream dataStream) throws IOException {
methods = new MethodInfo[methods_count];
for (int i = 0; i < methods_count; i++) {
methods[i] = readMethod(dataStream);
}
}
/**
* Reads a method.
* @param dataStream the data stream.
* @throws IOException if an I/O error occurs.
*/
protected MethodInfo readMethod(EnhancedDataInputStream dataStream) throws IOException {
int accessFlags = dataStream.readUnsignedShort();
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
int attributesCount = dataStream.readUnsignedShort();
for (int i = 0; i < attributesCount; i++) {
readAttribute(dataStream);
}
return new MethodInfo(accessFlags, nameIndex, descriptorIndex, attributes_count, null);
}
/**
* Reads an attribute.
* @param dataStream the data stream.
@ -334,14 +335,14 @@ public class BasicClassFileParser {
protected AbstractAttributeInfo readAttribute(EnhancedDataInputStream dataStream) throws IOException {
dataStream.skip(2);
long length = dataStream.readUnsignedInt();
if (length > 0) {
dataStream.skip(length);
}
return null;
}
/**
* Returns the entry at the constant pool index.
* @param index the index.
@ -350,7 +351,7 @@ public class BasicClassFileParser {
protected AbstractCPInfo getCPInfo(int index) {
return (AbstractCPInfo)(constant_pool.get(index-1));
}
/**
* Returns the name given an index to the constant pool table.
* The entry at the index must be a UTF8 string entry

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2007 IBM Corporation. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -24,10 +24,10 @@ import java.io.InputStream;
/**
* Singleton class for obtaining various information about class files.
* <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 {
private static ClassFileUtil instance;
/**
@ -36,20 +36,20 @@ public class ClassFileUtil {
private ClassFileUtil() {
super();
}
/**
* Returns the singleton instance.
* @return the singleton instance.
*/
public static final ClassFileUtil getInstance() {
if (instance == null) {
instance = new ClassFileUtil();
}
return instance;
}
/**
* Returns whether the class with the given path is runnable, i.e. whether it contains <code>public
* static void main (String[])</code> method.
@ -61,7 +61,7 @@ public class ClassFileUtil {
File classFile = new File(classFilePath);
return isRunnable(classFile);
}
/**
* Returns whether the class is runnable, i.e. whether it contains <code>public
* static void main (String[])</code> method.
@ -72,8 +72,8 @@ public class ClassFileUtil {
public boolean isRunnable(File classFile) throws IOException {
FileInputStream stream = new FileInputStream(classFile);
return isRunnable(stream);
}
}
/**
* 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.
@ -86,7 +86,7 @@ public class ClassFileUtil {
parser.parse();
return parser.isExecutable();
}
/**
* Gets the qualified class name for the file with the given path.
* @param classFilePath the class file path.
@ -96,7 +96,7 @@ public class ClassFileUtil {
File classFile = new File(classFilePath);
return getQualifiedClassName(classFile);
}
/**
* Gets the qualified class name.
* @param classFile the class file.
@ -106,7 +106,7 @@ public class ClassFileUtil {
FileInputStream stream = new FileInputStream(classFile);
return getQualifiedClassName(stream);
}
/**
* Gets the qualified class name for the class represented by the given input stream.
* @param stream the input stream representing a class.

View file

@ -37,22 +37,24 @@ import org.eclipse.rse.services.IService;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/**
* A IFileService is an abstraction of a file service that runs over some sort of connection.
* It can be shared among multiple instances of a subsystem. At some point this file
* service layer may become official API but for now it is experimental. Each
* subsystem is currently responsible for layering an abstraction over whatever it
* wants to construct as a service.
* A IFileService is an abstraction of a file service that runs over some sort
* of connection. It can be shared among multiple instances of a subsystem. At
* some point this file service layer may become official API but for now it is
* experimental. Each subsystem is currently responsible for layering an
* abstraction over whatever it wants to construct as a service.
* <p>
* This is a very bare bones definition. A real definition would probably have changed
* terminology, use URI's rather than Strings, and have much more robust error handling.
* </p><p>
* 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.
* This is a very bare bones definition. A real definition would probably have
* changed terminology, use URI's rather than Strings, and have much more robust
* error handling.
* </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
{

View file

@ -7,8 +7,8 @@
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -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 static final int DEFAULT_PRIORITY = Integer.MAX_VALUE;
private String name;
private String extension;
@ -40,21 +43,21 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
public SystemFileTransferModeMapping(String extension) {
this("*", extension); //$NON-NLS-1$
}
/**
* 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 extension the extension. Can be <code>null</code>.
*/
public SystemFileTransferModeMapping(String name, String extension) {
if ((name == null) || (name.length() < 1)) {
setName("*"); //$NON-NLS-1$
}
else {
setName(name);
}
setExtension(extension);
}
@ -71,7 +74,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getLabel()
*/
public String getLabel() {
if (extension != null) {
return (name + "." + extension); //$NON-NLS-1$
}
@ -103,35 +106,35 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
public boolean isText() {
return !isBinary();
}
/**
* Set whether transfer mode is binary
*/
public void setAsBinary() {
isBinary = true;
}
/**
* Set whether transfer mode is text
*/
public void setAsText() {
isBinary = false;
}
/**
* Set the name
*/
public void setName(String name) {
this.name = name;
}
/**
* Set the extension
*/
public void setExtension(String extension) {
this.extension = extension;
}
/**
* Set the priority - the smaller the number, the higher priority
* @param priority priority to set.
@ -139,7 +142,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
public void setPriority(int priority) {
this.priority = priority;
}
/*
* (non-Javadoc)
* @see org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMapping#getPriority()
@ -148,7 +151,7 @@ public class SystemFileTransferModeMapping implements ISystemFileTransferModeMap
{
return this.priority;
}
/**
* Clone this object.
*

View file

@ -7,8 +7,8 @@
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -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 {
private static SystemFileTransferModeRegistry instance;
private HashMap typeModeMappings;
private RSEUIPlugin plugin;
// Constants for reading from and writing to xml file
private static final String FILENAME = "fileTransferMode.xml"; //$NON-NLS-1$
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 BINARY_VALUE = "binary"; //$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
@ -80,20 +83,20 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
this.plugin = RSEUIPlugin.getDefault();
initialize();
}
/**
* Get the singleton instance
*/
public static SystemFileTransferModeRegistry getInstance() {
if (instance == null) {
instance = new SystemFileTransferModeRegistry();
}
return instance;
}
/**
* Delete's the existing file associations and reinitializes with defaults
*/
@ -102,16 +105,16 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
deleteAssociations();
initialize();
}
/**
* Initialize the registry from storage.
*/
private void initialize() {
// load our current associations (if any)
loadAssociations();
// get reference to the extension registry
IExtensionRegistry extRegistry = Platform.getExtensionRegistry();
@ -131,9 +134,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
String type = element.getAttribute("type"); //$NON-NLS-1$
if (type != null && !type.equals("")) { //$NON-NLS-1$
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(extension);
// add extension to list of text types
if (type.equalsIgnoreCase("text")) { //$NON-NLS-1$
mapping.setAsText();
@ -142,7 +145,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
if (type.equalsIgnoreCase("binary")) { //$NON-NLS-1$
mapping.setAsBinary();
}
int priority = SystemFileTransferModeMapping.DEFAULT_PRIORITY;
String priorityStr = element.getAttribute("priority"); //$NON-NLS-1$
try
@ -152,10 +155,10 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
catch (Exception e)
{
{
}
mapping.setPriority(priority);
String key = getMappingKey(mapping);
if (!typeModeMappings.containsKey(key)){
typeModeMappings.put(key, mapping);
@ -164,7 +167,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
SystemFileTransferModeMapping existingMapping = (SystemFileTransferModeMapping)typeModeMappings.get(key);
int existingPriority = existingMapping.getPriority();
if (priority < existingPriority){
// change properties of existing mapping to that of new priority
if (mapping.isBinary() && existingMapping.isText()){
existingMapping.setAsBinary();
@ -172,19 +175,19 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else if (mapping.isText() && existingMapping.isBinary()){
existingMapping.setAsText();
}
existingMapping.setPriority(priority);
}
}
}
}
else {
continue;
}
}
}
}
/**
* @see ISystemFileTransferModeRegistry#getModeMappings()
*/
@ -194,8 +197,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
sortedMappings.toArray(array);
return array;
}
/**
* The mappings are kept in a hash map for fast lookup. Sorting is
* typically only needed for certain dialogs/choices etc.
@ -213,23 +216,23 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
List result = new ArrayList(s);
return result;
}
/**
* Sets new mode mappings
*/
public void setModeMappings(SystemFileTransferModeMapping[] newMappings) {
typeModeMappings = new HashMap();
for (int i = 0; i < newMappings.length; i++) {
SystemFileTransferModeMapping mapping = newMappings[i];
typeModeMappings.put(getMappingKey(mapping), mapping);
}
}
/**
* Return a key given the mapping
* Return a key given the mapping
*/
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
return mapping.getLabel().toLowerCase();
@ -297,26 +300,26 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
*/
public boolean isText(IRemoteFile remoteFile) {
return isText(remoteFile.getName());
}
}
/**
* Get the mode mapping given a file name
*/
private SystemFileTransferModeMapping getMapping(String fileName) {
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(fileName.toLowerCase()));
if (mapping == null) {
mapping = createMappingFromModeMappings(fileName);
}
if (mapping == null) {
return getDefaultMapping(fileName);
}
return mapping;
}
}
private SystemFileTransferModeMapping createMappingFromModeMappings(String fileName)
{
// get file extension
@ -325,7 +328,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
String name = null;
String extension = null;
// if there is no extension
if ((extIndex == -1) || (extIndex == (fileName.length() - 1))) {
name = fileName;
@ -333,45 +336,45 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else {
name = fileName.substring(0, extIndex);
extension = fileName.substring(extIndex + 1);
}
}
// check if the name and extension combination exists already
SystemFileTransferModeMapping mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(name, extension))));
// if not, check only for the extension
if (mapping == null) {
mapping = (SystemFileTransferModeMapping)(typeModeMappings.get(getMappingKey(new SystemFileTransferModeMapping(extension))));
}
if (mapping == null) {
return null;
}
SystemFileTransferModeMapping fileMapping = new SystemFileTransferModeMapping(name, extension);
if (mapping.isText())
{
fileMapping.setAsText();
}
else
{
fileMapping.setAsBinary();
fileMapping.setAsBinary();
}
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
*/
public static int getFileTransferModeDefaultPreference()
public static int getFileTransferModeDefaultPreference()
{
IPreferenceStore store= RSEUIPlugin.getDefault().getPreferenceStore();
return store.getInt(ISystemFilePreferencesConstants.FILETRANSFERMODEDEFAULT);
}
/**
* 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('.');
int extIndex = fileName.lastIndexOf('.');
String name, extension;
// if there is no extension
// DY 04-23-2002 changed from default binary to default text for files that
// a) Have no extension
// b) Ends with a period
// 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;
extension = null;
@ -395,15 +398,15 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
else
{
name = fileName.substring(0, extIndex);
extension = fileName.substring(extIndex + 1);
extension = fileName.substring(extIndex + 1);
}
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
// default
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
// default
int defaultFileTransferMode = getFileTransferModeDefaultPreference();
if (defaultFileTransferMode == ISystemFilePreferencesConstants.FILETRANSFERMODE_BINARY)
{
mapping.setAsBinary();
@ -415,50 +418,50 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
return mapping;
}
/**
* Load the saved associations to the registry
*
* @return true if operation successful, false otherwise
*/
public boolean loadAssociations() {
typeModeMappings = new HashMap();
String location = getFileLocation();
File file = new File(location);
if (!file.exists())
return false;
FileInputStream stream = null;
InputStreamReader reader = null;
boolean result = false;
try {
stream = new FileInputStream(file);
reader = new InputStreamReader(stream, ENCODING);
XMLMemento memento = XMLMemento.createReadRoot(reader);
IMemento[] mementos = memento.getChildren(INFO_NODE);
for (int i = 0; i < mementos.length; i++) {
String name = mementos[i].getString(NAME_ATTRIBUTE);
String extension = mementos[i].getString(EXTENSION_ATTRIBUTE);
String mode = mementos[i].getString(MODE_ATTRIBUTE);
SystemFileTransferModeMapping mapping = new SystemFileTransferModeMapping(name, extension);
if (mode.equals(TEXT_VALUE)) {
mapping.setAsText();
}
else {
mapping.setAsBinary();
}
try
{
Integer priorityInt = mementos[i].getInteger(PRIORITY_ATTRIBUTE);
@ -468,13 +471,13 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
catch (Exception e)
{
{
}
typeModeMappings.put(getMappingKey(mapping), mapping);
}
result = true;
}
catch (Exception e) {
@ -482,9 +485,9 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
result = false;
}
finally {
try {
if (reader != null)
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$
}
}
return result;
}
private void deleteAssociations()
private void deleteAssociations()
{
String location = getFileLocation();
File assFile = new File(location);
assFile.delete();
}
/**
* Save the contents of the registry
*/
public void saveAssociations() {
String location = getFileLocation();
XMLMemento memento = XMLMemento.createWriteRoot(ROOT_NODE);
Iterator iter = typeModeMappings.values().iterator();
while (iter.hasNext()) {
@ -520,25 +523,25 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
IMemento infoMemento = memento.createChild(INFO_NODE);
infoMemento.putString(NAME_ATTRIBUTE, mapping.getName());
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());
}
FileOutputStream stream = null;
OutputStreamWriter writer = null;
try {
stream = new FileOutputStream(location);
writer = new OutputStreamWriter(stream, ENCODING);
writer = new OutputStreamWriter(stream, ENCODING);
memento.save(writer);
}
catch (Exception e) {
SystemBasePlugin.logError("Could not write to transfer mode xml file", e); //$NON-NLS-1$
}
finally {
try {
if (writer != null)
writer.close();
}
@ -547,8 +550,8 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
}
}
}
/**
* Get the file location
*/

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -35,7 +35,8 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf
/**
* 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
{
@ -52,7 +53,7 @@ public class RemoteFileUtility
ISubSystem[] sses = sr.getSubSystems(connection);
for (int i = 0; i < sses.length; i++)
{
if (sses[i] instanceof IRemoteFileSubSystem)
if (sses[i] instanceof IRemoteFileSubSystem)
{
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
return subSystem;
@ -60,7 +61,7 @@ public class RemoteFileUtility
}
return null;
}
/**
* Return the list of file subsystems associated with a connection.
* @param connection the connection to query.
@ -73,7 +74,7 @@ public class RemoteFileUtility
ISubSystem[] sses = sr.getSubSystems(connection);
for (int i = 0; i < sses.length; i++)
{
if (sses[i] instanceof IRemoteFileSubSystem)
if (sses[i] instanceof IRemoteFileSubSystem)
{
IRemoteFileSubSystem subSystem = (IRemoteFileSubSystem)sses[i];
results.add(subSystem);
@ -81,34 +82,34 @@ public class RemoteFileUtility
}
return (IRemoteFileSubSystem[])results.toArray(new IRemoteFileSubSystem[results.size()]);
}
/**
* Return the first remote file subsystem configuration associated with a system type.
* @param systemType the system type to query.
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
* no file subsystem is configured with the given system type.
*/
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
{
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < sses.length; i++)
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
{
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
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 the global SystemFileTransferModeRegistry.
* @return the global SystemFileTransferModeRegistry.
*/
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
{
return SystemFileTransferModeRegistry.getInstance();
}
}
return null;
}
/**
* Return the global SystemFileTransferModeRegistry.
* @return the global SystemFileTransferModeRegistry.
*/
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
{
return SystemFileTransferModeRegistry.getInstance();
}
}

View file

@ -7,8 +7,8 @@
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -30,19 +30,18 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
* which allows the input array to be changed dynamically.
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class, which
* allows the input array to be changed dynamically.
* <p>
* A cell editor that presents a list of items in a combo box.
* The cell editor's value is the zero-based index of the selected
* item.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* A cell editor that presents a list of items in a combo box. The cell editor's
* value is the zero-based index of the selected item.
* </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.
*/
@ -58,42 +57,42 @@ public class SystemComboBoxCellEditor extends CellEditor
*/
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
* editor value is the zero-based index of the selected item.
* 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 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;
if (items != null)
setItems(items);
setItems(items);
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
* editor value is the zero-based index of the selected item.
* 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 whether or not this is readonly
*/
//public SystemComboBoxCellEditor(Composite parent, boolean readOnly)
public SystemComboBoxCellEditor(Composite parent)
//public SystemComboBoxCellEditor(Composite parent, boolean readOnly)
public SystemComboBoxCellEditor(Composite parent)
{
super(parent);
super(parent);
selection = 0;
//this.readOnly = readOnly;
setValueValid(true);
}
setValueValid(true);
}
/**
* Change the input items
*/
@ -101,17 +100,17 @@ public class SystemComboBoxCellEditor extends CellEditor
{
this.items = items;
populateComboBoxItems();
setValueValid(true);
setValueValid(true);
}
/* (non-Javadoc)
* Method declared on CellEditor.
*/
protected Control createControl(Composite parent)
protected Control createControl(Composite parent)
{
if (!readOnly)
comboBox = new CCombo(parent, SWT.NONE);
if (!readOnly)
comboBox = new CCombo(parent, SWT.NONE);
else
comboBox = new CCombo(parent, SWT.READ_ONLY);
comboBox = new CCombo(parent, SWT.READ_ONLY);
comboBox.setFont(parent.getFont());
comboBox.addKeyListener(new KeyAdapter() {
@ -122,24 +121,24 @@ public class SystemComboBoxCellEditor extends CellEditor
comboBox.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
// DKM - only process this when there is a selection change
// fix for defect 138324
if (selection == comboBox.getSelectionIndex() && comboBox.getText().equals(comboBox.getItem(comboBox.getSelectionIndex())))
return; // no change
// must set the selection before getting value
selection = comboBox.getSelectionIndex();
selection = comboBox.getSelectionIndex();
Object newValue = doGetValue();
boolean newValidState = isCorrect(newValue);
if (newValidState) {
doSetValue(newValue);
} else {
// try to insert the current value into the error message.
setErrorMessage(
NLS.bind(getErrorMessage(), items[selection]));
NLS.bind(getErrorMessage(), items[selection]));
}
fireApplyEditorValue();
}
@ -163,14 +162,14 @@ public class SystemComboBoxCellEditor extends CellEditor
* @return the zero-based index of the current selection wrapped
* as an <code>Integer</code>
*/
protected Object doGetValue()
protected Object doGetValue()
{
return new Integer(selection);
return new Integer(selection);
}
/* (non-Javadoc)
* Method declared on CellEditor.
*/
protected void doSetFocus()
protected void doSetFocus()
{
comboBox.setFocus();
}
@ -179,10 +178,10 @@ public class SystemComboBoxCellEditor extends CellEditor
* this <code>CellEditor</code> framework method
* 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>
*/
protected void doSetValue(Object value)
*/
protected void doSetValue(Object value)
{
if (!(value instanceof Integer))
{
@ -193,11 +192,11 @@ public class SystemComboBoxCellEditor extends CellEditor
if (item.equals(value))
{
selection = i;
}
}
}
return;
return;
}
//Assert.isTrue(comboBox != null && (value instanceof Integer));
int newselection = ((Integer) value).intValue();
if (newselection != selection)
@ -213,9 +212,9 @@ public class SystemComboBoxCellEditor extends CellEditor
/**
* 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();
for (int i = 0; i < items.length; i++)

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -65,7 +65,7 @@ import org.eclipse.ui.part.ResourceTransfer;
/**
* 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 {
@ -119,7 +119,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
{
SystemPerspectiveHelpers.openRSEPerspective();
}
/*
* (non-Javadoc)
* @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)
* @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()
{
//this.currentRunnableContext = null;
//this.currentRunnableContextShell = null;
//this.currentRunnableContextShell = null;
popRunnableContext();
}
@ -256,7 +256,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
previousRunnableContextShells.remove(disposedShells.elementAt(idx));
previousRunnableContexts.remove(disposedContexts.elementAt(idx));
}
return currentRunnableContext;
}
@ -289,7 +289,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
clipboard = new Clipboard(display);
}
return clipboard;
}
@ -305,21 +305,21 @@ public class SystemRegistryUI implements ISystemRegistryUI {
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
{
int profileDelim = str.indexOf("."); //$NON-NLS-1$
if (profileDelim != -1)
int profileDelim = str.indexOf("."); //$NON-NLS-1$
if (profileDelim != -1)
{
String profileId = str.substring(0, profileDelim);
String connectionId = str.substring(profileDelim + 1, str.length());
ISystemProfile profile = registry.getSystemProfile(profileId);
return registry.getHost(profile, connectionId);
String profileId = str.substring(0, profileDelim);
String connectionId = str.substring(profileDelim + 1, str.length());
ISystemProfile profile = registry.getSystemProfile(profileId);
return registry.getHost(profile, connectionId);
}
}
int subsystemDelim = str.indexOf(":", connectionDelim + 1); //$NON-NLS-1$
String subSystemId = str.substring(0, subsystemDelim);
String srcKey = str.substring(subsystemDelim + 1, str.length());
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
ISubSystem subSystem = registry.getSubSystem(subSystemId);
if (subSystem != null)
@ -364,26 +364,26 @@ public class SystemRegistryUI implements ISystemRegistryUI {
Clipboard clipboard = getSystemClipboard();
ArrayList srcObjects = new ArrayList();
Object object = null;
if (srcType == SystemDNDTransferRunnable.SRC_TYPE_RSE_RESOURCE)
{
// determine the source objects
object = clipboard.getContents(PluginTransfer.getInstance());
if (object instanceof PluginTransferData)
{
// RSE transfer
PluginTransferData data = (PluginTransferData) object;
byte[] result = data.getData();
//StringTokenizer tokenizer = new StringTokenizer(new String(result), SystemViewDataDropAdapter.RESOURCE_SEPARATOR);
String[] tokens = (new String(result)).split("\\"+SystemViewDataDropAdapter.RESOURCE_SEPARATOR); //$NON-NLS-1$
for (int i = 0;i < tokens.length; i++)
{
String srcStr = tokens[i];
Object srcObject = getObjectFor(srcStr);
srcObjects.add(srcObject);
}
@ -403,7 +403,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
}
}
else if (srcType == SystemDNDTransferRunnable.SRC_TYPE_OS_RESOURCE)
{
// Local File transfer
@ -438,11 +438,11 @@ public class SystemRegistryUI implements ISystemRegistryUI {
*/
public SystemScratchpad getSystemScratchPad()
{
if (scratchpad == null)
{
scratchpad = new SystemScratchpad();
}
return scratchpad;
if (scratchpad == null)
{
scratchpad = new SystemScratchpad();
}
return scratchpad;
}
@ -474,7 +474,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
}
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())
factory.setShowFilterStrings(show);
}
}
}
}
}
}*/
/**
* Reflect the user changing the preference for showing new connection prompt
@ -526,7 +526,7 @@ public class SystemRegistryUI implements ISystemRegistryUI {
// ----------------------------
// RESOURCE EVENT METHODS...
// ----------------------------
// ----------------------------
/*
* (non-Javadoc)

View file

@ -1,13 +1,13 @@
/********************************************************************************
* Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
*
* Initial Contributors:
* The following IBM employees contributed to the Remote System Explorer
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* component that contains this file: David McKnight, Kushal Munir,
* Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
@ -31,16 +31,15 @@ import org.eclipse.swt.widgets.Shell;
/**
* Registry and control center for RSE UI related operations.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRegistryUI extends ISystemShellProvider {
// ----------------------------------
// UI METHODS...
// ----------------------------------
/**
* Show the RSE perspective if it is not already showing
*/
@ -58,10 +57,10 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
*/
public void expandSubSystem(ISubSystem subsystem);
/**
* Returns the clipboard used for copy actions
*/
public Clipboard getSystemClipboard();
/**
* Returns the clipboard used for copy actions
*/
public Clipboard getSystemClipboard();
/**
* 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);
/**
* 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.
*/
public void clearRunnableContext();
@ -129,21 +128,21 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
// ----------------------------
// RESOURCE EVENT METHODS...
// ----------------------------
// ----------------------------
/**
* 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.
* <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.
*/
public void postEvent(ISystemResourceChangeEvent event);
/**
* Notify a specific listener of a change to a system resource such as a connection.
* <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.
*/
public void postEvent(ISystemResourceChangeListener listener, ISystemResourceChangeEvent event);

View file

@ -15,12 +15,10 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* A pagebook is a composite control where only a single control is visible
* at a time. It is similar to a notebook, but without tabs.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
*
* A pagebook is a composite control where only a single control is visible at a
* time. It is similar to a notebook, but without tabs.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class PageBook extends Composite {
private StackLayout fLayout;

View file

@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright (c) 2006, 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
* 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.
*
* <p> Not to be implemented by clients.
* @author Michael Scharf
* <p>
* <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
* work or that it will remain the same. Please do not use this API without
* consulting with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* part of a work in progress. There is no guarantee that this API will work or
* that it will remain the same. Please do not use this API without consulting
* with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a>
* team.
* </p>
*
* @author Michael Scharf
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITerminalControl {
/**
* @return the current state of the connection
*/
@ -38,7 +39,7 @@ public interface ITerminalControl {
* @param state
*/
void setState(TerminalState state);
/**
* A shell to show dialogs.
* @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.
* @param text
* TODO: Michael Scharf: Is this really needed?
* TODO: Michael Scharf: Is this really needed?
*/
void displayTextInTerminal(String text);
@ -71,5 +72,5 @@ public interface ITerminalControl {
* TODO: Michael Scharf: Should be replaced by a better error notification mechanism!
*/
void setMsg(String msg);
}

View file

@ -1,23 +1,24 @@
/*******************************************************************************
* Copyright (c) 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
*******************************************************************************/
package org.eclipse.tm.terminal.model;
/**
* A writable matrix of characters and {@link Style}. This is intended to be the
* low level representation of the text of a Terminal. Higher layers are responsible
* to fill the text and styles into this representation.
*
* <p><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.
* A writable matrix of characters and {@link Style}. This is intended to be
* the low level representation of the text of a Terminal. Higher layers are
* responsible to fill the text and styles into this representation.
* <p>
* <b>Note: </b> Implementations of this interface has to be thread safe.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
@ -61,30 +62,30 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* @param style the style or null
*/
void setChars(int line, int column, char[] chars, int start, int len, Style style);
/**
* Cleans the entire line.
* @param line
*/
void cleanLine(int line);
// /**
// * @param line
// * @return true if this line belongs to the previous line but is simply
// * wrapped.
// */
// boolean isWrappedLine(int line);
//
// /**
// * Makes this line an extension to the previous line. Wrapped lines get folded back
// * when the width of the terminal changes
// * @param line
// * @param extendsPreviousLine
// */
// void setWrappedLine(int line, boolean extendsPreviousLine);
// /**
// * @param line
// * @return true if this line belongs to the previous line but is simply
// * wrapped.
// */
// boolean isWrappedLine(int line);
//
// /**
// * Makes this line an extension to the previous line. Wrapped lines get folded back
// * when the width of the terminal changes
// * @param line
// * @param 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}
* <p>To illustrate shift, here is some sample data:
* <pre>
@ -100,7 +101,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* 0 aaaa
* 1 cccc
* 2 dddd
* 3
* 3
* 4 eeee
* </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>
* <pre>
* 0 aaaa
* 1
* 1
* 2 bbbb
* 3 cccc
* 4 eeee
@ -119,7 +120,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* Negative number means scroll down, positive scroll up (see example above).
*/
void scroll(int startLine, int size, int shift);
/**Adds a new line to the terminal. If maxHeigth is reached, the entire terminal
* will be scrolled. Else a line will be added.
*/
@ -145,7 +146,7 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* @param length
*/
void copyRange(ITerminalTextData source, int sourceStartLine, int destStartLine,int length);
void setCursorLine(int line);
void setCursorColumn(int column);
}

View file

@ -1,11 +1,11 @@
/*******************************************************************************
* Copyright (c) 2007 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Contributors:
* Michael Scharf (Wind River) - initial API and implementation
*******************************************************************************/
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}.
* While the {@link ITerminalTextData} continues changing, the snapshot remains
* unchanged until the next snapshot is taken by calling {@link #updateSnapshot(boolean)}.
* This is important, because the {@link ITerminalTextData} might get
* modified by another thread. Suppose you would want to draw the content of
* the {@link ITerminalTextData} using the following loop:
* unchanged until the next snapshot is taken by calling
* {@link #updateSnapshot(boolean)}. This is important, because the
* {@link ITerminalTextData} might get modified by another thread. Suppose you
* would want to draw the content of the {@link ITerminalTextData} using the
* following loop:
*
* <pre>
* for(int line=0;line&lt;term.getHeight();line++)
* for(int column=0; column&lt;term.getWidth();column++)
* drawCharacter(column,line,term.getChar(column,line),term.getStyle(column,line));
* for (int line = 0; line &lt; term.getHeight(); line++)
* for (int column = 0; column &lt; term.getWidth(); column++)
* drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line));
* </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
* put a <code>synchronized(term){}</code> statement around the code. This has
* two problems: 1. you would have to know about the internals of the synchronisation
* of {@link ITerminalTextData}. 2. The other thread that changes {@link ITerminalTextData}
* is blocked while the potentially slow drawing is done.
*
* 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 put a <code>synchronized(term){}</code> statement around the code.
* This has two problems: 1. you would have to know about the internals of the
* synchronisation of {@link ITerminalTextData}. 2. The other thread that
* changes {@link ITerminalTextData} is blocked while the potentially slow
* drawing is done.
* <p>
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to draw
* the content. There is no danger that the data structure get changed while
* you draw. There are also methods to find out what has changed to minimize
* the number of lines that get redrawn.</p>
*
* <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&lt;=snap.getLastChangedLine();line++)
* // redraw only if the line has changed
* if(snap.hasLineChanged(line))
* for(int column=0; column&lt;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&lt;=snap.getFirstChangedLine();line++)
* // redraw only if the line has changed
* if(snap.hasLineChanged(line))
* for(int column=0; column&lt;snap.getWidth();column++)
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
* </pre>
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to
* draw the content. There is no danger that the data structure get changed
* while you draw. There are also methods to find out what has changed to
* minimize the number of lines that get redrawn.
* </p>
*
* <p><b>Note</b>: This interface is not intended to be implemented by clients.</p>
* <p><b>Threading Note</b>: This class is not thread save! All methods have to be called by
* the a same thread, that created the instance by calling
* {@link ITerminalTextDataReadOnly#makeSnapshot()}. </p>
* <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 &lt;= snap.getLastChangedLine(); line++)
* // redraw only if the line has changed
* if (snap.hasLineChanged(line))
* for (int column = 0; column &lt; 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 &lt;b&gt;before&lt;/b&gt; drawing the changed lines.
* doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift());
* // iterate over the potentially changed lines
* for (int line = snap.getFirstChangedLine(); line &lt;= snap.getFirstChangedLine(); line++)
* // redraw only if the line has changed
* if (snap.hasLineChanged(line))
* for (int column = 0; column &lt; 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 {
/**
@ -79,7 +90,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
* is called and a new snapshot needs to be updated again.
* <p>
* 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.
*
* <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 removeListener(SnapshotOutOfDateListener listener);
/**
* Ends the listening to the {@link ITerminalTextData}. After this
* has been called no new snapshot data is collected.
@ -115,11 +126,11 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
void setInterestWindow(int startLine, int size);
int getInterestWindowStartLine();
int getInterestWindowSize();
/**
* Create a new snapshot of the {@link ITerminalTextData}. It will efficiently
* 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
* {@link #hasLineChanged(int)}
* 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
* 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}
*
* <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
*/
boolean hasLineChanged(int line);
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)
*/
boolean hasTerminalChanged();
@ -203,7 +214,7 @@ public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
* to the previous snapshot. See also {@link ITerminalTextData#scroll(int, int, int)}
*/
int getScrollWindowShift();
/**
* @return The {@link ITerminalTextData} on that this instance is observing.
*/