<!-- <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"/></code> todescribeyourgeneralAPIs. Ifpossiblepleaseprovide simplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
The <b>Tag Based Editor Support</b> is a small module based on
<api group="java" name="EditorLibrary" category="stable"type="import" ></api> module providing
<api group="java" name="DocumentModelAPI" category="friend"type="export"></api>.
</p>
It consists of
<ul>
<li>API in org.netbeans.modules.editor.structure.api</li>
<li>SPI in org.netbeans.modules.editor.structure.spi</li>
<li>Implementation in org.netbeans.modules.editor.structure</li>
</ul>
<p>
The API is primarily aimed to provide structural views of <b>tags based</b>
document types like XML/JSP/HTML which contents comprise a tree structure of nested elements.
<br/><br/>
The API allows other modules to plug in their document model provider(s).
<code>DocumentModelProvider</code> is an SPI interface implemented by other module(s)
which wants to afford a structural view of a particular document type to clients.
The view is then used by clients (navigator/folding etc.) to obtain and work with structure of a particullar document.
The plug-ins are registered via declarative xml layers approach.
<br/><br/>
The views are tree-like structures consisting of <code>DocumentElement</code>-s.
The <code>DocumentElement</code> function as a model's elements,
living in a tree-like structure and describing pieces of the document.
They are a kind of nodes - you can traverse through them in the tree structure and
get some metadata of the related piece of document.
<br/><br/>
The heart of the API is <code>DocumentModel</code> which is an entry point allowing clients to get document model structure and listen on its changes.
</p>
</answer>
<!-- <questionid="arch-quality"when="init"> Howwillthe<ahref="http://www.netbeans.org/community/guidelines/q-evangelism.html">quality</a> ofyourcodebetestedand howarefutureregressionsgoingtobeprevented? <hint> Whatkindoftestingdo youwanttouse?Howmuchfunctionality,inwhichareas, shouldbecoveredbythetests? </hint> </question>
-->
<answer id="arch-quality">
<p>
There will be a set of unit tests covering the API/SPI classes. Regression tests will be created if it's possible and appropriate.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
Most of the work is done. The API/SPI and implementation is created, stored in cvs and is stable.
However there is a need to provide some unit tests, which are not created yet.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> <hint> Contentofthisanswerwillbedisplayedaspartofpageat http://www.netbeans.org/download/dev/javadoc/usecases.html Youcanusetags<usecasename="name>regularhtmldescription</usecase> andifyouwanttouseanURLyoucanprefixifwith@TOP@tobegin attherootofyourjavadoc </hint> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<p>
<b>API:</b>
</p>
<usecase name="Code folding"id="folding">
uses the API to obtain a list of (XML/JSP/HTML/...) document elements and
listen on the document model elements changes. The Elements are then used to manage document folds.
</usecase>
<usecase name="Navigator"id="navigator">
gets a tree structure of a JSP/HTML/XML/... document elements and creates an appropriate nodes
view in the navigator panel. Then listen on the changes of the document structure and update the tree.
</usecase>
<usecase name="Deployment Descriptor navigator"id="dd_navigator">
will likely use the API to select appropriate parts of the text when
using the DD navigator.
</usecase>
<usecase name=""id="potentiall_usages">
The API can potentially be used by anyone who needs to get the document structure or do some mapping between the
document text and the semantic of the document content.
</usecase>
<p>
<b>SPI:</b><br/>
</p>
<usecase name="register_plugin"id="regp">
If a module wants to create a provider, it has to:
<ol>
<li>Create a <code>DocumentModelProvider</code> implementation for a particullar document type.</li>
<li>Associate it with a particullar mimetype by registering it into layer.</li>
</ol>
</usecase>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
The API allow clients to get a structural model of a document and listen on changes of the model.
It is also possible to listen to the state of the model itself - when the model starts scannig of the document,
when it starts update of the model data and when the update finishes.
The model is read-only and is incrementally updated based on changes of the document content (e.g. when user edits the document).
A provider has to implement an SPI (DocumentModelProvider) for a particullar
document type (e.g. XML or JSP) and then register itself into the system.
</p>
</answer>
<!-- <questionid="arch-where"when="init"> Whereonecanfindsourcesforyourmodule? <hint> PleaseprovidelinktotheCVSwebclientat http://www.netbeans.org/download/source_browse.html orjustusetagdefaultanswergenerate='here' </hint> </question>
-->
<answer id="arch-where">
<p>
Sources are stored in <code>xml/tageditorsupport</code> module in <code>tag_editor_support</code> branch.
</p>
</answer>
<!-- <questionid="compat-i18n"when="impl"> Isyourmodulecorrectlyinternationalized? <hint> Correctinternationalizationmeansthatitobeysinstructions at<ahref="http://www.netbeans.org/download/dev/javadoc/org-openide-modules/org/openide/modules/doc-files/i18n-branding.html"> NetBeansI18Npages</a>. </hint> </question>
-->
<answer id="compat-i18n">
<p>
The module provides neither any localized messages nor UI.
</p>
</answer>
<!-- <questionid="compat-standards"when="init"> Doesthemoduleimplementordefineanystandards?Isthe implementationexactordoesitdeviatesomehow? </question>
-->
<answer id="compat-standards">
<p>
No new unusual standard, just layer-based xml registration and SPI
interface <code>DocumentModelProvider</code> that clients has to implement.
</p>
</answer>
<!-- <questionid="compat-version"when="impl"> Canyourmodulecoexistwithearlierandfuture versionsofitself?Canyoucorrectlyreadalloldsettings?Willfuture versionsbeabletoreadyourcurrentsettings?Canyouread orpolitelyignoresettingsstoredbyafutureversion? <hint> Veryhelpfulforreadingsettingsistostoreversionnumber there,sofutureversionscandecidewhetherhowtoread/convert thesettingsandolderversionscanignorethenewones. </hint> </question>
-->
<answer id="compat-version">
<p>
The module has no persistable settings.
</p>
</answer>
<!-- <questionid="dep-jre"when="final"> WhichversionofJREdoyouneed(1.2,1.3,1.4,etc.)? <hint> Itisexpectedthatifyourmodulerunson1.xthatitwillrun on1.x+1ifno,statethatplease.Alsodescribeherecaseswhere yourundifferentcodeondifferentversionsofJREandwhy. </hint> </question>
-->
<answer id="dep-jre">
<p>
The module can run on the same JDK which is supported by netbeans.
</p>
</answer>
<!-- <questionid="dep-jrejdk"when="final"> DoyourequiretheJDKoristheJREenough? </question>
-->
<answer id="dep-jrejdk">
<p>
The module can run on the same JDK which is supported by netbeans. AFAIK JRE is enought.
</p>
</answer>
<!-- <questionid="dep-nb"when="init"> WhatotherNetBeansprojectsandmodulesdoesthisonedependon? <hint> Ifyouwant,describesuchprojectsasimportedAPIsusing the<code><apiname="identification"type="importorexport"category="stable"url="whereisthedescription"/></code> </hint> </question>
-->
<answer id="dep-nb">
<p>
The Tag Based Editor Support module depends on:
<api group="java" name="org.netbeans.modules.editor.mimelookup"type="import" category="official">
Needed for the layer registration mechanism of providers.
</api>
<api group="java" name="EditorLibrary"type="import" category="official">
Needed for access to the Document instance which is the DocumentModel built on.
</api>
</p>
</answer>
<!-- <questionid="dep-non-nb"when="init"> WhatotherprojectsoutsideNetBeansdoesthisonedependon? <hint> Somenon-NetBeansprojectsarepackagedasNetBeansmodules (see<ahref="http://libs.netbeans.org/">libraries</a>)and itispreferredtousethisapproachwhenmoremodulesmay dependonsuchthird-partylibrary. </hint> </question>
-->
<answer id="dep-non-nb">
<p>
There aren't any non-netbeans modules or libraries which this module depends on.
</p>
</answer>
<!-- <questionid="dep-platform"when="init"> Onwhichplatformsdoesyourmodulerun?Doesitruninthesame wayoneach? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
<p>
The module does work on all platforms in the same way.
</p>
</answer>
<answer id="deploy-dependencies">
<p>
Only clients of the API needs to have a depenedency to it.
So far there is only xml/text-edit module depending on this API
(it uses it for xml navigator and folding feature)
</p>
</answer>
<!-- <questionid="deploy-jar"when="impl"> DoyoudeployjustmoduleJARfile(s)orotherfilesaswell? <hint> UsuallyamoduleconsistofoneJARfile(perhapswithClass-Path extensions)andalsoaconfigurationfilethatenablesit.Ifyou haveanyotherfiles,use <apigroup="java.io.File"name="yourname"type="export"category="friend"&an>gt;...</api> todefinethelocation,nameandstabilityofyourfiles(ofcourse changing"yourname"and"friend"tosuityourneeds). IfitusesmorethanoneJAR,describewheretheyarelocated,how theyrefertoeachother. IfitconsistofmoduleJAR(s)andotherfiles,pleasedescribe whatistheirpurpose,whyotherfilesarenecessary.Please makesurethatinstallation/uninstallationleavesthesystem instateasitwasbeforeinstallation. </hint> </question>
-->
<answer id="deploy-jar">
<p>
The only module's jar file needs to be deployed.
</p>
</answer>
<!-- <questionid="deploy-packages"when="init"> Arepackagesofyourmodulemadeinaccessiblebynotdeclaringthem public? <hint> NetBeansmodulesystemallowsrestrictionofaccessrightsto publicclassesofyourmodulefromothermodules.Thisprevents unwanteddependenciesofothersonyourcodeandshouldbeused wheneverpossible(<ahref="http://www.netbeans.org/download/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.4-public-packages"> publicpackages </a>).Ifyoudonotrestrictaccesstoyourclassesyouare makingittooeasyforotherpeopletomisuseyourimplementation details,thatiswhyyoushouldhavegoodreasonfornot restrictingpackageaccess. </hint> </question>
-->
<answer id="deploy-packages">
<p>
There is only <code>org.netbeans.modules.editor.structure</code> package which is not declared in public-packages.
It contains code responsible for reading data from the layer creating appropriate DocumentModelProviderFactory instancies.
</p>
</answer>
<!-- <questionid="deploy-shared"when="final"> Doyouneedtobeinstalledinthesharedlocationonly,orintheuserdirectoryonly, orcanyourmodulebeinstalledanywhere? <hint> Installationlocationshallnotmatter,ifitdoesexplainwhy. Consideralsowhether<code>InstalledFileLocator</code>canhelp. </hint> </question>
-->
<answer id="deploy-shared">
<p>
It is enought to install the module into a shared location.
</p>
</answer>
<!-- <questionid="exec-introspection"when="impl"> Doesyourmoduleuseanykindofruntimetypeinformation(<code>instanceof</code>, workwith<code>java.lang.Class</code>,etc.)? <hint> CheckforcaseswhenyouhaveanobjectoftypeAandyoualso expectitto(possibly)beoftypeBanddosomespecialaction.That shouldbedocumented.Thesameappliesonoperationsinmeta-level (Class.isInstance(...),Class.isAssignableFrom(...),etc.). </hint> </question>
-->
<answer id="exec-introspection">
<p>
The methods declaring javax.swing.text.Document needs in fact an instance of org.netbeans.editor.BaseDocument.
There is a runtime test in DocumentModel.getDocumentModel(j.s.t.Document) which warns users that the BaseDocument is necessary by throwing an IAE exception in such case.
</p>
</answer>
<!-- <questionid="exec-property"when="impl"> Isexecutionofyourcodeinfluencedbyanyenvironmentor Javasystem(<code>System.getProperty</code>)property? <hint> Ifthereisapropertythatcanchangethebehaviorofyour code,somebodywilllikelyuseit.Youshoulddescribewhatitdoes andthe<ahref="http://openide.netbeans.org/tutorial/api-design.html#life">stabilitycategory</a> ofthisAPI.Youmayuse <pre> <apitype="export"group="property"name="id"category="private"url="http://..."> descriptionoftheproperty,whereitisused,whatitinfluence,etc. </api> </pre> </hint> </question>
-->
<answer id="exec-property">
<p>
There is a consistency check of the model enabled/disabled by system property org.netbeans.editor.model.enable_consistency_check
</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>
The model is locked for reading during its modifications. <br/>
<b>!!! Do not access the document model's element under the document writeLock()!!!</b>.
This may cause a deadlock if you do a document change, do not do writeUnlock() and access the model.
In such case the model needs to resort it's elements which is done under document readLock().
</p>
</answer>
<!-- <questionid="format-clipboard"when="impl"> Whichdataflavors(ifany)doesyourcodereadfromorinsertto theclipboard(byaccesstoclipboardonmeanscallingmethodson<code>java.awt.datatransfer.Transferable</code>? <hint> OftenNode'sdealwithclipboardbyusageof<code>Node.clipboardCopy,Node.clipboardCutandNode.pasteTypes</code>. Checkyourcodeforoverridingthesemethods. </hint> </question>
-->
<answer id="format-clipboard">
<p>
there is not clipboard support.
</p>
</answer>
<!-- <questionid="format-dnd"when="impl"> Whichprotocols(ifany)doesyourcodeunderstandduringDrag&Drop? <hint> OftenNode'sdealwithclipboardbyusageof<code>Node.drag,Node.getDropType</code>. Checkyourcodeforoverridingthesemethods.Btw.iftheyarenotoverridden,they bydefaultdelegateto<code>Node.clipboardCopy,Node.clipboardCutandNode.pasteTypes</code>. </hint> </question>
-->
<answer id="format-dnd">
<p>
DND is not supported.
</p>
</answer>
<!-- <questionid="format-types"when="impl"> Whichprotocolsandfileformats(ifany)doesyourmodulereadorwriteondisk, ortransmitorreceiveoverthenetwork?Doyougenerateanantbuildscript? Canitbeeditedandmodified? <hint> <p> Filescanbereadandwrittenbyotherprograms,modulesandusers.Iftheyinfluence yourbehaviour,makesureyoueitherdocumenttheformatorclaimthatitisaprivate api(usingthe<api>tag). </p> <p> Ifyougenerateanantbuildfile,thisisverylikelygoingtobeseenbyendusersand theywillbeattemptedtoeditit.Youshouldbereadyforthatandprovideherealink todocumentationthatyouhaveforsuchpurposesandalsodescribehowyouaregoingto understandsuchfilesduringnextrelease,whenyou(verylikely)slightlychangethe format. </p> </hint> </question>
-->
<answer id="format-types">
<p>
There are no custom protocols or file formats.
</p>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> Pleasedescribetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract.Forthatuse<apigroup=&lookup&/>tag. </hint> </question>
-->
<answer id="lookup-lookup">
<p>
The module only uses editor's mimeLookup to lookup DocumentModelProviderFactory instancies in the layer.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
Each document element held by DocumentModel consumes some memory (???bytes).
The entire amount depends on the size and the strucure of the text file.
</p>
</answer>
<!-- <questionid="perf-progress"when="final"> Doesyourmoduleexecuteanylong-runningtasks? <hint>Longrunningtasksshouldneverblock AWTthreadasitbadlyhurtstheUI <ahref="http://performance.netbeans.org/responsiveness/issues.html"> responsiveness</a>. Taskslikeconnectingover network,computinghugeamountofdata,compilation bedoneasynchronously(forexample using<code>RequestProcessor</code>),definitivelyitshould notblockAWTthread. </hint> </question>
-->
<answer id="perf-progress">
<p>
This depends on the implementation of the DocumentModelProvider.
It's updateModel method can be performed for quite long time, especially when
initializing the model for the first time.
It's up to the clients not to run the code from AWT thread.
</p>
</answer>
<!-- <questionid="perf-scale"when="init"> Whichexternalcriteriainfluencetheperformanceofyour program(sizeoffileineditor,numberoffilesinmenu, insourcedirectory,etc.)andhowwellyourcodescales? <hint> Pleaseincludesomeestimates,thereareothermoredetailed questionstoanswerinlaterphasesofimplementation. </hint> </question>
-->
<answer id="perf-scale">
<p>
The model creation/update time depends on the size of the underlaying document and
also on its structure.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforcethatitwillbehavecorrectlyandquicklyandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
The providers are supposed to plug-in an effective code.
There aren't any extra mechanisms to ensure the plugins
uses effective mechanisms which do not last for ages.
</p>
</answer>
<!-- <questionid="resources-layer"when="final"> Doesyourmoduleprovideownlayer?Doesitcreateanyfilesor foldersinit?Whatitistryingtocommunicatebythatandwithwhich components? <hint> NetBeansallowsautomaticanddeclarativeinstallationofresources bymodulelayers.Moduleregisterfilesintoappropriateplaces andothercomponentsusethatinformationtoperformtheirtask (buildmenu,toolbar,windowlayout,listoftemplates,setof options,etc.). </hint> </question>
-->
<answer id="resources-layer">
<p>
A DocumentModel folder is created in the appropriate folder inside /Editors/<mime-type>/.
The folder is then looked up by mimeLookup to obtain DocumentModelProviderFactory instance.
</p>
</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.