com.cc.framework.ui.control
Class ControlActionDef

java.lang.Object
  extended bycom.cc.framework.ui.control.ControlActionDef
All Implemented Interfaces:
java.io.Serializable, SimpleEnumType

public class ControlActionDef
extends java.lang.Object
implements SimpleEnumType, java.io.Serializable

Encapsulates an action with the needed parameters.

NOTE: New actions must also be assign into the MAP!

Since:
1.0
Version:
$Revision: 1.45 $
Author:
Harald Schulz
See Also:
Serialized Form

Field Summary
private  java.lang.String action
          The name of the action.
static ControlActionDef ACTION_ADD
          Handler: void onAdd(ControlRequestContext ctx, String parentKey)
static ControlActionDef ACTION_ADDAPPOINTMENT
          Action: AddAppointment this event is triggered within an scheduler control, when the user clicks on a add appointment button element.
static ControlActionDef ACTION_APPOINTMENTCLICK
          Action: Appointment this event is triggered within an scheduler control, when the user clicks on and appointment The parameter timeInMillis designates the time in UTC milliseconds from the epoch.
static ControlActionDef ACTION_CELLCLICK
          Handler: void onCellClick(ControlRequestContext ctx, String column, String key)
static ControlActionDef ACTION_CHANGEDATE
          Action: ChangeDate this event is triggered within an scheduler control, when the user switches the controls view to another date.
static ControlActionDef ACTION_CHECK
          Action: Check This action is triggered if a checkbox is clicked.
static ControlActionDef ACTION_CHECKALL
          Action: CheckAll This action is triggered if all rows are checked or unchecked.
static ControlActionDef ACTION_CHECKAPPOINTMENT
          Action: CheckAppointment This action is triggered if a checkbox on an appointment is clicked.
static ControlActionDef ACTION_CHECKCOLUMN
          Action: CheckColumn This action is triggered if all rows of a specific column are checked or unchecked.
static ControlActionDef ACTION_CHECKDATE
          Action: CheckDate This action is triggered if a checkbox on an date is clicked.
static ControlActionDef ACTION_CLOSE
          Action: close Handler: void onClose(ControlRequestContext ctx)
static ControlActionDef ACTION_COLLAPSE
          Action: Collapse This action is triggered by a tree if a group node is closed.
static ControlActionDef ACTION_CREATE
          Action: Create Handler: void onCreate(ControlRequestContext ctx)
static ControlActionDef ACTION_CRUMBCLICK
          Action: CrumbClick Handler: void onCrumbClick(ControlRequestContext ctx, String crumbId)
static ControlActionDef ACTION_DELETE
          Handler: void onDelete(ControlRequestContext ctx, String key)
static ControlActionDef ACTION_DRILLDOWN
          Handler: void onDrilldown(ControlRequestContext ctx, String key)
static ControlActionDef ACTION_EDIT
          Handler: void onEdit(ControlRequestContext ctx, String key)
static ControlActionDef ACTION_EXPAND
          Action: Expand This action is triggered by a tree if a group node is opened.
static ControlActionDef ACTION_EXPANDEX
          Action: ExpandEx This action is triggered by a tree if a group node with unknown number of children is opened.
static ControlActionDef ACTION_EXPORTLIST
          Action: Export (without parameters) Handler: void onExport(ControlRequestContext ctx)
static ControlActionDef ACTION_HELP
          Action: help Handler: void onHelp(ControlRequestContext ctx, String helpId)
static ControlActionDef ACTION_LOADMENU
          Action: load menu Handler: void onLoadMenu(ControlRequestContext ctx, String menuId)
static ControlActionDef ACTION_MAXIMIZE
          Action: maximize Handler: void onMaximize(ControlRequestContext ctx)
static ControlActionDef ACTION_MINIMIZE
          Action: minimize Handler: void onMinimize(ControlRequestContext ctx)
static ControlActionDef ACTION_MOVE
          Action: move Handler: void onMove(ControlRequestContext ctx, int direction)
