Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

RSE
Release 3.0

org.eclipse.rse.files.ui.resources
Class SystemEditableRemoteFile

java.lang.Object
  extended by 
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


Nested Class Summary
 class SystemEditableRemoteFile.DisplayMessageDialog
           
 class SystemEditableRemoteFile.DisplayQuestionDialog
           
 
Field Summary
 
Fields inherited from interface org.eclipse.rse.ui.view. ISystemEditableRemoteObject
NOT_OPEN, OPEN_IN_DIFFERENT_PERSPECTIVE, OPEN_IN_SAME_PERSPECTIVE
 
Constructor Summary
SystemEditableRemoteFile ( IRemoteFile remoteFile)
          Constructor for SystemEditableRemoteFile
SystemEditableRemoteFile ( IRemoteFile remoteFile, IEditorDescriptor editorDescriptor)
          Constructor for SystemEditableRemoteFile
SystemEditableRemoteFile ( IWorkbenchPage page, IRemoteFile remoteFile, IEditorDescriptor editorDescriptor)
          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 ( IProgressMonitor monitor)
          Download the file.
 boolean download ( Shell shell)
          Download the file.
 boolean exists ()
          Returns whether the edited object exists.
  String getAbsolutePath ()
          Return the absolute path on the remote system.
  String getActualHostFor ( String remotePath)
           
protected   IEditorDescriptor getDefaultTextEditor ()
           
  IEditorPart getEditor ()
          Get the editor
  IEditorPart getEditorPart ()
          Returns the open IEditorPart for this remote object if there is one.
protected   IEditorRegistry getEditorRegistry ()
           
static  SystemEditableRemoteFile getInstance ( IFile file)
          Returns an instance of this class given a local copy of a remote file.
  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
  ISubSystem getSubSystem ()
          Return the subsystem for the edited object.
  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.
 boolean isStale ()
          Returns whether the underlying resource needs to be updated from the host
 void open (boolean readOnly, IProgressMonitor monitor)
          Open in editor
 void open ( IProgressMonitor monitor)
          Open in editor
 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 openSystemEditor ()
          Open the 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
protected  void setReadOnly ( IFile file, boolean flag)
           
 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
 

Constructor Detail

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

Method Detail

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

RSE
Release 3.0

Copyright (c) IBM Corporation and others 2000, 2008. All Rights Reserved.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire