org.apache.tapestry.event
Class BrowserEvent

java.lang.Object
  extended by org.apache.tapestry.event.BrowserEvent

public class BrowserEvent
extends java.lang.Object

Represents a client side generated browser event.

Author:
jkuhnert

Field Summary
static java.lang.String CHAR_CODE
           
static java.lang.String KEYS
           
static java.lang.String LAYER_X
           
static java.lang.String LAYER_Y
           
static java.lang.String NAME
           
static java.lang.String PAGE_X
           
static java.lang.String PAGE_Y
           
static java.lang.String TARGET
           
static java.lang.String TARGET_ATTR_ID
           
static java.lang.String TYPE
           
 
Constructor Summary
BrowserEvent(IRequestCycle cycle)
          Creates a new browser event that will extract its own parameters.
BrowserEvent(java.lang.String name, EventTarget target)
          Creates a new browser event with the specified name/target properties.
 
Method Summary
 java.lang.String getCharCode()
           
 java.lang.String[] getKeys()
           
 java.lang.String getLayerX()
           
 java.lang.String getLayerY()
           
 java.lang.String getName()
          The name of the event that was generated.
 java.lang.String getPageX()
           
 java.lang.String getPageY()
           
 EventTarget getTarget()
          Returns the target of the client side event.
 java.lang.String getType()
           
static boolean hasBrowserEvent(IRequestCycle cycle)
          Utility method to check if the current request contains a browser event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
See Also:
Constant Field Values

TYPE

public static final java.lang.String TYPE
See Also:
Constant Field Values

KEYS

public static final java.lang.String KEYS
See Also:
Constant Field Values

CHAR_CODE

public static final java.lang.String CHAR_CODE
See Also:
Constant Field Values

PAGE_X

public static final java.lang.String PAGE_X
See Also:
Constant Field Values

PAGE_Y

public static final java.lang.String PAGE_Y
See Also:
Constant Field Values

LAYER_X

public static final java.lang.String LAYER_X
See Also:
Constant Field Values

LAYER_Y

public static final java.lang.String LAYER_Y
See Also:
Constant Field Values

TARGET

public static final java.lang.String TARGET
See Also:
Constant Field Values

TARGET_ATTR_ID

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

BrowserEvent

public BrowserEvent(IRequestCycle cycle)
Creates a new browser event that will extract its own parameters.

Parameters:
cycle - The request cycle to extract parameters from.

BrowserEvent

public BrowserEvent(java.lang.String name,
                    EventTarget target)
Creates a new browser event with the specified name/target properties.

Parameters:
name - The name of the event, ie "onClick", "onBlur", etc..
target - The target of the client side event.
Method Detail

getName

public java.lang.String getName()
The name of the event that was generated.

Examples would be onClick,onSelect,onLoad,etc....

Returns:
The event name.

getTarget

public EventTarget getTarget()
Returns the target of the client side event.

Returns:

getCharCode

public java.lang.String getCharCode()
Returns:
the charCode

getKeys

public java.lang.String[] getKeys()
Returns:
the keys

getLayerX

public java.lang.String getLayerX()
Returns:
the layerX

getLayerY

public java.lang.String getLayerY()
Returns:
the layerY

getPageX

public java.lang.String getPageX()
Returns:
the pageX

getPageY

public java.lang.String getPageY()
Returns:
the pageY

getType

public java.lang.String getType()
Returns:
the type

hasBrowserEvent

public static boolean hasBrowserEvent(IRequestCycle cycle)
Utility method to check if the current request contains a browser event.

Parameters:
cycle - The associated request.
Returns:
True if the request contains browser event data.


Copyright © 2006 Apache Software Foundation. All Rights Reserved.