static ControlActionDef ACTION_PAGE
          Action: Page this event is triggered within an control, when the user moves from one page to another page Handler: void onPage(ControlRequestContext ctx, int page) Arguments: page The page to which the system should go. -1 = jump to the last page 0..n = jump to the specified page Caution: The Handler itself must ensure adherence to the valid range.
static ControlActionDef ACTION_PRINTLIST
          Action: Print (without parameters) Handler: void onPrint(ControlRequestContext ctx)
static ControlActionDef ACTION_REFRESH
          Action: Refresh Handler: void onRefresh(ControlRequestContext ctx)
static ControlActionDef ACTION_REMOVE
          Handler: void onRemove(ControlRequestContext ctx, String key)
static ControlActionDef ACTION_RESTORE
          Action: restore Handler: void onRestore(ControlRequestContext ctx)
static ControlActionDef ACTION_SELECT
          Handler: void onSelect(ControlRequestContext ctx, String key)
static ControlActionDef ACTION_SELECTDATE
          Action: ChangeDate this event is triggered within an scheduler control, when the user clicks on a date element.
static ControlActionDef ACTION_SORT
          Handler: void onSort(ControlRequestContext ctx, String column, SortOrder direction)
static ControlActionDef ACTION_SWAPALL
          Action: Swap all option elements Handler: void onSwapAll(ControlRequestContext ctx, int direction)
static ControlActionDef ACTION_SWAPSELECTED
          Action: Swap selected option elements Handler: void onSwapSelected(ControlRequestContext ctx, int direction)
static ControlActionDef ACTION_TABCLICK
          Action: TabClick Handler: void onTabClick(ControlRequestContext ctx, String tabId)
static ControlActionDef ACTION_TABSCROLL
          Action: TabScroll Handler: void onTabScroll(ControlRequestContext ctx, String tabId)
static ControlActionDef ACTION_VIEW
          Action: View this event is triggered within an control, when the user switches to another view Handler: void onView(ControlRequestContext ctx, String view)
private static java.util.Hashtable registry
          List with all actions defined above
private static long serialVersionUID
          Serial Version UID
private  java.lang.Class[] types
          Array with the parameters that belongs to the action.
 
Constructor Summary
ControlActionDef(java.lang.String actionCode, java.lang.Class[] types)
          Constructor for ControlActionDef The class is instantiate with the parameters.
 
Method Summary
 void checkType(int index, java.lang.Class type)
          Method checkType
 ControlAction createInstance(Control ctrl)
          Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition.
 ControlAction createInstance(Control ctrl, java.lang.String actionName)
          Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition.
 ControlAction createInstance(PainterContext ctx)
          Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition.
 boolean equals(java.lang.Object obj)
          Compares the argument to this type
 java.lang.String getAction()
          Retrieves the action identifier
 int getFormalParameterCount()
          Liefert die Anzahl der formalen Parameter zurück.
 java.lang.Class[] getFormalParameterTypes()
          Liefert ein Array mit den Typen der formalen Parameter zurück.
 java.lang.String getName()
          Method getName
 java.lang.Class getParameterType(int index)
          Retrieves the class for the given parameter
 java.lang.Class[] getTypes()
          Retrieves the parameter types for this action
 int hashCode()
           
static boolean isRegistered(java.lang.String action)
          Checks if a certain action is registered in the action registry
 java.lang.Object[] mapActualParameter(ControlRequestContext ctx, java.lang.String[] paramStr)
          Method mapActualParameter
static ControlActionDef parse(java.lang.String code)
          Returns a ControlActionDef for the argument
static ControlActionDef query(java.lang.String code)
          Returns a ControlActionDef for the argument
static void registerActionDefinition(ControlActionDef def)
          Registers an action definition in the global registry
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Serial Version UID

See Also:
Constant Field Values

ACTION_PAGE

