com.sybase.uep.bobclient.controls
Class CustomEventsHandler

java.lang.Object
  extended by com.sybase.uep.bobclient.controls.CustomEventsHandler

public class CustomEventsHandler
extends java.lang.Object

The custom events handler.

Author:
bdeng

Constructor Summary
CustomEventsHandler()
          Constructor
CustomEventsHandler(ICustomEventsDelegate delegate, int eventsFlags)
          Constructor
 
Method Summary
 void drawFocus(java.lang.Object field, int controlID, net.rim.device.api.ui.Graphics g, boolean on)
          Delegates the drawFocus method to custom events delegate
 ICustomEventsDelegate getDelegate()
          Returns the custom events delegate
 int getEventsFlags()
          Returns the events flags
 boolean isOnClickRegistered()
          Returns whether onClick event is registered.
 boolean isOnDrawRegistered()
          Returns whether onDraw event is registered.
 boolean isOnLoadRegistered()
          Returns whether onLoad event is registered.
 boolean isOnOrientationChangeRegistered()
          Returns whether onOrientationChange event is registered.
 boolean isOnRecordChangeRegistered()
          Returns whether onRecordChange event is registered.
 boolean isOnValueChangeRegistered()
          Returns whether onValueChange event is registered.
 boolean navigationClick(java.lang.Object field, int controlID, ActionList actions, int status, int time)
          Delegates the navigationClick method to custom events delegate
 boolean navigationMovement(java.lang.Object field, int controlID, int dx, int dy, int status, int time)
          Delegates the navigationMovement method to custom events delegate
 boolean navigationUnclick(java.lang.Object field, int controlID, int status, int time)
          Delegates the navigationUnclick method to custom events delegate
 void onFocus(java.lang.Object field, int controlID, int direction)
          Delegates the onFocus method to custom events delegate
 boolean onLoad(java.lang.Object field, int controlID)
          Delegates the onLoad method to custom events delegate, returns true if custom events delegate onLoad is called and false otherwise.
 void onOrientationChange(java.lang.Object field, int controlID, int width, int height)
          Delegates the onOrientationChange method to custom events delegate
 void onRecordChange(java.lang.Object field, int controlID)
          Delegates the onRecordChange method to custom events delegate
 void onUnfocus(java.lang.Object field, int controlID)
          Delegates the onUnfocus method to custom events delegate
 void onValueChange(java.lang.Object field, int controlID, int context)
          Delegates the onValueChange method to custom events delegate
 void paint(java.lang.Object field, int controlID, net.rim.device.api.ui.Graphics g)
          Delegates the paint method to custom events delegate
 void setDelegate(ICustomEventsDelegate delegate)
          Sets the custom events delegate
 void setEventsFlags(int eventsFlags)
          Sets the events flags
 boolean touchEvent(java.lang.Object field, int controlID, net.rim.device.api.ui.TouchEvent message)
          Delegates the touchEvent method to custom events delegate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomEventsHandler

public CustomEventsHandler()
Constructor


CustomEventsHandler

public CustomEventsHandler(ICustomEventsDelegate delegate,
                           int eventsFlags)
Constructor

Parameters:
delegate - the custom events delegate
eventsFlags - the event flags
Method Detail

getDelegate

public ICustomEventsDelegate getDelegate()
Returns the custom events delegate

Returns:
the custom events delegate

setDelegate

public void setDelegate(ICustomEventsDelegate delegate)
Sets the custom events delegate

Parameters:
delegate - the custom events delegate to set

getEventsFlags

public int getEventsFlags()
Returns the events flags

Returns:
the events flags

setEventsFlags

public void setEventsFlags(int eventsFlags)
Sets the events flags

Parameters:
eventsFlags - the events flags to set

onOrientationChange

public void onOrientationChange(java.lang.Object field,
                                int controlID,
                                int width,
                                int height)
Delegates the onOrientationChange method to custom events delegate

Parameters:
field - the control
controlID - the control ID
width - amount of available horizontal space.
height - amount of available vertical space.

paint

public void paint(java.lang.Object field,
                  int controlID,
                  net.rim.device.api.ui.Graphics g)
