Style Intelligence v12.0

inetsoft.sree
Class EventHandler

java.lang.Object
  extended by inetsoft.sree.EventHandler
All Implemented Interfaces:
Serializable

public class EventHandler
extends Object
implements Serializable

Client-side event handler stores the event to command mapping. It is searched on the client when an event is generated. If a command is found, it is executed on the client, and the event is not passed to the server. Otherwise, the event is passed back to the server to be handled by the replet event handler.

See Also:
Serialized Form

Nested Class Summary
static class EventHandler.EventAction
          Event to action mapping object.
 
Constructor Summary
EventHandler()
          Create an empty handler.
EventHandler(EventHandler base)
          Create an event handler with a base handler.
 
Method Summary
protected  void addElement(EventHandler.EventAction ea, int idx)
          Add an event to action mapping object to the handler.
 void addFormLink(String name, String replet)
          Add a request event to replet link.
 void addMouseClickCommand(String eid, Point item, RepletCommand cmd)
          Add a mouse click event to action mapping.
 void addMouseEntryCommand(int eventid, Object src, Point item, RepletCommand cmd)
          Add a mouse entry event to action mapping.
 void addMousePopupTriggerCommand(String eid, Point item, RepletCommand cmd)
          Add a menu popup trigger event to action mapping.
 void addRepletMenuCommand(String eid, Point item, String menuitem, RepletCommand cmd)
          Add a menu event to action mapping.
 void addRepletMenuCommand(String menuitem, RepletCommand cmd)
          Add a menu event to action mapping.
 void addSelectionCommand(String eid, Object item, RepletCommand cmd)
          Add a selection event to action mapping.
 int getActionCount()
          Get the count of all event to action mapping objects.
 RepletCommand getCommand(EventObject e)
          Get the command associated with the event.
 Enumeration getEventActions()
          Get all event to action mapping objects.
 ActionListener getEventListener()
          Get the event action listener.
 Point getEventLocation(EventObject event)
          Get the event location (col, row).
 int getEventMask()
          Return the bitwise OR of all event masks this handler handles.
 void removeAll()
          Remove all event handlers.
 void setEventListener(ActionListener l)
          Set the event action listener to replet.
 String toString()
          Get the string representation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventHandler

public EventHandler()
Create an empty handler.


EventHandler

public EventHandler(EventHandler base)
Create an event handler with a base handler. The base handler can used to chain multiple event handlers into a single hander.

Method Detail

getCommand

public RepletCommand getCommand(EventObject e)
Get the command associated with the event.

Parameters:
e - replet event.
Returns:
associated command.

getActionCount

public int getActionCount()
Get the count of all event to action mapping objects.


getEventActions

public Enumeration getEventActions()
Get all event to action mapping objects.

Returns:
Enumeration of EventAction objects.

getEventLocation

public Point getEventLocation(EventObject event)
Get the event location (col, row). This function will perform necessary translation from the original event specification, to the new row/column index if the table has been transformed internally since the report creation, e.g. sorted by an user.


removeAll

public void removeAll()
Remove all event handlers.


getEventMask

public final int getEventMask()
Return the bitwise OR of all event masks this handler handles.

Returns:
event mask.

addRepletMenuCommand

public void addRepletMenuCommand(String menuitem,
                                 RepletCommand cmd)
Add a menu event to action mapping. The menu event matches all menu events on the report.

Parameters:
menuitem - menu item.
cmd - associated command.

addRepletMenuCommand

public void addRepletMenuCommand(String eid,
                                 Point item,
                                 String menuitem,
                                 RepletCommand cmd)
Add a menu event to action mapping. The menu event matches menu events originating from the specified element/item.

Parameters:
eid - element ID.
item - element item, null to ignore.
menuitem - menu item.
cmd - associated command.

addFormLink

public void addFormLink(String name,
                        String replet)
Add a request event to replet link. Request events are normally handled on the server side. The only exception is the command to show a new replet. In this case, the request is forwarded to the new replet as the creation request.

Parameters:
name - name of the request.
replet - the name of the replet to show.

addSelectionCommand

public void addSelectionCommand(String eid,
                                Object item,
                                RepletCommand cmd)
Add a selection event to action mapping.

Parameters:
eid - element ID.
item - element item, null to ignore.
cmd - associated command.

addMouseEntryCommand

public void addMouseEntryCommand(int eventid,
                                 Object src,
                                 Point item,
                                 RepletCommand cmd)
Add a mouse entry event to action mapping.

Parameters:
eventid - the event id, entered or exited.
src - element ID, String or ReportElement.
item - element item, null to ignore.
cmd - associated command.

addMouseClickCommand

public void addMouseClickCommand(String eid,
                                 Point item,
                                 RepletCommand cmd)
Add a mouse click event to action mapping.

Parameters:
eid - element ID.
item - element item, null to ignore.
cmd - associated command.

addMousePopupTriggerCommand

public void addMousePopupTriggerCommand(String eid,
                                        Point item,
                                        RepletCommand cmd)
Add a menu popup trigger event to action mapping.

Parameters:
eid - element ID.
item - element item, null to ignore.
cmd - associated command.

addElement

protected void addElement(EventHandler.EventAction ea,
                          int idx)
Add an event to action mapping object to the handler.


toString

public String toString()
Get the string representation.

Overrides:
toString in class Object

setEventListener

public void setEventListener(ActionListener l)
Set the event action listener to replet.


getEventListener

public ActionListener getEventListener()
Get the event action listener.


Copyright © 1996-2014 InetSoft Technology Corp. All Rights Reserved.