public static final ControlActionDef ACTION_PAGE
Action: Page this event is triggered within an control, when the user moves from one page to another page Handler: void onPage(ControlRequestContext ctx, int page) Arguments: page The page to which the system should go. -1 = jump to the last page 0..n = jump to the specified page Caution: The Handler itself must ensure adherence to the valid range.


ACTION_CELLCLICK

public static final ControlActionDef ACTION_CELLCLICK
Handler: void onCellClick(ControlRequestContext ctx, String column, String key)


ACTION_DRILLDOWN

public static final ControlActionDef ACTION_DRILLDOWN
Handler: void onDrilldown(ControlRequestContext ctx, String key)


ACTION_SELECT

public static final ControlActionDef ACTION_SELECT
Handler: void onSelect(ControlRequestContext ctx, String key)


ACTION_EDIT

public static final ControlActionDef ACTION_EDIT
Handler: void onEdit(ControlRequestContext ctx, String key)


ACTION_DELETE

public static final ControlActionDef ACTION_DELETE
Handler: void onDelete(ControlRequestContext ctx, String key)


ACTION_ADD

public static final ControlActionDef ACTION_ADD
Handler: void onAdd(ControlRequestContext ctx, String parentKey)


ACTION_EXPAND

public static final ControlActionDef ACTION_EXPAND
Action: Expand This action is triggered by a tree if a group node is opened. Handler: void onExpand(ControlRequestContext ctx, String key)


ACTION_COLLAPSE

public static final ControlActionDef ACTION_COLLAPSE
Action: Collapse This action is triggered by a tree if a group node is closed. Handler: void onCollapse(ControlRequestContext ctx, String key)


ACTION_EXPANDEX

public static final ControlActionDef ACTION_EXPANDEX
Action: ExpandEx This action is triggered by a tree if a group node with unknown number of children is opened. The handler can now load the required nodes/data Handler: void onExpandEx(ControlRequestContext ctx, String key)


ACTION_CHECK

public static final ControlActionDef ACTION_CHECK
Action: Check This action is triggered if a checkbox is clicked. Handler: void onCheck(ControlRequestContext ctx, String key, SelectMode mode, boolean check)


ACTION_CHECKALL

public static final ControlActionDef ACTION_CHECKALL
Action: CheckAll This action is triggered if all rows are checked or unchecked. Handler: void onCheckAll(ControlRequestContext ctx, SelectMode mode, boolean check)


ACTION_CHECKCOLUMN

public static final ControlActionDef ACTION_CHECKCOLUMN
Action: CheckColumn This action is triggered if all rows of a specific column are checked or unchecked. Handler: void onCheckColumn(ControlRequestContext ctx, String column, boolean check)


ACTION_CREATE

public static final ControlActionDef ACTION_CREATE
Action: Create Handler: void onCreate(ControlRequestContext ctx)


ACTION_REFRESH

public static final ControlActionDef ACTION_REFRESH
Action: Refresh Handler: void onRefresh(ControlRequestContext ctx)


ACTION_TABCLICK

public static final ControlActionDef ACTION_TABCLICK
Action: TabClick Handler: void onTabClick(ControlRequestContext ctx, String tabId)


ACTION_TABSCROLL

public static final ControlActionDef ACTION_TABSCROLL
Action: TabScroll Handler: void onTabScroll(ControlRequestContext ctx, String tabId)


ACTION_CRUMBCLICK

public static final ControlActionDef ACTION_CRUMBCLICK
Action: CrumbClick Handler: void onCrumbClick(ControlRequestContext ctx, String crumbId)


ACTION_SORT

public static final ControlActionDef ACTION_SORT
Handler: void onSort(ControlRequestContext ctx, String column, SortOrder direction)


ACTION_HELP

public static final ControlActionDef ACTION_HELP
Action: help Handler: void onHelp(ControlRequestContext ctx, String helpId)


ACTION_MINIMIZE

