<questionid="arch-what"> Whatisthisprojectgoodfor? <hint> Pleaseprovideherefewlinesdescribingthetheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
The <api
name="EditorAPI"type="export" category="official" url="@org-openide-text@/org/openide/text/doc-files/api.html"
group="java" /> is used for accessing editor-related functionality from within the IDE
for use by other modules and the core IDE itself.
</answer>
<questionid="compat-standards"> Doesthemoduleimplementsordefinesanystandards?Isthe implementationexactoritdeviatessomehow? </question>
-->
<answer id="compat-standards">
The module uses <a href="@JDK@@JDKMODULE_JAVA_DESKTOP@/javax/swing/text/package-summary.html">Swing text package</a>.
It extends it in <a href="@org-openide-text@/org/openide/text/NbDocument.html">NbDocument</a> class which adds
support for:
<ul>
<li><a href="@org-openide-text@/org/openide/text/NbDocument.WriteLockable.html">locking document for complex modifications</a></li>
<li><a href="@org-openide-text@/org/openide/text/NbDocument.Printable.html">styled text printing</a></li>
<li><a href="@org-openide-text@/org/openide/text/NbDocument.PositionBiasable.html">holding and working with biased positions</a></li>
<li><a href="@org-openide-text@/org/openide/text/NbDocument.CustomEditor.html">adding of special UI components to their Editor pane</a></li>
<li><a href="@org-openide-text@/org/openide/text/NbDocument.Annotatable.html">annotations</a></li>
</ul>
</answer>
<!-- Question: compat-version
<questionid="compat-version"> Doesyourmoduleproperlycoexistswithearlierandfuture versions?Canyoucorrectlyreadsettings?Willfuture versionsbeabletoreadsettings? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
Module uses serialization. It coexists with the earlier versions, but
not with future ones. The future versions will be able to read settings.
</answer>
<questionid="dep-platform"> Onwhichplatformsyourmodulerun?Any?Doesitruninthesame way? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
Any platform. Runs the same way.
</answer>
<!-- Question: deploy-jar
<questionid="deploy-jar"> DoyoudeployjustmoduleJARfile(s)orsomeotherfiles? <hint> IfyourmoduleconsistjustfromonemoduleJARfile,justconfirmthat. IfitusesmorethanoneJAR,describewheretherearelocated,how theyrefertoeachother. IfitconsistofmoduleJAR(s)andotherfiles,pleasedescribe whatistheirpurpose,whyotherfilesarenecessary.Please makesurethatinstallation/deinstallationleavesthesystem instateasitwasbeforeinstallation. </hint> </question>
-->
<answer id="deploy-jar">
Classes belonging to this module do not reside in standalone library.
They are bundled together with other parts of the openide in openide.jar.
</answer>
<!-- Question: deploy-nbm
<questionid="deploy-nbm"> CanyoudeployNBMviaAutoUpdatecenter? <hint> Ifnotwhy? </hint> </question>
-->
<answer id="deploy-nbm">
Module does not have its own NBM.
</answer>
<!-- Question: deploy-packages
<questionid="deploy-packages"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/apis/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>). </hint> </question>
-->
<answer id="deploy-packages">
No, but it is not necessary. The module has just one public package.
</answer>
<!-- Question: deploy-shared
<questionid="deploy-shared"> Doyouneedtobeinstalledinsharedlocationoronlyinuserdirectory? <hint> Installationlocationshallnotmatter,ifitdoesexplainwhy. </hint> </question>
-->
<answer id="deploy-shared">
Module does not have its own jar.
</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">
The module can be influencend by this property:
<api type="export" group="property" name="indentEngine" category="stable" >
Property hold instance of <a href="@org-openide-text@/org/openide/text/IndentEngine.html">IndentEngine</a>
and this indentation engine is used instead of system one.
</api>
It set these Swing properties:
<api type="import" group="property" name="javax.swing.text.Document.StreamDescriptionProperty" category="stable" >
Property hold instance of <a href="@org-openide-loaders@/org/openide/loaders/DataObject.html">DataObject</a>
from which the document was created. This property can be used by the modules and is part of the Editor API.
</api>
<api type="import" group="property" name="javax.swing.text.Document.TitleProperty" category="stable" >
Property hold instance of String with name of the file being edited.
This property can be used by the modules and is part of the Editor API.
</api>
<api type="export" group="property" name="javax.swing.text.Document.modificationListener" category="friend" >
In order to fix <a href="https://bz.apache.org/netbeans/show_bug.cgi?id=51872">issue 51872</a> the
openide needs a way how to be notified about change of a document outside of its Document lock.
<code>DocumentListener</code>s are always notified under the lock, so a special contract has
been established (since version5.3) by registering an instance of <code>VetoableListener</code>
by calling <code>putProperty ("modificationListener", listener)</code>. The
NetBeans aware documents are adviced to honor this property and call the listener
outside of the document lock when a modification is made. The actual contract
of the call can be seen in
<a href="https://github.com/apache/netbeans/tree/master/platform/openide.text/test/unit/src/org/openide/text/NbLikeEditorKit.java">NbLikeEditorKit.java</a>
in methods
<code>insertString</code> and <code>remove</code>.
</api>
<api type="export" group="property" name="beforeSaveRunnable" category="friend" >
Document property that allows to execute a runnable before save of a document is performed.
For example an extra whitespace accumulated during typing can be removed by exploiting this property.
</api>
<api type="export" group="property" name="expectedTime" category="friend" >
<a href="@TOP@/org/openide/text/CloneableEditorSupport.html">CloneableEditorSupport</a>
understands not only its <code>Env.TIME</code> property, but also special "expectedTime". When this one arrives, it means refresh its internal
last saved time, but without any refresh. This functionality is used from
<code>DataEditorSupport</code> when the DataObject is moved to new location
and we need to adjust the time to the new file object.
</api>
<api type="export" group="property" name="usedByCloneableEditor" category="friend" >
Component client property which is set to Boolean.TRUE if an editor pane is actively used by a cloneable editor.
Once the component gets closed the CloneableEditor sets the property to Boolean.FALSE.
</api>
</answer>
<!-- Question: exec-privateaccess
<questionid="exec-privateaccess"> Areyouawareofanyotherpartofthesystemcallingsomeof yourmethodsbyreflection? <hint> Ifso,describethe"contract"asanAPI.Likelyprivateorfriendone,but stillAPIandconsiderrewriteofit. </hint> </question>
-->
<answer id="exec-privateaccess">
<api name="EditorKitInitialization" category="friend" group="java"type="export">
In order to speedup, or remove the load of initialization of kit in AWT during startup,
there is a special API that allows to ask the kit to pre-initialize. If the kit
implements <code>Callable</code> interface from JDK, it is called in non-AWT thread.
This works since version6.18 and can be disabled by property <code>oldInitialization</code>.
</api>
</answer>
<answer id="exec-property">
<api name="oldInitialization" category="devel" group="property"type="export">
As the speedup of startup done in version6.18 is not fully compatible,
there is a way to get back the original behaviour: just use
<code>this.putClientProperty("oldInitialization", Boolean.TRUE)</code>
and the whole initialization will be done in AWT thread. This is generally
slower, but compatible.
</api>
<api name="org.openide.text.CloneableEditor.oldInitialization" category="private" group="property"type="export">
In order to measure startup improvements between AWT and non-AWT startup,
we have a property dedicated to testing that can switch all editors to be
opened in AWT. Just start NetBeans with
<code>-J-Dorg.openide.text.CloneableEditor.oldInitialization=true</code>.
This property may be discontiued anytime.
</api>
<api name="org.netbeans.modules.openide.text.ASK_OnReload" group="branding"type="export" category="stable">
Control on reload yes/no dialog in
<a href="@TOP@/org/openide/text/CloneableEditorSupport.html">CloneableEditorSupport</a>
by setting the <code>ASK_OnReload</code> key in
<code>org/netbeans/modules/openide/text/Bundle.properties</code>
to <code>yes</code> or <code>no</code> in a branding file in your application.
</api>
<api name="org.netbeans.modules.openide.text.UserQuestionAnswer" group="branding"type="export" category="devel">
Controls handling of UserQuestionExceptions thrown during document I/O by
<a href="@TOP@/org/openide/text/CloneableEditorSupport.html">CloneableEditorSupport</a>
Specific classes can be branded to result in "yes" (reload without asking) or "no" (cancel the re/load operation). If unspecified or set to any other value, the
user will be asked the question (this is the default behaviour).
<p/>
The support is available from version6.96
</api>
</answer>
<!-- Question: exec-reflection
<questionid="exec-reflection"> Doesyourcodeusesjava.lang.reflecttoexecutesomeothercode? <hint> ThisusuallyindicatesamissingorunsufficientAPIintheother partofthesystem.Iftheothersideisnotawareofyourdependency thiscontractcanbeeasilybroken. </hint> </question>
-->
<answer id="exec-reflection">
Yes, it calls protected method <a href="@org-openide-loaders@/org/openide/loaders/MultiDataObject.html#getCookieSet()">MultiDataObject.getCookieSet()</a>.
The class which calls this is deprecated, but it is still in use by clients.
<p/>
Another reflection is used in QuietEditorPane, where DelegatingTransferHandler delegates
also on two protected methods of TransferHandler: <code>createTransferable</code> and
<code>exportDone</code>. This delegation is needed because of drag and drop feature described
in <a href="https://bz.apache.org/netbeans/show_bug.cgi?id=53439">issue #53439</a>
</answer>
<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">
Yes, it looks for <a href="@org-openide-text@/org/openide/text/IndentEngine.html">IndentEngine</a> service type class. This class is defined in
this module. The first one indentation engine found for the given MIME is returned.
Others are ignored.
</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 of document. It is done in <a href="@org-openide-util@/org/openide/util/RequestProcessor.html">RequestProcessor</a>.
</answer>
<!-- Question: perf-scale
<questionid="perf-scale"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? Pleaseincludesomeestimates. </question>
-->
<answer id="perf-scale">
Size of file which is going to be open.
</answer>
<questionid="resources-read"> Doesyourmodulereadanyresourcesfromlayers?Forwhatpurpose? <hint> Asthisissomekindofintermoduledependency,itisakindofAPI. Pleasedescribeitandclasifyaccordingto <ahref="http://openide.netbeans.org/tutorial/api-design.html#categories"> commonstabilitycategories</a>. </hint> </question>
-->
<answer id="resources-read">
<api type="export" category="devel" group="layer" name="Editors-TabActions">
Actions for the editor tab (window) context menu can be injected into <code>Editors/TabActions</code>.
</api>
</answer>
<!-- <questionid="exec-introspection"> Doesyourmoduleuseanykindofruntimetypeinformations(instanceof, workwithjava.lang.Class,etc.)? <hint> CheckforcaseswhenyouhaveanobjectoftypeAandyoualso expectitto(possibly)beoftypeBanddosomespecialaction.That shouldbedocumented.Thesameappliesonoperationsinmeta-level (Class.isInstance(...),Class.isAssignableFrom(...),etc.). </hint> </question>
-->
<answer id="exec-introspection">
The Editor module operate with plain Swing <a href="@JDK@@JDKMODULE_JAVA_DESKTOP@/javax/swing/text/Document.html">Document</a> in
its APIs and checks whether the document does not implement some of the Netbeans extensions defined in
<a href="@org-openide-text@/org/openide/text/NbDocument.html">NbDocument</a>.
It also tries to retype <a href="@org-openide-windows@/org/openide/windows/CloneableTopComponent.Ref.html#getComponents()">CloneableTopComponent.Ref.getComponents()</a>
to its <a href="@org-openide-text@/org/openide/text/CloneableEditor.html">CloneableEditor</a>. If some document does not implement
<a href="@JDK@@JDKMODULE_JAVA_DESKTOP@/javax/swing/text/StyledDocument.html">StyledDocument</a>,
it is wrapped into <a href="@org-openide-text@/org/openide/text/FilterDocument.html">FilterDocument</a> which implements limited StyledDocument functionality.
</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.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.