org.formaria.aria.events
Interface AriaEventHandler

All Known Implementing Classes:
EventHandler, GroovyEventHandler, SwtEventHandler

public interface AriaEventHandler

Specifies an event handler for Aria. Most of the common events are handled. The class's implementations are intended as a mixin for a panel class such as Page and should not be used directly

Copyright (c) Formaria Ltd., 2008

License: see license.txt

$Revision: 1.7 $


Method Summary
 MethodReference addHandler(java.lang.Object comp, long eventType, java.lang.String methodName)
          Adds an event handler.
 MethodReference addHandler(java.lang.Object srcObj, java.lang.String methodName, java.lang.String adderMethod, java.lang.String listenerInterface, long eventMask, java.lang.Object listener)
          Adds a handler for action events
 void addHandler(PageSupport xpage, java.lang.Object targetComp, java.lang.String typeStr, java.lang.String methodName)
           
 void addListener(java.lang.Object comp, java.lang.String listenerName, java.lang.String argType, java.lang.Object listener)
          Adds a listener for an event type.
 void clearMouseClick()
          Clear the mouse click tracking
 java.lang.reflect.Method findEvent(java.lang.Object src, long eventType)
          Lookup an event for a component.
 java.util.EventObject getCurrentEvent()
          Get the current event
 ValidationHandler getValidationHandler()
          Get the validation handler reference.
 boolean invoke(long eventType, java.util.EventObject evt)
          Invokes an event.
 boolean isFocusChangeSuppressed()
          Check the focus change status
 void removeHandlers(java.lang.Object comp)
          Remove all the event handlers for a particular object
 void suppressFocusEvents(boolean suppress)
          Used by messageboxes and other dialogs to prevent the display of the dialog causing extra focus events from being fired.
 boolean wasMouseClicked()
          A utility method used to determine if the last event corrseponds to a mouse click.
 boolean wasMouseDoubleClicked()
          A utility method used to determine if the last event corrseponds to a mouse double click.
 boolean wasMouseRightClicked()
          A utility method used to determine if the last event corrseponds to a mouse right click.
 

Method Detail

getValidationHandler

ValidationHandler getValidationHandler()
Get the validation handler reference. Note that the caller should not hold a reference to this value as it will probably cause a memory leak.

Returns:
the current validation handler

invoke

boolean invoke(long eventType,
               java.util.EventObject evt)
Invokes an event. Called in response to an event. If a handler has been added for the event it will be invoked.

Parameters:
eventType - the event type
evt - the event object
Returns:
true if an event is invoked

removeHandlers

void removeHandlers(java.lang.Object comp)
Remove all the event handlers for a particular object

Parameters:
comp - the object whose events are being removed

addHandler

MethodReference addHandler(java.lang.Object comp,
                           long eventType,
                           java.lang.String methodName)
                           throws java.lang.ClassNotFoundException,
                                  java.lang.NoSuchMethodException
Adds an event handler. A specific handler such as the addActionHandler should be used instead of calling this method

Parameters:
eventType - long value indicating the mask of the event to be handled
comp - the component that fires the event
methodName - the method to be invoked in response to the object
Throws:
java.lang.ClassNotFoundException - throw if the class cannot be located
java.lang.NoSuchMethodException - throw if the named method cannot be located

addHandler

MethodReference addHandler(java.lang.Object srcObj,
                           java.lang.String methodName,
                           java.lang.String adderMethod,
                           java.lang.String listenerInterface,
                           long eventMask,
                           java.lang.Object listener)
Adds a handler for action events

Parameters:
srcObj - the menu item that fires the events
methodName - the method to be invoked in response to the action event
adderMethod - the adder method name e.g. addActionListener
listenerInterface - the listener interface e.g. java.awt.event.ActionListener
eventMask - the event mask e.g. AWTEvent.ACTION_EVENT_MASK
listener - the listener implementation, usually the page's this pointer
See Also:
ActionListener, ActionEvent

addListener

void addListener(java.lang.Object comp,
                 java.lang.String listenerName,
                 java.lang.String argType,
                 java.lang.Object listener)
Adds a listener for an event type. This method should not normally be called by an application

Parameters:
comp - the component that fires events
listenerName - the name of the listener interface
argType - the listener arguments
listener - the listener implementation, usually the page's this pointer

clearMouseClick

void clearMouseClick()
Clear the mouse click tracking


wasMouseClicked

boolean wasMouseClicked()
A utility method used to determine if the last event corrseponds to a mouse click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was clicked

wasMouseDoubleClicked

boolean wasMouseDoubleClicked()
A utility method used to determine if the last event corrseponds to a mouse double click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was double clicked

wasMouseRightClicked

boolean wasMouseRightClicked()
A utility method used to determine if the last event corrseponds to a mouse right click. The notion of a click is extended by assuming the a mouse press and release within a single component constitutes a click even if not at the same coordinate. A MouseEvent.MOUSE_CLICKED is only triggered when the press and release are at the same location and this is often inadequate for end-user interaction.

Returns:
true if the mouse was right clicked

getCurrentEvent

java.util.EventObject getCurrentEvent()
Get the current event

Returns:
the AWTEvent that was last triggered

isFocusChangeSuppressed

boolean isFocusChangeSuppressed()
Check the focus change status

Returns:
true if the focus change events are being suppressed.

suppressFocusEvents

void suppressFocusEvents(boolean suppress)
Used by messageboxes and other dialogs to prevent the display of the dialog causing extra focus events from being fired.

Parameters:
suppress - true to suppress focus events

findEvent

java.lang.reflect.Method findEvent(java.lang.Object src,
                                   long eventType)
Lookup an event for a component.

Parameters:
src - The Object which contains the event
eventType - The id of the event required
Returns:
The Method object

addHandler

void addHandler(PageSupport xpage,
                java.lang.Object targetComp,
                java.lang.String typeStr,
                java.lang.String methodName)