public static final ControlActionDef ACTION_MINIMIZE
Action: minimize Handler: void onMinimize(ControlRequestContext ctx)


ACTION_MAXIMIZE

public static final ControlActionDef ACTION_MAXIMIZE
Action: maximize Handler: void onMaximize(ControlRequestContext ctx)


ACTION_MOVE

public static final ControlActionDef ACTION_MOVE
Action: move Handler: void onMove(ControlRequestContext ctx, int direction)


ACTION_REMOVE

public static final ControlActionDef ACTION_REMOVE
Handler: void onRemove(ControlRequestContext ctx, String key)


ACTION_RESTORE

public static final ControlActionDef ACTION_RESTORE
Action: restore Handler: void onRestore(ControlRequestContext ctx)


ACTION_CLOSE

public static final ControlActionDef ACTION_CLOSE
Action: close Handler: void onClose(ControlRequestContext ctx)


ACTION_VIEW

public static final ControlActionDef ACTION_VIEW
Action: View this event is triggered within an control, when the user switches to another view Handler: void onView(ControlRequestContext ctx, String view)


ACTION_CHANGEDATE

public static final ControlActionDef ACTION_CHANGEDATE
Action: ChangeDate this event is triggered within an scheduler control, when the user switches the controls view to another date. The parameter timeInMillis designates the new time in UTC milliseconds from the epoch. Handler: void onChangeDate(ControlRequestContext ctx, long timeInMillis, String view)


ACTION_SELECTDATE

public static final ControlActionDef ACTION_SELECTDATE
Action: ChangeDate this event is triggered within an scheduler control, when the user clicks on a date element. The parameter timeInMillis designates the new time in UTC milliseconds from the epoch. Handler: void onSelectDate(ControlRequestContext ctx, long timeInMillis, String view)


ACTION_APPOINTMENTCLICK

public static final ControlActionDef ACTION_APPOINTMENTCLICK
Action: Appointment this event is triggered within an scheduler control, when the user clicks on and appointment The parameter timeInMillis designates the time in UTC milliseconds from the epoch. Handler: void onAppointmentclick(ControlRequestContext ctx, String key, long timeInMillis)


ACTION_CHECKAPPOINTMENT

public static final ControlActionDef ACTION_CHECKAPPOINTMENT
Action: CheckAppointment This action is triggered if a checkbox on an appointment is clicked. Handler: void onCheckAppointment(ControlRequestContext ctx, String key, long timeInMillis, boolean check)


ACTION_CHECKDATE

public static final ControlActionDef ACTION_CHECKDATE
Action: CheckDate This action is triggered if a checkbox on an date is clicked. Handler: void onCheckDate(ControlRequestContext ctx, long timeInMillis, SchedulerScope scope, boolean check)


ACTION_ADDAPPOINTMENT

public static final ControlActionDef ACTION_ADDAPPOINTMENT
Action: AddAppointment this event is triggered within an scheduler control, when the user clicks on a add appointment button element. The parameter timeInMillis designates the new time in UTC milliseconds from the epoch. Handler: void onAddDate(ControlRequestContext ctx, long timeInMillis)


ACTION_PRINTLIST

public static final ControlActionDef ACTION_PRINTLIST
Action: Print (without parameters) Handler: void onPrint(ControlRequestContext ctx)


ACTION_EXPORTLIST

public static final ControlActionDef ACTION_EXPORTLIST
Action: Export (without parameters) Handler: void onExport(ControlRequestContext ctx)


ACTION_SWAPSELECTED

public static final ControlActionDef ACTION_SWAPSELECTED
Action: Swap selected option elements Handler: void onSwapSelected(ControlRequestContext ctx, int direction)


ACTION_SWAPALL

public static final ControlActionDef ACTION_SWAPALL
Action: Swap all option elements Handler: void onSwapAll(ControlRequestContext ctx, int direction)


ACTION_LOADMENU

public static final ControlActionDef ACTION_LOADMENU
Action: load menu Handler: void onLoadMenu(ControlRequestContext ctx, String menuId)


