oracle.javatools.editor
Interface ActionHookInvoker

An ActionHookInvoker is an interface to a class that
is responsible for performing some set of actions. Although this
interface is almost identical to ActionInvoker, it is intended to
be used to allow editor clients or plugins to register themselves
as actions hooks in order to take over responsibility for
handling a certain subset of editor actions for some specific
task (preferably for a temporary period of time.

Let's take code insight as an example, when you pop up a completion
window, the insight functionality needs to be able to trap the
cursor navigation keys, escape (cancel), and enter (complete)
from the editor. This is how it would be done. When the dialog
is first brought up, it would register itself as an ActionHookDialog,
and when it is dismissed, it will deregister itself.

Note, as a hint, in invokeAction don't do a series of
if comparisons as it can get expensive (if there are a lot of actions
or a lot of ActionHookInvokers.) For example, don't
do this:

The better thing to do would be to build up a hash table of actions
using the action names as keys and invoke the actions that way.

Note the difference in invokeAction() between this interface
and ActionInvoker. invokeAction() returns
a boolean here based on whether the action was performed by the
ActionHookInvoker. Otherwise, the caller will continue
on to the next invoker and so on.

A current limitation is that the DefaultKeyTypedAction is not accessible
through this interface (or through any interface currently) as it
its execution path is different.