1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-29 03:03:10 +02:00

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

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

View file

@ -18,10 +18,11 @@ package org.eclipse.rse.core;
/**
* Interface for RSE core registry. Clients should use this interface as the starting point for querying and
* manipulating model objects in the RSE framework.
* Interface for RSE core registry. Clients should use this interface as the
* starting point for querying and manipulating model objects in the RSE
* framework.
*
* This interface is not intended to be implemented by clients.
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface IRSECoreRegistry {

View file

@ -29,10 +29,11 @@ import org.osgi.framework.Bundle;
* Interface for a system type. Constants are defined for various system types.
* These constants are kept in sync with definitions in plugin.xml.
* <p>
* This interface is not intended to be implemented by clients. System type
* implementations must subclass {@link AbstractRSESystemType} rather than
* implementing this interface directly.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* System type implementations must subclass
* {@link AbstractRSESystemType} rather than implementing this
* interface directly.
* </p>
*/
public interface IRSESystemType extends IAdaptable {
@ -316,7 +317,7 @@ public interface IRSESystemType extends IAdaptable {
*
* @return The list of subsystem configuration id's. May be empty,
* but never <code>null</code>.
*/
*/
public String[] getSubsystemConfigurationIds();
/**

View file

@ -22,14 +22,14 @@ import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.IRSEUserIdConstants;
/**
* An ordered list of connections ({@link IHost} objects), owned by an {@link ISystemProfile}.
* An ordered list of connections ({@link IHost} objects), owned by an
* {@link ISystemProfile}.
* <p>
* Implementations of this interface are expected to be thread-safe in the sense
* that integrity of the host list is maintained even if multiple threads call
* multiple methods in this interface concurrently.
* </p><p>
* This interface is not intended to be implemented by clients.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemHostPool extends IRSEPersistableContainer {
@ -62,48 +62,48 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
*/
public IHost[] getHosts();
/**
* Create a connection object, given only the minimal information.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @return IHost object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
/**
* Create a connection object, given only the minimal information.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @return IHost object, or null if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName);
/**
* Create a connection object, given all the possible attributes except default userId.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
/**
* Create a connection object, given all the possible attributes except default userId.
* <p>
* THE RESULTING CONNECTION OBJECT IS ADDED TO THE LIST OF EXISTING CONNECTIONS FOR YOU.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique. All other errors throw an exception.
*/
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description);
/**
* Create a connection object, given all the possible attributes.
* <p>
* The new connection is added to the list and saved to disk.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique.
* @see IRSEUserIdConstants
*/
/**
* Create a connection object, given all the possible attributes.
* <p>
* The new connection is added to the list and saved to disk.
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id. See IRSEUserIdConstants for values.
* @return IHost object, or <code>null</code> if it failed to create
* because the aliasName is not unique.
* @see IRSEUserIdConstants
*/
public IHost createHost(IRSESystemType systemType, String aliasName, String hostName, String description, String defaultUserId, int defaultUserIdLocation);
/**
@ -118,7 +118,7 @@ public interface ISystemHostPool extends IRSEPersistableContainer {
* @param systemType system type matching one of the system types
* defined via the systemType extension point.
* @param aliasName unique connection name.
* @param hostName IP name or address of the host.
* @param hostName IP name or address of the host.
* @param description optional description of the connection. Can be null.
* @param defaultUserId userId to use as the default for the subsystems.
* @param defaultUserIdLocation where to set the given default user Id from IRSEUserIdConstants.
@ -126,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);
/**
* Return a connection object, given its alias name.
*
* Can be used to test if an alias name is already used (non-null return).
*
* @param aliasName unique aliasName (case insensitive) to search on.
* @return IHost object with unique aliasName, or null if
* no connection object with this name exists.
*/
/**
* Return a connection object, given its alias name.
*
* Can be used to test if an alias name is already used (non-null return).
*
* @param aliasName unique aliasName (case insensitive) to search on.
* @return IHost object with unique aliasName, or null if
* no connection object with this name exists.
*/
public IHost getHost(String aliasName);
/**

View file

@ -52,17 +52,15 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy;
import org.eclipse.rse.internal.core.RSECoreRegistry;
/**
* Registry or front door for all remote system connections.
* There is a singleton of the class implementation of this interface.
* To get it, call the {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
* Registry or front door for all remote system connections. There is a
* singleton of the class implementation of this interface. To get it, call the
* {@link org.eclipse.rse.core.RSECorePlugin#getTheSystemRegistry()}.
* <p>
* The idea here is that connections are grouped by system profile. At any
* time, there is a user-specified number of profiles "active" and connections
* from each active profile are worked with.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* The idea here is that connections are grouped by system profile. At any time,
* there is a user-specified number of profiles "active" and connections from
* each active profile are worked with.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemViewInputProvider {
@ -497,7 +495,7 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
*/
public IHost createHost(IRSESystemType systemType, String connectionName, String hostAddress, String description) throws Exception;
/**
/**
* Create a host object. The resulting host object is added to the list of existing host objects
* in the specified profile.
* <ul>
@ -518,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;
/**
* Update an existing host given the new information.
* This method:
* <ul>
* <li>calls the setXXX methods on the given host object, updating the information in it.
* <li>save the host's host pool to disk
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
* We must do this because a host name changes fundamentally affects the connection,
* rendering any information currently displayed under
* that host obsolete.
* </ul>
* <p>
* @param host the host to be updated
* Update an existing host given the new information.
* This method:
* <ul>
* <li>calls the setXXX methods on the given host object, updating the information in it.
* <li>save the host's host pool to disk
* <li>fires an ISystemResourceChangeEvent event of type EVENT_CHANGE to all registered listeners
* <li>if the system type or host name is changed, calls disconnect on each associated subsystem.
* We must do this because a host name changes fundamentally affects the connection,
* rendering any information currently displayed under
* that host obsolete.
* </ul>
* <p>
* @param host the host to be updated
* @param systemType system type matching one of the system types
* defined via the systemTypes extension point.
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the host. Can be null.
* @param defaultUserId userId to use as the default for the subsystems under this host.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
String hostName, String description,
String defaultUserId, int defaultUserIdLocation);
* @param connectionName unique connection name.
* @param hostName ip name of host.
* @param description optional description of the host. Can be null.
* @param defaultUserId userId to use as the default for the subsystems under this host.
* @param defaultUserIdLocation one of the constants in {@link org.eclipse.rse.core.IRSEUserIdConstants}
* that tells us where to set the user Id
*/
public void updateHost(IHost host, IRSESystemType systemType, String connectionName,
String hostName, String description,
String defaultUserId, int defaultUserIdLocation);
/**
* Creates subsystems for a given host and subsystem configurations.
@ -825,14 +823,17 @@ public interface ISystemRegistry extends ISchedulingRule, IAdaptable, ISystemVie
/**
* Marks all filters for this subsystem as stale to prevent caching
* @param subsystem
*
* @param subsystem the subsystem to work on
*/
public void invalidateFiltersFor(ISubSystem subsystem);
/**
* Marks all filters for this subsystem the contain resourceParent as stale to prevent caching
* @param resourceParent
* @param subsystem
* Marks all filters for this subsystem that contain resourceParent as stale
* to prevent caching
*
* @param resourceParent a remote resource object
* @param subsystem the subsystem to work on
*/
public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem);

