This document lists changes made to the Search in Projects API.
Fuller descriptions of all changes can be found below (follow links).
Not all deprecations are listed here, assuming that the deprecated APIs continue to essentially work. For a full deprecation list, please consult the Javadoc.
SearchPatternController
DefaultSearchResultsDisplayer
These API specification versions may be used to indicate that a module requires a certain API feature in order to function. For example, if you see here a feature you need which is labelled 1.20, your manifest should contain in its main attributes the line:
OpenIDE-Module-Module-Dependencies: org.netbeans.api.search/1 > 1.20
SearchPatternController
DefaultSearchResultsDisplayer
org.netbeans.api.search.ui.ComponentUtils
SearchPatternController
org.netbeans.spi.search.provider.DefaultSearchResultsDisplayer
DefaultSearchResultsDisplayer
org.netbeans.api.search.provider.FileNameMatcher
org.netbeans.api.search.ReplacePattern
org.netbeans.api.search.ui.ScopeOptionsController
org.netbeans.api.search.provider.SearchFilter
org.netbeans.spi.search.SearchFilterDefinition
org.netbeans.api.search.SearchHistory
org.netbeans.api.search.provider.SearchInfo
org.netbeans.spi.search.SearchInfoDefinition
org.netbeans.api.search.provider.SearchListener
org.netbeans.api.search.SearchPattern
org.netbeans.api.search.ui.SearchPatternController
SearchPatternController
org.netbeans.spi.search.provider.SearchResultsDisplayer
org.netbeans.api.search.SearchRoot
org.netbeans.spi.search.SearchScopeDefinition
ComponentUtils
ScopeOptionsController
; made by: jhavlin; issues:
#226286
Controls for specifying search scope options can now be split into two panels - one for scope options, and one for file name options.
Class ComponentUtils has new method adjustPanelsForOptions(JPanel, JPanel, boolean, FileNameController), that takes the two panels. It can be used instead of adjustPanelForOptions(JPanel, boolean, FileNameController), that puts all controls into a single panel.
Class ScopeOptionsController has new method getFileNameComponent() to get the panel with controls related to file name. (The panel related to search scope can be get using getComponent()).
SearchPattern
SearchPatternController
; made by: jhavlin; issues:
#224328
Before, the search pattern distinguished two match types: Regular Expression and Standard. The standard meant that the text was searched literally in editor search, and that the searched text could contain basic wildcards (* and ?) in Find in Projects.
Now, the Search pattern can specify exact match type: Regular Expression, Basic Wildcards and Literal. Basic wildcards are not supported by Editor search, but the fallback to Literal Search is transparent for the editor.
To support extra match types, a few parts have to be added to the API:
SearchScopeDefinition
; made by: jhavlin; issues:
#222406
Search scope can define an icon that will be shown in the UI, usually in the combo box for search scope selection.
To use a custom scope icon, override method SearchScopeDefinition.getIcon().
ReplacePattern
SearchHistory
; made by: mkristofic
Search History is extended for replace history.
New ReplacePattern is a wrap class for replace expression.
SearchResultsDisplayer
; made by: jhavlin
The new SearchResultsDisplayer.closed()
is
called when the results panel is closed by the user. It can
be overriden to release all resouces held by the panel.
Before this change, HierarchyListener
s were
used to detect detaching of search results panels. But it
is quite complicated as the panels can be often detached and
attached again when they are moved from a simple pane to a
tabbed pane or vice versa.
SearchRoot
FileNameMatcher
SearchFilter
SearchInfo
SearchListener
SearchFilterDefinition
SearchInfoDefinition
; made by: jhavlin
Previous versions of this API supported searching based on
traversing of FileObject
s only. In some cases
(e.g. remote filesystems), working with
FileObjects
is too expensive and slow.
This API change make it possible to work with
URI
objects as an alternative to
FileObjects
.
SearchPatternController
SearchPatternController
ComponentUtils
; made by: jhavlin
Added method
ComponentUtils.adjustComboForSearchPattern
and class
SearchPatternController
, that complements
other controllers for search-related UI components.
DefaultSearchResultsDisplayer
DefaultSearchResultsDisplayer
; made by: jhavlin
Method
SearchResultsDisplayer.createDefault
now
returns object of type
DefaultSearchResultsDisplayer
that can be customized, and that let users reuse some features
used in the standard search provider.