public final class EditorUtilities extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CARET_OVERWRITE_MODE_PROPERTY
Client property of editor component which determines
whether caret is currently in overwrite mode (Boolean.TRUE) or insert mode (Boolean.FALSE or null).
|
Modifier and Type | Method and Description |
---|---|
static void |
addCaretUndoableEdit(Document doc,
Caret caret)
Add an undoable edit describing current state of caret(s) during document's atomic section.
|
static Action |
getAction(EditorKit editorKit,
String actionName)
Find an action with the given name in the editor kit.
|
public static final String CARET_OVERWRITE_MODE_PROPERTY
public static Action getAction(EditorKit editorKit, String actionName)
editorKit
- non-null editor kit in which search is performed.actionName
- non-null action name to search for.public static void addCaretUndoableEdit(Document doc, Caret caret)
CustomUndoDocument
otherwise the method would do nothing.doc
- document to which the created undoable edit will be added.
Null may be passed then the method has no effect.caret
- non-null caret which state should be storedIllegalStateException
- if this method is called outside of an atomic section.CustomUndoDocument
,
AtomicLockDocument