<questionid="arch-what"> Whatisthisprojectgoodfor? <hint> Pleaseprovideherefewlinesdescribingthetheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
The Editor Library 2 module is a set of official APIs and SPIs, designed to
replaces the original Editor Library with legacy APIs
that are not properly structured and do not conform to the rules
implied on the current NB APIs.
</p>
<p>
The APIs currently offered in Editor Library 2 module include:
</p>
<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://openide.netbeans.org/tutorial/api-design.html#design.apiandspi"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export&>quot;/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
The Netbeans editor infrastructure provides an implementation of the Swing Text
package APIs as well as some additional features such as syntax coloring, code
folding, braces matching, etc.
<br/>
</answer>
<!-- <questionid="arch-usecases"when="init"> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitat whatcircumstancesandwhatwillbethetypicalcodetowrite tousethemodule. </question>
-->
<answer id="arch-usecases">
At the moment the Editor Library 2 module contains distinct APIs/SPIs. They live
in their own package and the usecases can be found in the packages overview.
<ul>
<li>Code Generator SPI -
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/codegen/package-summary.html#usecases">org.netbeans.spi.editor.codegen</a>
</li>
<li>Highlighting SPI -
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/highlighting/package-summary.html#usecases">org.netbeans.spi.editor.highlighting</a>
</li>
<li>Typing Hooks SPI -
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/typinghooks/package-summary.html#usecases">org.netbeans.spi.editor.typinghooks</a>
</li>
<li>Caret API -
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/api/editor/caret/package-summary.html#usecases">org.netbeans.api.editor.caret</a>
</li>
<li>Caret SPI -
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/caret/package-summary.html#usecases">org.netbeans.spi.editor.caret</a>
</li>
</ul>
</answer>
<!-- <questionid="arch-quality"when="init"> Howthequalityofyourcodewillbetestedand howfutureregressionsaregoingtobeprevented? <hint> Whatkindoftestingyouwanttouse?What/howmuchareaoffunctionality shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
Code is accompanied with unit tests.
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonetheworkshouldbe ready. </hint> </question>
-->
<answer id="arch-time">
The migration process from the old APIs in Editor Library to the new ones
in Editor Library 2 is a long task without any clear time frame. We will
gradually keep deprecating parts of Editor Library and Editor module and
announce their replacements in the Editor Library 2 or other specialized
modules.
</answer>
<questionid="compat-standards"> Doesthemoduleimplementsordefinesanystandards?Isthe implementationexactoritdeviatessomehow? </question>
-->
<answer id="compat-standards">
It conforms to the Swing Text Package API.
</answer>
<questionid="dep-platform"> Onwhichplatformsyourmodulerun?Any?Doesitruninthesame way? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
The module is 100% pure Java and runs on any platform.
</answer>
<!-- <questionid="deploy-dependencies"when="final"> Whatdoothermodulesneedtodotodeclareadependencyonthisone? <hint> Provideasampleoftheactuallinesyouwouldaddtoamodulemanifest todeclareadependency,forexampleusingOpenIDE-Module-Module-Dependencies orOpenIDE-Module-Requires.Youmayusethemagictoken@SPECIFICATION-VERSION@ torepresentthecurrentspecificationversionofthemodule. </hint> </question>
-->
<answer id="deploy-dependencies">
Just normal module dependency.
</answer>
<questionid="exec-component"> Isexecutionofyourcodeinfluencedby(string)property ofanyofyourcomponents? <hint> Often<code>JComponent.getClientProperty</code>,<code>Action.getValue</code> or<code>PropertyDescriptor.getValue</code>,etc.areusedtoinfluence abehaviourofsomecode.Thisofcourseformsaninterfacethatshould bedocumented.Alsoifonedependsonsomeinterfacethatanobject implements(<code>componentinstanceofRunnable</code>)thatformsan APIaswell. </hint> </question>
-->
<answer id="exec-component">
<p>
Yes, the Highlighting SPI recognizes the following client properties that can
be set on a <code>JTextComponenet</code>.
</p>
<ul>
<li>
<api name="HighlightsLayerIncludes" group="property" category="official"type="export" >
Defines a regular expression that can be used for filtering out highlighting
layers used for rendering a text component. If specified, any layer with id matching the regular expression <b>will</b> be used for rendering the
component. By default, when the property is not specified or is <code>null</code>,
all layers are used. See
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/highlighting/package-summary.html#usecase5">Use case 5.</a>
for more details.
</api></li>
<li>
<api name="HighlightsLayerExcludes" group="property" category="official"type="export" >
Defines a regular expression that can be used for filtering out highlighting
layers used for rendering a text component. If specified, any layer with id matching the regular expression <b>will not</b> be used for rendering the
component. By default, when the property is not specified or is <code>null</code>,
all layers are used. See
<a href="@org-netbeans-modules-editor-lib2@/org/netbeans/spi/editor/highlighting/package-summary.html#usecase5">Use case 5.</a>
for more details.
</api></li>
</ul>
</answer>
<questionid="format-types"> Whichfileformatsyourcodereadsorwritesondisk? </question>
-->
<answer id="format-types">
None. Reading/writing files into editor document is not handled in this module.
</answer>
<!-- Question: lookup-lookup
<questionid="lookup-lookup"> Doesyourmoduleuses<code>org.openide.util.Lookup</code> tofindanycomponentstocommunicateto?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclasifythestabilityofsuch APIcontract. </hint> </question>
-->
<answer id="lookup-lookup">
The module uses <code>MimeLookup</code> for various purposes. The Highlighting
SPI looks up factories for highlighing layers registered in MimeLookup under
a mime type of documents that those layer wish to colorify.
</answer>
<!-- Question: lookup-register
<questionid="lookup-register"> Doyouregisteranythingintothelookupforothertofind? <hint> Doyouregisterusinglayerfileorusing<code>META-INF/services</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
Yes. There are some implementations of highlighting layers provided by this
module and they are registered in <code>MimeLookup</code>.
</answer>
<questionid="perf-limit"> Arethereanylimitsinnumber/sizeofelementsyourcode canhandle? </question>
-->
<answer id="perf-limit">
No explicit limits. Technically, the available memory size is the limit...
</answer>
<!-- Question: perf-mem
<questionid="perf-mem"> Whatistheamountofmemoryyourcomponentoccupies?Estimate witharelactiontothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
One average source file opened in the editor occupies roughly 500KB.
</answer>
<questionid="perf-progress"> Doesyourmoduleexecutessomelongrunningtask? <hint>Typicallytheyaretaskslikeconnectingover network,computinghugeamountofdata,compilation. Suchcommunicationshouldbedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
Opening a file in the editor can be a long task for large files.
</answer>
<!-- Question: perf-scale
<questionid="perf-scale"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? Pleaseincludesomeestimates. </question>
-->
<answer id="perf-scale">
<p>
The number of characters in a file multiplied by 2 to respect 2 bytes for each unicode character.
</p>
<p>
Each line is represented by a line element, which takes up about 96 bytes and
a position object occupying another 48 bytes.
</p>
</answer>
<!-- <questionid="exec-threading"when="impl"> Whatthreadingmodels,ifany,doesyourmoduleadhereto? <hint> IfyourmodulecallsforeignAPIswhichhaveaspecificthreadingmodel, indicatehowyoucomplywiththerequirementsformultithreadedaccess (synchronization,mutexes,etc.)applicabletothoseAPIs. IfyourmoduledefinesanyAPIs,orhascomplexinternalstructures thatmightbeusedfrommultiplethreads,declarehowyouprotect dataagainstconcurrentaccess,raceconditions,deadlocks,etc., andwhethersuchrulesareenforcedbyruntimewarnings,errors,assertions,etc. Examples:aclassmightbenon-thread-safe(likeJavaCollections);might befullythread-safe(internallocking);mightrequireaccessthroughamutex (andmayormaynotautomaticallyacquirethatmutexonbehalfofaclientmethod); mightbeabletorunonlyintheeventqueue;etc. Alsodescribewhenanyeventsarefired:synchronously,asynchronously,etc. Ideas:<ahref="http://core.netbeans.org/proposals/threading/index.html#recommendations">ThreadingRecommendations</a>(inprogress) </hint> </question>
-->
<answer id="exec-threading">
<p>
Threading model of the EditorDocument adheres to javax.swing.text.Document
interface. There can be multiple reader threads accessing
the document simultaneously but only one mutating thread at the time.
</p>
<p>
All the UI-related tasks adhere to Swing/AWT conventions i.e. they
must be performed in EQ thread.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforce,thatitwillbehavecorrectlyandfastandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
The infrastructure does not enforce any performance criteria and it's up to
modules to perform reasonably. On the other hand each SPI defines its threading
and locking model, which should help modules to understand the constraints
and impact of their code.
</answer>
<!-- <questionid="compat-deprecation"when="init"> Howtheintroductionofyourprojectinfluencesfunctionality providedbypreviousversionoftheproduct? <hint> Ifyouareplanningtodeprecate/remove/changeanyexistingAPIs, listthemhereaccompaniedwiththereasonexplainingwhyyou aredoingso. </hint> </question>
-->
<answer id="compat-deprecation">
The APIs and SPIs in editor/lib2 module should become offical replacements
for the legacy editor APIs that do not conform with the Netbeans API standards.
</answer>
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.34Bemerkung:
(vorverarbeitet am 2026-09-28)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.