Class ActionContext

java.lang.Object
com.pnfsoftware.jeb.core.actions.ActionContext

public class ActionContext extends Object
Context of pre-execution and execution for an action.

These objects are provided by a client (front-end) to a unit plugin when trying to:

  • verify execution: the client checks if an action execution can take place
  • prepare for execution: the client may provide pre-execution information, the engine will provide pre-execution information as well
  • execute an action: the client provides input data required by the plugin to perform the action
The context identifies the target unit, action identifier, and optionally the selected item or address.
See Also:
  • Constructor Details

    • ActionContext

      public ActionContext(IInteractiveUnit unit, int actionId, long itemId)
      Create an object, requesting action information for the provided item or provided address.
      Parameters:
      unit - mandatory target unit
      actionId - mandatory action id
      itemId - optional item id (0 for none)
    • ActionContext

      public ActionContext(IInteractiveUnit unit, int actionId, long itemId, String address)
      Create an object, requesting action information for the provided item or provided address.
      Parameters:
      unit - mandatory target unit
      actionId - mandatory action id
      itemId - optional item id (0 for none)
      address - optional address (null for none)
    • ActionContext

      public ActionContext(IInteractiveUnit unit, int actionId, long itemId, String address, AddressConversionPrecision precision)
      Create an object, requesting action information for the provided item or provided address.
      Parameters:
      unit - mandatory target unit
      actionId - mandatory action id
      itemId - optional item id (0 for none)
      address - optional address (null for none)
      precision - precision of the address
  • Method Details

    • getUnit

      public IInteractiveUnit getUnit()
      Get the unit on to which the action is to be executed.
      Returns:
      the unit
    • setUnit

      public void setUnit(IInteractiveUnit unit)
      Set the target unit.
      Parameters:
      unit - target interactive unit
    • getActionId

      public int getActionId()
      Get the action identifier.
      Returns:
      the mandatory action identifier
    • setActionId

      public void setActionId(int actionId)
      Set the action identifier.
      Parameters:
      actionId - action identifier
    • getItemId

      public long getItemId()
      Get the item id of the object onto which the action should take place.
      Returns:
      the optional item id, 0 if none
    • setItemId

      public void setItemId(long itemId)
      Set the target item identifier.
      Parameters:
      itemId - item identifier, or 0 if no item is selected
    • getAddress

      public String getAddress()
      Get the address at which the action should take place.
      Returns:
      the optional address, null if none
    • setAddress

      public void setAddress(String address)
      Set the target address.
      Parameters:
      address - address, or null if the action is not address-based
    • getAddressPrecision

      public AddressConversionPrecision getAddressPrecision()
      Get the precision associated with the target address.
      Returns:
      the address precision
    • setAddressPrecision

      public void setAddressPrecision(AddressConversionPrecision addressPrecision)
      Set the precision associated with the target address.
      Parameters:
      addressPrecision - address precision
    • toString

      public String toString()
      Overrides:
      toString in class Object