org.eclipse.rse.files.ui.resources
Class SystemEditableRemoteFile
java.lang.Object
org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile
-
All Implemented Interfaces:
-
EventListener,
IResourceChangeListener,
IResourceDeltaVisitor,
ISystemEditableRemoteObject,
IPartListener
-
public class SystemEditableRemoteFile
- extends
Object
- implements
ISystemEditableRemoteObject,
IPartListener,
IResourceChangeListener,
IResourceDeltaVisitor
Methods inherited from class java.lang.
Object
|
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait
|
SystemEditableRemoteFile
public SystemEditableRemoteFile(
IWorkbenchPage page,
IRemoteFile remoteFile,
IEditorDescriptor editorDescriptor)
- Constructor for SystemEditableRemoteFile
-
Since:
- 3.0 changed String editorId into IEditorDescriptor
SystemEditableRemoteFile
public SystemEditableRemoteFile(
IRemoteFile remoteFile,
IEditorDescriptor editorDescriptor)
- Constructor for SystemEditableRemoteFile
-
Since:
- 3.0 changed String editorId into IEditorDescriptor
SystemEditableRemoteFile
public SystemEditableRemoteFile(
IRemoteFile remoteFile)
- Constructor for SystemEditableRemoteFile
getEditorRegistry
protected
IEditorRegistry getEditorRegistry()
-
-
getDefaultTextEditor
protected
IEditorDescriptor getDefaultTextEditor()
-
-
getInstance
public static
SystemEditableRemoteFile getInstance(
IFile file)
- Returns an instance of this class given a local copy of a remote file.
-
-
-
Parameters:
-
file
- the local file to create it from.
setRemoteFile
public void setRemoteFile(
IRemoteFile remoteFile)
- Set the remote file
-
-
getRemoteFile
public
IRemoteFile getRemoteFile()
- Get the remote file
-
-
setLocalPath
public void setLocalPath(
String localPath)
- Set the local path
-
-
getLocalPath
public
String getLocalPath()
- Get the local path
-
-
setEditor
public void setEditor(
IEditorPart editor)
- Set the editor
-
-
Specified by:
-
setEditor
in interface
ISystemEditableRemoteObject
-
-
Parameters:
-
editor
- the editor
getEditor
public
IEditorPart getEditor()
- Get the editor
-
-
isReadOnly
public boolean isReadOnly()
- Check if user has write authority to the file.
-
-
Specified by:
-
isReadOnly
in interface
ISystemEditableRemoteObject
-
-
Returns:
- true if the file is read-only
setReadOnly
public void setReadOnly(boolean isReadOnly)
- Indicate whether the file can be edited
-
-
Specified by:
-
setReadOnly
in interface
ISystemEditableRemoteObject
-
download
public boolean download(
Shell shell)
throws
Exception
- Download the file.
-
-
Specified by:
-
download
in interface
ISystemEditableRemoteObject
-
-
Parameters:
-
shell
- if the shell is null, no progress monitor will be shown
-
Returns:
- true if successful, false if cancelled
-
Throws:
-
Exception
setReadOnly
protected void setReadOnly(
IFile file,
boolean flag)
-
-
download
public boolean download(
IProgressMonitor monitor)
throws
Exception
- Download the file.
-
-
Specified by:
-
download
in interface
ISystemEditableRemoteObject
-
-
Parameters:
-
monitor
- the progress monitor
-
Returns:
- true if the operation was successful. false if the user cancels.
-
Throws:
-
Exception
doImmediateSaveAndUpload
public boolean doImmediateSaveAndUpload()
- Saves the local file and uploads it to the host immediately, rather than, in response to a resource change
event.
-
-
Specified by:
-
doImmediateSaveAndUpload
in interface
ISystemEditableRemoteObject
-
-
Returns:
- true if the operation was successful. false if the upload fails.
getLocalResource
public
IFile getLocalResource()
- Get the local resource
-
-
Specified by:
-
getLocalResource
in interface
ISystemEditableRemoteObject
-
delete
public void delete()
- Delete the local resource
-
-
getWorkspaceRemotePath
public
String getWorkspaceRemotePath(
String remotePath)
- Gets the path to use in the workspace for saving the local replica remote file. In most cases
this path will be the same thing as the remote path however, this mechanism exists so that 3rd parties
can customize where temp files are saved.
-
-
-
Parameters:
-
remotePath
- the absolute path to the resource on the host
-
Returns:
- the workspace mapping of the remote path
getActualHostFor
public
String getActualHostFor(
String remotePath)
-
-
getEditorPart
public
IEditorPart getEditorPart()
- Returns the open IEditorPart for this remote object if there is one.
-
-
Specified by:
-
getEditorPart
in interface
ISystemEditableRemoteObject
-
getRemoteObject
public
IAdaptable getRemoteObject()
- Returns the remote object that is editable
-
-
Specified by:
-
getRemoteObject
in interface
ISystemEditableRemoteObject
-
checkOpenInEditor
public int checkOpenInEditor()
- Is the local file open in an editor
-
-
Specified by:
-
checkOpenInEditor
in interface
ISystemEditableRemoteObject
-
open
public void open(
Shell shell)
- Open in editor
-
-
Specified by:
-
open
in interface
ISystemEditableRemoteObject
-
open
public void open(
Shell shell,
boolean readOnly)
- Open in editor
-
-
Specified by:
-
open
in interface
ISystemEditableRemoteObject
-
open
public void open(
IProgressMonitor monitor)
- Open in editor
-
-
Specified by:
-
open
in interface
ISystemEditableRemoteObject
-
open
public void open(boolean readOnly,
IProgressMonitor monitor)
- Open in editor
-
-
Specified by:
-
open
in interface
ISystemEditableRemoteObject
-
openInSystemEditor
public void openInSystemEditor(
Shell shell)
- Open in system editor
-
-
openInInPlaceEditor
public void openInInPlaceEditor(
Shell shell)
- Open in in place editor
-
-
setLocalResourceProperties
public void setLocalResourceProperties()
throws
CoreException
- Set local resource properties
-
-
Specified by:
-
setLocalResourceProperties
in interface
ISystemEditableRemoteObject
-
-
Throws:
-
CoreException
addAsListener
public void addAsListener()
- Register as listener for various events
-
-
Specified by:
-
addAsListener
in interface
ISystemEditableRemoteObject
-
openEditor
public void openEditor()
throws
PartInitException
- Open the editor
-
-
Specified by:
-
openEditor
in interface
ISystemEditableRemoteObject
-
-
Throws:
-
PartInitException
openSystemEditor
public void openSystemEditor()
throws
PartInitException
- Open the system editor
-
-
-
Throws:
-
PartInitException
partActivated
public void partActivated(
IWorkbenchPart part)
-
-
Specified by:
-
partActivated
in interface
IPartListener
-
-
See Also:
-
IPartListener.partActivated(IWorkbenchPart)
partBroughtToTop
public void partBroughtToTop(
IWorkbenchPart part)
-
-
Specified by:
-
partBroughtToTop
in interface
IPartListener
-
-
See Also:
-
IPartListener.partBroughtToTop(IWorkbenchPart)
partClosed
public void partClosed(
IWorkbenchPart part)
-
-
Specified by:
-
partClosed
in interface
IPartListener
-
-
See Also:
-
IPartListener.partClosed(IWorkbenchPart)
partDeactivated
public void partDeactivated(
IWorkbenchPart part)
-
-
Specified by:
-
partDeactivated
in interface
IPartListener
-
-
See Also:
-
IPartListener.partDeactivated(IWorkbenchPart)
partOpened
public void partOpened(
IWorkbenchPart part)
-
-
Specified by:
-
partOpened
in interface
IPartListener
-
-
See Also:
-
IPartListener.partOpened(IWorkbenchPart)
resourceChanged
public void resourceChanged(
IResourceChangeEvent event)
-
-
Specified by:
-
resourceChanged
in interface
IResourceChangeListener
-
-
See Also:
-
IResourceChangeListener.resourceChanged(IResourceChangeEvent)
visit
public boolean visit(
IResourceDelta delta)
throws
CoreException
-
-
Specified by:
-
visit
in interface
IResourceDeltaVisitor
-
-
Throws:
-
CoreException
-
See Also:
-
IResourceDeltaVisitor.visit(IResourceDelta)
saveAs
public boolean saveAs(
IRemoteFile newRemoteFile,
IProgressMonitor progressMonitor)
- Save as to a remote location
-
-
updateDirtyIndicator
public void updateDirtyIndicator()
-
Description copied from interface:
ISystemEditableRemoteObject
- Update the editor dirty indicator
-
-
Specified by:
-
updateDirtyIndicator
in interface
ISystemEditableRemoteObject
-
isDirty
public boolean isDirty()
-
Description copied from interface:
ISystemEditableRemoteObject
- Check if the file is dirty
-
-
Specified by:
-
isDirty
in interface
ISystemEditableRemoteObject
-
getAbsolutePath
public
String getAbsolutePath()
-
Description copied from interface:
ISystemEditableRemoteObject
- Return the absolute path on the remote system.
-
-
Specified by:
-
getAbsolutePath
in interface
ISystemEditableRemoteObject
-
getSubSystem
public
ISubSystem getSubSystem()
-
Description copied from interface:
ISystemEditableRemoteObject
- Return the subsystem for the edited object.
-
-
Specified by:
-
getSubSystem
in interface
ISystemEditableRemoteObject
-
exists
public boolean exists()
-
Description copied from interface:
ISystemEditableRemoteObject
- Returns whether the edited object exists.
-
-
Specified by:
-
exists
in interface
ISystemEditableRemoteObject
-
isStale
public boolean isStale()
-
Description copied from interface:
ISystemEditableRemoteObject
- Returns whether the underlying resource needs to be updated from the host
-
-
Specified by:
-
isStale
in interface
ISystemEditableRemoteObject
-
Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.