public class IlvSelectAllAccelerator extends IlvAccelerator
IlvSelectAllAccelerator
is used to allow the user to select
all the selectable objects in the manager.
The following code example shows how to use
IlvSelectAllAccelerator
in a simple Java application:
// Install the scroll down accelerator manager.addAccelerator( new IlvSelectAllAccelerator(KeyEvent.KEY_PRESSED, KeyEvent.VK_A, KeyEvent.CTRL_MASK, true));
All input events are handled by means of interactors or accelerators. Accelerators,
such as IlvSelectAllAccelerator
, are subclasses of IlvAccelerator
.
Each accelerator listens for a specific key event in the manager. For information on
handling events in a manager, see
Handling Events.
The following code examples show how to handle user events:
Constructor and Description |
---|
IlvSelectAllAccelerator(int type,
int keyCode,
char keyChar,
int modifiers,
boolean consumeEvents)
Creates an
IlvSelectAllAccelerator . |
IlvSelectAllAccelerator(int type,
int keyCode,
int modifiers)
Creates an
IlvSelectAllAccelerator . |
IlvSelectAllAccelerator(int type,
int keyCode,
int modifiers,
boolean consumeEvents)
Creates an
IlvSelectAllAccelerator . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
handleEvent(IlvManagerView view)
Processes the event.
|
boolean |
isSelectAll()
Returns whether all objects are selected or deselected when this
accelerator is triggered.
|
boolean |
isTraverse()
Returns whether this accelerator can select objects in submanagers
and link bundles.
|
void |
setSelectAll(boolean enable)
Sets whether all objects are selected or deselected in the manager of the
current view when this accelerator is triggered.
|
void |
setTraverse(boolean traverse)
Sets whether this accelerator selects only objects contained
directly in the manager of the view, or whether it also selects objects
in submanagers and link bundles.
|
CtrlChar, getEventType, getKeyChar, getKeyCode, getModifier, isConsumeEvents, setConsumeEvents
public IlvSelectAllAccelerator(int type, int keyCode, char keyChar, int modifiers, boolean consumeEvents)
IlvSelectAllAccelerator
.
You can specify the associated key either by a key code or by a key
character. Key codes are useful for function keys while
key characters are more useful for regular characters
'a'...'z','A'...'Z','0'...'9','+','-', etc.
which, depending on the keyboard layout may produce different key codes.
For instance, on a US keyboard, the character '+' has the same key code
as the character '=', while on a German keyboard, the character '+' has
the same key code as the character '*', hence specifying the '+'
character by key code instead of key character might be not suitable.
To indicate that only the key code should be checked, pass
KeyEvent.CHAR_UNDEFINED
as key character.
To indicate that only the key character should be checked, pass
KeyEvent.VK_UNDEFINED
as key code.type
- The type of the AWT event.keyCode
- The code associated with the key,
or KeyEvent.VK_UNDEFINED
.keyChar
- The character associated with the key,
or KeyEvent.CHAR_UNDEFINED
.modifiers
- The modifiers of the key.consumeEvents
- If true
, the accelerator handles and
consumes the event, except when the consume flag of the event
is already set to true
. If false
, the
accelerator ignores the event's consume flag, and handles all
events without changing the consume flag.public IlvSelectAllAccelerator(int type, int keyCode, int modifiers, boolean consumeEvents)
IlvSelectAllAccelerator
.type
- The type of the AWT event.keyCode
- The code associated with the key.modifiers
- The modifiers of the key.consumeEvents
- If true
, the accelerator handles and consumes
the event, except when the consume flag of the event is already set to
true
.
If false
, the accelerator ignores the event's consume flag,
and handles all events without changing the consume flag..public IlvSelectAllAccelerator(int type, int keyCode, int modifiers)
IlvSelectAllAccelerator
.type
- The type of the AWT event.keyCode
- The code associated with the key.modifiers
- The modifiers of the key.public void setSelectAll(boolean enable)
setTraverse(boolean)
is set to true
, the accelerator also selects or deselects all
selectable objects in the submanagers and link bundlesenable
- If true
, all objects are selected or deselected
by this accelerator. By default, selection of all objects
is enabled.public boolean isSelectAll()
public void setTraverse(boolean traverse)
traverse
- If true
, the selection recurses to
all objects in submanagers and link bundles. By default,
the accelerator selection is limited to objects in the
manager of the current view.public boolean isTraverse()
protected boolean handleEvent(IlvManagerView view)
handleEvent
in class IlvAccelerator
view
- The manager view.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.