blob: 154d41b81a423b05b16f05ce9fee8f2ca758f0a7 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_181) on Fri Sep 14 11:39:24 BST 2018 -->
<title>Overview (Deprecated, old search API)</title>
<meta name="date" content="2018-09-14">
<link rel="stylesheet" type="text/css" href="javadoc.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Overview (Deprecated, old search API)";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li class="navBarCell1Rev">Overview</li>
<li><a href="org/openidex/search/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="org/openidex/search/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">org.openidex.util/3 3.49.1 </div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?overview-summary.html" target="_top">Frames</a></li>
<li><a href="overview-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 class="title">Deprecated, old search API<br/><span style='font-style:normal; font-size:medium; font-weight:normal; background-color:#afafaf;'><a href='http://wiki.netbeans.org/API_Stability#Deprecated' target='_blank'>Deprecated</a></span></h1>
</div>
<div class="header">
<p>See: <a href="#overview.description">Description</a></p>
</div>
<div class="contentContainer">
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Deprecated, old search API table, listing packages, and an explanation">
<caption><span>Deprecated, old search API</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Package</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="org/openidex/search/package-summary.html">org.openidex.search</a></td>
<td class="colLast">&nbsp;</td>
</tr>
</tbody>
</table>
</div>
<div class="contentContainer"><a name="overview.description">
<!-- -->
</a>
<div class="block"><p>
<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>
</p>
<h3>What is New (see <a href="apichanges.html">all changes</a>)?</h3>
<ul>
<!--Search for dates that are later or equal to 1997-09-01 in
.-->
<!--Checking date 2011-9-2 with count of newer 0--><!--year ok-->
<li>Sep 2 '11 <a href="apichanges.html#SearchGroup.onStopSearch">Added method <code>SearchGroup.onStopSearch</code></a>
<p>
<p>
Class <code>SearchGroup</code> now contains method
<code>onStopSearch</code>, that can be overriden in subclasses
to perform some custom operations that are needed to stop the
search, e.g. terminate internal tasks.
</p>
</p>
</li>
<!--Checking date 2009-1-13 with count of newer 1--><!--year ok-->
<li>Jan 13 '09 <a href="apichanges.html#SearchUtils">Added utility class <code>Utils</code></a>
<p>
<p>
Class <code>Utils</code> made public with one public static method
<code>getFileObjectsIterator(SearchInfo si)</code>. This utility
method returns <code>Iterator</code> of <code>FileObject</code>s
for the provided <code>SearchInfo</code>. This change simplifies
the work with <code>SearchInfo</code> implementations.
</p>
</p>
</li>
<!--Checking date 2009-1-13 with count of newer 1--><!--year ok-->
<li>Jan 13 '09 <a href="apichanges.html#SearchInfo.Files">Added interface <code>SearchInfo.Files</code></a>
<p>
<p>
Added <code>SearchInfo.Files</code> interface which extends
<code>SearchInfo</code> interface. It adds method
<code>filesToSearch()</code> to provide <code>FileObject</code>s
which should be searched. This change allows to operate <code>FileObject</code>s
in the search mechanism instead of <code>DataObject</code>s and
as a result improves search performance.
</p>
</p>
</li>
<!--Checking date 2007-6-10 with count of newer 3--><!--year ok-->
<li>Jun 10 '07 <a href="apichanges.html#SearchInfoFactory.createCompoundSearchInfo">Added method <code>createCompoundSearchInfo(...)</code>
to class <code>SearchInfoFactory</code></a>
<p>
<p>
Compound <code>SearchInfo</code> is a useful functionality that
has been present in the package since the
<code>SearchInfo</code> interface had been introduced. It just
was not available from outside the
<code>org.openidex.search</code> package. This change makes it
available through a public factory method.
</p>
</p>
</li>
<!--Checking date 2007-1-12 with count of newer 4--><!--year ok-->
<li>Jan 12 '07 <a href="apichanges.html#issue-64392">
<code>SearchInfo</code>
objects contained in <code>Project</code>s'
lookups are now taken into account by action <em>Find in Projects...</em>
</a>
<p>
The change is not in the API itself but in the range of its usage.
Before the change, action <em>Find in Projects...</em> did not look
for
<a href="../org-openidex-util/org/openidex/search/SearchInfo.html" shape="rect"><code>SearchInfo</code></a>
objects &ndash; it always searched
projects' <a href="../org-netbeans-modules-projectapi/org/netbeans/api/project/SourceGroup.html" shape="rect"><code>SourceGroup</code></a>s.
Now the action first checks the
<a href="../org-netbeans-modules-projectapi/org/netbeans/api/project/Project.html#getLookup--" shape="rect">project's <code>Lookup</code></a>
for presence of a <code>SearchInfo</code> object. If some
<code>SearchInfo</code> is present, it is used for the search,
and only if there is no <code>SearchInfo</code>,
the project's <code>SourceGroup</code>s are searched.
</p>
</li>
<!--Checking date 2005-2-15 with count of newer 5--><!--Skipped as the amount of changes is too big-->
<!--Checking date 2005-1-7 with count of newer 6--><!--Skipped as the amount of changes is too big-->
<!--Checking date 2004-8-13 with count of newer 7--><!--Skipped as the amount of changes is too big-->
</ul>
<h3>Use Cases</h3>
<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 xml:space="preserve">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 xml:space="preserve">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>
<a href="index.html">deprecated-SearchAPI</a>
defines interfaces <code>SearchInfo</code>, <code>FileObjectFilter</code>
and a factory class <code>SearchInfoFactory</code>
</answer>
<h3>Exported Interfaces</h3>
This table lists all of the module exported APIs
with
defined stability classifications. It is generated
based on answers to questions about the architecture
of the module. <a href="architecture-summary.html">Read them all</a>...
<a name="group-java">
<h5>Group of java interfaces</h5>
</a>
<table cellpadding="1" cellspacing="0" border="0" class="tablebg" width="100%">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr class="tablersh">
<td align="CENTER" width="25%"><span class="titlectable">Interface Name</span></td><td align="CENTER" width="10%"><span class="titlectable">In/Out</span></td><td align="CENTER" width="10%"><span class="titlectable">Stability</span></td><td align="CENTER"><span class="titlectable">Specified in What Document?</span></td>
</tr>
<tr class="tabler">
<td>deprecated-SearchAPI</td><td>Exported</td><td><a href="http://wiki.netbeans.org/API_Stability#Deprecated">Deprecated</a></td><td><a name="java-deprecated-SearchAPI"><a href="index.html">index.html</a>
<p></p>
<p></p>
defines interfaces <code>SearchInfo</code>, <code>FileObjectFilter</code>
and a factory class <code>SearchInfoFactory</code>
<p></p>
</a></td>
</tr>
</table>
</td>
</tr>
</table>
<p></p>
<a name="group-lookup">
<h5>Group of lookup interfaces</h5>
</a>
<table cellpadding="1" cellspacing="0" border="0" class="tablebg" width="100%">
<tr>
<td>
<table border="0" cellpadding="3" cellspacing="1" width="100%">
<tr class="tablersh">
<td align="CENTER" width="25%"><span class="titlectable">Interface Name</span></td><td align="CENTER" width="10%"><span class="titlectable">In/Out</span></td><td align="CENTER" width="10%"><span class="titlectable">Stability</span></td><td align="CENTER"><span class="titlectable">Specified in What Document?</span></td>
</tr>
</table>
</td>
</tr>
</table>
<p></p>
<h3>Implementation Details</h3>
<h5>Where are the sources for the module?</h5>
<p>
<p>
The sources for the module are in the
<a href="http://hg.netbeans.org/" shape="rect">NetBeans Mercurial repositories</a>.
</p>
</p>
<h5>What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?</h5>
<p>
Nothing.
</p>
<p>
Read more about the implementation in the <a href="architecture-summary.html">answers to
architecture questions</a>.
</p></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li class="navBarCell1Rev">Overview</li>
<li><a href="org/openidex/search/package-summary.html">Package</a></li>
<li>Class</li>
<li>Use</li>
<li><a href="org/openidex/search/package-tree.html">Tree</a></li>
<li><a href="deprecated-list.html">Deprecated</a></li>
<li><a href="index-files/index-1.html">Index</a></li>
<li><a href="help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage">org.openidex.util/3 3.49.1 </div>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="index.html?overview-summary.html" target="_top">Frames</a></li>
<li><a href="overview-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small><span class="footnote">Built on September 14 2018.&nbsp;&nbsp;|&nbsp;&nbsp; Copyright &#169; 2017-2018 Apache Software Foundation. All Rights Reserved.</span></small></p>
</body>
</html>