Skip navigation links
org.openidex.util/3 3.51

Deprecated, old search API
Deprecated

See: Description

Deprecated, old search API 
Package Description
org.openidex.search  

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.

What is New (see all changes)?

Use Cases

The SearchInfo API+SPI allows other modules to specify whether and how should nodes they define be searched.

The definition is represented by objects implementing interface SearchInfo. To enable searching on a custom node, a SearchInfo 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 SearchInfoFactory.

Example:

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
                     }) );
    }

    ...

}

One of the factory methods - createSearchInfoBySubnodes(...) - requires that a reference to the node itself. In this case, it is not possible to fully define the lookup in the super(...) statement of the constructor because a reference to the node is not available until the call of super(...) returns. In this case, a special technique must be used:

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));
    }

    ...

}
deprecated-SearchAPI defines interfaces SearchInfo, FileObjectFilter and a factory class SearchInfoFactory

Exported Interfaces

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. Read them all...
Group of java interfaces
Interface NameIn/OutStabilitySpecified in What Document?
deprecated-SearchAPIExportedDeprecatedindex.html

defines interfaces SearchInfo, FileObjectFilter and a factory class SearchInfoFactory

Group of lookup interfaces
Interface NameIn/OutStabilitySpecified in What Document?

Implementation Details

Where are the sources for the module?

The sources for the module are in the NetBeans Mercurial repositories.

What do other modules need to do to declare a dependency on this one, in addition to or instead of a plain module dependency?

Nothing.

Read more about the implementation in the answers to architecture questions.

Skip navigation links
org.openidex.util/3 3.51