Remote Systems
v6.4.1

com.ibm.etools.systems.core.resources
Class SystemEditableRemoteFile

java.lang.Object
  extended bycom.ibm.etools.systems.core.resources.SystemEditableRemoteFile
All Implemented Interfaces:
ISystemEditableRemoteObject, ISystemRemoteEditConstants, ISystemTextEditorConstants

public class SystemEditableRemoteFile
extends Object
implements ISystemEditableRemoteObject, ISystemTextEditorConstants, ISystemRemoteEditConstants


Field Summary
static String Copyright
           
 
Fields inherited from interface com.ibm.etools.systems.core.resources.ISystemEditableRemoteObject
NOT_OPEN, OPEN_IN_DIFFERENT_PERSPECTIVE, OPEN_IN_SAME_PERSPECTIVE
 
Fields inherited from interface com.ibm.etools.systems.core.resources.ISystemTextEditorConstants
BIDI_LOGICAL_KEY, CCSID_KEY, EDITOR_PROFILE_TYPE, LOCAL_ENCODING_KEY, MAX_LINE_LENGTH_KEY, SEQUENCE_NUMBERS_KEY, SOURCE_ENCODING_KEY, SYSTEM_TEXT_BROWSER_ID, SYSTEM_TEXT_EDITOR_ID, TEMP_CCSID_KEY
 
Fields inherited from interface com.ibm.etools.systems.core.resources.ISystemRemoteEditConstants
DEFAULT_EDITOR_PROFILE, DOWNLOAD_FILE_MODIFIED_STAMP, EDITOR_COMPARE_LOCATION, EDITOR_GET_FILE_LOCATION, LOAD_TYPE_KEY, LOAD_TYPE_USE_STRING, REMOTE_FILE_BINARY_TRANSFER, REMOTE_FILE_MODIFIED_STAMP, REMOTE_FILE_MOUNTED, REMOTE_FILE_OBJECT_KEY, REMOTE_FILE_PATH_KEY, REMOTE_FILE_SUBSYSTEM_KEY, RESOLVED_MOUNTED_REMOTE_FILE_HOST_KEY, RESOLVED_MOUNTED_REMOTE_FILE_PATH_KEY, TEMP_FILE_DIRTY, TEMP_FILE_READONLY, UNIVERSAL_EDITOR_PROFILE, UNIVERSAL_LOCAL_EDITOR_PROFILE
 
Constructor Summary
SystemEditableRemoteFile(IRemoteFile remoteFile)
          Constructor for SystemEditableRemoteFile
SystemEditableRemoteFile(IRemoteFile remoteFile, String editorId)
          Constructor for SystemEditableRemoteFile
SystemEditableRemoteFile(IWorkbenchPage page, IRemoteFile remoteFile, String editorId)
          Constructor for SystemEditableRemoteFile
 
Method Summary
 void addAsListener()
          Register as listener for various events
 int checkOpenInEditor()
          Is the local file open in an editor
 void delete()
          Delete the local resource
 boolean doImmediateSaveAndUpload()
          Saves the local file and uploads it to the host immediately, rather than, in response to a resource change event.
 boolean download(Shell shell)
          Download the file.
 String getActualHostFor(String remotePath)
           
 IEditorPart getEditor()
          Get the editor
 IEditorPart getEditorPart()
          Returns the open IEditorPart for this remote object if there is one.
 String getLocalPath()
          Get the local path
 IFile getLocalResource()
          Get the local resource
 IRemoteFile getRemoteFile()
          Get the remote file
 IAdaptable getRemoteObject()
          Returns the remote object that is editable
 String getWorkspaceRemotePath(String remotePath)
          Gets the path to use in the workspace for saving the local replica remote file.
 boolean isDirty()
          Check if the file is dirty
 boolean isReadOnly()
          Check if user has write authority to the file.
 void open(Shell shell)
          Open in editor
 void open(Shell shell, boolean readOnly)
          Open in editor
 void openEditor()
          Open the editor
 void openInInPlaceEditor(Shell shell)
          Open in in place editor
 void openInSystemEditor(Shell shell)
          Open in system editor
 void partActivated(IWorkbenchPart part)
           
 void partBroughtToTop(IWorkbenchPart part)
           
 void partClosed(IWorkbenchPart part)
           
 void partDeactivated(IWorkbenchPart part)
           
 void partOpened(IWorkbenchPart part)
           
 void resourceChanged(IResourceChangeEvent event)
           
 boolean saveAs(IRemoteFile newRemoteFile, IProgressMonitor progressMonitor)
          Save as to a remote location
 void setEditor(IEditorPart editor)
          Set the editor
 void setLocalPath(String localPath)
          Set the local path
 void setLocalResourceProperties()
          Set local resource properties
 void setReadOnly(boolean isReadOnly)
          Indicate whether the file can be edited
 void setRemoteFile(IRemoteFile remoteFile)
          Set the remote file
 void updateDirtyIndicator()
          Update the editor dirty indicator
 boolean visit(IResourceDelta delta)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

Copyright

public static final String Copyright
See Also:
Constant Field Values
Constructor Detail

SystemEditableRemoteFile

public SystemEditableRemoteFile(IWorkbenchPage page,
                                IRemoteFile remoteFile,
                                String editorId)
Constructor for SystemEditableRemoteFile


SystemEditableRemoteFile

public SystemEditableRemoteFile(IRemoteFile remoteFile,
                                String editorId)
Constructor for SystemEditableRemoteFile


SystemEditableRemoteFile

public SystemEditableRemoteFile(IRemoteFile remoteFile)
Constructor for SystemEditableRemoteFile

Method Detail

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 readonly

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
Returns:
true if successful, false if cancelled
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

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

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

partActivated

public void partActivated(IWorkbenchPart part)
See Also:
IPartListener#partActivated(IWorkbenchPart)

partBroughtToTop

public void partBroughtToTop(IWorkbenchPart part)
See Also:
IPartListener#partBroughtToTop(IWorkbenchPart)

partClosed

public void partClosed(IWorkbenchPart part)
See Also:
IPartListener#partClosed(IWorkbenchPart)

partDeactivated

public void partDeactivated(IWorkbenchPart part)
See Also:
IPartListener#partDeactivated(IWorkbenchPart)

partOpened

public void partOpened(IWorkbenchPart part)
See Also:
IPartListener#partOpened(IWorkbenchPart)

resourceChanged

public void resourceChanged(IResourceChangeEvent event)
See Also:
IResourceChangeListener#resourceChanged(IResourceChangeEvent)

visit

public boolean visit(IResourceDelta delta)
              throws CoreException
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

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.