<!-- <questionid="arch-overall"when="init"> Describetheoverallarchitecture. <hint> WhatwillbeAPIfor <ahref="http://wiki.netbeans.org/API_Design#Separate_API_for_clients_from_support_API"> clientsandwhatsupportAPI</a>? Whatpartswillbepluggable? Howwillplug-insberegistered?Pleaseuse<code><apitype="export"/></code> todescribeyourgeneralAPIsandspecifytheir <ahref="http://wiki.netbeans.org/API_Stability#Private"> stabilitycategories</a>. Ifpossiblepleaseprovidesimplediagrams. </hint> </question>
-->
<answer id="arch-overall">
<p>
<api type="export" category="devel" group="java" name="multitabs" />
</p>
<p>The main purpose of this API is to allow third-party customizations of editor
tabs. Instead of implementing many interfaces and creating various UI delegates
it is possible to create a simple decorator-like class that can customize
the appearance of a specific editor tab. For example change tabs background color
according to file type or project type, change its icon etc.</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?Howyoufindoutthatyour projectwassuccessful? </hint> </question>
-->
<answer id="arch-quality">
<p>
The API will be covered by unit tests.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
The API is already implemented in org.netbeans.core.multitabs package.
</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://wiki.netbeans.org/API_Design#The_Importance_of_Being_Use_Case_Oriented"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<usecase id="tabdecorator" name="Tab Decorator">
<p>To customize the rendering of (some) editor tabs one needs subclass
<code>TabDecorator</code> class and register it in the global <code>Lookup</code>.</p>
<p>The example below shows a decorator that removes file extension
from Java source files to have shorter tabs to show more file names
without the need for scrolling.</p>
<pre>
ServiceProvider(service = TabDecorator.class, position = 1000) public class MyTabDecorator extends TabDecorator {
public String getText( TabData tab ) {
String res = tab.getText();
if( null != res )
res = res.replace( ".java", "");
return res;
}
}
</pre>
</usecase>
<usecase id="customdisplayer" name="Custom Tab Displayer">
<p>If one needs a custom editor tab displayer for example to have special
tab layout or special layout of scrolling buttons etc it is necessary
to subclass <code>TabDisplayer</code> class and register an instance
of <code>TabDisplayerFactory</code> in the global <code>Lookup</code>.
</p>
<pre>
public class MyTabDisplayer extends TabDisplayer {
public MyTabDisplayer( TabDataModel model ) {
super( model );
}
ServiceProvider(service = TabDisplayerFactory.class) public static class MyTabDisplayerFactory extends TabDisplayerFactory { public TabDisplayer createTabDisplayer( TabDataModel tabModel, int orientation ) {
return new MyTabDisplayer( tabModel );
}
}
//implement all abstract methods here
}
</pre>
</usecase>
</answer>
<!-- <questionid="dep-non-nb"when="init"> WhatotherprojectsoutsideNetBeansdoesthisonedependon? <hint> Dependingon3rdpartylibrariesisalwaysproblematic, especiallyiftheyarenotopensource,asthatcomplicates thelicensingschemeofNetBeans.Pleaseenumerateyour externaldependencieshere,soitiscorrectlyunderstoodsince thebeginingwhatarethelegalimplicationsofyourproject. Alsopleasenotethat somenon-NetBeansprojectsarepackagedasNetBeansmodules (see<ahref="http://libs.netbeans.org/">libraries</a>)and itispreferredtousethisapproachwhenmoremodulesmay dependandsharesuchthird-partylibraries. </hint> </question>
-->
<answer id="dep-non-nb">
<p>
The module depends on org.netbeans.swing.tabcontrol module (it reuses its data model)
and on org.netbeans.core.windows module as it implements some of its
tab container interfaces and classes.
</p>
</answer>
<!-- <questionid="lookup-lookup"when="init"> Doesyourmoduleuse<code>org.openide.util.Lookup</code> oranysimilartechnologytofindanycomponentstocommunicatewith?Whichones? <hint> NetBeansisbuildaroundagenericregistryofservicescalled lookup.Itispreferabletouseitforregistrationanddiscovery ifpossible.See <ahref="http://www.netbeans.org/download/dev/javadoc/org-openide-util/org/openide/util/lookup/doc-files/index.html"> TheSolutiontoComunicationBetweenComponents </a>.Ifyoudonotplantouselookupandinsistusage ofothersolution,thenpleasedescribewhyitisnotworkingfor you. <br/> Whenfillingthefinalversionofyourarchdocument,please describetheinterfacesyouaresearchingfor,where aredefined,whetheryouaresearchingforjustoneormoreofthem, iftheorderisimportant,etc.Alsoclassifythestabilityofsuch APIcontract.Use<apigroup=&lookup&/>tag,so yourinformationgetslistedinthesummarypageofyourjavadoc. </hint> </question>
-->
<answer id="lookup-lookup">
<p>
The module checks the global lookup for an instance of <code>org.netbeans.core.multitabs.TabDisplayerFactory</code>
to see if other than the default implementation of multi-tabs is available.
</p>
<p>
The default implementation of multi-tabs also looks for <code>org.netbeans.core.multitabs.TabDecorator</code>
instances to check if any third party wants to change the editor tab rendering.
</p>
</answer>
<!-- <questionid="lookup-register"when="final"> Doyouregisteranythingintolookupforothercodetofind? <hint> Doyouregisterusinglayerfileorusingadeclarativeannotationsuchas<code>@ServiceProvider</code>? Whoissupposedtofindyourcomponent? </hint> </question>
-->
<answer id="lookup-register">
<p>
The module registers an instance of
<code>org.netbeans.swing.tabcontrol.customtabs.TabbedComponentFactory</code>
to provide custom implementation of editor tabs displayer.
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
It's just a JTable showing an editor tab in each cell.
</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>
Does not apply
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforcethatitwillbehavecorrectlyandquicklyandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
All the code will be executed in EDT, NetBeans slowness detector should kick-in
when third-party plugin takes too much time.
</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.