registry

private static java.util.Hashtable registry
List with all actions defined above


action

private java.lang.String action
The name of the action. This name is used to call an event handler in the action class. The event handler must follow the naming convention: do[action]().


types

private java.lang.Class[] types
Array with the parameters that belongs to the action.

Constructor Detail

ControlActionDef

public ControlActionDef(java.lang.String actionCode,
                        java.lang.Class[] types)
Constructor for ControlActionDef The class is instantiate with the parameters. So the type of the parameters can be checked.

Parameters:
actionCode - Name of the Action
types - Parameter of the action
Method Detail

registerActionDefinition

public static void registerActionDefinition(ControlActionDef def)
Registers an action definition in the global registry

Parameters:
def - The action definition

isRegistered

public static boolean isRegistered(java.lang.String action)
Checks if a certain action is registered in the action registry

Parameters:
action - The action name to check
Returns:
returns true if the action is already registered in the registry

query

public static ControlActionDef query(java.lang.String code)
Returns a ControlActionDef for the argument

Parameters:
code - String to parse
Returns:
ControlActionDef or null

parse

public static ControlActionDef parse(java.lang.String code)
Returns a ControlActionDef for the argument

Parameters:
code - String to parse
Returns:
ControlActionDef

equals

public boolean equals(java.lang.Object obj)
Compares the argument to this type

Parameters:
obj - String to compare
Returns:
boolean

hashCode

public int hashCode()
See Also:
Object.hashCode()

createInstance

public ControlAction createInstance(PainterContext ctx)
Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition. Mit Hilfe der ControlAction.setParam() Methoden können die zu den vordefinierten Parametertypen passenden aktuellen Parameter gesetzt werden.

Parameters:
ctx - the painter context
Returns:
ControlAction

createInstance

public ControlAction createInstance(Control ctrl)
Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition. Mit Hilfe der ControlAction.setParam() Methoden können die zu den vordefinierten Parametertypen passenden aktuellen Parameter gesetzt werden.

Parameters:
ctrl - Control
Returns:
ControlAction

createInstance

public ControlAction createInstance(Control ctrl,
                                    java.lang.String actionName)
Die Methode erzeugt eine konkrete Aktionsinstanz zu dieser Aktionsdefinition. Mit Hilfe der ControlAction.setParam() Methoden können die zu den vordefinierten Parametertypen passenden aktuellen Parameter gesetzt werden.

Parameters:
ctrl - Control
actionName - Action name
Returns:
ControlAction

getFormalParameterCount

public int getFormalParameterCount()
Liefert die Anzahl der formalen Parameter zurück.

Returns:
int

getFormalParameterTypes

public java.lang.Class[] getFormalParameterTypes()
Liefert ein Array mit den Typen der formalen Parameter zurück. Der erste Parameter in der Liste ist dabei immer vom Typ ControlRequestContext!

Returns:
Class

mapActualParameter

public java.lang.Object[] mapActualParameter(ControlRequestContext ctx,
                                             java.lang.String[] paramStr)
                                      throws java.lang.Exception
Method mapActualParameter

Parameters:
ctx - ControlRequestContext
paramStr - Parameter
Returns:
Object
Throws:
java.lang.Exception - If an Exception occurred

getParameterType

public java.lang.Class getParameterType(int index)
Retrieves the class for the given parameter

Parameters:
index - Parameter Index
Returns:
Parameter Type

checkType

public void checkType(int index,
                      java.lang.Class type)
Method checkType

Parameters:
index - Index
type - Type

getName

public java.lang.String getName()
Method getName

Returns:
String

getAction

public java.lang.String getAction()
Retrieves the action identifier

Returns:
action identifier

getTypes

public java.lang.Class[] getTypes()
Retrieves the parameter types for this action

Returns:
parameter types

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2000-2005 SCC Informationssysteme GmbH. All Rights Reserved.