Methods' Details |
getAllKeyEvents
sequence< ::com::sun::star::awt::KeyEvent > |
getAllKeyEvents(); |
- Description
- return the list of all key events, which
are available at this configration set.
The key events are the "primary keys" of this configuration sets.
Means: Commands are registerd for key events.
Such key event can be mapped to its bound command,
using the method getCommandForKeyEvent().
- Returns
- A list of key events.
- See also
- getCommandForKeyEvent().
|
|
getCommandByKeyEvent
- Description
- return the registered command for the specified key event.
This function can be used to:
- by a generic service, which can execute commands if a
keyboard event occures.
- or to iterate over the whole container and change some
accelerator bindings.
- Parameter aKeyEvent
- the key event, where the registered command is searched for.
- Returns
- The registered command for the specified key event.
- Throws
- ::com::sun::star::container::NoSuchElementException
if the key event is an invalid one or does not exists
inside this configuration set.
|
|
setKeyEvent
- Description
- modify or create a key - command - binding.
If the specified key event does not already exists inside this
configuration access, it will be created and the command will be
registered for it.
If the specified key event already exists, its command will
be overwritten with the new command. There is no warning nor any error
about that! The outside code has to use the method getCommandForKeyEvent()
to check for possible collisions.
Note: This method cant be used to remove entities from the configuration set.
Empty parameters will result into an exception!
Use the method removeKeyEvent() instead.
- Parameter aKeyEvent
- specify the key event, which must be updated or new created.
- Parameter sCommand
- the new command for the specified key event.
- Throws
- ::com::sun::star::lang::IllegalArgumentException
if the key event isnt a valid one. Commands can be
checked only, if they are empty. Because every URL schema can be used
by commands in general, so its not possible to validate it.
- See also
- removeKeyEvent()
|
|
removeKeyEvent
- Description
- remove a key-command-binding from this configuration set.
- Parameter aKeyEvent
- the key event, which should be removed.
- Throws
- ::com::sun::star::container::NoSuchElementException
if the key event does not exists inside this configuration set.
|
|
getKeyEventsByCommand
- Description
- optimized access to the relation "command-key" instead
of "key-command" which is provided normaly by this interface.
It can be used to implement collision handling, if more then one
key event match to the same command. The returned list contains all
possible key events - and the outside code can select an possible one.
Of course - mostly this list will contain only one key event ...
- Parameter sCommand
- the command, where key bindings are searched for.
- Returns
- A list of ::com::sun::star::awt::KeyEvent structures,
where the pecified command is registered for.
- Throws
- ::com::sun::star::lang::IllegalArgumentException
if the specified command is empty. It cant be checked, if a command
is valid - because every URL schema can be used here.
- Throws
- ::com::sun::star::container::NoSuchElementException
if the specified command isnt empty but does not
occure inside this configuration set.
|
|
getPreferredKeyEventsForCommandList
sequence< any > |
getPreferredKeyEventsForCommandList( |
[in] sequence< string > |
lCommandList ) |
raises( |
::com::sun::star::lang::IllegalArgumentException ); |
- Description
- optimized function to map a list of commands to a corresponding
list of key events.
It provides a fast mapping, which is e.g. needed by a menu or toolbar implementation.
E.g. a sub menu is described by a list of commands - and the implementation of the menu
must show the corresponding shortcuts. Iteration over all items of this configuration
set can be very expensive.
Instead to the method getKeyEventsForCommand() the returned list contains only
one(!) key event bound to one(!) requested command. If more then one key event
is bound to a command - a selection is done inside this method.
This internal selection cant be influenced from outside.
@attention Because its not defined, that any command (e.g. configured inside a menu)
must have an accelerator - we cant reject the call if at least one command
does not occure inside this configuration set ...
We handle it more gracefully - and return an empty item instead of throwing
and exception.
- Parameter lCommandList
- a list of commands
- Returns
- A (non packed!) list of key events, where every item match by index
directly to a command of the specified CommandList.
If a command does not exists inside this configuration set, the
corresponding any value will be empty.
- Throws
- ::com::sun::star::lang::IllegalArgumentException
if at least one of the specified commands is empty.
It cant be checked, if a command is valid -
because every URL schema can be used here.
|
|
removeCommandFromAllKeyEvents
- Description
- search for an key-command-binding inside this configuration set,
where the specified command is used.
If such binding could be located, the command will be removed
from it. If as result of that the key binding will be empty,
if will be removed too.
This is an optimized method, which can perform removing of commands
from this configuration set. Because normaly Commands are "foreign keys"
and key identifier the "primary keys" - it needs some work to remove
all commands outside this container ...
- Parameter sCommand
- the command, which should be removed from any key binding.
- Throws
- ::com::sun::star::lang::IllegalArgumentException
if the specified command is empty.
- Throws
- ::com::sun::star::container::NoSuchElementException
if the specified command isnt used inside this configuration set.
|
|
Copyright © 2012, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.