mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-28 18:53:20 +02:00
[cleanup] Add @noimplement and similar API Tools Javadoc Markup
This commit is contained in:
parent
ee32242b1a
commit
14af215d50
25 changed files with 1349 additions and 1320 deletions
|
@ -18,10 +18,11 @@ package org.eclipse.rse.core;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface for RSE core registry. Clients should use this interface as the starting point for querying and
|
* Interface for RSE core registry. Clients should use this interface as the
|
||||||
* manipulating model objects in the RSE framework.
|
* starting point for querying and manipulating model objects in the RSE
|
||||||
|
* framework.
|
||||||
*
|
*
|
||||||
* This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface IRSECoreRegistry {
|
public interface IRSECoreRegistry {
|
||||||
|
|
||||||
|
|
|
@ -29,10 +29,11 @@ import org.osgi.framework.Bundle;
|
||||||
* Interface for a system type. Constants are defined for various system types.
|
* Interface for a system type. Constants are defined for various system types.
|
||||||
* These constants are kept in sync with definitions in plugin.xml.
|
* These constants are kept in sync with definitions in plugin.xml.
|
||||||
* <p>
|
* <p>
|
||||||
* This interface is not intended to be implemented by clients. System type
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* implementations must subclass {@link AbstractRSESystemType} rather than
|
* System type implementations must subclass
|
||||||
* implementing this interface directly.
|
* {@link AbstractRSESystemType} rather than implementing this
|
||||||
* </p>
|
* interface directly.
|
||||||
|
* </p>
|
||||||
*/
|
*/
|
||||||
public interface IRSESystemType extends IAdaptable {
|
public interface IRSESystemType extends IAdaptable {
|
||||||
|
|
||||||
|
@ -316,7 +317,7 @@ public interface IRSESystemType extends IAdaptable {
|
||||||
*
|
*
|
||||||
* @return The list of subsystem configuration id's. May be empty,
|
* @return The list of subsystem configuration id's. May be empty,
|
||||||
* but never <code>null</code>.
|
* but never <code>null</code>.
|
||||||
*/
|
*/
|
||||||
public String[] getSubsystemConfigurationIds();
|
public String[] getSubsystemConfigurationIds();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,14 +22,14 @@ import org.eclipse.rse.core.IRSESystemType;
|
||||||
import org.eclipse.rse.core.IRSEUserIdConstants;
|
import org.eclipse.rse.core.IRSEUserIdConstants;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An ordered list of connections ({@link IHost} objects), owned by an {@link ISystemProfile}.
|
* An ordered list of connections ({@link IHost} objects), owned by an
|
||||||
|
* {@link ISystemProfile}.
|
||||||
* <p>
|
* <p>
|
||||||
* Implementations of this interface are expected to be thread-safe in the sense
|
* Implementations of this interface are expected to be thread-safe in the sense
|
||||||
* that integrity of the host list is maintained even if multiple threads call
|
* that integrity of the host list is maintained even if multiple threads call
|
||||||
* multiple methods in this interface concurrently.
|
* multiple methods in this interface concurrently.
|
||||||
* </p><p>
|
|
||||||
* This interface is not intended to be implemented by clients.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemHostPool extends IRSEPersistableContainer {
|
public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
|
|
||||||
|
@ -62,48 +62,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
*/
|
*/
|
||||||
public IHost[] getHosts();
|
public IHost[] getHosts();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given only the minimal information.
|
* Create a connection object, given only the minimal information.
|
||||||
* <p>
|
* <p>
|
||||||
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @return IHost object, or null if it failed to create
|
* @return IHost object, or null if it failed to create
|
||||||
* because the aliasName is not unique. All other errors throw an exception.
|
* because the aliasName is not unique. All other errors throw an exception.
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given all the possible attributes except default userId.
|
* Create a connection object, given all the possible attributes except default userId.
|
||||||
* <p>
|
* <p>
|
||||||
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @return IHost object, or <code>null</code> if it failed to create
|
* @return IHost object, or <code>null</code> if it failed to create
|
||||||
* because the aliasName is not unique. All other errors throw an exception.
|
* because the aliasName is not unique. All other errors throw an exception.
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a connection object, given all the possible attributes.
|
* Create a connection object, given all the possible attributes.
|
||||||
* <p>
|
* <p>
|
||||||
* The new connection is added to the list and saved to disk.
|
* The new connection is added to the list and saved to disk.
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems.
|
* @param defaultUserId userId to use as the default for the subsystems.
|
||||||
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
|
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
|
||||||
* @return IHost object, or <code>null</code> if it failed to create
|
* @return IHost object, or <code>null</code> if it failed to create
|
||||||
* because the aliasName is not unique.
|
* because the aliasName is not unique.
|
||||||
* @see IRSEUserIdConstants
|
* @see IRSEUserIdConstants
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemType extension point.
|
* defined via the systemType extension point.
|
||||||
* @param aliasName unique connection name.
|
* @param aliasName unique connection name.
|
||||||
* @param hostName IP name or address of the host.
|
* @param hostName IP name or address of the host.
|
||||||
* @param description optional description of the connection. Can be null.
|
* @param description optional description of the connection. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems.
|
* @param defaultUserId userId to use as the default for the subsystems.
|
||||||
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
|
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
|
||||||
|
@ -126,15 +126,15 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
|
||||||
*/
|
*/
|
||||||
public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
public void updateHost(IHost conn, IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a connection object, given its alias name.
|
* Return a connection object, given its alias name.
|
||||||
*
|
*
|
||||||
* Can be used to test if an alias name is already used (non-null return).
|
* Can be used to test if an alias name is already used (non-null return).
|
||||||
*
|
*
|
||||||
* @param aliasName unique aliasName (case insensitive) to search on.
|
* @param aliasName unique aliasName (case insensitive) to search on.
|
||||||
* @return IHost object with unique aliasName, or null if
|
* @return IHost object with unique aliasName, or null if
|
||||||
* no connection object with this name exists.
|
* no connection object with this name exists.
|
||||||
*/
|
*/
|
||||||
public IHost getHost(String aliasName);
|
public IHost getHost(String aliasName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -52,17 +52,15 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
|
||||||
import org.eclipse.rse.internal.core.RSECoreRegistry;
|
import org.eclipse.rse.internal.core.RSECoreRegistry;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry or front door for all remote system connections.
|
* Registry or front door for all remote system connections. There is a
|
||||||
* There is a singleton of the class implementation of this interface.
|
* singleton of the class implementation of this interface. To get it, call the
|
||||||
* To get it, call the {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
|
* {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
|
||||||
* <p>
|
* <p>
|
||||||
* The idea here is that connections are grouped by system profile. At any
|
* The idea here is that connections are grouped by system profile. At any time,
|
||||||
* time, there is a user-specified number of profiles "active" and connections
|
* there is a user-specified number of profiles "active" and connections from
|
||||||
* from each active profile are worked with.
|
* each active profile are worked with.
|
||||||
* </p>
|
|
||||||
* <p>
|
|
||||||
* This interface is not intended to be implemented by clients.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
|
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
|
||||||
|
|
||||||
|
@ -497,7 +495,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
*/
|
*/
|
||||||
public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
|
public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a host object. The resulting host object is added to the list of existing host objects
|
* Create a host object. The resulting host object is added to the list of existing host objects
|
||||||
* in the specified profile.
|
* in the specified profile.
|
||||||
* <ul>
|
* <ul>
|
||||||
|
@ -518,31 +516,31 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
public IHost createHost(String profileName, IRSESystemType systemType, String hostName, String hostAddress, String description, boolean createSubSystems) throws Exception;
|
public IHost createHost(String profileName, IRSESystemType systemType, String hostName, String hostAddress, String description, boolean createSubSystems) throws Exception;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update an existing host given the new information.
|
* Update an existing host given the new information.
|
||||||
* This method:
|
* This method:
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>calls the setXXX methods on the given host object, updating the information in it.
|
* <li>calls the setXXX methods on the given host object, updating the information in it.
|
||||||
* <li>save the host's host pool to disk
|
* <li>save the host's host pool to disk
|
||||||
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
|
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
|
||||||
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
|
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
|
||||||
* We must do this because a host name changes fundamentally affects the connection,
|
* We must do this because a host name changes fundamentally affects the connection,
|
||||||
* rendering any information currently displayed under
|
* rendering any information currently displayed under
|
||||||
* that host obsolete.
|
* that host obsolete.
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* @param host the host to be updated
|
* @param host the host to be updated
|
||||||
* @param systemType system type matching one of the system types
|
* @param systemType system type matching one of the system types
|
||||||
* defined via the systemTypes extension point.
|
* defined via the systemTypes extension point.
|
||||||
* @param connectionName unique connection name.
|
* @param connectionName unique connection name.
|
||||||
* @param hostName ip name of host.
|
* @param hostName ip name of host.
|
||||||
* @param description optional description of the host. Can be null.
|
* @param description optional description of the host. Can be null.
|
||||||
* @param defaultUserId userId to use as the default for the subsystems under this host.
|
* @param defaultUserId userId to use as the default for the subsystems under this host.
|
||||||
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
|
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
|
||||||
* that tells us where to set the user Id
|
* that tells us where to set the user Id
|
||||||
*/
|
*/
|
||||||
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
|
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
|
||||||
String hostName, String description,
|
String hostName, String description,
|
||||||
String defaultUserId, int defaultUserIdLocation);
|
String defaultUserId, int defaultUserIdLocation);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates subsystems for a given host and subsystem configurations.
|
* Creates subsystems for a given host and subsystem configurations.
|
||||||
|
@ -825,14 +823,17 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks all filters for this subsystem as stale to prevent caching
|
* Marks all filters for this subsystem as stale to prevent caching
|
||||||
* @param subsystem
|
*
|
||||||
|
* @param subsystem the subsystem to work on
|
||||||
*/
|
*/
|
||||||
public void invalidateFiltersFor(ISubSystem subsystem);
|
public void invalidateFiltersFor(ISubSystem subsystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Marks all filters for this subsystem the contain resourceParent as stale to prevent caching
|
* Marks all filters for this subsystem that contain resourceParent as stale
|
||||||
* @param resourceParent
|
* to prevent caching
|
||||||
* @param subsystem
|
*
|
||||||
|
* @param resourceParent a remote resource object
|
||||||
|
* @param subsystem the subsystem to work on
|
||||||
*/
|
*/
|
||||||
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);
|
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);
|
||||||
|
|
||||||
|
|
|
@ -36,11 +36,10 @@ import org.eclipse.rse.services.IService;
|
||||||
/**
|
/**
|
||||||
* Subsystem Configuration interface.
|
* Subsystem Configuration interface.
|
||||||
*
|
*
|
||||||
* <p>
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* This interface is not intended to be implemented by clients. Subsystem
|
* Subsystem configuration implementations must subclass
|
||||||
* configuration implementations must subclass SubSystemConfiguration
|
* SubSystemConfiguration rather than implementing this interface
|
||||||
* rather than implementing this interface directly.
|
* directly.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer {
|
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer {
|
||||||
// ---------------------------------
|
// ---------------------------------
|
||||||
|
|
|
@ -39,8 +39,7 @@ import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
|
||||||
import org.eclipse.rse.logging.Logger;
|
import org.eclipse.rse.logging.Logger;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A filter pool manager manages filter pools.
|
* A filter pool manager manages filter pools. It is used to
|
||||||
* It is used to
|
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Get a list of existing filter pools
|
* <li>Get a list of existing filter pools
|
||||||
* <li>Create filter pools
|
* <li>Create filter pools
|
||||||
|
@ -49,11 +48,11 @@ import org.eclipse.rse.logging.Logger;
|
||||||
* <li>Rename filter pools
|
* <li>Rename filter pools
|
||||||
* </ul>
|
* </ul>
|
||||||
* <p>
|
* <p>
|
||||||
* The filter pool manager ensures that
|
* The filter pool manager ensures that changes to filters and pools are
|
||||||
* changes to filters and pools are
|
|
||||||
* committed and events are fired properly.
|
* committed and events are fired properly.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
|
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
|
||||||
private ISystemFilterPoolManagerProvider caller = null;
|
private ISystemFilterPoolManagerProvider caller = null;
|
||||||
|
@ -122,7 +121,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
|
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
|
||||||
|
|
||||||
protected List pools = new ArrayList(3);
|
protected List pools = new ArrayList(3);
|
||||||
// protected List pools = null;
|
// protected List pools = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
@ -330,17 +329,17 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
|
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
|
||||||
pools.toArray(result);
|
pools.toArray(result);
|
||||||
return result;
|
return result;
|
||||||
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
|
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
|
||||||
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
|
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
|
||||||
// List pools = getPools();
|
// List pools = getPools();
|
||||||
// poolArray = new ISystemFilterPool[pools.size()];
|
// poolArray = new ISystemFilterPool[pools.size()];
|
||||||
// Iterator i = pools.iterator();
|
// Iterator i = pools.iterator();
|
||||||
// int idx = 0;
|
// int idx = 0;
|
||||||
// while (i.hasNext())
|
// while (i.hasNext())
|
||||||
// poolArray[idx++] = (ISystemFilterPool) i.next();
|
// poolArray[idx++] = (ISystemFilterPool) i.next();
|
||||||
// //System.out.println("Pool array created. length = "+poolArray.length);
|
// //System.out.println("Pool array created. length = "+poolArray.length);
|
||||||
// }
|
// }
|
||||||
// return poolArray;
|
// return poolArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -359,10 +358,10 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
/*
|
/*
|
||||||
* Call this to invalidate array cache after any activity
|
* Call this to invalidate array cache after any activity
|
||||||
*/
|
*/
|
||||||
// private void invalidatePoolCache() {
|
// private void invalidatePoolCache() {
|
||||||
// poolArray = null;
|
// poolArray = null;
|
||||||
// poolNames = null;
|
// poolNames = null;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new filter pool.
|
* Create a new filter pool.
|
||||||
|
@ -393,9 +392,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
|
||||||
pool.setSystemFilterPoolManager(this);
|
pool.setSystemFilterPoolManager(this);
|
||||||
pool.setStringsCaseSensitive(areStringsCaseSensitive());
|
pool.setStringsCaseSensitive(areStringsCaseSensitive());
|
||||||
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
|
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
|
||||||
// List pools = getPools();
|
// List pools = getPools();
|
||||||
pools.add(pool);
|
pools.add(pool);
|
||||||
// invalidatePoolCache();
|
// invalidatePoolCache();
|
||||||
commit(pool);
|
commit(pool);
|
||||||
if ((caller != null) && !suspendCallbacks) {
|
if ((caller != null) && !suspendCallbacks) {
|
||||||
caller.filterEventFilterPoolCreated(pool);
|
caller.filterEventFilterPoolCreated(pool);
|
||||||
|
|
|
@ -17,13 +17,12 @@
|
||||||
package org.eclipse.rse.files.ui.resources;
|
package org.eclipse.rse.files.ui.resources;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This interface defines a remote path. It is not intended to be implemented by
|
* This interface defines a remote path.
|
||||||
* clients.
|
*
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ISystemRemotePath {
|
public interface ISystemRemotePath {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the profile name.
|
* Get the profile name.
|
||||||
* @return the profile name
|
* @return the profile name
|
||||||
|
|
|
@ -87,6 +87,7 @@ import org.eclipse.rse.internal.files.ui.ISystemFileConstants;
|
||||||
import org.eclipse.rse.internal.files.ui.resources.SystemFileNameHelper;
|
import org.eclipse.rse.internal.files.ui.resources.SystemFileNameHelper;
|
||||||
import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager;
|
import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager;
|
||||||
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
import org.eclipse.rse.internal.subsystems.files.core.ISystemFilePreferencesConstants;
|
||||||
|
import org.eclipse.rse.internal.ui.dialogs.CopyRunnable;
|
||||||
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
|
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
|
||||||
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
|
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
|
||||||
import org.eclipse.rse.services.clientserver.archiveutils.ISystemArchiveHandler;
|
import org.eclipse.rse.services.clientserver.archiveutils.ISystemArchiveHandler;
|
||||||
|
@ -108,7 +109,6 @@ import org.eclipse.rse.subsystems.files.core.subsystems.RemoteFileSubSystem;
|
||||||
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
|
import org.eclipse.rse.subsystems.files.core.util.ValidatorFileUniqueName;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
import org.eclipse.rse.internal.ui.dialogs.CopyRunnable;
|
|
||||||
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
|
import org.eclipse.rse.ui.dialogs.SystemRenameSingleDialog;
|
||||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||||
import org.eclipse.swt.widgets.Display;
|
import org.eclipse.swt.widgets.Display;
|
||||||
|
@ -117,10 +117,8 @@ import org.eclipse.ui.PlatformUI;
|
||||||
/**
|
/**
|
||||||
* Utility class for doing file transfers on universal systems.
|
* Utility class for doing file transfers on universal systems.
|
||||||
*
|
*
|
||||||
* 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.
|
||||||
* @noextend
|
|
||||||
* @noinstantiate
|
|
||||||
*/
|
*/
|
||||||
public class UniversalFileTransferUtility
|
public class UniversalFileTransferUtility
|
||||||
{
|
{
|
||||||
|
@ -133,11 +131,18 @@ public class UniversalFileTransferUtility
|
||||||
private static final int CANCEL_ALL = 16;
|
private static final int CANCEL_ALL = 16;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param severity
|
* Creates a new RenameStatus object. The created status has no
|
||||||
* @param pluginId
|
* children.
|
||||||
* @param code
|
*
|
||||||
* @param message
|
* @param severity the severity; one of <code>OK</code>,
|
||||||
* @param exception
|
* <code>ERROR</code>, <code>INFO</code>,
|
||||||
|
* <code>WARNING</code>, or <code>CANCEL</code>
|
||||||
|
* @param pluginId the unique identifier of the relevant plug-in
|
||||||
|
* @param code the plug-in-specific status code, or <code>OK</code>
|
||||||
|
* @param message a human-readable message, localized to the current
|
||||||
|
* locale
|
||||||
|
* @param exception a low-level exception, or <code>null</code> if not
|
||||||
|
* applicable
|
||||||
*/
|
*/
|
||||||
public RenameStatus(int severity, String pluginId, int code, String message, Throwable exception) {
|
public RenameStatus(int severity, String pluginId, int code, String message, Throwable exception) {
|
||||||
super(severity, pluginId, code, message, exception);
|
super(severity, pluginId, code, message, exception);
|
||||||
|
@ -153,7 +158,7 @@ public class UniversalFileTransferUtility
|
||||||
private static boolean doSuperTransfer(IRemoteFileSubSystem subsystem)
|
private static boolean doSuperTransfer(IRemoteFileSubSystem subsystem)
|
||||||
{
|
{
|
||||||
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER) &&
|
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER) &&
|
||||||
subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
||||||
return doSuperTransferProperty;
|
return doSuperTransferProperty;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,27 +231,27 @@ public class UniversalFileTransferUtility
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// copy remote file to workspace
|
// copy remote file to workspace
|
||||||
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
|
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
|
||||||
listener.addIgnoreFile(tempFile);
|
listener.addIgnoreFile(tempFile);
|
||||||
String remoteEncoding = srcFileOrFolder.getEncoding();
|
String remoteEncoding = srcFileOrFolder.getEncoding();
|
||||||
srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
|
srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
|
||||||
listener.removeIgnoreFile(tempFile);
|
listener.removeIgnoreFile(tempFile);
|
||||||
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
|
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
|
||||||
{
|
{
|
||||||
// eclipse doesn't like this if the resource appears to be from another project
|
// eclipse doesn't like this if the resource appears to be from another project
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
|
//tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
|
||||||
tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
|
tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
// if the file is virtual, set read only if necessary
|
// if the file is virtual, set read only if necessary
|
||||||
// TODO: why set this here? And why for virtual only??
|
// TODO: why set this here? And why for virtual only??
|
||||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
||||||
|
@ -276,7 +281,7 @@ public class UniversalFileTransferUtility
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (final SystemMessageException e)
|
catch (final SystemMessageException e)
|
||||||
{
|
{
|
||||||
|
@ -316,7 +321,7 @@ public class UniversalFileTransferUtility
|
||||||
properties.setEncoding(remoteFile.getEncoding());
|
properties.setEncoding(remoteFile.getEncoding());
|
||||||
properties.setUsedBinaryTransfer(remoteFile.isBinary());
|
properties.setUsedBinaryTransfer(remoteFile.isBinary());
|
||||||
|
|
||||||
// get the modified timestamp from the File, not the IFile
|
// get the modified timestamp from the File, not the IFile
|
||||||
// for some reason, the modified timestamp from the IFile does not always return
|
// for some reason, the modified timestamp from the IFile does not always return
|
||||||
// the right value. There is a Javadoc comment saying the value from IFile might be a
|
// the right value. There is a Javadoc comment saying the value from IFile might be a
|
||||||
// cached value and that might be the cause of the problem.
|
// cached value and that might be the cause of the problem.
|
||||||
|
@ -359,7 +364,7 @@ public class UniversalFileTransferUtility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// get the modified timestamp from the File, not the IFile
|
// get the modified timestamp from the File, not the IFile
|
||||||
// for some reason, the modified timestamp from the IFile does not always return
|
// for some reason, the modified timestamp from the IFile does not always return
|
||||||
// the right value. There is a Javadoc comment saying the value from IFile might be a
|
// the right value. There is a Javadoc comment saying the value from IFile might be a
|
||||||
// cached value and that might be the cause of the problem.
|
// cached value and that might be the cause of the problem.
|
||||||
|
@ -524,8 +529,8 @@ public class UniversalFileTransferUtility
|
||||||
|
|
||||||
if (storedTime != currentTime && (storedEncoding == null || !storedEncoding.equals(currentEncoding)))
|
if (storedTime != currentTime && (storedEncoding == null || !storedEncoding.equals(currentEncoding)))
|
||||||
{
|
{
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
// if the file is virtual, set read only if necessary
|
// if the file is virtual, set read only if necessary
|
||||||
// TODO: why set this here? And why for virtual only??
|
// TODO: why set this here? And why for virtual only??
|
||||||
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
if (srcFileOrFolder instanceof IVirtualRemoteFile)
|
||||||
|
@ -561,7 +566,7 @@ public class UniversalFileTransferUtility
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -672,7 +677,7 @@ public class UniversalFileTransferUtility
|
||||||
IRemoteFile rmtFile = (IRemoteFile)remoteSet.get(r);
|
IRemoteFile rmtFile = (IRemoteFile)remoteSet.get(r);
|
||||||
|
|
||||||
if (tempResource != null && !tempResource.exists()) // need to check for null resource
|
if (tempResource != null && !tempResource.exists()) // need to check for null resource
|
||||||
// because it's possible to be null when the download fails
|
// because it's possible to be null when the download fails
|
||||||
{
|
{
|
||||||
// refresh temp file in project
|
// refresh temp file in project
|
||||||
try
|
try
|
||||||
|
@ -708,7 +713,7 @@ public class UniversalFileTransferUtility
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -850,26 +855,26 @@ public class UniversalFileTransferUtility
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// copy remote file to workspace
|
// copy remote file to workspace
|
||||||
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
|
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
|
||||||
listener.addIgnoreFile(tempFile);
|
listener.addIgnoreFile(tempFile);
|
||||||
String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
|
String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
|
||||||
download(srcFileOrFolder, tempFile, encoding, monitor);
|
download(srcFileOrFolder, tempFile, encoding, monitor);
|
||||||
listener.removeIgnoreFile(tempFile);
|
listener.removeIgnoreFile(tempFile);
|
||||||
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
|
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
|
||||||
{
|
{
|
||||||
// eclipse doesn't like this if the resource appears to be from another project
|
// eclipse doesn't like this if the resource appears to be from another project
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
|
tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (tempFile.exists())
|
if (tempFile.exists())
|
||||||
{
|
{
|
||||||
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
|
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
|
@ -889,7 +894,7 @@ public class UniversalFileTransferUtility
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1226,7 +1231,7 @@ public class UniversalFileTransferUtility
|
||||||
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true);
|
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a copy via drag and drop.
|
* Perform a copy via drag and drop.
|
||||||
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
|
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
|
||||||
* temporary object produced by the doDrag.
|
* temporary object produced by the doDrag.
|
||||||
|
@ -1282,8 +1287,8 @@ public class UniversalFileTransferUtility
|
||||||
}
|
}
|
||||||
else if (isTargetVirtual)
|
else if (isTargetVirtual)
|
||||||
{
|
{
|
||||||
//if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
|
//if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
|
||||||
//instead of the file separator of the file subsystem.
|
//instead of the file separator of the file subsystem.
|
||||||
newPathBuf.append(ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR);
|
newPathBuf.append(ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1415,7 +1420,7 @@ public class UniversalFileTransferUtility
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
copyFilesOrFolders.add(srcFileOrFolder);
|
copyFilesOrFolders.add(srcFileOrFolder);
|
||||||
|
@ -1501,42 +1506,42 @@ public class UniversalFileTransferUtility
|
||||||
{
|
{
|
||||||
if (existingFiles != null)
|
if (existingFiles != null)
|
||||||
{
|
{
|
||||||
IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
|
IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
|
||||||
// newTargetFolder will be null if user chose to do a rename
|
// newTargetFolder will be null if user chose to do a rename
|
||||||
if (newTargetFolder == null) {
|
if (newTargetFolder == null) {
|
||||||
newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
|
newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
|
||||||
}
|
|
||||||
if (newTargetFolder != null && !newTargetFolder.exists())
|
|
||||||
{
|
|
||||||
newTargetFolder = targetFS.createFolder(newTargetFolder, monitor);
|
|
||||||
}
|
|
||||||
|
|
||||||
boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
|
|
||||||
boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
|
|
||||||
|
|
||||||
if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
|
|
||||||
{
|
|
||||||
compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//sometimes, IContainer#members does not return the right members under
|
|
||||||
//this folder. We need to call refreshLocal() first to overcome this problem
|
|
||||||
directory.refreshLocal(IResource.DEPTH_ONE, monitor);
|
|
||||||
IResource[] children = directory.members();
|
|
||||||
SystemWorkspaceResourceSet childSet = new SystemWorkspaceResourceSet(children);
|
|
||||||
SystemRemoteResourceSet childResults = uploadResourcesFromWorkspace(childSet, newTargetFolder, monitor, false);
|
|
||||||
if (childResults == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
if (childResults.hasMessage())
|
if (newTargetFolder != null && !newTargetFolder.exists())
|
||||||
{
|
{
|
||||||
resultSet.setMessage(childResults.getMessage());
|
newTargetFolder = targetFS.createFolder(newTargetFolder, monitor);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
newFilePathList.add(newPath);
|
boolean isTargetLocal = newTargetFolder.getParentRemoteFileSubSystem().getHost().getSystemType().isLocal();
|
||||||
|
boolean destInArchive = (newTargetFolder instanceof IVirtualRemoteFile) || newTargetFolder.isArchive();
|
||||||
|
|
||||||
|
if (doCompressedTransfer && doSuperTransferPreference && !destInArchive && !isTargetLocal)
|
||||||
|
{
|
||||||
|
compressedUploadFromWorkspace(directory, newTargetFolder, monitor);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//sometimes, IContainer#members does not return the right members under
|
||||||
|
//this folder. We need to call refreshLocal() first to overcome this problem
|
||||||
|
directory.refreshLocal(IResource.DEPTH_ONE, monitor);
|
||||||
|
IResource[] children = directory.members();
|
||||||
|
SystemWorkspaceResourceSet childSet = new SystemWorkspaceResourceSet(children);
|
||||||
|
SystemRemoteResourceSet childResults = uploadResourcesFromWorkspace(childSet, newTargetFolder, monitor, false);
|
||||||
|
if (childResults == null)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
if (childResults.hasMessage())
|
||||||
|
{
|
||||||
|
resultSet.setMessage(childResults.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
newFilePathList.add(newPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (SystemMessageException e)
|
catch (SystemMessageException e)
|
||||||
|
@ -1615,7 +1620,7 @@ public class UniversalFileTransferUtility
|
||||||
/*
|
/*
|
||||||
SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS);
|
SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS);
|
||||||
copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getAbsolutePath());
|
copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getAbsolutePath());
|
||||||
*/
|
*/
|
||||||
|
|
||||||
String name = srcFileOrFolder.getName();
|
String name = srcFileOrFolder.getName();
|
||||||
|
|
||||||
|
@ -1839,7 +1844,7 @@ public class UniversalFileTransferUtility
|
||||||
FileServiceSubSystem localSS = (FileServiceSubSystem)getLocalFileSubSystem();
|
FileServiceSubSystem localSS = (FileServiceSubSystem)getLocalFileSubSystem();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
localSS.delete(destinationArchive, monitor);
|
localSS.delete(destinationArchive, monitor);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -1896,7 +1901,7 @@ public class UniversalFileTransferUtility
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
@ -1998,23 +2003,23 @@ public class UniversalFileTransferUtility
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
|
String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
|
||||||
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
|
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
|
||||||
if (destinationArchive.exists())
|
if (destinationArchive.exists())
|
||||||
{
|
{
|
||||||
directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
|
directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
|
||||||
}
|
}
|
||||||
directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
|
directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
|
||||||
}
|
}
|
||||||
catch (RemoteFileSecurityException e)
|
catch (RemoteFileSecurityException e)
|
||||||
{
|
{
|
||||||
// can't write to this directory
|
// can't write to this directory
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (destinationArchive == null)
|
if (destinationArchive == null)
|
||||||
{
|
{
|
||||||
String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
|
String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
|
||||||
String destArchPath = homeFolder + separator + file.getName();
|
String destArchPath = homeFolder + separator + file.getName();
|
||||||
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
|
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
|
||||||
if (destinationArchive.exists()) directory.getParentRemoteFileSubSystem().delete(destinationArchive,monitor);
|
if (destinationArchive.exists()) directory.getParentRemoteFileSubSystem().delete(destinationArchive,monitor);
|
||||||
destinationArchive = directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
|
destinationArchive = directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
|
||||||
|
@ -2091,21 +2096,21 @@ public class UniversalFileTransferUtility
|
||||||
if (replace)
|
if (replace)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!monitor.isCanceled())
|
if (!monitor.isCanceled())
|
||||||
{
|
{
|
||||||
String currentSourcePath = dest.getAbsolutePath() + ArchiveHandlerManager.VIRTUAL_SEPARATOR + arcContents[i].fullName;
|
String currentSourcePath = dest.getAbsolutePath() + ArchiveHandlerManager.VIRTUAL_SEPARATOR + arcContents[i].fullName;
|
||||||
IRemoteFile currentSource = localSS.getRemoteFileObject(currentSourcePath, monitor);
|
IRemoteFile currentSource = localSS.getRemoteFileObject(currentSourcePath, monitor);
|
||||||
boolean shouldExtract = currentSource.isFile();
|
boolean shouldExtract = currentSource.isFile();
|
||||||
|
|
||||||
if (!shouldExtract)
|
if (!shouldExtract)
|
||||||
{
|
{
|
||||||
// check for empty dir
|
// check for empty dir
|
||||||
IRemoteFile[] children = localSS.list(currentSource, monitor);
|
IRemoteFile[] children = localSS.list(currentSource, monitor);
|
||||||
|
|
||||||
if (children == null || children.length == 0)
|
if (children == null || children.length == 0)
|
||||||
{
|
{
|
||||||
shouldExtract = true;
|
shouldExtract = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldExtract)
|
if (shouldExtract)
|
||||||
|
@ -2117,36 +2122,36 @@ public class UniversalFileTransferUtility
|
||||||
boolean canWrite = true;
|
boolean canWrite = true;
|
||||||
if (currentTarget != null)
|
if (currentTarget != null)
|
||||||
{
|
{
|
||||||
IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
|
IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
|
||||||
if (currentTargetResource != null && currentTargetResource.exists())
|
if (currentTargetResource != null && currentTargetResource.exists())
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
{
|
||||||
currentTargetResource.delete(false, monitor);
|
try
|
||||||
|
{
|
||||||
|
currentTargetResource.delete(false, monitor);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
// don't extract this one
|
||||||
|
canWrite = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
|
if (canWrite)
|
||||||
{
|
{
|
||||||
// don't extract this one
|
localSS.copy(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), monitor);
|
||||||
canWrite = false;
|
// FIXME localSS.copyFromArchiveWithEncoding(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), sourceEncoding, isText, monitor);
|
||||||
|
|
||||||
|
SystemIFileProperties properties = new SystemIFileProperties(currentTargetResource);
|
||||||
|
properties.setRemoteFileTimeStamp(arcContents[i].getTimeStamp());
|
||||||
|
monitor.worked(1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canWrite)
|
|
||||||
{
|
|
||||||
localSS.copy(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), monitor);
|
|
||||||
// FIXME localSS.copyFromArchiveWithEncoding(currentSource, currentTarget.getParentRemoteFile(), currentSource.getName(), sourceEncoding, isText, monitor);
|
|
||||||
|
|
||||||
SystemIFileProperties properties = new SystemIFileProperties(currentTargetResource);
|
|
||||||
properties.setRemoteFileTimeStamp(arcContents[i].getTimeStamp());
|
|
||||||
monitor.worked(1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//return null;
|
//return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2158,7 +2163,7 @@ public class UniversalFileTransferUtility
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
cleanup(cpdest, dest);
|
cleanup(cpdest, dest);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
@ -2172,18 +2177,18 @@ public class UniversalFileTransferUtility
|
||||||
{
|
{
|
||||||
if (arc1 != null)
|
if (arc1 != null)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
arc1.getParentRemoteFileSubSystem().delete(arc1, null);
|
arc1.getParentRemoteFileSubSystem().delete(arc1, null);
|
||||||
}
|
}
|
||||||
catch (SystemMessageException e)
|
catch (SystemMessageException e)
|
||||||
{
|
{
|
||||||
SystemMessageDialog.displayMessage(e);
|
SystemMessageDialog.displayMessage(e);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (arc2 != null && arc2.exists())
|
if (arc2 != null && arc2.exists())
|
||||||
arc2.delete();
|
arc2.delete();
|
||||||
|
@ -2401,13 +2406,13 @@ public class UniversalFileTransferUtility
|
||||||
|
|
||||||
public static String getActualHostFor(IRemoteFileSubSystem subsystem, String remotePath)
|
public static String getActualHostFor(IRemoteFileSubSystem subsystem, String remotePath)
|
||||||
{
|
{
|
||||||
String hostname = subsystem.getHost().getHostName();
|
String hostname = subsystem.getHost().getHostName();
|
||||||
if (subsystem.getHost().getSystemType().isLocal())
|
if (subsystem.getHost().getSystemType().isLocal())
|
||||||
{
|
{
|
||||||
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
|
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
return hostname;
|
return hostname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getActualHostFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
|
public static String getActualHostFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
|
||||||
|
@ -2735,7 +2740,7 @@ public class UniversalFileTransferUtility
|
||||||
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor);
|
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform a copy via drag and drop.
|
* Perform a copy via drag and drop.
|
||||||
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
|
* @param workspaceSet the objects to be copied. If the target and sources are not on the same system, then this is a
|
||||||
* temporary object produced by the doDrag.
|
* temporary object produced by the doDrag.
|
||||||
|
|
|
@ -23,13 +23,13 @@ import org.eclipse.rse.files.ui.resources.ISystemRemoteMarker;
|
||||||
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
|
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is an internal implementation of the ISystemRemoteMarker interface.
|
* This class is an internal implementation of the ISystemRemoteMarker
|
||||||
* It is not intended to be implemented by clients.
|
* interface.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemRemoteMarker implements ISystemRemoteMarker {
|
public class SystemRemoteMarker implements ISystemRemoteMarker {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resource with which this marker is associated.
|
* Resource with which this marker is associated.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -25,25 +25,28 @@ import org.eclipse.ui.IWorkbench;
|
||||||
import org.eclipse.ui.IWorkbenchPage;
|
import org.eclipse.ui.IWorkbenchPage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Standard workbench wizard for exporting resources from the workspace
|
* Standard workbench wizard for exporting resources from the workspace to the
|
||||||
* to the local file system.
|
* local file system.
|
||||||
* <p>
|
* <p>
|
||||||
* This class may be instantiated and used without further configuration;
|
* This class may be instantiated and used without further configuration.
|
||||||
* this class is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Example:
|
* Example:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* IWizard wizard = new RemoteExportWizard();
|
* IWizard wizard = new RemoteExportWizard();
|
||||||
* wizard.init(workbench, selection);
|
* wizard.init(workbench, selection);
|
||||||
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
||||||
* dialog.open();
|
* dialog.open();
|
||||||
* </pre>
|
* </pre>
|
||||||
* During the call to <code>open</code>, the wizard dialog is presented to the
|
*
|
||||||
* user. When the user hits Finish, the user-selected workspace resources
|
* During the call to <code>open</code>, the wizard dialog is presented to
|
||||||
* are exported to the user-specified location in the local file system,
|
* the user. When the user hits Finish, the user-selected workspace resources
|
||||||
* the dialog closes, and the call to <code>open</code> returns.
|
* are exported to the user-specified location in the local file system, the
|
||||||
|
* dialog closes, and the call to <code>open</code> returns.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
|
public class RemoteExportWizard extends AbstractSystemWizard implements IExportWizard {
|
||||||
private IStructuredSelection selection;
|
private IStructuredSelection selection;
|
||||||
|
|
|
@ -52,11 +52,10 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
|
||||||
|
|
||||||
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
|
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
|
||||||
/**
|
/**
|
||||||
* An operation which does the actual work of copying objects from the local file
|
* An operation which does the actual work of copying objects from the local
|
||||||
* system into the workspace.
|
* file system into the workspace.
|
||||||
* <p>
|
*
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
|
||||||
private static final int POLICY_DEFAULT = 0;
|
private static final int POLICY_DEFAULT = 0;
|
||||||
|
|
|
@ -28,22 +28,25 @@ import org.eclipse.ui.IWorkbench;
|
||||||
* Standard workbench wizard for importing resources from the local file system
|
* Standard workbench wizard for importing resources from the local file system
|
||||||
* into the workspace.
|
* into the workspace.
|
||||||
* <p>
|
* <p>
|
||||||
* This class may be instantiated and used without further configuration;
|
* This class may be instantiated and used without further configuration.
|
||||||
* this class is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
* <p>
|
* <p>
|
||||||
* Example:
|
* Example:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* IWizard wizard = new RemoteImportWizard();
|
* IWizard wizard = new RemoteImportWizard();
|
||||||
* wizard.init(workbench, selection);
|
* wizard.init(workbench, selection);
|
||||||
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
* WizardDialog dialog = new WizardDialog(shell, wizard);
|
||||||
* dialog.open();
|
* dialog.open();
|
||||||
* </pre>
|
* </pre>
|
||||||
* During the call to <code>open</code>, the wizard dialog is presented to the
|
*
|
||||||
* user. When the user hits Finish, the user-selected files are imported
|
* During the call to <code>open</code>, the wizard dialog is presented to
|
||||||
|
* the user. When the user hits Finish, the user-selected files are imported
|
||||||
* into the workspace, the dialog closes, and the call to <code>open</code>
|
* into the workspace, the dialog closes, and the call to <code>open</code>
|
||||||
* returns.
|
* returns.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
|
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
|
||||||
private IWorkbench workbench;
|
private IWorkbench workbench;
|
||||||
|
@ -118,8 +121,8 @@ public class RemoteImportWizard extends AbstractSystemWizard implements IImportW
|
||||||
return mainPage.finish();
|
return mainPage.finish();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean performCancel() {
|
public boolean performCancel() {
|
||||||
mainPage.cancel();
|
mainPage.cancel();
|
||||||
return super.performCancel();
|
return super.performCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,9 +41,10 @@ import org.eclipse.rse.internal.services.clientserver.java.StringInfo;
|
||||||
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
|
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is a basic class file parser that returns a package name from a class file.
|
* This is a basic class file parser that returns a package name from a class
|
||||||
|
* file.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class BasicClassFileParser {
|
public class BasicClassFileParser {
|
||||||
|
|
||||||
|
@ -188,65 +189,65 @@ public class BasicClassFileParser {
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|
||||||
case IClassFileConstants.CONSTANT_CLASS: {
|
case IClassFileConstants.CONSTANT_CLASS: {
|
||||||
int nameIndex = dataStream.readUnsignedShort();
|
int nameIndex = dataStream.readUnsignedShort();
|
||||||
return new ClassInfo(tag, nameIndex);
|
return new ClassInfo(tag, nameIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_FIELD_REF: {
|
case IClassFileConstants.CONSTANT_FIELD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_METHOD_REF: {
|
case IClassFileConstants.CONSTANT_METHOD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
|
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
|
||||||
int classIndex = dataStream.readUnsignedShort();
|
int classIndex = dataStream.readUnsignedShort();
|
||||||
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
int nameAndTypeIndex = dataStream.readUnsignedShort();
|
||||||
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_STRING: {
|
case IClassFileConstants.CONSTANT_STRING: {
|
||||||
int stringIndex = dataStream.readUnsignedShort();
|
int stringIndex = dataStream.readUnsignedShort();
|
||||||
return new StringInfo(tag, stringIndex);
|
return new StringInfo(tag, stringIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_INTEGER: {
|
case IClassFileConstants.CONSTANT_INTEGER: {
|
||||||
long bytes = dataStream.readUnsignedInt();
|
long bytes = dataStream.readUnsignedInt();
|
||||||
return new IntegerInfo(tag, bytes);
|
return new IntegerInfo(tag, bytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_FLOAT: {
|
case IClassFileConstants.CONSTANT_FLOAT: {
|
||||||
long bytes = dataStream.readUnsignedInt();
|
long bytes = dataStream.readUnsignedInt();
|
||||||
return new FloatInfo(tag, bytes);
|
return new FloatInfo(tag, bytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_LONG: {
|
case IClassFileConstants.CONSTANT_LONG: {
|
||||||
long highBytes = dataStream.readUnsignedInt();
|
long highBytes = dataStream.readUnsignedInt();
|
||||||
long lowBytes = dataStream.readUnsignedInt();
|
long lowBytes = dataStream.readUnsignedInt();
|
||||||
return new LongInfo(tag, highBytes, lowBytes);
|
return new LongInfo(tag, highBytes, lowBytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_DOUBLE: {
|
case IClassFileConstants.CONSTANT_DOUBLE: {
|
||||||
long highBytes = dataStream.readUnsignedInt();
|
long highBytes = dataStream.readUnsignedInt();
|
||||||
long lowBytes = dataStream.readUnsignedInt();
|
long lowBytes = dataStream.readUnsignedInt();
|
||||||
return new DoubleInfo(tag, highBytes, lowBytes);
|
return new DoubleInfo(tag, highBytes, lowBytes);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
|
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
|
||||||
int nameIndex = dataStream.readUnsignedShort();
|
int nameIndex = dataStream.readUnsignedShort();
|
||||||
int descriptorIndex = dataStream.readUnsignedShort();
|
int descriptorIndex = dataStream.readUnsignedShort();
|
||||||
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
|
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
|
||||||
}
|
}
|
||||||
case IClassFileConstants.CONSTANT_UTF8: {
|
case IClassFileConstants.CONSTANT_UTF8: {
|
||||||
int length = dataStream.readUnsignedShort();
|
int length = dataStream.readUnsignedShort();
|
||||||
short[] bytes = new short[length];
|
short[] bytes = new short[length];
|
||||||
|
|
||||||
for (int i = 0; i < length; i++) {
|
for (int i = 0; i < length; i++) {
|
||||||
bytes[i] = (short)(dataStream.readUnsignedByte());
|
bytes[i] = (short)(dataStream.readUnsignedByte());
|
||||||
}
|
}
|
||||||
|
|
||||||
return new UTF8Info(tag, length, bytes);
|
return new UTF8Info(tag, length, bytes);
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ import java.io.InputStream;
|
||||||
/**
|
/**
|
||||||
* Singleton class for obtaining various information about class files.
|
* Singleton class for obtaining various information about class files.
|
||||||
* <p>
|
* <p>
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class ClassFileUtil {
|
public class ClassFileUtil {
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public class ClassFileUtil {
|
||||||
public boolean isRunnable(File classFile) throws IOException {
|
public boolean isRunnable(File classFile) throws IOException {
|
||||||
FileInputStream stream = new FileInputStream(classFile);
|
FileInputStream stream = new FileInputStream(classFile);
|
||||||
return isRunnable(stream);
|
return isRunnable(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns whether the class represented by the given input stream is runnable,
|
* Returns whether the class represented by the given input stream is runnable,
|
||||||
|
|
|
@ -37,22 +37,24 @@ import org.eclipse.rse.services.IService;
|
||||||
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A IFileService is an abstraction of a file service that runs over some sort of connection.
|
* A IFileService is an abstraction of a file service that runs over some sort
|
||||||
* It can be shared among multiple instances of a subsystem. At some point this file
|
* of connection. It can be shared among multiple instances of a subsystem. At
|
||||||
* service layer may become official API but for now it is experimental. Each
|
* some point this file service layer may become official API but for now it is
|
||||||
* subsystem is currently responsible for layering an abstraction over whatever it
|
* experimental. Each subsystem is currently responsible for layering an
|
||||||
* wants to construct as a service.
|
* abstraction over whatever it wants to construct as a service.
|
||||||
* <p>
|
* <p>
|
||||||
* This is a very bare bones definition. A real definition would probably have changed
|
* This is a very bare bones definition. A real definition would probably have
|
||||||
* terminology, use URI's rather than Strings, and have much more robust error handling.
|
* changed terminology, use URI's rather than Strings, and have much more robust
|
||||||
* </p><p>
|
* error handling.
|
||||||
* Implementers of this interface will have to either be instantiated, initialized, or
|
|
||||||
* somehow derive a connection as part of its state.
|
|
||||||
* </p><p>
|
|
||||||
* This interface is not intended to be implemented by clients. File service
|
|
||||||
* implementations must subclass {@link AbstractFileService} rather than implementing
|
|
||||||
* this interface directly.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* Implementers of this interface will have to either be instantiated,
|
||||||
|
* initialized, or somehow derive a connection as part of its state.
|
||||||
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
|
* File service implementations must subclass
|
||||||
|
* {@link AbstractFileService} rather than implementing this
|
||||||
|
* interface directly.
|
||||||
*/
|
*/
|
||||||
public interface IFileService extends IService
|
public interface IFileService extends IService
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,7 +23,10 @@ import org.eclipse.rse.subsystems.files.core.model.ISystemFileTransferModeMappin
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal class. Clients must not instantiate or subclass it.
|
* An internal class.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemFileTransferModeMapping implements ISystemFileTransferModeMapping, Cloneable {
|
public class SystemFileTransferModeMapping implements ISystemFileTransferModeMapping, Cloneable {
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,10 @@ import org.eclipse.ui.XMLMemento;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An internal class. Clients must not instantiate or subclass it.
|
* An internal class.
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRegistry {
|
public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRegistry {
|
||||||
|
@ -229,7 +232,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a key given the mapping
|
* Return a key given the mapping
|
||||||
*/
|
*/
|
||||||
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
|
private String getMappingKey(ISystemFileTransferModeMapping mapping) {
|
||||||
return mapping.getLabel().toLowerCase();
|
return mapping.getLabel().toLowerCase();
|
||||||
|
@ -529,7 +532,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
|
||||||
|
|
||||||
try {
|
try {
|
||||||
stream = new FileOutputStream(location);
|
stream = new FileOutputStream(location);
|
||||||
writer = new OutputStreamWriter(stream, ENCODING);
|
writer = new OutputStreamWriter(stream, ENCODING);
|
||||||
memento.save(writer);
|
memento.save(writer);
|
||||||
}
|
}
|
||||||
catch (Exception e) {
|
catch (Exception e) {
|
||||||
|
|
|
@ -35,7 +35,8 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf
|
||||||
/**
|
/**
|
||||||
* Public utility class for dealing with remote file subsystems.
|
* Public utility class for dealing with remote file subsystems.
|
||||||
*
|
*
|
||||||
* Clients may use this class, but not instantiate or subclass it.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
|
* @noinstantiate This class is not intended to be instantiated by clients.
|
||||||
*/
|
*/
|
||||||
public class RemoteFileUtility
|
public class RemoteFileUtility
|
||||||
{
|
{
|
||||||
|
@ -88,27 +89,27 @@ public class RemoteFileUtility
|
||||||
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
|
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
|
||||||
* no file subsystem is configured with the given system type.
|
* no file subsystem is configured with the given system type.
|
||||||
*/
|
*/
|
||||||
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
|
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
|
||||||
{
|
{
|
||||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||||
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
|
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
|
||||||
for (int i = 0; i < sses.length; i++)
|
for (int i = 0; i < sses.length; i++)
|
||||||
|
{
|
||||||
|
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
|
||||||
{
|
{
|
||||||
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
|
return (IRemoteFileSubSystemConfiguration)sses[i];
|
||||||
{
|
|
||||||
return (IRemoteFileSubSystemConfiguration)sses[i];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
}
|
||||||
}
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the global SystemFileTransferModeRegistry.
|
* Return the global SystemFileTransferModeRegistry.
|
||||||
* @return the global SystemFileTransferModeRegistry.
|
* @return the global SystemFileTransferModeRegistry.
|
||||||
*/
|
*/
|
||||||
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
|
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
|
||||||
{
|
{
|
||||||
return SystemFileTransferModeRegistry.getInstance();
|
return SystemFileTransferModeRegistry.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -30,19 +30,18 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
|
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class, which
|
||||||
* which allows the input array to be changed dynamically.
|
* allows the input array to be changed dynamically.
|
||||||
* <p>
|
* <p>
|
||||||
* A cell editor that presents a list of items in a combo box.
|
* A cell editor that presents a list of items in a combo box. The cell editor's
|
||||||
* The cell editor's value is the zero-based index of the selected
|
* value is the zero-based index of the selected item.
|
||||||
* item.
|
|
||||||
* <p>
|
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemComboBoxCellEditor extends CellEditor
|
public class SystemComboBoxCellEditor extends CellEditor
|
||||||
{
|
{
|
||||||
private boolean readOnly = false;
|
private boolean readOnly = false;
|
||||||
/**
|
/**
|
||||||
* The list of items to present in the combo box.
|
* The list of items to present in the combo box.
|
||||||
*/
|
*/
|
||||||
|
@ -72,9 +71,9 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
super(parent);
|
super(parent);
|
||||||
selection = 0;
|
selection = 0;
|
||||||
if (items != null)
|
if (items != null)
|
||||||
setItems(items);
|
setItems(items);
|
||||||
else
|
else
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Creates a new cell editor with a combo containing the given
|
* Creates a new cell editor with a combo containing the given
|
||||||
|
@ -92,7 +91,7 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
super(parent);
|
super(parent);
|
||||||
selection = 0;
|
selection = 0;
|
||||||
//this.readOnly = readOnly;
|
//this.readOnly = readOnly;
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Change the input items
|
* Change the input items
|
||||||
|
@ -101,17 +100,17 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
{
|
{
|
||||||
this.items = items;
|
this.items = items;
|
||||||
populateComboBoxItems();
|
populateComboBoxItems();
|
||||||
setValueValid(true);
|
setValueValid(true);
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Method declared on CellEditor.
|
* Method declared on CellEditor.
|
||||||
*/
|
*/
|
||||||
protected Control createControl(Composite parent)
|
protected Control createControl(Composite parent)
|
||||||
{
|
{
|
||||||
if (!readOnly)
|
if (!readOnly)
|
||||||
comboBox = new CCombo(parent, SWT.NONE);
|
comboBox = new CCombo(parent, SWT.NONE);
|
||||||
else
|
else
|
||||||
comboBox = new CCombo(parent, SWT.READ_ONLY);
|
comboBox = new CCombo(parent, SWT.READ_ONLY);
|
||||||
comboBox.setFont(parent.getFont());
|
comboBox.setFont(parent.getFont());
|
||||||
|
|
||||||
comboBox.addKeyListener(new KeyAdapter() {
|
comboBox.addKeyListener(new KeyAdapter() {
|
||||||
|
@ -139,7 +138,7 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
} else {
|
} else {
|
||||||
// try to insert the current value into the error message.
|
// try to insert the current value into the error message.
|
||||||
setErrorMessage(
|
setErrorMessage(
|
||||||
NLS.bind(getErrorMessage(), items[selection]));
|
NLS.bind(getErrorMessage(), items[selection]));
|
||||||
}
|
}
|
||||||
fireApplyEditorValue();
|
fireApplyEditorValue();
|
||||||
}
|
}
|
||||||
|
@ -165,7 +164,7 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
*/
|
*/
|
||||||
protected Object doGetValue()
|
protected Object doGetValue()
|
||||||
{
|
{
|
||||||
return new Integer(selection);
|
return new Integer(selection);
|
||||||
}
|
}
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* Method declared on CellEditor.
|
* Method declared on CellEditor.
|
||||||
|
@ -179,9 +178,9 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
* this <code>CellEditor</code> framework method
|
* this <code>CellEditor</code> framework method
|
||||||
* accepts a zero-based index of a selection.
|
* accepts a zero-based index of a selection.
|
||||||
*
|
*
|
||||||
* @param value the zero-based index of the selection wrapped
|
* @param value the zero-based index of the selection wrapped
|
||||||
* as an <code>Integer</code>
|
* as an <code>Integer</code>
|
||||||
*/
|
*/
|
||||||
protected void doSetValue(Object value)
|
protected void doSetValue(Object value)
|
||||||
{
|
{
|
||||||
if (!(value instanceof Integer))
|
if (!(value instanceof Integer))
|
||||||
|
@ -195,7 +194,7 @@ public class SystemComboBoxCellEditor extends CellEditor
|
||||||
selection = i;
|
selection = i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Assert.isTrue(comboBox != null && (value instanceof Integer));
|
//Assert.isTrue(comboBox != null && (value instanceof Integer));
|
||||||
|
|
|
@ -65,7 +65,7 @@ import org.eclipse.ui.part.ResourceTransfer;
|
||||||
/**
|
/**
|
||||||
* Registry and control center for RSE UI related operations.
|
* Registry and control center for RSE UI related operations.
|
||||||
*
|
*
|
||||||
* This class is not intended to be subclassed by clients.
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class SystemRegistryUI implements ISystemRegistryUI {
|
public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
|
|
||||||
|
@ -305,13 +305,13 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
|
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
|
||||||
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
|
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
|
||||||
{
|
{
|
||||||
int profileDelim = str.indexOf("."); //$NON-NLS-1$
|
int profileDelim = str.indexOf("."); //$NON-NLS-1$
|
||||||
if (profileDelim != -1)
|
if (profileDelim != -1)
|
||||||
{
|
{
|
||||||
String profileId = str.substring(0, profileDelim);
|
String profileId = str.substring(0, profileDelim);
|
||||||
String connectionId = str.substring(profileDelim + 1, str.length());
|
String connectionId = str.substring(profileDelim + 1, str.length());
|
||||||
ISystemProfile profile = registry.getSystemProfile(profileId);
|
ISystemProfile profile = registry.getSystemProfile(profileId);
|
||||||
return registry.getHost(profile, connectionId);
|
return registry.getHost(profile, connectionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,11 +438,11 @@ public class SystemRegistryUI implements ISystemRegistryUI {
|
||||||
*/
|
*/
|
||||||
public SystemScratchpad getSystemScratchPad()
|
public SystemScratchpad getSystemScratchPad()
|
||||||
{
|
{
|
||||||
if (scratchpad == null)
|
if (scratchpad == null)
|
||||||
{
|
{
|
||||||
scratchpad = new SystemScratchpad();
|
scratchpad = new SystemScratchpad();
|
||||||
}
|
}
|
||||||
return scratchpad;
|
return scratchpad;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -31,9 +31,8 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Registry and control center for RSE UI related operations.
|
* Registry and control center for RSE UI related operations.
|
||||||
* <p>
|
*
|
||||||
* This interface is not intended to be implemented by clients.
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
* </p>
|
|
||||||
*/
|
*/
|
||||||
public interface ISystemRegistryUI extends ISystemShellProvider {
|
public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
|
|
||||||
|
@ -58,10 +57,10 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
|
||||||
*/
|
*/
|
||||||
public void expandSubSystem(ISubSystem subsystem);
|
public void expandSubSystem(ISubSystem subsystem);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the clipboard used for copy actions
|
* Returns the clipboard used for copy actions
|
||||||
*/
|
*/
|
||||||
public Clipboard getSystemClipboard();
|
public Clipboard getSystemClipboard();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the list of objects on the system clipboard
|
* Returns the list of objects on the system clipboard
|
||||||
|
|
|
@ -15,12 +15,10 @@ import org.eclipse.swt.widgets.Composite;
|
||||||
import org.eclipse.swt.widgets.Control;
|
import org.eclipse.swt.widgets.Control;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A pagebook is a composite control where only a single control is visible
|
* A pagebook is a composite control where only a single control is visible at a
|
||||||
* at a time. It is similar to a notebook, but without tabs.
|
* time. It is similar to a notebook, but without tabs.
|
||||||
* <p>
|
|
||||||
* This class may be instantiated; it is not intended to be subclassed.
|
|
||||||
* </p>
|
|
||||||
*
|
*
|
||||||
|
* @noextend This class is not intended to be subclassed by clients.
|
||||||
*/
|
*/
|
||||||
public class PageBook extends Composite {
|
public class PageBook extends Composite {
|
||||||
private StackLayout fLayout;
|
private StackLayout fLayout;
|
||||||
|
|
|
@ -17,15 +17,16 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represents the terminal view as seen by a terminal connection.
|
* Represents the terminal view as seen by a terminal connection.
|
||||||
*
|
|
||||||
* <p> Not to be implemented by clients.
|
|
||||||
* @author Michael Scharf
|
|
||||||
* <p>
|
* <p>
|
||||||
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
|
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
|
||||||
* part of a work in progress. There is no guarantee that this API will
|
* part of a work in progress. There is no guarantee that this API will work or
|
||||||
* work or that it will remain the same. Please do not use this API without
|
* that it will remain the same. Please do not use this API without consulting
|
||||||
* consulting with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
|
* with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a>
|
||||||
|
* team.
|
||||||
* </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Michael Scharf
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalControl {
|
public interface ITerminalControl {
|
||||||
|
|
||||||
|
|
|
@ -12,12 +12,13 @@ package org.eclipse.tm.terminal.model;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A writable matrix of characters and {@link Style}. This is intended to be the
|
* A writable matrix of characters and {@link Style}. This is intended to be
|
||||||
* low level representation of the text of a Terminal. Higher layers are responsible
|
* the low level representation of the text of a Terminal. Higher layers are
|
||||||
* to fill the text and styles into this representation.
|
* responsible to fill the text and styles into this representation.
|
||||||
*
|
* <p>
|
||||||
* <p><b>Note: </b> Implementations of this interface has to be thread safe.
|
* <b>Note: </b> Implementations of this interface has to be thread safe.
|
||||||
* <p><b>Note: </b> This interface is not intended to be implemented by clients.
|
* </p>
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
|
|
||||||
|
@ -68,20 +69,20 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
|
||||||
* @param line
|
* @param line
|
||||||
*/
|
*/
|
||||||
void cleanLine(int line);
|
void cleanLine(int line);
|
||||||
// /**
|
// /**
|
||||||
// * @param line
|
// * @param line
|
||||||
// * @return true if this line belongs to the previous line but is simply
|
// * @return true if this line belongs to the previous line but is simply
|
||||||
// * wrapped.
|
// * wrapped.
|
||||||
// */
|
// */
|
||||||
// boolean isWrappedLine(int line);
|
// boolean isWrappedLine(int line);
|
||||||
//
|
//
|
||||||
// /**
|
// /**
|
||||||
// * Makes this line an extension to the previous line. Wrapped lines get folded back
|
// * Makes this line an extension to the previous line. Wrapped lines get folded back
|
||||||
// * when the width of the terminal changes
|
// * when the width of the terminal changes
|
||||||
// * @param line
|
// * @param line
|
||||||
// * @param extendsPreviousLine
|
// * @param extendsPreviousLine
|
||||||
// */
|
// */
|
||||||
// void setWrappedLine(int line, boolean extendsPreviousLine);
|
// void setWrappedLine(int line, boolean extendsPreviousLine);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars
|
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars
|
||||||
|
|
|
@ -13,62 +13,73 @@ package org.eclipse.tm.terminal.model;
|
||||||
/**
|
/**
|
||||||
* This class maintains a snapshot of an instance of {@link ITerminalTextData}.
|
* This class maintains a snapshot of an instance of {@link ITerminalTextData}.
|
||||||
* While the {@link ITerminalTextData} continues changing, the snapshot remains
|
* While the {@link ITerminalTextData} continues changing, the snapshot remains
|
||||||
* unchanged until the next snapshot is taken by calling {@link #updateSnapshot(boolean)}.
|
* unchanged until the next snapshot is taken by calling
|
||||||
* This is important, because the {@link ITerminalTextData} might get
|
* {@link #updateSnapshot(boolean)}. This is important, because the
|
||||||
* modified by another thread. Suppose you would want to draw the content of
|
* {@link ITerminalTextData} might get modified by another thread. Suppose you
|
||||||
* the {@link ITerminalTextData} using the following loop:
|
* would want to draw the content of the {@link ITerminalTextData} using the
|
||||||
|
* following loop:
|
||||||
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* for(int line=0;line<term.getHeight();line++)
|
* for (int line = 0; line < term.getHeight(); line++)
|
||||||
* for(int column=0; column<term.getWidth();column++)
|
* for (int column = 0; column < term.getWidth(); column++)
|
||||||
* drawCharacter(column,line,term.getChar(column,line),term.getStyle(column,line));
|
* drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line));
|
||||||
* </pre>
|
* </pre>
|
||||||
* This might fail because the background thread could change the dimensions of the
|
*
|
||||||
* {@link ITerminalTextData} while you iterate the loop. One solution would be to
|
* This might fail because the background thread could change the dimensions of
|
||||||
* put a <code>synchronized(term){}</code> statement around the code. This has
|
* the {@link ITerminalTextData} while you iterate the loop. One solution would
|
||||||
* two problems: 1. you would have to know about the internals of the synchronisation
|
* be to put a <code>synchronized(term){}</code> statement around the code.
|
||||||
* of {@link ITerminalTextData}. 2. The other thread that changes {@link ITerminalTextData}
|
* This has two problems: 1. you would have to know about the internals of the
|
||||||
* is blocked while the potentially slow drawing is done.
|
* synchronisation of {@link ITerminalTextData}. 2. The other thread that
|
||||||
|
* changes {@link ITerminalTextData} is blocked while the potentially slow
|
||||||
|
* drawing is done.
|
||||||
* <p>
|
* <p>
|
||||||
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to draw
|
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to
|
||||||
* the content. There is no danger that the data structure get changed while
|
* draw the content. There is no danger that the data structure get changed
|
||||||
* you draw. There are also methods to find out what has changed to minimize
|
* while you draw. There are also methods to find out what has changed to
|
||||||
* the number of lines that get redrawn.</p>
|
* minimize the number of lines that get redrawn.
|
||||||
*
|
|
||||||
* <p><b>Drawing optimization</b>: To optimize redrawing of changed lines, this class keeps
|
|
||||||
* track of lines that have changed since the previous snapshot.</p>
|
|
||||||
*
|
|
||||||
* <pre>
|
|
||||||
* // iterate over the potentially changed lines
|
|
||||||
* for(int line=snap.getFirstChangedLine();line<=snap.getLastChangedLine();line++)
|
|
||||||
* // redraw only if the line has changed
|
|
||||||
* if(snap.hasLineChanged(line))
|
|
||||||
* for(int column=0; column<snap.getWidth();column++)
|
|
||||||
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
|
|
||||||
* </pre>
|
|
||||||
*
|
|
||||||
* <p><b>Scroll optimization:</b> Often new lines are appended at the bottom of the
|
|
||||||
* terminal and the rest of the lines are scrolled up. In this case all lines would be
|
|
||||||
* marked as changed. To optimize for this
|
|
||||||
* case, {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
|
|
||||||
* the <code>detectScrolling</code> parameter. The object will keep track of scrolling.
|
|
||||||
* The UI must <b>first</b> handle the scrolling and then use the {@link #hasLineChanged(int)}
|
|
||||||
* method to determine scrolling:
|
|
||||||
* <pre>
|
|
||||||
* // scroll the visible region of the UI <b>before</b> drawing the changed lines.
|
|
||||||
* doUIScrolling(snap.getScrollChangeY(),snap.getScrollChangeN(),snap.getScrollChangeShift());
|
|
||||||
* // iterate over the potentially changed lines
|
|
||||||
* for(int line=snap.getFirstChangedLine();line<=snap.getFirstChangedLine();line++)
|
|
||||||
* // redraw only if the line has changed
|
|
||||||
* if(snap.hasLineChanged(line))
|
|
||||||
* for(int column=0; column<snap.getWidth();column++)
|
|
||||||
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
|
|
||||||
* </pre>
|
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* <p><b>Note</b>: This interface is not intended to be implemented by clients.</p>
|
* <p>
|
||||||
* <p><b>Threading Note</b>: This class is not thread save! All methods have to be called by
|
* <b>Drawing optimization</b>: To optimize redrawing of changed lines, this
|
||||||
* the a same thread, that created the instance by calling
|
* class keeps track of lines that have changed since the previous snapshot.
|
||||||
* {@link ITerminalTextDataReadOnly#makeSnapshot()}. </p>
|
* </p>
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* // iterate over the potentially changed lines
|
||||||
|
* for (int line = snap.getFirstChangedLine(); line <= snap.getLastChangedLine(); line++)
|
||||||
|
* // redraw only if the line has changed
|
||||||
|
* if (snap.hasLineChanged(line))
|
||||||
|
* for (int column = 0; column < snap.getWidth(); column++)
|
||||||
|
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
* <p>
|
||||||
|
* <b>Scroll optimization:</b> Often new lines are appended at the bottom of
|
||||||
|
* the terminal and the rest of the lines are scrolled up. In this case all
|
||||||
|
* lines would be marked as changed. To optimize for this case,
|
||||||
|
* {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
|
||||||
|
* the <code>detectScrolling</code> parameter. The object will keep track of
|
||||||
|
* scrolling. The UI must <b>first</b> handle the scrolling and then use the
|
||||||
|
* {@link #hasLineChanged(int)} method to determine scrolling:
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
* // scroll the visible region of the UI <b>before</b> drawing the changed lines.
|
||||||
|
* doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift());
|
||||||
|
* // iterate over the potentially changed lines
|
||||||
|
* for (int line = snap.getFirstChangedLine(); line <= snap.getFirstChangedLine(); line++)
|
||||||
|
* // redraw only if the line has changed
|
||||||
|
* if (snap.hasLineChanged(line))
|
||||||
|
* for (int column = 0; column < snap.getWidth(); column++)
|
||||||
|
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
|
||||||
|
* </pre>
|
||||||
|
* </p>
|
||||||
|
* <p>
|
||||||
|
* <b>Threading Note</b>: This class is not thread safe! All methods have to be
|
||||||
|
* called by the a same thread, that created the instance by calling
|
||||||
|
* {@link ITerminalTextDataReadOnly#makeSnapshot()}.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @noimplement This interface is not intended to be implemented by clients.
|
||||||
*/
|
*/
|
||||||
public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue