|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.xoetrope.swt.XSwtEventHandler
public class XSwtEventHandler
Implements an event handler for XUI. Most of the common events are handled. The class is intended as a mixin for a panel class such as XPage and should not be used directly
Copyright (c) Xoetrope Ltd., 2002-2003
License: see license.txt
$Revision: 1.8 $
| Field Summary | |
|---|---|
protected java.util.Hashtable |
classInstances
|
protected java.lang.Object |
container
|
protected static java.util.EventObject |
currentEvt
|
protected XProject |
currentProject
|
protected java.util.Hashtable |
handlers
|
protected static java.lang.Object |
mouseDownComponent
|
protected static boolean |
mouseEventInvoked
|
protected static int |
suppressFocusEvents
|
protected XValidationHandler |
xValidationHandler
|
| Constructor Summary | |
|---|---|
XSwtEventHandler(XProject project,
java.lang.Object c,
XValidationHandler vh)
Create a new XSwtEventHandler |
|
| Method Summary | |
|---|---|
void |
addActionHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for action events |
void |
addFocusHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for focus events |
XMethodReference |
addHandler(java.lang.Object comp,
long eventType,
java.lang.String methodStr)
Adds an event handler. |
XMethodReference |
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)
Adds an event handler. |
void |
addItemHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for item events |
void |
addKeyHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for key events |
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 |
addMenuHandler(java.lang.Object menuItem,
java.lang.String methodName)
Adds a handler for action events |
void |
addMouseHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for mouse events |
void |
addMouseMotionHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for mouse motion events |
void |
addTextHandler(java.lang.Object comp,
java.lang.String methodName)
Adds a handler for text events |
java.lang.reflect.Method |
findEvent(java.lang.Object src,
long eventType)
Lookup an event for a component. |
void |
focusGained(org.eclipse.swt.events.FocusEvent e)
|
void |
focusLost(org.eclipse.swt.events.FocusEvent e)
|
java.util.EventObject |
getCurrentEvent()
Get the current event |
XValidationHandler |
getValidationHandler()
Get the validation handler reference. |
void |
invoke(long eventType,
java.util.EventObject evt)
Invokes an event. |
boolean |
isFocusChangeSuppressed()
Check the focus change status |
void |
keyPressed(org.eclipse.swt.events.KeyEvent e)
|
void |
keyReleased(org.eclipse.swt.events.KeyEvent e)
|
void |
keyTyped(org.eclipse.swt.events.KeyEvent e)
|
void |
mouseClick(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDown(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseDragged(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseEnter(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseExit(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseHover(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseMove(org.eclipse.swt.events.MouseEvent e)
|
void |
mouseUp(org.eclipse.swt.events.MouseEvent e)
|
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. |
void |
widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
|
void |
widgetSelected(org.eclipse.swt.events.SelectionEvent e)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static java.util.EventObject currentEvt
protected java.lang.Object container
protected XProject currentProject
protected java.util.Hashtable handlers
protected java.util.Hashtable classInstances
protected static java.lang.Object mouseDownComponent
protected static boolean mouseEventInvoked
protected static int suppressFocusEvents
protected XValidationHandler xValidationHandler
| Constructor Detail |
|---|
public XSwtEventHandler(XProject project,
java.lang.Object c,
XValidationHandler vh)
project - project concernedc - container objectvh - validation handler| Method Detail |
|---|
public void removeHandlers(java.lang.Object comp)
removeHandlers in interface XuiEventHandlercomp - the object whose events are being removedpublic XValidationHandler getValidationHandler()
getValidationHandler in interface XuiEventHandler
public void invoke(long eventType,
java.util.EventObject evt)
invoke in interface XuiEventHandlereventType - type of eventevt - the event object
public java.lang.reflect.Method findEvent(java.lang.Object src,
long eventType)
findEvent in interface XuiEventHandlersrc - the event source objecteventType - The id of the event required
public boolean isFocusChangeSuppressed()
isFocusChangeSuppressed in interface XuiEventHandlerpublic java.util.EventObject getCurrentEvent()
getCurrentEvent in interface XuiEventHandler
public XMethodReference addHandler(java.lang.Object comp,
long eventType,
java.lang.String methodStr)
throws java.lang.ClassNotFoundException,
java.lang.NoSuchMethodException
addHandler in interface XuiEventHandlercomp - the component that fires the eventmethodStr - the method to be invoked in response to the objecteventType - long value indicating the mask of the event to be handled
java.lang.ClassNotFoundException - throw if the class cannot be located
java.lang.NoSuchMethodException - throw if the named method cannot be located
public XMethodReference addHandler(java.lang.Object srcObj,
java.lang.String methodName,
java.lang.String adderMethod,
java.lang.String listenerInterface,
long eventMask,
java.lang.Object listener)
addHandler in interface XuiEventHandlersrcObj - the menu item that fires the eventsmethodName - the method to be invoked in response to the action eventadderMethod - the adder method name e.g. addActionListenerlistenerInterface - the listener interface e.g. org.eclipse.swt.events.ActionListenereventMask - the event mask e.g. AWTEvent.ACTION_EVENT_MASKlistener - the listener implementation, usually the page's this pointerorg.eclipse.swt.events.ActionListener,
org.eclipse.swt.events.ActionEvent
public void addListener(java.lang.Object comp,
java.lang.String listenerName,
java.lang.String argType,
java.lang.Object listener)
addListener in interface XuiEventHandlercomp - the component that fires eventslistenerName - the name of the listener interfaceargType - the listener argumentslistener - the listener implementation
public void addMenuHandler(java.lang.Object menuItem,
java.lang.String methodName)
menuItem - the menu item that fires the eventsmethodName - the method to be invoked in response to the action eventorg.eclipse.swt.events.ActionListener,
org.eclipse.swt.events.ActionEvent
public void addActionHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the action eventorg.eclipse.swt.events.ActionListener,
org.eclipse.swt.events.ActionEvent
public void addFocusHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the focus eventFocusListener,
FocusEvent
public void addTextHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the text eventorg.eclipse.swt.events.TextListener,
org.eclipse.swt.events.TextEvent
public void addItemHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the item eventorg.eclipse.swt.events.ItemListener,
org.eclipse.swt.events.ItemEvent
public void addKeyHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the key eventKeyListener,
KeyEvent
public void addMouseHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the mouse eventorg.eclipse.swt.events.MouseMotionListener,
MouseEvent
public void addMouseMotionHandler(java.lang.Object comp,
java.lang.String methodName)
comp - the component that fires the eventsmethodName - the method to be invoked in response to the mouse eventorg.eclipse.swt.events.MouseMotionListener,
MouseEventpublic boolean wasMouseClicked()
wasMouseClicked in interface XuiEventHandlerpublic boolean wasMouseDoubleClicked()
wasMouseDoubleClicked in interface XuiEventHandlerpublic boolean wasMouseRightClicked()
wasMouseRightClicked in interface XuiEventHandlerpublic void widgetSelected(org.eclipse.swt.events.SelectionEvent e)
widgetSelected in interface org.eclipse.swt.events.SelectionListenerpublic void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e)
widgetDefaultSelected in interface org.eclipse.swt.events.SelectionListenerpublic void focusGained(org.eclipse.swt.events.FocusEvent e)
focusGained in interface org.eclipse.swt.events.FocusListenerpublic void focusLost(org.eclipse.swt.events.FocusEvent e)
focusLost in interface org.eclipse.swt.events.FocusListenerpublic void keyPressed(org.eclipse.swt.events.KeyEvent e)
keyPressed in interface org.eclipse.swt.events.KeyListenerpublic void keyReleased(org.eclipse.swt.events.KeyEvent e)
keyReleased in interface org.eclipse.swt.events.KeyListenerpublic void keyTyped(org.eclipse.swt.events.KeyEvent e)
public void mouseClick(org.eclipse.swt.events.MouseEvent e)
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
mouseDoubleClick in interface org.eclipse.swt.events.MouseListenerpublic void mouseEnter(org.eclipse.swt.events.MouseEvent e)
mouseEnter in interface org.eclipse.swt.events.MouseTrackListenerpublic void mouseExit(org.eclipse.swt.events.MouseEvent e)
mouseExit in interface org.eclipse.swt.events.MouseTrackListenerpublic void mouseDown(org.eclipse.swt.events.MouseEvent e)
mouseDown in interface org.eclipse.swt.events.MouseListenerpublic void mouseUp(org.eclipse.swt.events.MouseEvent e)
mouseUp in interface org.eclipse.swt.events.MouseListenerpublic void mouseMove(org.eclipse.swt.events.MouseEvent e)
mouseMove in interface org.eclipse.swt.events.MouseMoveListenerpublic void mouseHover(org.eclipse.swt.events.MouseEvent e)
mouseHover in interface org.eclipse.swt.events.MouseTrackListenerpublic void mouseDragged(org.eclipse.swt.events.MouseEvent e)
public void suppressFocusEvents(boolean suppress)
suppressFocusEvents in interface XuiEventHandlersuppress - true to suppress focus events
public void addHandler(PageSupport xpage,
java.lang.Object targetComp,
java.lang.String typeStr,
java.lang.String methodName)
addHandler in interface XuiEventHandlerxpage - The page that contains the response methodstargetComp - the component to which the event handler is addedtypeStr - the type of handlermethodName - the name of the response method
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||