public class ComponentUtils extends Object
Modifier and Type | Method and Description |
---|---|
static FileNameController |
adjustComboForFileName(JComboBox jComboBox)
Adjust a
JComboBox to act as component for selecting file name
pattern, and return a controller object for interacting with it. |
static ScopeController |
adjustComboForScope(JComboBox jComboBox,
String preferredScopeId,
SearchScopeDefinition... extraSearchScopes)
Adjust a
JComboBox to act as component for selecting search
scope, and return a controller object for interacting with it. |
static SearchPatternController |
adjustComboForSearchPattern(JComboBox jComboBox)
Adjust a
JComboBox to act as component for selecting search text
pattern, and return a controller object for interacting with it. |
static ScopeOptionsController |
adjustPanelForOptions(JPanel jPanel,
boolean searchAndReplace,
FileNameController fileNameController)
Adjust an empty panel for specifying search scope options.
|
static ScopeOptionsController |
adjustPanelsForOptions(JPanel scopePanel,
JPanel fileNamePanel,
boolean searchAndReplace,
FileNameController fileNameController)
Adjust two empty panels for specifying search scope options.
|
@NonNull public static FileNameController adjustComboForFileName(@NonNull JComboBox jComboBox)
JComboBox
to act as component for selecting file name
pattern, and return a controller object for interacting with it.
Such ajdusted combo box is useful if you need a valid file name pattern
for SearchScopeOptions
that you want to pass to file object
iterator of a SearchInfo
.
You can bind this combo box with scope options panel to toggle its
regular-expresion mode.jComboBox
- Freshly created component that will be adjusted.jComboBox
.ComponentUtils.adjustPanelForOptions(JPanel, boolean, FileNameController)
@NonNull public static ScopeController adjustComboForScope(@NonNull JComboBox jComboBox, @NullAllowed String preferredScopeId, @NonNull SearchScopeDefinition... extraSearchScopes)
JComboBox
to act as component for selecting search
scope, and return a controller object for interacting with it.jComboBox
- Freshly created component that will be modified.preferredScopeId
- Preferred search scope ID (e.g. "open projects",
"main projects", "node selection").extraSearchScopes
- Extra search scopes that should be visible among
standard search scopes created by SearchScopeDefinitionProvider
s.jComboBox
.ScopeController.getSearchInfo()
@NonNull public static ScopeOptionsController adjustPanelForOptions(@NonNull JPanel jPanel, boolean searchAndReplace, @NonNull FileNameController fileNameController)
SearchScopeOptions
that you want to pass to file object
iterator of a SearchInfo
.jPanel
- Empty (with no child components) panel to adjust.searchAndReplace
- True if options for search-and-replace mode
should be shown, false to show options for search-only mode.fileNameController
- File-name combo box that will be bound to this
settings panel.jPanel
with controls for setting
search options (search in archives, search in generated sources, use
ignore list, treat file name pattern as regular expression matching file
path).ScopeOptionsController.getSearchScopeOptions()
@NonNull public static ScopeOptionsController adjustPanelsForOptions(@NonNull JPanel scopePanel, @NonNull JPanel fileNamePanel, boolean searchAndReplace, @NonNull FileNameController fileNameController)
SearchScopeOptions
that you want to pass to file
object iterator of a SearchInfo
.scopePanel
- Empty (with no child components) panel to adjust for
controls related to search scope (search in archives, search in generated
sources).fileNamePanel
- Empty (with no child components) panel to adjust for
controls related to file name pattern (regular expression, ignore list).searchAndReplace
- True if options for search-and-replace mode
should be shown, false to show options for search-only mode.fileNameController
- File-name combo box that will be bound to this
settings panel.JPanel
s with controls for setting
search options (search in archives, search in generated sources, use
ignore list, treat file name pattern as regular expression matching file
path).ScopeOptionsController.getSearchScopeOptions()
@NonNull public static SearchPatternController adjustComboForSearchPattern(@NonNull JComboBox jComboBox)
JComboBox
to act as component for selecting search text
pattern, and return a controller object for interacting with it.
You can bind this combo box with some abstract buttons (usually check
boxes) to set pattern options.jComboBox
- Freshly created component that will be adjusted.jComboBox
.