com.ibm.carma.ui.job
Class AbstractCarmaJob

java.lang.Object
  extended by org.eclipse.core.runtime.PlatformObject
      extended by org.eclipse.core.internal.jobs.InternalJob
          extended by org.eclipse.core.runtime.jobs.Job
              extended by com.ibm.carma.ui.job.AbstractCarmaJob
All Implemented Interfaces:
java.lang.Comparable, org.eclipse.core.runtime.IAdaptable
Direct Known Subclasses:
ConnectJob, CopyResourcesJob, CustomActionJob, DeleteJob, DisconnectJob, DownloadJob, FileExtensionJob, GetContentsJob, NewMemberJob, OpenMemberJob, RefreshPropertiesJob, UpdatePropertiesJob, UploadJob

public abstract class AbstractCarmaJob
extends org.eclipse.core.runtime.jobs.Job

AbstractCarmaJob should be used by extenders to create Jobs operating on connected or disconnected CARMA objects.

There are many helper functions to handle common cases such as NotSynchronized or NotConnected exceptions. If the action being performed is not complex, users should instead consider extending CustomActionJob instead, as it requires less work to extend


Field Summary
static java.lang.String COPYRIGHT
           
 
Fields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING
 
Constructor Summary
AbstractCarmaJob(java.lang.String name)
          Create a new Job with the specified name.
 
Method Summary
 void displayCustomReturns(CARMAContent resource, CARMAReturn returnValues)
          Opens a dialog to display the given custom returns to the user.
 void displayCustomReturns(CARMAContent resource, java.util.Map<? extends CARMAContent,? extends CARMAReturn> map)
          Opens a dialog to display the given custom returns to the user.
 void displayCustomReturns(CustomActionAccepter resource, java.lang.String actionId, java.util.Map<? extends CustomActionAccepter,? extends CARMAReturn> map)
          Opens a dialog to display the given custom returns to the user.
 void displayCustomReturns(java.lang.String actionId, java.util.Map<? extends CustomActionAccepter,? extends CARMAReturn> map)
          Opens a dialog to display the given custom returns to the user.
static Action getActionFromReturns(CARMAReturn returnValues)
          Walks the return value structure and determines the action the returns come from
static java.lang.String getActionName(CARMAResource resource, java.lang.String actionId)
          Determines the (displayable) action name based on the given resource and action Id
 
Methods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, done, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, removeJobChangeListener, schedule, schedule, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, wakeUp, wakeUp
 
Methods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareTo, toString
 
Methods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.core.runtime.IAdaptable
getAdapter
 

Field Detail

COPYRIGHT

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

AbstractCarmaJob

public AbstractCarmaJob(java.lang.String name)
Create a new Job with the specified name.

Parameters:
name - the name of the job
Method Detail

getActionFromReturns

public static Action getActionFromReturns(CARMAReturn returnValues)
Walks the return value structure and determines the action the returns come from

Parameters:
returnValues - the return value to gather the action specification from
Returns:
the action associated with the given return values

displayCustomReturns

public void displayCustomReturns(CARMAContent resource,
                                 CARMAReturn returnValues)
Opens a dialog to display the given custom returns to the user.

Parameters:
resource - the resource to display the custom returns for
returnValues - the custom return values to display

displayCustomReturns

public void displayCustomReturns(CARMAContent resource,
                                 java.util.Map<? extends CARMAContent,? extends CARMAReturn> map)
Opens a dialog to display the given custom returns to the user.

Parameters:
resource - the resource to display the custom returns for
map - map of the custom return values to display

displayCustomReturns

public void displayCustomReturns(java.lang.String actionId,
                                 java.util.Map<? extends CustomActionAccepter,? extends CARMAReturn> map)
Opens a dialog to display the given custom returns to the user.

Parameters:
actionId - the identifier of the action executed
map - the map of return values from the executed action

displayCustomReturns

public void displayCustomReturns(CustomActionAccepter resource,
                                 java.lang.String actionId,
                                 java.util.Map<? extends CustomActionAccepter,? extends CARMAReturn> map)
Opens a dialog to display the given custom returns to the user.

Parameters:
resource - the resource to display the custom returns for
actionId - the identifier of the action executed
map - the map of return values from the executed action

getActionName

public static java.lang.String getActionName(CARMAResource resource,
                                             java.lang.String actionId)
Determines the (displayable) action name based on the given resource and action Id

Parameters:
resource - resource the action is associated with
actionId - identifier of the action in the CARMA system
Returns:
displayable action name