<!-- <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 module is useless by itself. It contains an SPI which can be used by
modules defining nodes to make the nodes searchable, or to specify how
the nodes should be searched, and an API which makes
implementation of the SPI easier.
</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 is one test class which tests implementations of interface
<code>SearchInfo</code> produced by factory class
<code>SearchInfoFactory</code>.
</p>
</answer>
<!-- <questionid="arch-time"when="init"> Whatarethetimeestimatesofthework? <hint> Pleaseexpressyourestimatesofhowlongthedesign,implementation, stabilizationarelikelytolast.Howmanypeoplewillbeneededto implementthisandwhatistheexpectedmilestonebywhichtheworkshouldbe ready? </hint> </question>
-->
<answer id="arch-time">
<p>
The module is fully implemented.
</p><p>
The test are not real unit tests as they rely on functionality of projects.
Modification of tests to real unit tests would require 3 or 4 more days.
</p>
</answer>
<!-- <questionid="arch-usecases"when="init"> Describethemain<ahref="http://openide.netbeans.org/tutorial/api-design.html#usecase"> usecases</a>ofthenewAPI.Whowilluseitunder whatcircumstances?Whatkindofcodewouldtypicallyneedtobewritten tousethemodule? </question>
-->
<answer id="arch-usecases">
<p>
The SearchInfo API+SPI allows other modules to specify whether and how
should nodes they define be searched.
</p><p>
The definition is represented by objects implementing interface
<code>SearchInfo</code>. To enable searching on a custom node,
a <code>SearchInfo</code> object must be added to the node's lookup.
In most cases, there is no need to define own class implementing the
interface - one can use factory methods of class
<code>SearchInfoFactory</code>.
</p><p>
Example:
</p><blockquote>
<pre>import org.openide.util.lookup.Lookups;
public class MyNode extends AbstractNode {
public MyNode(FileObject folder) {
super( new MyNodeChildren(folder),
Lookups.singleton(SearchInfoFactory.createSearchInfo(
folder,
true,
new FileObjectFilter[] {
SearchInfoFactory.VISIBILITY_FILTER
}) );
}
...
}</pre>
</blockquote>
<p>
One of the factory methods - <code>createSearchInfoBySubnodes(...)</code>
- requires that a reference to the node itself. In this case, it is not
possible to fully define the lookup in the <code>super(...)</code>
statement of the constructor because a reference to the node is not
available until the call of <code>super(...)</code> returns.
In this case, a special technique must be used:
</p>
<blockquote>
<pre>import org.openide.util.lookup.AbstractLookup;
import org.openide.util.lookup.InstanceContent;
public class MyNode extends AbstractNode {
public MyNode() {
this(new InstanceContent());
}
public MyNode(InstanceContent ic) {
super(new AbstractLookup(ic));
ic.add(SearchInfoFactory.createSearchInfoBySubnodes(this));
}
...
}</pre>
</blockquote>
<api group="java"
name="deprecated-SearchAPI" type="export"
category="deprecated" url="@TOP@index.html">
defines interfaces <code>SearchInfo</code>, <code>FileObjectFilter</code>
and a factory class <code>SearchInfoFactory</code>
</api>
</answer>
<!-- <questionid="arch-what"when="init"> Whatisthisprojectgoodfor? <hint> Pleaseprovidehereafewlinesdescribingtheproject, whatproblemitshouldsolve,providelinkstodocumentation, specifications,etc. </hint> </question>
-->
<answer id="arch-what">
<p>
It allows other modules to define how the nodes they define should be
searched, without depending on any concrete module containing the search
feature.
</p>
</answer>
<!-- <questionid="compat-standards"when="init"> Doesthemoduleimplementordefineanystandards?Isthe implementationexactordoesitdeviatesomehow? </question>
-->
<answer id="compat-standards">
<p>
No, it does not implement or define any standards.
</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>
Yes, different versions of the module can coexist.
The module has no settings and will not attempt to read settings
of the future versions having settings, if any.
</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 has been tested with JDK 1.4 and JDK 1.5.
It should run with JDK/JRE 1.3.x, too, but it has not been tested for it.
</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>
No such project known at the moment.
</p>
</answer>
<!-- <questionid="dep-platform"when="init"> Onwhichplatformsdoesyourmodulerun?Doesitruninthesame wayoneach? <hint> IfyourmoduleisusingJNIordealswithspecialdifferencesof OSeslikefilesystems,etc.pleasedescribeherewhattheyare. </hint> </question>
-->
<answer id="dep-platform">
<p>
It runs on all platforms with a JRE 1.4+.
It runs in the same way on each.
</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>
Yes.
</p><p>
Objects implementing interface <code>SearchInfo</code>
(defined in this module) are expected to be registered in lookups
of nodes (only on instance per node).
<api group="lookup"
name="deprecated-SearchInfo-lookup" type="import"
category="stable">
Helper method
<code>SearchInfoFactory.createSearchInfoBySubnodes(Node)</code>,
which combines <code>SearchInfo</code> objects of multiple nodes
to a single <code>SearchInfo</code> object, uses the lookup mechanism
to obtain <code>SearchInfo</code> objects from the nodes.
</api>
</p>
</answer>
<!-- <questionid="perf-mem"when="final"> Howmuchmemorydoesyourcomponentconsume?Estimate witharelationtothenumberofwindows,etc. </question>
-->
<answer id="perf-mem">
<p>
Amount of memory consumed by implementations of interface
<code>SearchInfo</code>, produced by class <code>SearchInfoFactory</code>,
is related to the maximum nesting level of folder/nodes
and to the maximum number of folders/nodes in each level.
Except for very extreme conditions, the amount of memory is not essential.
Term "extreme conditions" comprises:
</p>
<ul>
<li>very deep hierarchy of nodes and very large number of nodes
in each level</li>
<li>very big amount (thousands and more) of nodes having defined
<code>SearchInfo</code> objects</li>
</ul>
<p>
Memory footprint of <code>SearchInfo</code> implementations returned by
factory class <code>SearchInfoFactory</code> is low. This may not be true
for custom plugged-in implementations.
</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>
Implementations of interface <code>SearchInfo</code> produced by
factory class <code>SearchInfoFactory</code> scale well, except for the
case that there are multiple nodes using
<code>SearchInfoFactory.createSearchInfoBySubnodes(Node)</code>
in a (sub)tree of a hierarchy of nodes. If the whole branch is being
searched, the performance may be a little bit slower. The more such nodes
there are on the way from the (sub)tree's root to the leaves, the lower
is the speed of the the root node's <code>SearchInfo</code>
implementation. This is a theoretical implication and no performance
problems have been observed yet.
</p>
</answer>
<!-- <questionid="perf-spi"when="init"> Howtheperformanceofthepluggedincodewillbeenforced? <hint> Ifyouallowforeigncodetobepluggedintoyourownmodule,how doyouenforcethatitwillbehavecorrectlyandquicklyandwillnot negativelyinfluencetheperformanceofyourownmodule? </hint> </question>
-->
<answer id="perf-spi">
<p>
It is possible to define and plug in a custom implementation of interfaces
<code>SearchInfo</code> and <code>FileObjectFilter</code>.
</p><p>
In case of a buggy or slow implementation, this may not affect the speed
of this module but it may affect modules that use functionality of this
module, i.e. modules implementing the search feature. But there is no
affection until the node which uses such custom implementations, is
searched (except for memory leaks, of course).
</p>
</answer>
<!-- <questionid="resources-file"when="final"> Doesyourmoduleuse<code>java.io.File</code>directly? <hint> NetBeansprovidealogicalwrapperoverplainfilescalled <code>org.openide.filesystems.FileObject</code>that providesuniformaccesstosuchresourcesandisthepreferred waythatshouldbeused.Butofcoursetherecanbesituationswhen thisisnotsuitable. </hint> </question>
-->
<answer id="resources-file">
<p>
Yes. But only because it is required by another API, specifically by method
<code>org.netbeans.api.queries.SharabilityQuery.getSharability(File)</code>.
</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.