# HG changeset patch
# Parent 90657ff2e3ebc869fce1f3f98c7a8e2a8385d538
#160415: Stabilize Search API
diff --git a/api.search/arch.xml b/api.search/arch.xml
--- a/api.search/arch.xml
+++ b/api.search/arch.xml
@@ -131,14 +131,18 @@
- SearchHistory is synchronising history content through netbeans modules and it saves history to preferences.
+
There are two separate histories. One for search and another for replace.
- When you add your propertyListener to SearchHistory - you can listen for changes in histories.
+ When you add your propertyListener to
+
- SearchHistory has methods for adding new entries and getting whole history list.
+ SearchHistory
+ is synchronising history content through netbeans modules and it saves history to preferences.
SearchHistory
+ - you can listen for changes in histories.
SearchHistory
+ has methods for adding new entries and getting whole history list.
The definition is represented by objects extending class
- SearchInfoDefinition
. To customize searching on
- a custom node, a
+
+
+ SearchInfoDefinition
+
. To customize searching on a custom node, a
SearchInfoDefinition
object must be added to the node's lookup.
In most cases, there is no need to define own class extending the
class - one can use factory methods of class
- SearchInfoDefinitionFactory
.
+
+
+ SearchInfoDefinitionFactory
+
.
In some cases implementators may need to apply the same set
of SearchFilterDefinitions in the whole subtree of a node.
- If so, it is not needed to put SearchInfoDefinition to all
- nodes' lookups, but only one instance of SubTreeSearchOptions
- have to be put into the lookup of the root node.
+ If so, it is not needed to put SearchInfoDefinition
to all
+ nodes' lookups, but only one instance of
+
+ SubTreeSearchOptions
+
have to be put into the lookup of the root node.
SearchInfoDefinition
,
- SearchFilterDefinition
,
- SubTreeSearchOptions
+ SearchInfoDefinition
,
+ SearchFilterDefinition
,
+ SubTreeSearchOptions
and a factory class
- SearchInfoDefinitionFactory
+ SearchInfoDefinitionFactory
SearchProvider
to register the new search feature to the IDE or platform application.
+ SearchProvider
+ to register the new search feature to the IDE or platform application.
SearchProvider.Presenter
that creates visual component for adding to the search dialog and that can interact with dialog buttons.
+ SearchProvider.Presenter
+ that creates visual component for adding to the search dialog and that can interact with dialog buttons.
SearchResultsDisplayer
to show search results to the user.
+ SearchResultsDisplayer
+ to show search results to the user.
SearchComposition
that encapsulates setting and state of searches, provide access to result displayer, and is able to start and terminate the search.
+ SearchComposition
+ that encapsulates setting and state of searches, provide access to result displayer, and is able to start
+ and terminate the search.
SearchProvider
,
- SearchProvider.Presenter
,
- SearchResultsDisplayer
,
- SearchComposition
+ SearchProvider
,
+ SearchProvider.Presenter
,
+ SearchResultsDisplayer
,
+ SearchComposition
and relative classes.
SearchInfo
, that defines which files
- should be searched (it can be retrieved from methods in
- SearchInfoUtils, or UI component ScopeComboBox),
- SearchListener
that you should inform about events that
- happen during searching, and helper classes FileInfoUtils
-
(getting SearchInfo objects for nodes) and
- FileNameMatcher
(filtering files by file name).
+ Contains class SearchInfo
,
+ that defines which files should be searched (it can be retrieved from methods in
+ SearchInfoUtils
,
+ or UI component controller ScopeController
),
+ SearchListener
+ that you should inform about events that happen during searching, and helper classes
+ SearchInfoUtils
+ (getting SearchInfo objects for nodes) and
+ FileNameMatcher
+ (filtering files by file name).
+ This package contains classes that can be used by modules that need + to work with Search in Projects dialog, or want to share + information about what data was recently searched. + There are also some utility classes for general usage. +
+
+ If you want to get or store recently searched items, see
+ SearchHistory
,
+ SearchPattern
+ and ReplacePattern
+
+ To display Find in Project dialog, and start a search with
+ predefine criteria, use
+ SearchControl
+ with SearchScopeOptions
.
+
+ Class SearchRoot
defines
+ a location in a filesystem where the search should start.
+ RegexpUtil
can create a pattern
+ for matching file names. These classes can be useful when implementing some custom search infrastructure.
+
+ Classes that you may need to work with if you are implementing + a custom search provider. +
+
+ SearchInfo
+ defines what should be searched. It contains set of files or folders (what should be searched)
+ with associated
+ SearchFilter
s
+ (what should be skipped in those folders).
+
+ SearchListener
+ is an object that will be passed to your implementation of
+ SearchInfo
+ and that you should inform about interesting events that occur during the search.
+
+ SearchInfoUtils
+ contains utility methods for creation of search info for nodes or for files.
+ FileNameMatcher
+ matches files to current search options.
+
+ This package contains class ComponentUtils
+ that can adjust fresh UI components to be used in panels for
+ SearchProvider.Presenter
.
+
+ The advantage of modifying of existing components and returning + controller objects (instead of using subclasses of swing components) + is that it can be comfortably used with NetBeasn GUI Builder. +
+ + diff --git a/api.search/src/org/netbeans/spi/search/package.html b/api.search/src/org/netbeans/spi/search/package.html new file mode 100644 --- /dev/null +++ b/api.search/src/org/netbeans/spi/search/package.html @@ -0,0 +1,61 @@ + + + + +
+ This package contains classes that you can subclass and register to
+ lookups of nodes if you want to specify how the nodes should be
+ searched. For this, use
+ SearchInfoDefinition
+ or SubTreeSearchOptions
,
+ and possibly SearchFilterDefinition
+ and SearchInfoDefinitionFactory
.
+
+ To add a custom search scope to Find in Projects dialog,
+ you will need to subclass
+ SearchScopeDefinition
+ and SearchScopeDefinitionProvider
.
+
+ This package contains classes that are needed to add a custom panel + to Find in Projects dialog, that can have customized search + criteria, search algorithm and results panel. +
+
+ The entry point for such custom search provider is class
+ SearchProvider
.
+