public interface TypedActionHandlerEx extends TypedActionHandler
TypedActionHandler
that can supply an action plan before actually executing an action.
The generated action plan is used to perform preemptive rendering in editor before acquiring a write lock.
Modifier and Type | Method and Description |
---|---|
void |
beforeExecute(Editor editor,
char c,
DataContext context,
ActionPlan plan)
The method is invoked before acquiring a write lock and actually executing an action.
|
execute
void beforeExecute(Editor editor, char c, DataContext context, ActionPlan plan)
There's no need to mirror all the oncoming changes, focus on latency-sensitive activity (like typing).
Implementation should not modify entities besides ActionPlan
(e.g. Editor
, Document
, CaretModel
, etc.).
Moreover, as the handlers can be chained, implementation must rely primarily on the state that is provided by the ActionPlan
(i.e. ActionPlan.getText()
must be used instead of a direct Document.getText()
call).
The handler is responsible for delegating to the previously registered handler if needed.
editor
- the editor in which the key was typed.c
- the typed character.context
- the current data context.plan
- the current action plan draft.