Delegates the paint method to custom events delegate

Parameters:
field - the control
controlID - the control ID
g - Graphics context for drawing the focus.

drawFocus

public void drawFocus(java.lang.Object field,
                      int controlID,
                      net.rim.device.api.ui.Graphics g,
                      boolean on)
Delegates the drawFocus method to custom events delegate

Parameters:
field - the control
controlID - the control ID
g - Graphics context for drawing the focus.
on - true if the focus should be set; otherwise, false.

onLoad

public boolean onLoad(java.lang.Object field,
                      int controlID)
Delegates the onLoad method to custom events delegate, returns true if custom events delegate onLoad is called and false otherwise.

Parameters:
field - the control
controlID - the control ID
Returns:
true if custom events delegate onLoad is called and false otherwise.

onFocus

public void onFocus(java.lang.Object field,
                    int controlID,
                    int direction)
Delegates the onFocus method to custom events delegate

Parameters:
field - the control
controlID - the control ID
direction - indicates from which direction the focus enters the field.

onUnfocus

public void onUnfocus(java.lang.Object field,
                      int controlID)
Delegates the onUnfocus method to custom events delegate

Parameters:
field - the control
controlID - the control ID

navigationClick

public boolean navigationClick(java.lang.Object field,
                               int controlID,
                               ActionList actions,
                               int status,
                               int time)
Delegates the navigationClick method to custom events delegate

Parameters:
field - the control
controlID - the control ID
status - Bitfield of values defined by KeypadListener.
time - number of milliseconds since the device was turned on.
Returns:

navigationUnclick

public boolean navigationUnclick(java.lang.Object field,
                                 int controlID,
                                 int status,
                                 int time)
Delegates the navigationUnclick method to custom events delegate

Parameters:
field - the control
controlID - the control ID
status - Bitfield of values defined by KeypadListener.
time - number of milliseconds since the device was turned on.
Returns:

navigationMovement

public boolean navigationMovement(java.lang.Object field,
                                  int controlID,
                                  int dx,
                                  int dy,
                                  int status,
                                  int time)
Delegates the navigationMovement method to custom events delegate

Parameters:
field - the control
controlID - the control ID
dx - magnitude of navigational motion: negative for a move left and postive for a move right.
dy - magnitude of navigational motion: negative for an upwards move, and positive for a downwards move.
status - Bitfield of values defined by KeypadListener.
time - number of milliseconds since the device was turned on.
Returns:

touchEvent

public boolean touchEvent(java.lang.Object field,
                          int controlID,
                          net.rim.device.api.ui.TouchEvent message)
Delegates the touchEvent method to custom events delegate

Parameters:
field - the control
controlID - the control ID
message - TouchEvent object containing various input parameters including the event type and touch coordinates.

onValueChange

public void onValueChange(java.lang.Object field,
                          int controlID,
                          int context)
Delegates the onValueChange method to custom events delegate

Parameters:
field - the control
controlID - the control ID
context - information specifying the origin of the change.

onRecordChange

public void onRecordChange(java.lang.Object field,
                           int controlID)
Delegates the onRecordChange method to custom events delegate

Parameters:
field - the control
controlID - the control ID

isOnClickRegistered

public boolean isOnClickRegistered()
Returns whether onClick event is registered.

Returns:
whether onClick event is registered.

isOnLoadRegistered

public boolean isOnLoadRegistered()
Returns whether onLoad event is registered.

Returns:
whether onLoad event is registered.

isOnDrawRegistered

public boolean isOnDrawRegistered()
Returns whether onDraw event is registered.

Returns:
whether onDraw event is registered.

isOnOrientationChangeRegistered

public boolean isOnOrientationChangeRegistered()
Returns whether onOrientationChange event is registered.

Returns:
whether onOrientationChange event is registered.

isOnRecordChangeRegistered

public boolean isOnRecordChangeRegistered()
Returns whether onRecordChange event is registered.

Returns:
whether onRecordChange event is registered.

isOnValueChangeRegistered

public boolean isOnValueChangeRegistered()
Returns whether onValueChange event is registered.

Returns:
whether onValueChange event is registered.