diff --git a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/propertypages/FolderInfoPropertyPage.java b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/propertypages/FolderInfoPropertyPage.java index 03c341d4505..463f29b9916 100644 --- a/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/propertypages/FolderInfoPropertyPage.java +++ b/rse/examples/org.eclipse.rse.examples.tutorial/src/samples/ui/propertypages/FolderInfoPropertyPage.java @@ -199,7 +199,7 @@ public class FolderInfoPropertyPage { try { - IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(currFolder); + IRemoteFile[] folders = currFolder.getParentRemoteFileSubSystem().listFoldersAndFiles( currFolder, null); if ((folders != null) && (folders.length>0)) { for (int idx=0; !stopped && (idx - *
  • If the input is a folder, that folder must be empty for this to succeed. - * - * - * @param folderOrFile represents the object to be deleted. - * @return false if the given folder/file didn't exist to begin with, else true. Throws an exception if anything fails. - * - * @deprecated use the delete that takes a monitor now - */ - public boolean delete(IRemoteFile folderOrFile) throws RemoteFolderNotEmptyException, RemoteFileSecurityException, RemoteFileIOException; - + /** * Delete the given remote file or folder. @@ -332,16 +329,6 @@ public interface IRemoteFileSubSystem extends ISubSystem{ */ public boolean rename(IRemoteFile folderOrFile, String newName) throws RemoteFileSecurityException, RemoteFileIOException; - /** - * Move a file or folder to a new target parent folder. - * - * @param sourceFolderOrFile The file or folder to move - * @param targetFolder The folder to move to. No guarantee it is on the same system, so be sure to check getSystemConnection()! - * @param newName The new name for the moved file or folder - * @return false true iff the move succeeded - */ - public boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName) throws RemoteFileSecurityException, RemoteFileIOException; - /** * Move a file or folder to a new target parent folder. @@ -702,7 +689,7 @@ public interface IRemoteFileSubSystem extends ISubSystem{ * This version is called by RemoteFileSubSystemImpl's resolveFilterString(s) * noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point */ - public IRemoteFile[] listRoots(IRemoteFileContext context) throws InterruptedException; + public IRemoteFile[] listRoots(IRemoteFileContext context, IProgressMonitor monitor) throws InterruptedException; /** * Returns the TCP/IP address for the local system that is accessible from diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java index 4f66c122acd..82e02153a1d 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/subsystems/RemoteFileSubSystem.java @@ -58,7 +58,6 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessage; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.files.RemoteFileIOException; import org.eclipse.rse.services.files.RemoteFileSecurityException; -import org.eclipse.rse.services.files.RemoteFolderNotEmptyException; import org.eclipse.rse.services.search.IHostSearchResult; import org.eclipse.rse.services.search.IHostSearchResultConfiguration; import org.eclipse.rse.subsystems.files.core.model.RemoteFileFilterString; @@ -584,7 +583,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi if (debugMode) SystemBasePlugin.logInfo("...LISTROOTS = " + fs.listRoots()); if (fs.listRoots()) - return listRoots(new RemoteFileContext(this, null, fs)); + return listRoots(new RemoteFileContext(this, null, fs), monitor); else { boolean showDirs = fs.getShowSubDirs(); @@ -639,17 +638,17 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi else if (hasFileContents) { // already have the files, now add the folders - listFolders(parent, filter); + listFolders(parent, filter, monitor); } else if (hasFolderContents) { // already have the folders, now add the files - listFiles(parent, filter); + listFiles(parent, filter, monitor); } else { // don't have anything - query both - listFoldersAndFiles(parent, filter); + listFoldersAndFiles(parent, filter, monitor); } children = parent.getContents(RemoteChildrenContentsType.getInstance(), filter); } @@ -661,7 +660,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi } else { - children = listFolders(parent, filter); + children = listFolders(parent, filter, monitor); } } else @@ -672,7 +671,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi } else { - children = listFiles(parent, filter); + children = listFiles(parent, filter, monitor); } } } @@ -825,11 +824,11 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi { if (showDirs && showFiles) //children = listFoldersAndFiles((IRemoteFile)parent, filterString); - children = listFoldersAndFiles((IRemoteFile) parent, filterString); + children = listFoldersAndFiles((IRemoteFile) parent, filterString, monitor); else if (showDirs) - children = listFolders((IRemoteFile) parent, filterString); + children = listFolders((IRemoteFile) parent, filterString, monitor); else - children = listFiles((IRemoteFile) parent, filterString); + children = listFiles((IRemoteFile) parent, filterString, monitor); if (sort && (children != null) && (children.length > 1)) Arrays.sort(children); } @@ -846,9 +845,9 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi /** * Return a list of roots/drives on the remote system */ - public IRemoteFile[] listRoots() throws InterruptedException + public IRemoteFile[] listRoots(IProgressMonitor monitor) throws InterruptedException { - return listRoots(getDefaultContext()); + return listRoots(getDefaultContext(), monitor); } @@ -856,9 +855,9 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * Return a list of all remote folders in the given parent folder on the remote system * @param parent The parent folder to list folders in */ - public IRemoteFile[] listFolders(IRemoteFile parent) throws SystemMessageException + public IRemoteFile[] listFolders(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException { - return listFolders(parent, null); + return listFolders(parent, null, monitor); } /** @@ -866,7 +865,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * @param parent The parent folder to list folders in * @param fileNameFilter The name pattern for subsetting the file list when this folder is subsequently expanded */ - public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter) throws SystemMessageException + public IRemoteFile[] listFolders(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException { RemoteFileFilterString filterString = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration()); filterString.setPath(parent.getAbsolutePath()); @@ -875,7 +874,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi filterString.setShowSubDirs(true); RemoteFileContext context = new RemoteFileContext(this, parent, filterString); //return listFolders(parent, fileNameFilter, context); - return listFolders(parent, null, context); + return listFolders(parent, null, context, monitor); } @@ -883,9 +882,9 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * Return a list of all remote files in the given parent folder on the remote system * @param parent The parent folder to list files in */ - public IRemoteFile[] listFiles(IRemoteFile parent) throws SystemMessageException + public IRemoteFile[] listFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException { - return listFiles(parent, null); + return listFiles(parent, null, monitor); } /** @@ -893,7 +892,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * @param parent The parent folder to list files in * @param fileNameFilter The name pattern to subset the list by, or null to return all files. */ - public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter) throws SystemMessageException + public IRemoteFile[] listFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException { RemoteFileFilterString filterString = new RemoteFileFilterString(getParentRemoteFileSubSystemConfiguration()); filterString.setPath(parent.getAbsolutePath()); @@ -901,7 +900,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi filterString.setShowFiles(true); filterString.setShowSubDirs(false); RemoteFileContext context = new RemoteFileContext(this, parent, filterString); - return listFiles(parent, fileNameFilter, context); + return listFiles(parent, fileNameFilter, context, monitor); } @@ -909,9 +908,9 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * Return a list of all remote folders and files in the given folder. The list is not subsetted. * @param parent The parent folder to list folders and files in */ - public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent) throws SystemMessageException + public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, IProgressMonitor monitor) throws SystemMessageException { - return listFoldersAndFiles(parent, (String) null); + return listFoldersAndFiles(parent, (String) null, monitor); } /** @@ -922,7 +921,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi * @param parent The parent folder to list folders and files in * @param fileNameFilter The name pattern to subset the file list by, or null to return all files. */ - public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter) throws SystemMessageException + public IRemoteFile[] listFoldersAndFiles(IRemoteFile parent, String fileNameFilter, IProgressMonitor monitor) throws SystemMessageException { @@ -934,7 +933,7 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi filterString.setShowFiles(true); filterString.setShowSubDirs(true); RemoteFileContext context = new RemoteFileContext(this, parent, filterString); - return listFoldersAndFiles(parent, fileNameFilter, context); + return listFoldersAndFiles(parent, fileNameFilter, context, monitor); } @@ -1067,40 +1066,10 @@ public abstract class RemoteFileSubSystem extends SubSystem implements IRemoteFi - /** - * Delete the given remote file or folder. - * - * - * noteThis method should be abstract but MOF doesn't allow abstract impl classes at this point - * - * @param folderOrFile represents the object to be deleted. - * @return false if the given folder/file didn't exist to begin with, else true. Throws an exception if anything fails. - * @deprecated - */ - public boolean delete(IRemoteFile folderOrFile) throws RemoteFolderNotEmptyException, RemoteFileSecurityException, RemoteFileIOException - { - // child subclasses must override - return delete(folderOrFile, null); - } - /** - * Move a file or folder to a new target parent folder. - * - * @param sourceFolderOrFile The file or folder to move - * @param targetFolder The folder to move to. No guarantee it is on the same system, so be sure to check getSystemConnection()! - * @param newName The new name for the moved file or folder - * @return true iff the move succeeded - * @deprecated - */ - public boolean move(IRemoteFile sourceFolderOrFile, IRemoteFile targetFolder, String newName) throws RemoteFileSecurityException, RemoteFileIOException - { - return move(sourceFolderOrFile, targetFolder, newName, null); - } diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java index e1acf3f69e9..ce34613c5b8 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.core/src/org/eclipse/rse/subsystems/files/core/util/ValidatorFileUniqueName.java @@ -81,7 +81,7 @@ public class ValidatorFileUniqueName ); try { - IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder); + IRemoteFile[] contents = parentFolder.getParentRemoteFileSubSystem().listFoldersAndFiles(parentFolder, null); if (contents!=null) { String[] names = new String[contents.length]; diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemSearchResultConfiguration.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemSearchResultConfiguration.java index a88f61210fc..5d9ba7a03b1 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemSearchResultConfiguration.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/DStoreFileSubSystemSearchResultConfiguration.java @@ -80,7 +80,7 @@ public class DStoreFileSubSystemSearchResultConfiguration extends DStoreSearchRe if (!parentRemoteFile.hasContents(RemoteChildrenContentsType.getInstance())) { // query all files to save time (so we can retrieve cached files - _fileSubSystem.listFiles(parentRemoteFile); + _fileSubSystem.listFiles(parentRemoteFile, null); } String path = fileNode.getValue() + "/" + fileNode.getName(); //$NON-NLS-1$ diff --git a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java index c4ffc16c9d9..d7ad8d099b0 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java +++ b/rse/plugins/org.eclipse.rse.subsystems.files.dstore/src/org/eclipse/rse/subsystems/files/dstore/subsystem/RemoteFilePropertyChangeListener.java @@ -29,7 +29,6 @@ import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.extra.internal.extra.DomainEvent; import org.eclipse.dstore.extra.internal.extra.IDomainListener; import org.eclipse.rse.core.SystemBasePlugin; -import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.subsystems.CommunicationsEvent; import org.eclipse.rse.core.subsystems.ICommunicationsListener; import org.eclipse.rse.core.subsystems.IConnectorService; diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcess.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcess.java index a7c0858bd24..88f121d91fc 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcess.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcess.java @@ -49,7 +49,7 @@ public interface IRemoteProcess extends IHostProcess, IAdaptable /** * Get parent subsystem */ - public RemoteProcessSubSystem getParentRemoteProcessSubSystem(); + public IRemoteProcessSubSystem getParentRemoteProcessSubSystem(); /** * Return the connection this remote process is from. diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessContext.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessContext.java index 63e8691a53f..3fb4667cb82 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessContext.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessContext.java @@ -34,7 +34,7 @@ public interface IRemoteProcessContext /** * Get parent subsystem */ - public RemoteProcessSubSystem getParentRemoteProcessSubSystem(); + public IRemoteProcessSubSystem getParentRemoteProcessSubSystem(); /** * Return the parent remote process object expanded to get this object, or null if no such parent @@ -54,7 +54,7 @@ public interface IRemoteProcessContext /** * Set parent subsystem */ - public void setParentRemoteProcessSubSystem(RemoteProcessSubSystem parentSubSystem); + public void setParentRemoteProcessSubSystem(IRemoteProcessSubSystem parentSubSystem); /** * Set the parent remote process object expanded to get this object, or null if no such parent diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/RemoteProcessSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessSubSystem.java similarity index 87% rename from rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/RemoteProcessSubSystem.java rename to rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessSubSystem.java index ee4e42019df..2e367683ac7 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/RemoteProcessSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/IRemoteProcessSubSystem.java @@ -17,6 +17,7 @@ package org.eclipse.rse.subsystems.processes.core.subsystem; +import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.services.clientserver.messages.SystemMessageException; import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; @@ -26,7 +27,7 @@ import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; * @author mjberger * */ -public interface RemoteProcessSubSystem extends ISubSystem +public interface IRemoteProcessSubSystem extends ISubSystem { // ---------------------- @@ -52,31 +53,35 @@ public interface RemoteProcessSubSystem extends ISubSystem * This version is called directly by users. * @param processNameFilter filter the results according to this object * @param context A context object that will be associated with each returned process + * @param monitor the progress monitor * @return the list of all processes running on the host machine that correspond to the filter, * or null if there are none. */ - public IRemoteProcess[] listAllProcesses(IHostProcessFilter processNameFilter, IRemoteProcessContext context) throws InterruptedException, SystemMessageException; + public IRemoteProcess[] listAllProcesses(IHostProcessFilter processNameFilter, IRemoteProcessContext context, IProgressMonitor monitor) throws InterruptedException, SystemMessageException; /** * Returns root processes * @param context A context object that will be associated with each returned process + * @param monitor the progress monitor */ - public IRemoteProcess[] listRoots(IRemoteProcessContext context); + public IRemoteProcess[] listRoots(IRemoteProcessContext context, IProgressMonitor monitor); /** * Return a list of all remote child processes of the given parent process on the remote system * @param parent The parent process whose children to list * @param context A context object that will be associated with each returned process + * @param monitor the progress monitor */ - public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IRemoteProcessContext context) throws SystemMessageException; + public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IRemoteProcessContext context, IProgressMonitor monitor) throws SystemMessageException; /** * Return a list of remote child processes of the given process, which match the filter. * @param parent The parent process whose children to list * @param processFilter The process filter to subset the list by, or null to return all child processes. * @param context A context object that will be associated with each returned process + * @param monitor the progress monitor */ - public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IHostProcessFilter processFilter, IRemoteProcessContext context) throws SystemMessageException; + public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IHostProcessFilter processFilter, IRemoteProcessContext context, IProgressMonitor monitor) throws SystemMessageException; /** * Given a process, return its parent process object. @@ -94,7 +99,6 @@ public interface RemoteProcessSubSystem extends ISubSystem * Kill the given process. * * @param process represents the object to be killed. - * @param the signal to send to the process * @return false if the given process doesn't exist, else true. Throws an exception if anything fails. */ public boolean kill(IRemoteProcess process, String signal) throws SystemMessageException; diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessContext.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessContext.java index 3a5e6f027d8..42dd1d4aaf4 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessContext.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessContext.java @@ -22,7 +22,7 @@ import java.util.Vector; import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext; -import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem; +import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; /** * This class represents a place to hold contextual information stored within @@ -36,7 +36,7 @@ import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSyste public class RemoteProcessContext implements IRemoteProcessContext { - protected RemoteProcessSubSystem subsystem; + protected IRemoteProcessSubSystem subsystem; protected IRemoteProcess parentProcess; protected IHostProcessFilter filterString; protected Vector allFilterStrings; @@ -44,7 +44,7 @@ public class RemoteProcessContext implements IRemoteProcessContext /** * Constructor that takes all inputs. */ - public RemoteProcessContext(RemoteProcessSubSystem subsystem, IRemoteProcess parentProcessObject, + public RemoteProcessContext(IRemoteProcessSubSystem subsystem, IRemoteProcess parentProcessObject, IHostProcessFilter filterString) { this.subsystem = subsystem; @@ -64,7 +64,7 @@ public class RemoteProcessContext implements IRemoteProcessContext /** * Set the parent subsystem */ - public void setParentRemoteProcessSubSystem(RemoteProcessSubSystem subsystem) + public void setParentRemoteProcessSubSystem(IRemoteProcessSubSystem subsystem) { this.subsystem = subsystem; } @@ -119,7 +119,7 @@ public class RemoteProcessContext implements IRemoteProcessContext /** * Return the parent subsystem */ - public RemoteProcessSubSystem getParentRemoteProcessSubSystem() + public IRemoteProcessSubSystem getParentRemoteProcessSubSystem() { return subsystem; } diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java index e4862374f23..74a4695ad8b 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessImpl.java @@ -25,7 +25,7 @@ import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; import org.eclipse.rse.services.clientserver.processes.ISystemProcessRemoteConstants; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext; -import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem; +import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; @@ -67,7 +67,7 @@ public class RemoteProcessImpl implements IRemoteProcess, ISystemProcessRemoteCo /* (non-Javadoc) * @see org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess#getParentRemoteProcessSubSystem() */ - public RemoteProcessSubSystem getParentRemoteProcessSubSystem() + public IRemoteProcessSubSystem getParentRemoteProcessSubSystem() { return _context.getParentRemoteProcessSubSystem(); } @@ -77,7 +77,7 @@ public class RemoteProcessImpl implements IRemoteProcess, ISystemProcessRemoteCo */ public IHost getSystemConnection() { - RemoteProcessSubSystem ss = _context.getParentRemoteProcessSubSystem(); + IRemoteProcessSubSystem ss = _context.getParentRemoteProcessSubSystem(); if (ss == null) return null; else @@ -122,7 +122,7 @@ public class RemoteProcessImpl implements IRemoteProcess, ISystemProcessRemoteCo IRemoteProcess parentProcess = _context.getParentRemoteProcess(); if ((parentProcess == null) && getPPid() != -1) { - RemoteProcessSubSystem ss = _context.getParentRemoteProcessSubSystem(); + IRemoteProcessSubSystem ss = _context.getParentRemoteProcessSubSystem(); if (ss != null) { try diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java index 8ab65c7c3bd..664aa38da94 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/core/subsystem/impl/RemoteProcessSubSystemImpl.java @@ -31,7 +31,7 @@ import org.eclipse.rse.services.clientserver.processes.IHostProcessFilter; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext; import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystemConfiguration; -import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem; +import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; /** * The implementation of the RemoteProcessSubSystem interface. @@ -46,7 +46,7 @@ import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSyste * */ public abstract class RemoteProcessSubSystemImpl extends SubSystem implements - RemoteProcessSubSystem, ICommunicationsListener + IRemoteProcessSubSystem, ICommunicationsListener { public RemoteProcessSubSystemImpl(IHost host, IConnectorService connectorService) @@ -132,7 +132,7 @@ public abstract class RemoteProcessSubSystemImpl extends SubSystem implements IRemoteProcess[] ps = null; try { - ps = listAllProcesses(rpf, context); + ps = listAllProcesses(rpf, context, monitor); } catch (SystemMessageException e) { @@ -144,7 +144,7 @@ public abstract class RemoteProcessSubSystemImpl extends SubSystem implements /** * At this point there is only one root process, the 'init' process with pid 1 */ - public IRemoteProcess[] listRoots(IRemoteProcessContext context) + public IRemoteProcess[] listRoots(IRemoteProcessContext context, IProgressMonitor monitor) { IRemoteProcess[] roots = new IRemoteProcess[1]; try @@ -163,7 +163,8 @@ public abstract class RemoteProcessSubSystemImpl extends SubSystem implements */ public abstract IRemoteProcess[] listAllProcesses( IHostProcessFilter processNameFilter, - IRemoteProcessContext context) throws InterruptedException, + IRemoteProcessContext context, + IProgressMonitor monitor) throws InterruptedException, SystemMessageException; /* (non-Javadoc) diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/IProcessServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/IProcessServiceSubSystem.java index 23194dfcdbe..ffd6f2f6b7a 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/IProcessServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/IProcessServiceSubSystem.java @@ -17,10 +17,10 @@ package org.eclipse.rse.subsystems.processes.servicesubsystem; import org.eclipse.rse.core.subsystems.IServiceSubSystem; -import org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem; +import org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessSubSystem; -public interface IProcessServiceSubSystem extends RemoteProcessSubSystem, IServiceSubSystem +public interface IProcessServiceSubSystem extends IRemoteProcessSubSystem, IServiceSubSystem { } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java index 84d56f41c28..38e4f44d24e 100644 --- a/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java +++ b/rse/plugins/org.eclipse.rse.subsystems.processes.core/src/org/eclipse/rse/subsystems/processes/servicesubsystem/ProcessServiceSubSystem.java @@ -17,7 +17,6 @@ package org.eclipse.rse.subsystems.processes.servicesubsystem; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.subsystems.IConnectorService; import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration; @@ -118,30 +117,30 @@ public class ProcessServiceSubSystem extends RemoteProcessSubSystemImpl implemen /* (non-Javadoc) * @see org.eclipse.rse.subsystems.processes.core.subsystem.impl.RemoteProcessSubSystemImpl#listAllProcesses(org.eclipse.rse.services.clientserver.processes.IHostProcessFilter, org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext) */ - public IRemoteProcess[] listAllProcesses(IHostProcessFilter processFilter, IRemoteProcessContext context) throws InterruptedException, SystemMessageException + public IRemoteProcess[] listAllProcesses(IHostProcessFilter processFilter, IRemoteProcessContext context, IProgressMonitor monitor) throws InterruptedException, SystemMessageException { checkIsConnected(); - IHostProcess[] processes = getProcessService().listAllProcesses(null, processFilter); + IHostProcess[] processes = getProcessService().listAllProcesses(monitor, processFilter); return getHostProcessToRemoteProcessAdapter().convertToRemoteProcesses(context, null, processes); } /* (non-Javadoc) * @see org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem#listChildProcesses(org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess, org.eclipse.rse.services.clientserver.processes.IHostProcessFilter, org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext) */ - public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IHostProcessFilter processFilter, IRemoteProcessContext context) throws SystemMessageException + public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IHostProcessFilter processFilter, IRemoteProcessContext context, IProgressMonitor monitor) throws SystemMessageException { checkIsConnected(); - IHostProcess[] processes = getProcessService().listChildProcesses(null, parent.getPid(), processFilter); + IHostProcess[] processes = getProcessService().listChildProcesses(monitor, parent.getPid(), processFilter); return getHostProcessToRemoteProcessAdapter().convertToRemoteProcesses(context, parent, processes); } /* (non-Javadoc) * @see org.eclipse.rse.subsystems.processes.core.subsystem.RemoteProcessSubSystem#listChildProcesses(org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcess, org.eclipse.rse.subsystems.processes.core.subsystem.IRemoteProcessContext) */ - public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IRemoteProcessContext context) throws SystemMessageException + public IRemoteProcess[] listChildProcesses(IRemoteProcess parent, IRemoteProcessContext context, IProgressMonitor monitor) throws SystemMessageException { checkIsConnected(); - IHostProcess[] processes = getProcessService().listChildProcesses(null, parent.getPid()); + IHostProcess[] processes = getProcessService().listChildProcesses(monitor, parent.getPid()); return getHostProcessToRemoteProcessAdapter().convertToRemoteProcesses(context, parent, processes); } diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java index bbcc091159c..655dd1b338b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/internal/ui/view/SystemView.java @@ -73,6 +73,7 @@ import org.eclipse.rse.core.model.ISystemMessageObject; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.references.IRSEBaseReferencingObject; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.model.ISystemPromptableObject; import org.eclipse.rse.model.ISystemRemoteChangeEvent; import org.eclipse.rse.model.ISystemRemoteChangeEvents; @@ -2549,13 +2550,17 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour matches = findAllRemoteItemReferences(oldElementName, renameObject, subsystem, matches); if (matches == null) return; + TreeItem[] selected = getTree().getSelection(); + getTree().deselectAll(); + + boolean refresh = false; // STEP 3: process all references to the old name object for (int idx = 0; idx < matches.size(); idx++) { Item match = (Item) matches.elementAt(idx); // a reference to this remote object if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) { Object data = match.getData(); - boolean refresh = false; + if (data != renameObject) // not a binary match { if (rmtAdapter == null) rmtAdapter = getRemoteAdapter(data); @@ -2563,13 +2568,23 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour } else { refresh = true; } - update(data, properties); // for refreshing non-structural properties in viewer when model changes + + + internalUpdate(match, data, properties); + + //update(data, properties); // for refreshing non-structural properties in viewer when model changes //System.out.println("Match found. refresh required? " + refresh); - if (refresh) +// if (refresh) //refreshRemoteObject(data,null,false); - smartRefresh(new TreeItem[] { (TreeItem) match }); + // smartRefresh(new TreeItem[] { (TreeItem) match }); } } + + if (refresh) + { + smartRefresh((TreeItem[])matches.toArray(new TreeItem[matches.size()])); + getTree().setSelection(selected); + } // STEP 4: update property sheet, just in case. updatePropertySheet(); @@ -4418,7 +4433,10 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour ok = adapter.doRename(getShell(), element, newNames[nameIdx++]); if (ok) { if (remoteAdapter != null) - sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, null, oldFullName, this); + { + ISubSystem ss = adapter.getSubSystem(element); + sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, ss, oldFullName, this); + } else sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement)); diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java index bbcc091159c..655dd1b338b 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/view/SystemView.java @@ -73,6 +73,7 @@ import org.eclipse.rse.core.model.ISystemMessageObject; import org.eclipse.rse.core.model.ISystemRegistry; import org.eclipse.rse.core.references.IRSEBaseReferencingObject; import org.eclipse.rse.core.subsystems.ISubSystem; +import org.eclipse.rse.core.subsystems.SubSystem; import org.eclipse.rse.model.ISystemPromptableObject; import org.eclipse.rse.model.ISystemRemoteChangeEvent; import org.eclipse.rse.model.ISystemRemoteChangeEvents; @@ -2549,13 +2550,17 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour matches = findAllRemoteItemReferences(oldElementName, renameObject, subsystem, matches); if (matches == null) return; + TreeItem[] selected = getTree().getSelection(); + getTree().deselectAll(); + + boolean refresh = false; // STEP 3: process all references to the old name object for (int idx = 0; idx < matches.size(); idx++) { Item match = (Item) matches.elementAt(idx); // a reference to this remote object if ((match instanceof TreeItem) && !((TreeItem) match).isDisposed()) { Object data = match.getData(); - boolean refresh = false; + if (data != renameObject) // not a binary match { if (rmtAdapter == null) rmtAdapter = getRemoteAdapter(data); @@ -2563,13 +2568,23 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour } else { refresh = true; } - update(data, properties); // for refreshing non-structural properties in viewer when model changes + + + internalUpdate(match, data, properties); + + //update(data, properties); // for refreshing non-structural properties in viewer when model changes //System.out.println("Match found. refresh required? " + refresh); - if (refresh) +// if (refresh) //refreshRemoteObject(data,null,false); - smartRefresh(new TreeItem[] { (TreeItem) match }); + // smartRefresh(new TreeItem[] { (TreeItem) match }); } } + + if (refresh) + { + smartRefresh((TreeItem[])matches.toArray(new TreeItem[matches.size()])); + getTree().setSelection(selected); + } // STEP 4: update property sheet, just in case. updatePropertySheet(); @@ -4418,7 +4433,10 @@ public class SystemView extends TreeViewer implements ISystemTree, ISystemResour ok = adapter.doRename(getShell(), element, newNames[nameIdx++]); if (ok) { if (remoteAdapter != null) - sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, null, oldFullName, this); + { + ISubSystem ss = adapter.getSubSystem(element); + sr.fireRemoteResourceChangeEvent(ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_RENAMED, element, parentElement, ss, oldFullName, this); + } else sr.fireEvent(new org.eclipse.rse.model.SystemResourceChangeEvent(element, ISystemResourceChangeEvents.EVENT_RENAME, parentElement)); diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java index 0415e3872ac..53c84b83823 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/model/SystemRegistry.java @@ -62,6 +62,7 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfiguration; import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; import org.eclipse.rse.core.subsystems.util.ISubSystemConfigurationAdapter; import org.eclipse.rse.filters.SystemFilterPool; +import org.eclipse.rse.filters.SystemFilterReference; import org.eclipse.rse.filters.SystemFilterStartHere; import org.eclipse.rse.internal.model.SystemHostPool; import org.eclipse.rse.internal.model.SystemModelChangeEvent; @@ -2970,7 +2971,17 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemModelChangeEven String remoteResourceName = null; if (remoteResource instanceof String) remoteResourceName = (String)remoteResource; - else + else if (remoteResource instanceof SystemFilterReference) + { + ISystemFilterReference ref = (ISystemFilterReference)remoteResource; + ISubSystem ss = ref.getSubSystem(); + remoteResource = ss.getTargetForFilter(ref); + ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource); + if (ra == null) + return null; + remoteResourceName = ra.getAbsoluteName(remoteResource); + } + else { ISystemRemoteElementAdapter ra = getRemoteAdapter(remoteResource); if (ra == null) diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteServerLauncher.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteServerLauncher.java index 61330006c63..8461cafbe01 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteServerLauncher.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/RemoteServerLauncher.java @@ -148,7 +148,8 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe _serverLaunchType = ServerLaunchType.get(launchTypeName); IProperty daemonPortProperty = set.getProperty(KEY_DAEMON_PORT); - daemonPortProperty.setEnabled(_serverLaunchType.getType() == ServerLaunchType.DAEMON); + boolean daemon = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.DAEMON; + daemonPortProperty.setEnabled(daemon); daemonPortProperty.setLabel(SystemResources.RESID_CONNECTION_DAEMON_PORT_LABEL); _daemonPort = Integer.parseInt(daemonPortProperty.getValue()); @@ -156,13 +157,14 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe IProperty autoDetectProperty = set.getProperty(KEY_AUTODETECT_SSL); if (autoDetectProperty != null) { - autoDetectProperty.setEnabled(_serverLaunchType.getType() == ServerLaunchType.REXEC); + boolean autoDetect = _serverLaunchType == null || _serverLaunchType.getType() == ServerLaunchType.REXEC; + autoDetectProperty.setEnabled(autoDetect); autoDetectProperty.setLabel(SystemResources.RESID_SUBSYSTEM_AUTODETECT_LABEL); _autoDetectSSL = Boolean.getBoolean(autoDetectProperty.getValue()); } - boolean usingRexec = _serverLaunchType.getType() == ServerLaunchType.REXEC; + boolean usingRexec = _serverLaunchType != null && _serverLaunchType.getType() == ServerLaunchType.REXEC; IProperty rexecPortProperty = set.getProperty(KEY_REXEC_PORT); rexecPortProperty.setEnabled(usingRexec); rexecPortProperty.setLabel(SystemResources.RESID_CONNECTION_PORT_LABEL); @@ -197,6 +199,8 @@ public class RemoteServerLauncher extends ServerLauncher implements IRemoteServe set = createPropertySet(PROPERTY_SET_NAME, getDescription()); } + if (_serverLaunchType == null) + _serverLaunchType = ServerLaunchType.get(ServerLaunchType.DAEMON); IProperty launchTypeProperty = set.addProperty(KEY_SERVER_LAUNCH_TYPE_NAME, _serverLaunchType.getName(), getServerLauncherPropertyType()); launchTypeProperty.setLabel(SystemResources.RESID_PROP_SERVERLAUNCHER_MEANS_LABEL);