Introduction
This document lists changes made to the Editor Guarded Sections API .
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.
- (Jun 19 '07) GuardedSectionsProvider supports Charset
All changes by date
- (Feb 17 '16) Allow to protect existing text
- (May 21 '14) DocumentGuards API
- (Nov 25 '12) Ability run guarded readers/writers when the content of the guarded section's content is set
- (Jun 19 '07) GuardedSectionsProvider supports Charset
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.guards/1 > 1.20
- (1.33) Allow to protect existing text
- (1.29) DocumentGuards API
- (1.20) Ability run guarded readers/writers when the content of the guarded section's content is set
- (1.0) GuardedSectionsProvider supports Charset
Changes by affected class
org.netbeans.api.editor.guards.DocumentGuards
- (May 21 '14) DocumentGuards API
org.netbeans.spi.editor.guards.GuardedRegionMarker
- (May 21 '14) DocumentGuards API
org.netbeans.api.editor.guards.GuardedSectionManager
- (Feb 17 '16) Allow to protect existing text
Details of all changes by API and date
Editor Guarded Sections API
Allow to protect existing text
Feb 17 '16; API spec. version: 1.33; affected top-level classes:GuardedSectionManager
; made by: sdedic
Added method to create guarded block on top of existing text.
DocumentGuards API
May 21 '14; API spec. version: 1.29; affected top-level classes:GuardedRegionMarker
DocumentGuards
; made by: sdedic; issues:
#244679
APIs exposed and actually used on GuardedDocument in editor.lib
module is now declared in Editor Guarded Sections.
Clients may depend on Guarded Sections instead of on fading-away editor.lib module.
Dependency on openide.text
eliminated, new SPI GuardedRegionMarker
is added for Documents that are willing to style their contents according to guarded areas.
Ability run guarded readers/writers when the content of the guarded section's content is set
Nov 25 '12; API spec. version: 1.20; made by: jlahoda; issues: #221844When this option is set, setting the content of a GuardedSection will pass the data through the given guarded writer and back through the given guarded reader, to ensure the result is the same as if it would be read from the disk.
Note that this new mode is not fully compatible with the original mode, e.g. all the set methods of all the GuardedSection classes will throw IllegalStateException if invoked inside the write&read part.
GuardedSectionsProvider supports Charset
Jun 19 '07; API spec. version: 1.0; made by: jpokorsky; issues: #99363In order to use proper encoding by guards impl it is necessary to change GuardedSectionsProvider to accept encoding rather as
java.nio.Charset
instance
than as a plain encoding name.
-
Reader createGuardedReader(InputStream stream, String encoding) throws UnsupportedEncodingException
replaced withReader createGuardedReader(InputStream stream, Charset charset)
-
Writer createGuardedWriter(OutputStream stream, String encoding) throws UnsupportedEncodingException
replaced withReader createGuardedReader(InputStream stream, Charset charset)