public class EventList
extends java.lang.Object
implements java.io.Externalizable
ANYWHERE option is kept either globally, or per widget list, but they can't be mixed.
Events are kept as Sets of symbolic names. Widgets are kept as integer IDs.
Modifier and Type | Field and Description |
---|---|
private EventList |
chain
Chain of event lists (not transferred via network).
|
static int |
CHOOSE
High level CHOOSE operation code
|
(package private) static int |
CODE_MAX
The highest code
|
(package private) static int |
CODE_MIN
The lowest code
|
private java.util.List<EventDefinition> |
events
List of event definitions
|
private java.util.List<java.lang.String> |
goOn
Holds the GO-ON keys
|
private int |
operation
Type of operation
|
static int |
PROMPT_FOR
High level PROMPT-FOR operation code
|
static int |
SET
High level SET operation code
|
static int |
UPDATE
High level UPDATE operation code
|
private java.util.Set<java.lang.Integer> |
validations
Set of validatable widgets
|
static int |
WAIT_FOR
Low level WAIT-FOR operation code
|
Constructor and Description |
---|
EventList()
Default constructor with no events.
|
EventList(boolean flag)
A constructor that adds default GO and GO-ON events.
|
EventList(java.lang.String event)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
CommonFrame frame)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
GenericWidget widget)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
GenericWidget[] widget)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
GenericWidget[] widget,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
GenericWidget widget,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
handle handle)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
handle[] handle)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
handle[] handle,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
handle handle,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String[] event,
java.lang.Object[] target)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String[] event,
java.lang.Object[] target,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String event,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String event,
CommonFrame frame)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String event,
GenericWidget widget)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String event,
GenericWidget[] widget)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String event,
GenericWidget[] widget,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String event,
GenericWidget widget,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String event,
handle handle)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String event,
handle handle,
boolean anywhere)
Constructor that adds the given event definition.
|
EventList(java.lang.String event,
java.lang.Object[] target)
Constructor that adds the given event definition without the ANYWHERE option.
|
EventList(java.lang.String event,
java.lang.Object[] target,
boolean anywhere)
Constructor that adds the given event definition.
|
Modifier and Type | Method and Description |
---|---|
void |
addEvent(EventDefinition event)
Add the specified event to this event list.
|
void |
addEvent(java.lang.String event)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
CommonFrame frame)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
GenericWidget widget)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
GenericWidget[] widget)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
GenericWidget[] widget,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
GenericWidget widget,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
handle handle)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
handle[] handle)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
handle[] handle,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
handle handle,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String[] event,
java.lang.Object[] target)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String[] event,
java.lang.Object[] target,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String event,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String event,
CommonFrame frame)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String event,
GenericWidget widget)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String event,
GenericWidget[] widget)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String event,
GenericWidget[] widget,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String event,
GenericWidget widget,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String event,
handle handle)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String event,
handle handle,
boolean anywhere)
Adds an event definition to the list.
|
void |
addEvent(java.lang.String event,
java.lang.Object[] target)
Adds an event definition to the list without the ANYWHERE option.
|
void |
addEvent(java.lang.String event,
java.lang.Object[] target,
boolean anywhere)
Adds an event definition to the list.
|
void |
addGoOn(java.lang.String key)
Adds a key to the list of GO-ON keys.
|
void |
addGoOn(java.lang.String[] key)
Adds a key to the list of GO-ON keys.
|
boolean |
anyEventForWidget(WidgetId widgetId)
Checks whether this definition contains exit conditions referring
to the specified widget.
|
boolean |
cleanup(long resId,
int widgetId)
Remove all triggers which are registered for the specified resource or widget.
|
EventList |
difference(EventList el)
Returns a list of zero or more instances of
EventList s
which represent the events and widgets of this instance which are not
in the specified one. |
long[] |
getExitResourceIds()
Get the resource id list for which there are defined exit events.
|
int[] |
getExitWidgetIds()
Get the widget id list for which there are defined exit events.
|
EventList |
getNonExitEventsForWidget(int wid)
Returns an instance of
EventList which represents the common events for
particular widget. |
int |
getOperation()
Queries the terminal I/O operation type set here.
|
java.util.Map<java.lang.Integer,java.lang.Integer> |
getRowDisplayEvents()
Search for registered ROW-DISPLAY events.
|
int |
getTriggerId()
Gets trigger ID off of this event list.
|
boolean |
hasWidgetsOutsideWindow(TopLevelWindow<OutputManager<?>> activeWindow)
Check if there are any widgets (outside of the given window) listening for events in the
widget list.
|
boolean |
hasWindows()
Check if there are any windows listening for events in the widget list.
|
EventList |
intersection(EventList el)
Returns an instance of
EventList which represents
the common events and widgets with the specified one. |
boolean |
intersects(EventDefinition candidate)
Checks whether this event list has common events and widgets with
the specified candidate.
|
boolean |
intersects(EventList el)
Checks whether this event list has common events and widgets with
the specified one.
|
boolean |
isEmpty()
Determine if this event list is empty.
|
boolean |
isGoEvent(java.lang.String event)
Check if event is listed in GO-ON array.
|
boolean |
isSame(EventList other)
Reports if the list of event definitions is the same as the current
instance.
|
boolean |
isValidatable(GenericWidget widget)
Check if a given widget is validateable.
|
boolean |
isValidatable(int widgetId)
Check if a given widget is validateable.
|
void |
lookup(int fid,
int wid,
boolean trigger,
boolean isKey,
boolean specificWidget,
TriggerMatch result)
Checks whether this event matches any event defined in this
EventList instance. |
void |
lookup(int fid,
int wid,
boolean trigger,
boolean isKey,
TriggerMatch result)
Checks whether this event matches any event defined in this
EventList instance. |
void |
lookup(long resourceId,
boolean trigExit,
TriggerMatch result)
Checks whether this server event matches any server event defined in this
EventList instance. |
private void |
lookupEventHelper(int fid,
int wid,
java.lang.String ev,
boolean trigger,
boolean specific,
boolean universal,
boolean isKey,
TriggerMatch result)
Handles an event definition lookup for all known events and then it may also try the
same lookup for ANY-PRINTABLE and ANY-KEY events, depending on the properties of the
original event.
|
private void |
lookupWorker(int fid,
int wid,
boolean trig,
boolean isKey,
boolean specificWidget,
TriggerMatch result)
Worker routine for
lookup(int, int, boolean, boolean, TriggerMatch) . |
EventList |
merge(EventList from,
boolean lifo)
Merges in all events for all widgets and GO-ON events from the specified
EventList |
void |
readExternal(java.io.ObjectInput in)
Replacement for the default object reading method.
|
(package private) boolean |
remove(EventDefinition ed)
Remove all occurrences of the specified event definition.
|
void |
remove(EventList el)
Remove the events for widget/resources in the specified list.
|
private java.lang.String |
setCase(java.lang.String event)
Conditionally converts the event name to the upper case.
|
void |
setChain(EventList chain)
Set chain of other event lists.
|
void |
setOperation(int code)
Sets the terminal I/O operation type code for this instance.
|
void |
setTriggerId(int triggerId)
Sets the registered trigger for this event list.
|
void |
setValidatable(GenericWidget widget)
Sets the validateable widgets.
|
(package private) java.util.List<EventDefinition> |
splitEvents()
Split the events in this list into (id, event) and (anywhere-globally, event) pairs.
|
void |
writeExternal(java.io.ObjectOutput out)
Replacement for the default object writing method.
|
public static final int WAIT_FOR
public static final int PROMPT_FOR
public static final int SET
public static final int UPDATE
public static final int CHOOSE
static final int CODE_MIN
static final int CODE_MAX
private int operation
private java.util.List<java.lang.String> goOn
private java.util.Set<java.lang.Integer> validations
private java.util.List<EventDefinition> events
private EventList chain
public EventList()
addEvent()
to configure this
instance. This would be used for definitions that have multiple mappings of events
to targets.public EventList(boolean flag)
flag
- does nothing but simply selects the constructorpublic EventList(java.lang.String[] event, GenericWidget[] widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of string event names.widget
- An array of GenericWidget
instances associated with the specified
events.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String[] event, GenericWidget[] widget)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- An array of GenericWidget
instances associated with the specified
events.public EventList(java.lang.String event, GenericWidget[] widget)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- An array of GenericWidget
instances associated with the specified
event.public EventList(java.lang.String[] event, GenericWidget widget)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- GenericWidget
instance associated with the specified events.public EventList(java.lang.String event, GenericWidget widget)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- GenericWidget
instance associated with the specified event.public EventList(java.lang.String[] event, GenericWidget widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- GenericWidget
instance associated with the specified events.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String event, GenericWidget[] widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- An array of GenericWidget
instances associated with the specified
event.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String event, GenericWidget widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- GenericWidget
instance associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String event, handle handle)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.public EventList(java.lang.String[] event, handle handle)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.public EventList(java.lang.String[] event, handle[] handle)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.handle
- An array of handles.public EventList(java.lang.String event, handle handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String[] event, handle handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String[] event, handle[] handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.handle
- An array of handles.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String event, CommonFrame frame)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.frame
- CommonFrame
instance associated with the specified event.public EventList(java.lang.String[] event, CommonFrame frame)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.frame
- CommonFrame
instance associated with the specified events.public EventList(java.lang.String[] event)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.public EventList(java.lang.String[] event, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.anywhere
- true
if the global ANYWHERE option is being set.public EventList(java.lang.String event)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.public EventList(java.lang.String event, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.anywhere
- true
if the global ANYWHERE option is being set.public EventList(java.lang.String event, java.lang.Object[] target, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.target
- An array of widgets or handles.anywhere
- true
if the ANYWHERE option is used for this entry.public EventList(java.lang.String event, java.lang.Object[] target)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.target
- An array of widgets or handles.public EventList(java.lang.String[] event, java.lang.Object[] target)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.target
- An array of widgets or handles.public EventList(java.lang.String[] event, java.lang.Object[] target, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.target
- An array of widgets or handles.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String[] event, GenericWidget[] widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of string event names.widget
- An array of GenericWidget
instances associated with the specified
events.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String[] event, GenericWidget[] widget)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- An array of GenericWidget
instances associated with the specified
events.public void addEvent(java.lang.String event, GenericWidget[] widget)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- An array of GenericWidget
instances associated with the specified
event.public void addEvent(java.lang.String[] event, GenericWidget widget)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- GenericWidget
instance associated with the specified events.public void addEvent(java.lang.String event, GenericWidget widget)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- GenericWidget
instance associated with the specified event.public void addEvent(java.lang.String[] event, GenericWidget widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.widget
- GenericWidget
instance associated with the specified events.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String event, GenericWidget[] widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- An array of GenericWidget
instances associated with the specified
event.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String event, GenericWidget widget, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.widget
- GenericWidget
instance associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String event, handle handle)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.public void addEvent(java.lang.String[] event, handle handle)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.public void addEvent(java.lang.String[] event, handle[] handle)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.handle
- An array of handles.public void addEvent(java.lang.String event, handle handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String[] event, handle handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.handle
- The handle associated with the specified event.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String[] event, handle[] handle, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.handle
- An array of handles.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String event, CommonFrame frame)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.frame
- CommonFrame
instance associated with the specified event.public void addEvent(java.lang.String[] event, CommonFrame frame)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.frame
- CommonFrame
instance associated with the specified events.public void addEvent(java.lang.String[] event)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.public void addEvent(java.lang.String[] event, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.anywhere
- true
if the global ANYWHERE option is being set.public void addEvent(java.lang.String event)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.public void addEvent(java.lang.String event, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.anywhere
- true
if the global ANYWHERE option is being set.public void addEvent(java.lang.String event, java.lang.Object[] target, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.target
- An array of widgets or handles.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(java.lang.String event, java.lang.Object[] target)
Event names are case-insensitive on input and stored uppercased.
event
- The event name.target
- An array of widgets or handles.public void addEvent(java.lang.String[] event, java.lang.Object[] target)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.target
- An array of widgets or handles.public void addEvent(java.lang.String[] event, java.lang.Object[] target, boolean anywhere)
Event names are case-insensitive on input and stored uppercased.
event
- An array of event names.target
- An array of widgets or handles.anywhere
- true
if the ANYWHERE option is used for this entry.public void addEvent(EventDefinition event)
event
- The event to be added.public boolean isSame(EventList other)
other
- The event list to compare against.true
if the event definitions are the same.public void setChain(EventList chain)
chain
- The chain of event lists.public java.util.Map<java.lang.Integer,java.lang.Integer> getRowDisplayEvents()
public int[] getExitWidgetIds()
An "exit condition" is a pair of (event, widget ID) which can terminate the associated WAIT-FOR statement. This will return all resource IDs which have an associated exit event.
null
if there is no exit
event defined.public long[] getExitResourceIds()
An "exit condition" is a pair of (event, resource ID) which can terminate the associated WAIT-FOR statement. This will return all resource IDs which have an associated exit event.
null
if there is no exit event defined.public void addGoOn(java.lang.String[] key)
key
- array of key labelspublic void addGoOn(java.lang.String key)
key
- key labelpublic void setTriggerId(int triggerId)
triggerId
- trigger IDpublic int getTriggerId()
-1
if this event list
is for exit conditions.public boolean isGoEvent(java.lang.String event)
event
- Event name.true
if event is mentioned in the GO-ON array.public void setValidatable(GenericWidget widget)
widget
- GenericWidget
instancepublic boolean isValidatable(GenericWidget widget)
widget
- GenericWidget
instancetrue
if the widget is validateable.public boolean isValidatable(int widgetId)
widgetId
- widget IDtrue
if the widget is validatable.public int getOperation()
public void setOperation(int code)
code
- operation type code as one of the constants defined above.public boolean isEmpty()
true
if there are no events
, validations
or
goOn
entries and the chain
is null
.public void remove(EventList el)
el
- The event list which needs to be removed.public boolean cleanup(long resId, int widgetId)
resId
- The resource ID. -1 if not used.widgetId
- The widget ID. -1 if not used.public EventList merge(EventList from, boolean lifo)
EventList
from
- another EventList
to merge with this
.lifo
- true
if the events are imported in LIFO mode.public void lookup(int fid, int wid, boolean trigger, boolean isKey, TriggerMatch result)
EventList
instance.
This method forwards the call to
lookup(int, int, boolean, boolean, boolean, TriggerMatch)
with
specificWidget
set to false
.
fid
- Frame ID, can be -1
wid
- widget ID, can't be -1
, but can be SESSION_WINDOW_ID
.trigger
- true
if the search is for a trigger or false
to
search for an exit condition.isKey
- Marks real key pressed by user.result
- On input this contains the numeric event code that is the subject of the search.
On output both the event code and the trigger id may be modified.
For more information see
lookup(int, int, boolean, boolean, boolean, TriggerMatch)
.public void lookup(int fid, int wid, boolean trigger, boolean isKey, boolean specificWidget, TriggerMatch result)
EventList
instance.
The search is done slightly differently for the triggers versus exit events and for various classes of events.
According to the known facts, there are at least two classes of events:
The search for triggers is done in the following order:
If the widget is a frame or the session window, only the first step is taken.
The search for exit conditions is done in the following order:
If the widget is a frame, the search starts form the step 3.
If the widget is the session window, only the first step is taken.
fid
- Frame ID, can be -1
wid
- widget ID, can't be -1
, but can be SESSION_WINDOW_ID
.trigger
- true
if the search is for a trigger or false
to
search for an exit condition.isKey
- Marks real key pressed by user.specificWidget
- When true
only the specific widget events are lsearched, i.e.
anywhere, session window, etc. are ignored.result
- On input this contains the numeric event code that is the subject of the search.
On output both the event code and the trigger id may be modified. If no match
was found, then the trigger ID will be set to -1. For trigger searches, this is
the matching trigger ID and matched event code (which may be different from the
given event code in the case of ANY-KEY or ANY-PRINTABLE). For exit conditions,
the trigger ID will be the found event index when it is found.public void lookup(long resourceId, boolean trigExit, TriggerMatch result)
EventList
instance. Only exit conditions are checked.resourceId
- The ID of the resource.trigExit
- true
if the search is for a trigger or false
if the
search is for an exit condition.result
- On input this contains the numeric event code that is the subject of the search.
On output both the event code and the trigger id may be modified. If no match
was found, then the trigger ID will be set to -1. For trigger searches, this is
the matching trigger ID and matched event code (which may be different from the
given event code in the case of ANY-KEY or ANY-PRINTABLE). For exit conditions,
the trigger ID will be the found event index when it is found.public boolean intersects(EventList el)
They intersect if any of the event definitions in this list intersects with any event definition from the given list.
el
- another instance of EventList
true
if the event lists have common events and
widgetspublic boolean intersects(EventDefinition candidate)
They intersect if any of the event definitions in this list intersects with the candidate.
candidate
- A EventDefinition
.true
if the event list has common events and widgets with the
candidate.public EventList intersection(EventList el)
EventList
which represents
the common events and widgets with the specified one.
The returned EventList
retains all the internal fields of
this one except the list of event definitions.
el
- another instance of EventList
EventList
or null
if there is nothing in common.public EventList difference(EventList el)
EventList
s
which represent the events and widgets of this instance which are not
in the specified one.el
- another instance of EventList
EventList
or null
if there is nothing uncommon.public EventList getNonExitEventsForWidget(int wid)
EventList
which represents the common events for
particular widget.
The returned EventList
retains all the internal fields of
this one except the list of event definitions.
wid
- widget ID to check.EventList
containing events for given widget or null
if there is nothing.public boolean anyEventForWidget(WidgetId widgetId)
widgetId
- widget ID to checktrue
if the widget is referred from herepublic void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
readExternal
in interface java.io.Externalizable
in
- The input source from which fields will be restored.java.io.IOException
- In case of I/O errors.java.lang.ClassNotFoundException
- If payload can't be instantiated.public void writeExternal(java.io.ObjectOutput out) throws java.io.IOException
writeExternal
in interface java.io.Externalizable
out
- The output destination to which fields will be saved.java.io.IOException
- In case of I/O errors.public boolean hasWindows()
public boolean hasWidgetsOutsideWindow(TopLevelWindow<OutputManager<?>> activeWindow)
java.util.List<EventDefinition> splitEvents()
boolean remove(EventDefinition ed)
ed
- The event which needs to be removed.true
if this EventList has at least one occurrence of the specified
event.private java.lang.String setCase(java.lang.String event)
event
- original event nameprivate void lookupWorker(int fid, int wid, boolean trig, boolean isKey, boolean specificWidget, TriggerMatch result)
lookup(int, int, boolean, boolean, TriggerMatch)
.fid
- Frame ID, can be -1
.wid
- Widget ID, can't be -1
, but can be SESSION_WINDOW_ID
.trig
- true
if the search is for a trigger or false
to
search for an exit condition.isKey
- This flags marks reals keys typed by user.specificWidget
- When true
only the specific widget events are searched, i.e.
anywhere, session window, etc. are ignored.result
- On input this contains the numeric event code that is the subject of the search.
On output both the event code and the trigger id may be modified. If no match
was found, then the trigger ID will be set to -1. For trigger searches, this is
the matching trigger ID and matched event code (which may be different from the
given event code in the case of ANY-KEY or ANY-PRINTABLE). For exit conditions,
the trigger ID will be the found event index when it is found.private void lookupEventHelper(int fid, int wid, java.lang.String ev, boolean trigger, boolean specific, boolean universal, boolean isKey, TriggerMatch result)
fid
- Frame ID, can be -1
.wid
- Widget ID to check or -1 if this is a global anywhere event.ev
- The event name in the proper case (the caller should take care).trigger
- true
if the search is for a trigger or false
to
search for an exit condition.specific
- true
if an exact match is to be returned.universal
- true
if the event is of the universal class.isKey
- true
if the event was generated from the keyboard, which will
cause the ANY-KEY event to be checked.result
- On input this contains the numeric event code that is the subject of the search.
On output both the event code and the trigger id may be modified. If no match
was found, then the trigger ID will be set to -1. For trigger searches, this is
the matching trigger ID and matched event code (which may be different from the
given event code in the case of ANY-KEY or ANY-PRINTABLE). For exit conditions,
the trigger ID will be the found event index when it is found.