com.ibm.carma.ui.local
Class CarmaRemoteEditEnabler

java.lang.Object
  extended by com.ibm.carma.ui.local.CarmaRemoteEditEnabler

public class CarmaRemoteEditEnabler
extends java.lang.Object

Helper class for working with temporary CARMA member file contents. The class assists in locating/creating local files to download to/upload from as well as managing the local temporary file cache.

This Class is not intended to be sub-classed, but may be instantiated.

See Also:
CarmaFileEditListener

Field Summary
static java.lang.String CARMA_EDIT_PROJECT_NAME
          Temporary IFile project in the local workspace
static java.lang.String COPYRIGHT
           
 
Constructor Summary
CarmaRemoteEditEnabler(CARMAMember member)
          Create a new remote edit helper for the given CARMA member.
 
Method Summary
 org.eclipse.core.resources.IFile getIFile(org.eclipse.core.runtime.IProgressMonitor monitor, boolean download)
          Locates a temporary local IFile for the CARMA member provided in the constructor.
 CARMAMember getMember()
          Return the CARMA member that this enabler is working with
static CarmaRemoteEditEnabler getRemoteEditEnablerFor(org.eclipse.core.resources.IFile file)
          Locates a CarmaRemoteEditEnabler helper for the given IFile if one exists.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

CARMA_EDIT_PROJECT_NAME

public static final java.lang.String CARMA_EDIT_PROJECT_NAME
Temporary IFile project in the local workspace

See Also:
Constant Field Values
Constructor Detail

CarmaRemoteEditEnabler

public CarmaRemoteEditEnabler(CARMAMember member)
Create a new remote edit helper for the given CARMA member.

Parameters:
member - the CARMA member that needs to be worked with remotely (as a temp localc file)
Method Detail

getRemoteEditEnablerFor

public static CarmaRemoteEditEnabler getRemoteEditEnablerFor(org.eclipse.core.resources.IFile file)
Locates a CarmaRemoteEditEnabler helper for the given IFile if one exists. Will return null if no such enabler exists.

Parameters:
file - the IFile that should be "remote edit" enabled
Returns:
the enabler for the given IFile

getMember

public CARMAMember getMember()
Return the CARMA member that this enabler is working with

Returns:
The member the enabler is working with

getIFile

public org.eclipse.core.resources.IFile getIFile(org.eclipse.core.runtime.IProgressMonitor monitor,
                                                 boolean download)
                                          throws org.eclipse.core.runtime.CoreException
Locates a temporary local IFile for the CARMA member provided in the constructor. The IFile will be created if no such file currently exists. The IFile will be populated with the current contents from the host if the download argument is set to true. contents when the download

Parameters:
monitor - monitor for the operation, needed for operations where download is required
download - true if the CARMA member contents should be refreshed from the host
Returns:
temporary IFile for the given CARMA member
Throws:
org.eclipse.core.runtime.CoreException - The file contents could not be downloaded.