This document lists changes made to the Editor Utilities API. Please ask on the mailing list if you have any questions about the details of a change, or are wondering how to convert existing code to be compatible.

Index of APIs

Incompatible changes by date

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.

All changes by date

Changes by version

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.util > 1.20

Changes by affected class


Details of all changes by API and date

Uncategorized changes

Added methods to append elements to a GapList

Feb 22 '16; API spec. version: 1.64; affected top-level classes: GapList; made by: mmetelka; issues: #257888
Added supplementary methods to GapList to accompany the existing methods to add elements.

Added test for property storage support on events

May 20 '14; API spec. version: 1.60; made by: sdedic
Presence of property storage depends on the event publisher or document implementation. A client that wants to attach property to the event should be able to check whether the feature is available. In past the check was done by testing the implementation document type, which is not desirable.

Added String escape utils

Dec 10 '12; API spec. version: 1.52; made by: mkristofic

Added StringEscapeUtils.escapeHtml and StringEscapeUtil.unescapeHtml to escape text to html.

Added BlockCompare.invalidX() and invalidY()

Jul 30 '12; API spec. version: 1.49; made by: mmetelka

Added BlockCompare.invalidX() and BlockCompare.invalidY() to check for invalid bounds of compared blocks.

Added support for document property listeners

Mar 9 '10; API spec. version: 1.35; made by: vstejskal

Adding DocumentUtilities.addPropertyChangeListener(Document, PropertyChangeListener) and DocumentUtilities.removePropertyChangeListener(Document, PropertyChangeListener) in order to support listening on document property changes.

Added DocumentUtilities.getDocumentTimestamp(Document)

Jan 14 '10; API spec. version: 1.34; made by: vstejskal

Adding DocumentUtilities.getDocumentTimestamp(Document) to provide access to documents' timestamp property.

Added DocumentUtilities.getDocumentVersion(Document)

Feb 1 '09; API spec. version: 1.28; made by: vstejskal

Adding DocumentUtilities.getDocumentVersion(Document) to provide access to documents' version property.

Added DocumentUtilities.debugOffset(Document, int)

Jun 16 '08; API spec. version: 1.25; made by: mmetelka

Adding DocumentUtilities.debugOffset(Document, int) to dump both the integer offset and line and column as seen in editor's status bar. PositionRegion.toString(doc) debugs its bounds using debugOffset(). Added PositionRegion.getText() and PositionRegion.getString() to obtain text of the region.

Added DocumentUtilities.getMimeType

Jan 10 '08; API spec. version: 1.23; made by: vstejskal

Adding DocumentUtilities.getMimeType(Document) and DocumentUtilities.getMimeType(JTextComponent) in order to standardize access to documents' mimetype.

Added CharacterConversions class

Oct 17 '07; API spec. version: 1.21; made by: vstejskal

Adding CharacterConversions as a replacement for org.netbeans.editor.LineSeparatorConversion, which was deprecated.

Added DocumentListenerPriority.FIRST

Sep 21 '07; API spec. version: 1.20; made by: mmetelka

DocumentListenerPriority.FIRST is called prior any other priority levels.

Added DocumentUtilities.getDocumentListenerCount().

Sep 17 '07; API spec. version: 1.19; made by: mmetelka

DocumentUtilities.getDocumentListenerCount() returns total count of document listeners attached to a document covering the case when the document priority listening is used.

Added ArrayUtilities.binarySearch(...) methods.

Sep 4 '07; API spec. version: 1.18; made by: vstejskal

ArrayUtilities.binarySearch(int [] array, int key) and its variants can be used for searching in sorted integer array (eg. containing document offsets, etc.).

Added DocumentUtilities.isReadLocked() and isWriteLocked().

Mar 27 '07; API spec. version: 1.17; made by: mmetelka

DocumentUtilities.isReadLocked() and isWriteLocked() allow to check whether AbstractDocument based documents are currently read/write-locked.

Added FlyOffsetGapList.elementOrEndOffset().

Jan 16 '07; API spec. version: 1.16; made by: mmetelka

FlyOffsetGapList.elementOrEndOffset() added for use by lexer module to get either an element's offset or end offset of the last element.

DocumentListenerPriority.LEXER added

Dec 6 '06; API spec. version: 1.15; made by: mmetelka

DocumentListenerPriority.LEXER added for use by lexer module to update token list for a document.

Added ArrayUtilities.unmodifiableList().

Nov 16 '06; API spec. version: 1.14; made by: mmetelka

ArrayUtilities.unmodifiableList() return simple unmodifiable list for the given object array.

ListenerList.getListeners() return type changed.

Oct 17 '06; API spec. version: 1.13; made by: vstejskal

ListenerList.getListeners now returns List<T> instead of T[]. The listeners are returned in exactly the same order as they were added to the ListenerList.

CompactMap.MapEntry made an abstract class (not interface).

Oct 11 '06; API spec. version: 1.12; made by: mmetelka

CompactMap.MapEntry was made an abstract class (instead of original interface) to prevent misuse of CompactMap.MapEntry.setNextMapEntry(). CompactMap.AbstractMapEntry was removed.

Added ListenerList and DocumentListenerPriority.VIEW.

Sep 13 '06; API spec. version: 1.11; made by: mmetelka

Added ListenerList and added DocumentListenerPriority.VIEW.

Added PositionComparator and PositionRegion

Jun 14 '05; API spec. version: 1.6; made by: mmetelka; issues: #59388

Added two new classes PositionComparator and PositionRegion and a new level AFTER_CARET_UPDATE to DocumentListenerPriority class.

Added document listeners ordering support

Mar 24 '05; API spec. version: 1.4; made by: mmetelka; issues: #35034

Added document listeners ordering support through DocumentUtilities.addDocumentListener(doc, listener, priority).

Repackaged to org.netbeans.lib.editor.util package

Mar 13 '05; API spec. version: 1.5; made by: mmetelka; issues: #56339

The present classes were repackaged from org.netbeans.modules.editor.util into org.netbeans.lib.editor.util package to fulfil the editor module split proposal #51486 according to which the editor classes independent of the NB IDE should be placed under org.netbeans.lib package.

Built on April 30 2016.  |  Portions Copyright 1997-2016 Oracle. All rights reserved.