Elexis API documentation
Version 2.1.6 as of December 11 2011

ch.elexis.commands
Class Handler

java.lang.Object
  extended by ch.elexis.commands.Handler

public class Handler
extends java.lang.Object

Simplified Handler for execution of Commands

Author:
gerry

Field Summary
static java.lang.String DEFAULTPARAM
           
 
Constructor Summary
Handler()
           
 
Method Summary
static java.lang.Object execute(IViewSite origin, java.lang.String commandID, java.lang.Object param)
          Execute a Command with a single Object as Parameter
static java.lang.Object executeWithProgress(IViewSite origin, java.lang.String commandID, java.lang.Object param, IProgressMonitor monitor)
          Execute a Command with a single Object as Parameter and a ProgressMonitor
static IProgressMonitor getMonitor(ExecutionEvent eev)
          get the ProgressMonitor supplied by the caller
static java.lang.Object getParam(ExecutionEvent eev)
          Return the given single Parameter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULTPARAM

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

Handler

public Handler()
Method Detail

executeWithProgress

public static java.lang.Object executeWithProgress(IViewSite origin,
                                                   java.lang.String commandID,
                                                   java.lang.Object param,
                                                   IProgressMonitor monitor)
Execute a Command with a single Object as Parameter and a ProgressMonitor

Parameters:
origin - The ViewSite the Command was originated
commandID - the ID of the command as defined in plugin.xml
param - the arbitrary parameter
Returns:
the return value of the Command's execute method

execute

public static java.lang.Object execute(IViewSite origin,
                                       java.lang.String commandID,
                                       java.lang.Object param)
Execute a Command with a single Object as Parameter

Parameters:
origin - The ViewSite the Command was originated
commandID - the ID of the command as defined in plugin.xml
param - the arbitrary parameter
Returns:
the return value of the Command's execute method

getParam

public static java.lang.Object getParam(ExecutionEvent eev)
Return the given single Parameter. This is to be called from within the execute method of the command

Parameters:
eev - the ExecutionEnvironment of the command
Returns:
the Object as given from the caller to execute(...) or null if no such object was given

getMonitor

public static IProgressMonitor getMonitor(ExecutionEvent eev)
get the ProgressMonitor supplied by the caller

Parameters:
eev - the ExecutionEnvironment of the Command
Returns:
the monitor if any or null if none was given.

Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis