This document lists changes made to the Editor Library 2 API.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.netbeans.modules.editor.lib2/1 > 1.20
EditorActionRegistration; made by: markiewb; issues: #171261
Allow to set the keymap-category for an action registered using @EditorActionRegistration.
EditorCaret; made by: mmetelka; issues: #259023
CaretInfo.getDotBias() and CaretInfo.getMarkBias() added together with other methods and parameters for bias manipulation to properly handle bidirectional text.
SplitOffsetHighlightsSequence; made by: mmetelka; issues: #257889
Renamed ShiftHighlightsSequence to SplitOffsetHighlightsSequence to and its getStartShift() to getStartSplitOffset() for better description and getEndShift() to getEndSplitOffset().
EditorUtilities; made by: mmetelka; issues: #258798
EditorUtilities.addCaretUndoableEdit allows actions to remember caret position during an atomic transaction over a document.
StickyWindowSupport; made by: ralphbenjamin; issues: #258764
Support for Sticky Windows in the editor. JComponents can be added to a layer on top of the editor. Components will update their vertical position on editor changes.
CascadingNavigationFilter; made by: sdedic; issues: #258824
Swing NavigationFilters implemented on top of the Caret API. Caret API caller may describe the operation which causes the caret to be moved, so that filters and caret listeners can react on specific action groups.
A boilerplate NavigationFilter is provided, that supports chaining of filters on the caret
EditorActionNames; made by: mmetelka; issues: #258377
The EditorRegistry.findComponent() allows caret related undo edits to be undone in a focused component (for multiple views over a single document).
Also simplified naming of EditorActionNames.addCaretUp and addCaretDown.
EditorUtilities; affected packages:
org.netbeans.api.editor.caret; made by: mmetelka ralphbenjamin; issues: #257893
The Caret API was introduced to allow working with multiple carets within one document.
Highlights sequence that supports shifts in addition to regular offsets. This allows to color individual spaces within a tab character or to color extra virtual characters beyond a newline character.
EditorActionNames; made by: sdedic; issues: #194356
Many languages define their own actions and support for navigating between symbol occurrences. Common action name allows them to be presented and configured as one action in IDE configuration.
Allows highlights containers to be notified that they are no longer being used by highlighting manager.
Document data handling and implementation was separated into
SideBarFactory; made by: sdedic; issues: #226877
adopted from the legacy
editor.lib module, with unchanged semantic.
The original interface was deprecated.
AbstractEditorAction made part of editor SPI by making org.netbeans.spi.editor a public package.
Added EditorActionRegistration.noKeyBinding and EditorActionRegistration.noIconInMenu fields into EditorActionRegistration annotation.
Added NavigationHistory and NavigationHistory.Waypoint classes. It enables to add position to edit history. It also enables get edit history and look on last edits.
Added method getReplacedText() in TypedTextInterceptor to get replaced text after it's removed. This enables to use this text in some typing actions.
Added OnSaveTask interface which allows modules to register tasks into MimeLookup that will be performed right before document saving.
Added UndoableEditWrapper interface which allows wrapping of document-generated undoable edit by custom wrapping undoable edit(s).
Added EditorDocumentUtils.runExclusive(Runnable) method for gaining exclusive access to document without making any document mutations.
Add "weight" attribute to EditorActionRegistration annotation to allow for a clean actions overriding.
DialogBinding.bindComponentToFile(FileObject fileObject, int line, int column, int length, JTextComponent component)and
DialogBinding.bindComponentToDocument(Document document, int line, int column, int length, JTextComponent component).
DialogBinding; made by: dbalek; issues: #163769
EditorActionRegistration; made by: mmetelka; issues: #150875
CodeGeneratorimplementations registered for various mime types serve for creating code snippets and inserting them into documents on the Insert Code editor action invocation. The
CodeGeneratorContextProviderimplementations registered for the mime types could provide the respective CodeGenerators with an additional context information.
HighlightAttributeValueallows specifying highlights with attributes, which value is lazily evaluated at the time when the attrbute is used. For example when specifying tooltips.
EditorRegistryallows to get focused and last focused text component and list of all registered components and it allows to listen for currently focused component and changes of documents in it.
AttributesUtilitiesclass has been moved to