View file

@ -36,11 +36,10 @@ import org.eclipse.rse.services.IService;
/**
* Subsystem Configuration interface.
*
* <p>
* This interface is not intended to be implemented by clients. Subsystem
* configuration implementations must subclass SubSystemConfiguration
* rather than implementing this interface directly.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* Subsystem configuration implementations must subclass
* SubSystemConfiguration rather than implementing this interface
* directly.
*/
public interface ISubSystemConfiguration extends ISystemFilterPoolManagerProvider, IRSEPersistableContainer {
// ---------------------------------

View file

@ -39,8 +39,7 @@ import org.eclipse.rse.core.references.IRSEBaseReferencingObject;
import org.eclipse.rse.logging.Logger;
/**
* A filter pool manager manages filter pools.
* It is used to
* A filter pool manager manages filter pools. It is used to
* <ul>
* <li>Get a list of existing filter pools
* <li>Create filter pools
@ -49,11 +48,11 @@ import org.eclipse.rse.logging.Logger;
* <li>Rename filter pools
* </ul>
* <p>
* The filter pool manager ensures that
* changes to filters and pools are
* The filter pool manager ensures that changes to filters and pools are
* committed and events are fired properly.
* <p>
* This class is not intended to be subclassed by clients.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class SystemFilterPoolManager extends RSEPersistableObject implements ISystemFilterPoolManager {
private ISystemFilterPoolManagerProvider caller = null;
@ -122,7 +121,7 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
protected boolean singleFilterStringOnly = SINGLE_FILTER_STRING_ONLY_EDEFAULT;
protected List pools = new ArrayList(3);
// protected List pools = null;
// protected List pools = null;
/**
* Constructor
@ -330,17 +329,17 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
ISystemFilterPool[] result = new ISystemFilterPool[pools.size()];
pools.toArray(result);
return result;
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
// List pools = getPools();
// poolArray = new ISystemFilterPool[pools.size()];
// Iterator i = pools.iterator();
// int idx = 0;
// while (i.hasNext())
// poolArray[idx++] = (ISystemFilterPool) i.next();
// //System.out.println("Pool array created. length = "+poolArray.length);
// }
// return poolArray;
// //System.out.println("Inside getSFPools for mgr "+getName()+". poolArray null? "+(poolArray==null));
// if ((poolArray == null) || (getPools().size() != poolArray.length)) {
// List pools = getPools();
// poolArray = new ISystemFilterPool[pools.size()];
// Iterator i = pools.iterator();
// int idx = 0;
// while (i.hasNext())
// poolArray[idx++] = (ISystemFilterPool) i.next();
// //System.out.println("Pool array created. length = "+poolArray.length);
// }
// return poolArray;
}
/**
@ -359,10 +358,10 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
/*
* Call this to invalidate array cache after any activity
*/
// private void invalidatePoolCache() {
// poolArray = null;
// poolNames = null;
// }
// private void invalidatePoolCache() {
// poolArray = null;
// poolNames = null;
// }
/**
* Create a new filter pool.
@ -393,9 +392,9 @@ public class SystemFilterPoolManager extends RSEPersistableObject implements ISy
pool.setSystemFilterPoolManager(this);
pool.setStringsCaseSensitive(areStringsCaseSensitive());
pool.setSupportsDuplicateFilterStrings(isSetSupportsDuplicateFilterStrings() && supportsDuplicateFilterStrings());
// List pools = getPools();
// List pools = getPools();
pools.add(pool);
// invalidatePoolCache();
// invalidatePoolCache();
commit(pool);
if ((caller != null) && !suspendCallbacks) {
caller.filterEventFilterPoolCreated(pool);

View file

@ -17,13 +17,12 @@
package org.eclipse.rse.files.ui.resources;
/**
* This interface defines a remote path. It is not intended to be implemented by
* clients.
* This interface defines a remote path.
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRemotePath {
/**
* Get the profile name.
* @return the profile name

View file

@ -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.SystemRemoteEditManager;
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.archiveutils.ArchiveHandlerManager;
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.ui.RSEUIPlugin;
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.messages.SystemMessageDialog;
import org.eclipse.swt.widgets.Display;
@ -117,10 +117,8 @@ import org.eclipse.ui.PlatformUI;
/**
* Utility class for doing file transfers on universal systems.
*
* Clients may use this class, but not instantiate or subclass it.
*
* @noextend
* @noinstantiate
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class UniversalFileTransferUtility
{
@ -133,11 +131,18 @@ public class UniversalFileTransferUtility
private static final int CANCEL_ALL = 16;
/**
* @param severity
* @param pluginId
* @param code
* @param message
* @param exception
* Creates a new RenameStatus object. The created status has no
* children.
*
* @param severity the severity; one of <code>OK</code>,
* <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) {
super(severity, pluginId, code, message, exception);
@ -153,7 +158,7 @@ public class UniversalFileTransferUtility
private static boolean doSuperTransfer(IRemoteFileSubSystem subsystem)
{
boolean doSuperTransferProperty = RSEUIPlugin.getDefault().getPreferenceStore().getBoolean(ISystemFilePreferencesConstants.DOSUPERTRANSFER) &&
subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
subsystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
return doSuperTransferProperty;
}
@ -226,27 +231,27 @@ public class UniversalFileTransferUtility
try
{
// copy remote file to workspace
// copy remote file to workspace
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
listener.addIgnoreFile(tempFile);
String remoteEncoding = srcFileOrFolder.getEncoding();
srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
listener.removeIgnoreFile(tempFile);
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
{
// eclipse doesn't like this if the resource appears to be from another project
try
{
//tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
}
catch (Exception e)
{
srcFS.download(srcFileOrFolder, tempFile.getLocation().makeAbsolute().toOSString(), remoteEncoding, monitor);
listener.removeIgnoreFile(tempFile);
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
{
// eclipse doesn't like this if the resource appears to be from another project
try
{
//tempFile.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, monitor);
tempFile.refreshLocal(IResource.DEPTH_ZERO, null/*monitor*/);
}
catch (Exception e)
{
}
}
if (tempFile.exists())
{
}
}
if (tempFile.exists())
{
// if the file is virtual, set read only if necessary
// TODO: why set this here? And why for virtual only??
if (srcFileOrFolder instanceof IVirtualRemoteFile)
@ -276,7 +281,7 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
}
}
}
catch (final SystemMessageException e)
{
@ -316,7 +321,7 @@ public class UniversalFileTransferUtility
properties.setEncoding(remoteFile.getEncoding());
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
// 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.
@ -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
// 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.
@ -524,8 +529,8 @@ public class UniversalFileTransferUtility
if (storedTime != currentTime && (storedEncoding == null || !storedEncoding.equals(currentEncoding)))
{
if (tempFile.exists())
{
if (tempFile.exists())
{
// if the file is virtual, set read only if necessary
// TODO: why set this here? And why for virtual only??
if (srcFileOrFolder instanceof IVirtualRemoteFile)
@ -561,7 +566,7 @@ public class UniversalFileTransferUtility
{
e.printStackTrace();
}
}
}
}
}
}
@ -672,7 +677,7 @@ public class UniversalFileTransferUtility
IRemoteFile rmtFile = (IRemoteFile)remoteSet.get(r);
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
try
@ -708,7 +713,7 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
*/
*/
}
@ -850,26 +855,26 @@ public class UniversalFileTransferUtility
try
{
// copy remote file to workspace
// copy remote file to workspace
SystemUniversalTempFileListener listener = SystemUniversalTempFileListener.getListener();
listener.addIgnoreFile(tempFile);
String encoding = System.getProperty("file.encoding"); //$NON-NLS-1$
download(srcFileOrFolder, tempFile, encoding, monitor);
listener.removeIgnoreFile(tempFile);
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
{
// eclipse doesn't like this if the resource appears to be from another project
try
{
tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
}
catch (Exception e)
{
download(srcFileOrFolder, tempFile, encoding, monitor);
listener.removeIgnoreFile(tempFile);
if (!tempFile.exists() && !tempFile.isSynchronized(IResource.DEPTH_ZERO))
{
// eclipse doesn't like this if the resource appears to be from another project
try
{
tempFile.refreshLocal(IResource.DEPTH_ZERO, null);
}
catch (Exception e)
{
}
}
if (tempFile.exists())
{
}
}
if (tempFile.exists())
{
if (RemoteFileUtility.getSystemFileTransferModeRegistry().isText(srcFileOrFolder))
{
try
@ -889,7 +894,7 @@ public class UniversalFileTransferUtility
e.printStackTrace();
}
}
}
}
}
catch (Exception e)
{
@ -1226,7 +1231,7 @@ public class UniversalFileTransferUtility
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor, true);
}
/**
/**
* 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
* temporary object produced by the doDrag.
@ -1282,8 +1287,8 @@ public class UniversalFileTransferUtility
}
else if (isTargetVirtual)
{
//if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
//instead of the file separator of the file subsystem.
//if the target is a virtual folder, we need to append ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR
//instead of the file separator of the file subsystem.
newPathBuf.append(ArchiveHandlerManager.VIRTUAL_FOLDER_SEPARATOR);
}
else
@ -1415,7 +1420,7 @@ public class UniversalFileTransferUtility
break;
}
}
*/
*/
}
copyFilesOrFolders.add(srcFileOrFolder);
@ -1501,42 +1506,42 @@ public class UniversalFileTransferUtility
{
if (existingFiles != null)
{
IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
// newTargetFolder will be null if user chose to do a rename
if (newTargetFolder == null) {
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;
IRemoteFile newTargetFolder = (IRemoteFile)existingFiles.get(newPath);
// newTargetFolder will be null if user chose to do a rename
if (newTargetFolder == null) {
newTargetFolder = targetFS.getRemoteFileObject(newPath, monitor);
}
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)
@ -1615,7 +1620,7 @@ public class UniversalFileTransferUtility
/*
SystemMessage copyMessage = RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_COPY_PROGRESS);
copyMessage.makeSubstitution(srcFileOrFolder.getName(), targetFolder.getAbsolutePath());
*/
*/
String name = srcFileOrFolder.getName();
@ -1839,7 +1844,7 @@ public class UniversalFileTransferUtility
FileServiceSubSystem localSS = (FileServiceSubSystem)getLocalFileSubSystem();
try
{
localSS.delete(destinationArchive, monitor);
localSS.delete(destinationArchive, monitor);
}
catch (Exception e)
{
@ -1896,7 +1901,7 @@ public class UniversalFileTransferUtility
}
catch (Exception e)
{
e.printStackTrace();
e.printStackTrace();
throw e;
}
finally {
@ -1998,23 +2003,23 @@ public class UniversalFileTransferUtility
{
try
{
String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
String destArchPath = destinationParent.getAbsolutePath() + separator + file.getName();
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
if (destinationArchive.exists())
{
directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
directory.getParentRemoteFileSubSystem().delete(destinationArchive, monitor);
}
directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
}
catch (RemoteFileSecurityException e)
{
// can't write to this directory
// can't write to this directory
}
}
if (destinationArchive == null)
{
String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
String destArchPath = homeFolder + separator + file.getName();
String homeFolder = directory.getParentRemoteFileSubSystem().getRemoteFileObject("./", monitor).getAbsolutePath(); //$NON-NLS-1$
String destArchPath = homeFolder + separator + file.getName();
destinationArchive = directory.getParentRemoteFileSubSystem().getRemoteFileObject(destArchPath, monitor);
if (destinationArchive.exists()) directory.getParentRemoteFileSubSystem().delete(destinationArchive,monitor);
destinationArchive = directory.getParentRemoteFileSubSystem().createFile(destinationArchive, monitor);
@ -2091,21 +2096,21 @@ public class UniversalFileTransferUtility
if (replace)
{
if (!monitor.isCanceled())
{
if (!monitor.isCanceled())
{
String currentSourcePath = dest.getAbsolutePath() + ArchiveHandlerManager.VIRTUAL_SEPARATOR + arcContents[i].fullName;
IRemoteFile currentSource = localSS.getRemoteFileObject(currentSourcePath, monitor);
boolean shouldExtract = currentSource.isFile();
if (!shouldExtract)
{
// check for empty dir
IRemoteFile[] children = localSS.list(currentSource, monitor);
// check for empty dir
IRemoteFile[] children = localSS.list(currentSource, monitor);
if (children == null || children.length == 0)
{
shouldExtract = true;
}
if (children == null || children.length == 0)
{
shouldExtract = true;
}
}
if (shouldExtract)
@ -2117,36 +2122,36 @@ public class UniversalFileTransferUtility
boolean canWrite = true;
if (currentTarget != null)
{
IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
if (currentTargetResource != null && currentTargetResource.exists())
{
try
IResource currentTargetResource = SystemBasePlugin.getWorkspaceRoot().getContainerForLocation(new Path(currentTarget.getAbsolutePath()));
if (currentTargetResource != null && currentTargetResource.exists())
{
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
canWrite = false;
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);
}
}
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
{
//return null;
}
}
else
{
//return null;
}
}
}
@ -2158,7 +2163,7 @@ public class UniversalFileTransferUtility
}
catch (Exception e)
{
e.printStackTrace();
e.printStackTrace();
cleanup(cpdest, dest);
throw e;
}
@ -2172,18 +2177,18 @@ public class UniversalFileTransferUtility
{
if (arc1 != null)
{
try
{
arc1.getParentRemoteFileSubSystem().delete(arc1, null);
}
try
{
arc1.getParentRemoteFileSubSystem().delete(arc1, null);
}
catch (SystemMessageException e)
{
SystemMessageDialog.displayMessage(e);
}
catch (Exception e)
{
e.printStackTrace();
}
catch (Exception e)
{
e.printStackTrace();
}
}
if (arc2 != null && arc2.exists())
arc2.delete();
@ -2401,13 +2406,13 @@ public class UniversalFileTransferUtility
public static String getActualHostFor(IRemoteFileSubSystem subsystem, String remotePath)
{
String hostname = subsystem.getHost().getHostName();
if (subsystem.getHost().getSystemType().isLocal())
{
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
return result;
}
return hostname;
String hostname = subsystem.getHost().getHostName();
if (subsystem.getHost().getSystemType().isLocal())
{
String result = SystemRemoteEditManager.getInstance().getActualHostFor(hostname, remotePath, subsystem);
return result;
}
return hostname;
}
public static String getActualHostFor(String hostname, String remotePath, IRemoteFileSubSystem subsystem)
@ -2735,7 +2740,7 @@ public class UniversalFileTransferUtility
return uploadResourceFromWorkspace(srcFileOrFolder, targetFolder, monitor);
}
/**
/**
* 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
* temporary object produced by the doDrag.

View file

@ -23,13 +23,13 @@ import org.eclipse.rse.files.ui.resources.ISystemRemoteMarker;
import org.eclipse.rse.files.ui.resources.ISystemRemoteResource;
/**
* This class is an internal implementation of the ISystemRemoteMarker interface.
* It is not intended to be implemented by clients.
* This class is an internal implementation of the ISystemRemoteMarker
* interface.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class SystemRemoteMarker implements ISystemRemoteMarker {
/**
* Resource with which this marker is associated.
*/

View file

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

View file

@ -52,11 +52,10 @@ import org.eclipse.ui.dialogs.IOverwriteQuery;
// Similar to org.eclipse.ui.wizards.datatransfer.ImportOperation
/**
* An operation which does the actual work of copying objects from the local file
* system into the workspace.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* </p>
* An operation which does the actual work of copying objects from the local
* file system into the workspace.
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteFileImportOperation extends WorkspaceModifyOperation {
private static final int POLICY_DEFAULT = 0;

View file

@ -28,22 +28,25 @@ import org.eclipse.ui.IWorkbench;
* Standard workbench wizard for importing resources from the local file system
* into the workspace.
* <p>
* This class may be instantiated and used without further configuration;
* this class is not intended to be subclassed.
* This class may be instantiated and used without further configuration.
* </p>
* <p>
* Example:
*
* <pre>
* IWizard wizard = new RemoteImportWizard();
* wizard.init(workbench, selection);
* WizardDialog dialog = new WizardDialog(shell, wizard);
* dialog.open();
* </pre>
* During the call to <code>open</code>, the wizard dialog is presented to the
* user. When the user hits Finish, the user-selected files are imported
*
* During the call to <code>open</code>, the wizard dialog is presented to
* the user. When the user hits Finish, the user-selected files are imported
* into the workspace, the dialog closes, and the call to <code>open</code>
* returns.
* </p>
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class RemoteImportWizard extends AbstractSystemWizard implements IImportWizard {
private IWorkbench workbench;
@ -118,8 +121,8 @@ public class RemoteImportWizard extends AbstractSystemWizard implements IImportW
return mainPage.finish();
}
public boolean performCancel() {
mainPage.cancel();
return super.performCancel();
}
public boolean performCancel() {
mainPage.cancel();
return super.performCancel();
}
}

View file

@ -41,9 +41,10 @@ import org.eclipse.rse.internal.services.clientserver.java.StringInfo;
import org.eclipse.rse.internal.services.clientserver.java.UTF8Info;
/**
* This is a basic class file parser that returns a package name from a class file.
* This is a basic class file parser that returns a package name from a class
* file.
* <p>
* This class is not intended to be subclassed by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class BasicClassFileParser {
@ -188,65 +189,65 @@ public class BasicClassFileParser {
switch (tag) {
case IClassFileConstants.CONSTANT_CLASS: {
int nameIndex = dataStream.readUnsignedShort();
return new ClassInfo(tag, nameIndex);
}
case IClassFileConstants.CONSTANT_FIELD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_STRING: {
int stringIndex = dataStream.readUnsignedShort();
return new StringInfo(tag, stringIndex);
}
case IClassFileConstants.CONSTANT_INTEGER: {
long bytes = dataStream.readUnsignedInt();
return new IntegerInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_FLOAT: {
long bytes = dataStream.readUnsignedInt();
return new FloatInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_LONG: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new LongInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_DOUBLE: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new DoubleInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
}
case IClassFileConstants.CONSTANT_UTF8: {
int length = dataStream.readUnsignedShort();
short[] bytes = new short[length];
case IClassFileConstants.CONSTANT_CLASS: {
int nameIndex = dataStream.readUnsignedShort();
return new ClassInfo(tag, nameIndex);
}
case IClassFileConstants.CONSTANT_FIELD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new FieldRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new MethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_INTERFACE_METHOD_REF: {
int classIndex = dataStream.readUnsignedShort();
int nameAndTypeIndex = dataStream.readUnsignedShort();
return new InterfaceMethodRefInfo(tag, classIndex, nameAndTypeIndex);
}
case IClassFileConstants.CONSTANT_STRING: {
int stringIndex = dataStream.readUnsignedShort();
return new StringInfo(tag, stringIndex);
}
case IClassFileConstants.CONSTANT_INTEGER: {
long bytes = dataStream.readUnsignedInt();
return new IntegerInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_FLOAT: {
long bytes = dataStream.readUnsignedInt();
return new FloatInfo(tag, bytes);
}
case IClassFileConstants.CONSTANT_LONG: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new LongInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_DOUBLE: {
long highBytes = dataStream.readUnsignedInt();
long lowBytes = dataStream.readUnsignedInt();
return new DoubleInfo(tag, highBytes, lowBytes);
}
case IClassFileConstants.CONSTANT_NAME_AND_TYPE: {
int nameIndex = dataStream.readUnsignedShort();
int descriptorIndex = dataStream.readUnsignedShort();
return new NameAndTypeInfo(tag, nameIndex, descriptorIndex);
}
case IClassFileConstants.CONSTANT_UTF8: {
int length = dataStream.readUnsignedShort();
short[] bytes = new short[length];
for (int i = 0; i < length; i++) {
bytes[i] = (short)(dataStream.readUnsignedByte());
}
for (int i = 0; i < length; i++) {
bytes[i] = (short)(dataStream.readUnsignedByte());
}
return new UTF8Info(tag, length, bytes);
}
default: {
return null;
}
return new UTF8Info(tag, length, bytes);
}
default: {
return null;
}
}
}

View file

@ -24,7 +24,7 @@ import java.io.InputStream;
/**
* Singleton class for obtaining various information about class files.
* <p>
* This class is not intended to be subclassed by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class ClassFileUtil {
@ -72,7 +72,7 @@ public class ClassFileUtil {
public boolean isRunnable(File classFile) throws IOException {
FileInputStream stream = new FileInputStream(classFile);
return isRunnable(stream);
}
}
/**
* Returns whether the class represented by the given input stream is runnable,

View file

@ -37,22 +37,24 @@ import org.eclipse.rse.services.IService;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
/**
* A IFileService is an abstraction of a file service that runs over some sort of connection.
* It can be shared among multiple instances of a subsystem. At some point this file
* service layer may become official API but for now it is experimental. Each
* subsystem is currently responsible for layering an abstraction over whatever it
* wants to construct as a service.
* A IFileService is an abstraction of a file service that runs over some sort
* of connection. It can be shared among multiple instances of a subsystem. At
* some point this file service layer may become official API but for now it is
* experimental. Each subsystem is currently responsible for layering an
* abstraction over whatever it wants to construct as a service.
* <p>
* This is a very bare bones definition. A real definition would probably have changed
* terminology, use URI's rather than Strings, and have much more robust error handling.
* </p><p>
* Implementers of this interface will have to either be instantiated, initialized, or
* somehow derive a connection as part of its state.
* </p><p>
* This interface is not intended to be implemented by clients. File service
* implementations must subclass {@link AbstractFileService} rather than implementing
* this interface directly.
* This is a very bare bones definition. A real definition would probably have
* changed terminology, use URI's rather than Strings, and have much more robust
* error handling.
* </p>
* <p>
* Implementers of this interface will have to either be instantiated,
* initialized, or somehow derive a connection as part of its state.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
* File service implementations must subclass
* {@link AbstractFileService} rather than implementing this
* interface directly.
*/
public interface IFileService extends IService
{

View file

@ -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 {

View file

@ -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 {
@ -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) {
return mapping.getLabel().toLowerCase();
@ -529,7 +532,7 @@ public class SystemFileTransferModeRegistry implements ISystemFileTransferModeRe
try {
stream = new FileOutputStream(location);
writer = new OutputStreamWriter(stream, ENCODING);
writer = new OutputStreamWriter(stream, ENCODING);
memento.save(writer);
}
catch (Exception e) {

View file

@ -35,7 +35,8 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystemConf
/**
* Public utility class for dealing with remote file subsystems.
*
* Clients may use this class, but not instantiate or subclass it.
* @noextend This class is not intended to be subclassed by clients.
* @noinstantiate This class is not intended to be instantiated by clients.
*/
public class RemoteFileUtility
{
@ -88,27 +89,27 @@ public class RemoteFileUtility
* @return an IRemoteFileSubSystemConfiguration instance, or <code>null</code> if
* no file subsystem is configured with the given system type.
*/
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
{
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < sses.length; i++)
public static IRemoteFileSubSystemConfiguration getFileSubSystemConfiguration(IRSESystemType systemType)
{
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISubSystemConfiguration[] sses = sr.getSubSystemConfigurationsBySystemType(systemType, false);
for (int i = 0; i < sses.length; i++)
{
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
{
if (sses[i] instanceof IRemoteFileSubSystemConfiguration)
{
return (IRemoteFileSubSystemConfiguration)sses[i];
}
return (IRemoteFileSubSystemConfiguration)sses[i];
}
return null;
}
}
return null;
}
/**
* Return the global SystemFileTransferModeRegistry.
* @return the global SystemFileTransferModeRegistry.
*/
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
{
return SystemFileTransferModeRegistry.getInstance();
}
/**
* Return the global SystemFileTransferModeRegistry.
* @return the global SystemFileTransferModeRegistry.
*/
public static ISystemFileTransferModeRegistry getSystemFileTransferModeRegistry()
{
return SystemFileTransferModeRegistry.getInstance();
}
}

View file

@ -30,19 +30,18 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
/**
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class,
* which allows the input array to be changed dynamically.
* A slight variation of the Eclipse-supplied ComboBoxCellEditor class, which
* allows the input array to be changed dynamically.
* <p>
* A cell editor that presents a list of items in a combo box.
* The cell editor's value is the zero-based index of the selected
* item.
* <p>
* This class may be instantiated; it is not intended to be subclassed.
* A cell editor that presents a list of items in a combo box. The cell editor's
* value is the zero-based index of the selected item.
* </p>
*
* @noextend This class is not intended to be subclassed by clients.
*/
public class SystemComboBoxCellEditor extends CellEditor
{
private boolean readOnly = false;
private boolean readOnly = false;
/**
* The list of items to present in the combo box.
*/
@ -72,9 +71,9 @@ public class SystemComboBoxCellEditor extends CellEditor
super(parent);
selection = 0;
if (items != null)
setItems(items);
setItems(items);
else
setValueValid(true);
setValueValid(true);
}
/**
* Creates a new cell editor with a combo containing the given
@ -92,7 +91,7 @@ public class SystemComboBoxCellEditor extends CellEditor
super(parent);
selection = 0;
//this.readOnly = readOnly;
setValueValid(true);
setValueValid(true);
}
/**
* Change the input items
@ -101,17 +100,17 @@ public class SystemComboBoxCellEditor extends CellEditor
{
this.items = items;
populateComboBoxItems();
setValueValid(true);
setValueValid(true);
}
/* (non-Javadoc)
* Method declared on CellEditor.
*/
protected Control createControl(Composite parent)
{
if (!readOnly)
comboBox = new CCombo(parent, SWT.NONE);
if (!readOnly)
comboBox = new CCombo(parent, SWT.NONE);
else
comboBox = new CCombo(parent, SWT.READ_ONLY);
comboBox = new CCombo(parent, SWT.READ_ONLY);
comboBox.setFont(parent.getFont());
comboBox.addKeyListener(new KeyAdapter() {
@ -139,7 +138,7 @@ public class SystemComboBoxCellEditor extends CellEditor
} else {
// try to insert the current value into the error message.
setErrorMessage(
NLS.bind(getErrorMessage(), items[selection]));
NLS.bind(getErrorMessage(), items[selection]));
}
fireApplyEditorValue();
}
@ -165,7 +164,7 @@ public class SystemComboBoxCellEditor extends CellEditor
*/
protected Object doGetValue()
{
return new Integer(selection);
return new Integer(selection);
}
/* (non-Javadoc)
* Method declared on CellEditor.
@ -179,9 +178,9 @@ public class SystemComboBoxCellEditor extends CellEditor
* this <code>CellEditor</code> framework method
* accepts a zero-based index of a selection.
*
* @param value the zero-based index of the selection wrapped
* @param value the zero-based index of the selection wrapped
* as an <code>Integer</code>
*/
*/
protected void doSetValue(Object value)
{
if (!(value instanceof Integer))
@ -195,7 +194,7 @@ public class SystemComboBoxCellEditor extends CellEditor
selection = i;
}
}
return;
return;
}
//Assert.isTrue(comboBox != null && (value instanceof Integer));

View file

@ -65,7 +65,7 @@ import org.eclipse.ui.part.ResourceTransfer;
/**
* Registry and control center for RSE UI related operations.
*
* This class is not intended to be subclassed by clients.
* @noextend This class is not intended to be subclassed by clients.
*/
public class SystemRegistryUI implements ISystemRegistryUI {
@ -305,13 +305,13 @@ public class SystemRegistryUI implements ISystemRegistryUI {
int connectionDelim = str.indexOf(":"); //$NON-NLS-1$
if (connectionDelim == -1) // not subsystem, therefore likely to be a connection
{
int profileDelim = str.indexOf("."); //$NON-NLS-1$
int profileDelim = str.indexOf("."); //$NON-NLS-1$
if (profileDelim != -1)
{
String profileId = str.substring(0, profileDelim);
String connectionId = str.substring(profileDelim + 1, str.length());
ISystemProfile profile = registry.getSystemProfile(profileId);
return registry.getHost(profile, connectionId);
String profileId = str.substring(0, profileDelim);
String connectionId = str.substring(profileDelim + 1, str.length());
ISystemProfile profile = registry.getSystemProfile(profileId);
return registry.getHost(profile, connectionId);
}
}
@ -438,11 +438,11 @@ public class SystemRegistryUI implements ISystemRegistryUI {
*/
public SystemScratchpad getSystemScratchPad()
{
if (scratchpad == null)
{
scratchpad = new SystemScratchpad();
}
return scratchpad;
if (scratchpad == null)
{
scratchpad = new SystemScratchpad();
}
return scratchpad;
}

View file

@ -31,9 +31,8 @@ import org.eclipse.swt.widgets.Shell;
/**
* Registry and control center for RSE UI related operations.
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ISystemRegistryUI extends ISystemShellProvider {
@ -58,10 +57,10 @@ public interface ISystemRegistryUI extends ISystemShellProvider {
*/
public void expandSubSystem(ISubSystem subsystem);
/**
* Returns the clipboard used for copy actions
*/
public Clipboard getSystemClipboard();
/**
* Returns the clipboard used for copy actions
*/
public Clipboard getSystemClipboard();
/**
* Returns the list of objects on the system clipboard

View file

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

View file

@ -17,15 +17,16 @@ import org.eclipse.swt.widgets.Shell;
/**
* Represents the terminal view as seen by a terminal connection.
*
* <p> Not to be implemented by clients.
* @author Michael Scharf
* <p>
* <strong>EXPERIMENTAL</strong>. This class or interface has been added as
* part of a work in progress. There is no guarantee that this API will
* work or that it will remain the same. Please do not use this API without
* consulting with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a> team.
* part of a work in progress. There is no guarantee that this API will work or
* that it will remain the same. Please do not use this API without consulting
* with the <a href="http://www.eclipse.org/dsdp/tm/">Target Management</a>
* team.
* </p>
*
* @author Michael Scharf
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITerminalControl {

View file

@ -12,12 +12,13 @@ package org.eclipse.tm.terminal.model;
/**
* A writable matrix of characters and {@link Style}. This is intended to be the
* low level representation of the text of a Terminal. Higher layers are responsible
* to fill the text and styles into this representation.
*
* <p><b>Note: </b> Implementations of this interface has to be thread safe.
* <p><b>Note: </b> This interface is not intended to be implemented by clients.
* A writable matrix of characters and {@link Style}. This is intended to be
* the low level representation of the text of a Terminal. Higher layers are
* responsible to fill the text and styles into this representation.
* <p>
* <b>Note: </b> Implementations of this interface has to be thread safe.
* </p>
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITerminalTextData extends ITerminalTextDataReadOnly {
@ -68,20 +69,20 @@ public interface ITerminalTextData extends ITerminalTextDataReadOnly {
* @param line
*/
void cleanLine(int line);
// /**
// * @param line
// * @return true if this line belongs to the previous line but is simply
// * wrapped.
// */
// boolean isWrappedLine(int line);
//
// /**
// * Makes this line an extension to the previous line. Wrapped lines get folded back
// * when the width of the terminal changes
// * @param line
// * @param extendsPreviousLine
// */
// void setWrappedLine(int line, boolean extendsPreviousLine);
// /**
// * @param line
// * @return true if this line belongs to the previous line but is simply
// * wrapped.
// */
// boolean isWrappedLine(int line);
//
// /**
// * Makes this line an extension to the previous line. Wrapped lines get folded back
// * when the width of the terminal changes
// * @param line
// * @param extendsPreviousLine
// */
// void setWrappedLine(int line, boolean extendsPreviousLine);
/**
* Shifts some lines up or down. The "empty" space is filled with <code>'\000'</code> chars

View file

@ -13,62 +13,73 @@ package org.eclipse.tm.terminal.model;
/**
* This class maintains a snapshot of an instance of {@link ITerminalTextData}.
* While the {@link ITerminalTextData} continues changing, the snapshot remains
* unchanged until the next snapshot is taken by calling {@link #updateSnapshot(boolean)}.
* This is important, because the {@link ITerminalTextData} might get
* modified by another thread. Suppose you would want to draw the content of
* the {@link ITerminalTextData} using the following loop:
* unchanged until the next snapshot is taken by calling
* {@link #updateSnapshot(boolean)}. This is important, because the
* {@link ITerminalTextData} might get modified by another thread. Suppose you
* would want to draw the content of the {@link ITerminalTextData} using the
* following loop:
*
* <pre>
* for(int line=0;line&lt;term.getHeight();line++)
* for(int column=0; column&lt;term.getWidth();column++)
* drawCharacter(column,line,term.getChar(column,line),term.getStyle(column,line));
* for (int line = 0; line &lt; term.getHeight(); line++)
* for (int column = 0; column &lt; term.getWidth(); column++)
* drawCharacter(column, line, term.getChar(column, line), term.getStyle(column, line));
* </pre>
* This might fail because the background thread could change the dimensions of the
* {@link ITerminalTextData} while you iterate the loop. One solution would be to
* put a <code>synchronized(term){}</code> statement around the code. This has
* two problems: 1. you would have to know about the internals of the synchronisation
* of {@link ITerminalTextData}. 2. The other thread that changes {@link ITerminalTextData}
* is blocked while the potentially slow drawing is done.
*
* This might fail because the background thread could change the dimensions of
* the {@link ITerminalTextData} while you iterate the loop. One solution would
* be to put a <code>synchronized(term){}</code> statement around the code.
* This has two problems: 1. you would have to know about the internals of the
* synchronisation of {@link ITerminalTextData}. 2. The other thread that
* changes {@link ITerminalTextData} is blocked while the potentially slow
* drawing is done.
* <p>
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to draw
* the content. There is no danger that the data structure get changed while
* you draw. There are also methods to find out what has changed to minimize
* the number of lines that get redrawn.</p>
*
* <p><b>Drawing optimization</b>: To optimize redrawing of changed lines, this class keeps
* track of lines that have changed since the previous snapshot.</p>
*
* <pre>
* // iterate over the potentially changed lines
* for(int line=snap.getFirstChangedLine();line&lt;=snap.getLastChangedLine();line++)
* // redraw only if the line has changed
* if(snap.hasLineChanged(line))
* for(int column=0; column&lt;snap.getWidth();column++)
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
* </pre>
*
* <p><b>Scroll optimization:</b> Often new lines are appended at the bottom of the
* terminal and the rest of the lines are scrolled up. In this case all lines would be
* marked as changed. To optimize for this
* case, {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
* the <code>detectScrolling</code> parameter. The object will keep track of scrolling.
* The UI must <b>first</b> handle the scrolling and then use the {@link #hasLineChanged(int)}
* method to determine scrolling:
* <pre>
* // scroll the visible region of the UI <b>before</b> drawing the changed lines.
* doUIScrolling(snap.getScrollChangeY(),snap.getScrollChangeN(),snap.getScrollChangeShift());
* // iterate over the potentially changed lines
* for(int line=snap.getFirstChangedLine();line&lt;=snap.getFirstChangedLine();line++)
* // redraw only if the line has changed
* if(snap.hasLineChanged(line))
* for(int column=0; column&lt;snap.getWidth();column++)
* drawCharacter(column,line,snap.getChar(column,line),snap.getStyle(column,line));
* </pre>
* <b>Solution:</b> Take a snapshot of the terminal and use the snapshot to
* draw the content. There is no danger that the data structure get changed
* while you draw. There are also methods to find out what has changed to
* minimize the number of lines that get redrawn.
* </p>
*
* <p><b>Note</b>: This interface is not intended to be implemented by clients.</p>
* <p><b>Threading Note</b>: This class is not thread save! All methods have to be called by
* the a same thread, that created the instance by calling
* {@link ITerminalTextDataReadOnly#makeSnapshot()}. </p>
* <p>
* <b>Drawing optimization</b>: To optimize redrawing of changed lines, this
* class keeps track of lines that have changed since the previous snapshot.
* </p>
*
* <pre>
* // iterate over the potentially changed lines
* for (int line = snap.getFirstChangedLine(); line &lt;= snap.getLastChangedLine(); line++)
* // redraw only if the line has changed
* if (snap.hasLineChanged(line))
* for (int column = 0; column &lt; snap.getWidth(); column++)
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
* </pre>
*
* <p>
* <b>Scroll optimization:</b> Often new lines are appended at the bottom of
* the terminal and the rest of the lines are scrolled up. In this case all
* lines would be marked as changed. To optimize for this case,
* {@link #updateSnapshot(boolean)} can be called with <code>true</code> for
* the <code>detectScrolling</code> parameter. The object will keep track of
* scrolling. The UI must <b>first</b> handle the scrolling and then use the
* {@link #hasLineChanged(int)} method to determine scrolling:
*
* <pre>
* // scroll the visible region of the UI &lt;b&gt;before&lt;/b&gt; drawing the changed lines.
* doUIScrolling(snap.getScrollChangeY(), snap.getScrollChangeN(), snap.getScrollChangeShift());
* // iterate over the potentially changed lines
* for (int line = snap.getFirstChangedLine(); line &lt;= snap.getFirstChangedLine(); line++)
* // redraw only if the line has changed
* if (snap.hasLineChanged(line))
* for (int column = 0; column &lt; snap.getWidth(); column++)
* drawCharacter(column, line, snap.getChar(column, line), snap.getStyle(column, line));
* </pre>
* </p>
* <p>
* <b>Threading Note</b>: This class is not thread safe! All methods have to be
* called by the a same thread, that created the instance by calling
* {@link ITerminalTextDataReadOnly#makeSnapshot()}.
* </p>
*
* @noimplement This interface is not intended to be implemented by clients.
*/
public interface ITerminalTextDataSnapshot extends ITerminalTextDataReadOnly {
/**