public class SearchAction extends JosmAction implements ParameterizedAction
SearchCompiler
,
SearchDialog
,
Serialized FormModifier and Type | Class and Description |
---|---|
private static class |
SearchAction.CapturingSearchReceiver
This class stores the result of the search in a local variable.
|
(package private) static interface |
SearchAction.SearchReceiver
Interfaces implementing this may receive the result of the current search.
|
static class |
SearchAction.SearchSettingsActionParameter
ActionParameter implementation with SearchSetting as value type. |
(package private) static class |
SearchAction.SearchTask |
private static class |
SearchAction.SelectSearchReceiver
Select the search result and display a status text for it.
|
JosmAction.ActiveLayerChangeAdapter, JosmAction.LayerChangeAdapter, JosmAction.SelectionChangeAdapter
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEARCH_HISTORY_SIZE
The default size of the search history
|
private static SearchSetting |
lastSearch |
static int |
MAX_LENGTH_SEARCH_EXPRESSION_DISPLAY
Maximum number of characters before the search expression is shortened for display purposes.
|
private static java.lang.String |
SEARCH_EXPRESSION |
private static java.util.LinkedList<SearchSetting> |
searchHistory |
sc
Constructor and Description |
---|
SearchAction()
Constructs a new
SearchAction . |
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e) |
void |
actionPerformed(java.awt.event.ActionEvent e,
java.util.Map<java.lang.String,java.lang.Object> parameters)
Invoke action using the given parameters.
|
java.util.List<ActionParameter<?>> |
getActionParameters()
Get the list of parameters that describe the action.
|
static java.util.List<java.lang.String> |
getSearchExpressionHistory()
Gets a list of all texts that were recently used in the search
|
static java.util.Collection<SearchSetting> |
getSearchHistory()
Gets the search history
|
static void |
saveToHistory(SearchSetting s)
Saves a search to the search history.
|
static void |
search()
Launches the dialog for specifying search criteria and runs a search
|
(package private) static void |
search(SearchSetting s) |
static void |
search(java.lang.String search,
SearchMode mode)
Performs the search specified by the search string
search and the search mode mode . |
static java.util.Collection<IPrimitive> |
searchAndReturn(java.lang.String search,
SearchMode mode)
Performs the search specified by the search string
search and the search mode mode and returns the result of the search. |
static void |
searchWithHistory(SearchSetting s)
Adds the search specified by the settings in
s to the
search history and performs the search. |
static void |
searchWithoutHistory(SearchSetting s)
Performs the search specified by the settings in
s without saving it to search history. |
static SearchSetting |
showSearchDialog(SearchSetting initialValues)
Builds and shows the search dialog.
|
protected void |
updateEnabledState()
Refreshes the enabled state
|
checkAndConfirmOutlyingOperation, destroy, getLayerManager, getShortcut, initEnabledState, installAdapters, listenToLayerChange, listenToSelectionChange, setHelpId, setTooltip, updateEnabledState, updateEnabledStateOnCurrentSelection, updateEnabledStateOnCurrentSelection, updateEnabledStateOnModifiableSelection, waitFuture
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
public static final int DEFAULT_SEARCH_HISTORY_SIZE
public static final int MAX_LENGTH_SEARCH_EXPRESSION_DISPLAY
private static final java.lang.String SEARCH_EXPRESSION
private static final java.util.LinkedList<SearchSetting> searchHistory
private static volatile SearchSetting lastSearch
public SearchAction()
SearchAction
.public static java.util.Collection<SearchSetting> getSearchHistory()
public static void saveToHistory(SearchSetting s)
s
- The search to savepublic static java.util.List<java.lang.String> getSearchExpressionHistory()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
public void actionPerformed(java.awt.event.ActionEvent e, java.util.Map<java.lang.String,java.lang.Object> parameters)
ParameterizedAction
actionPerformed
in interface ParameterizedAction
e
- the ActionEventparameters
- parameter mappublic static SearchSetting showSearchDialog(SearchSetting initialValues)
initialValues
- A set of initial values needed in order to initialize the search dialog.
If is null
, then default settings are used.SearchSetting
object containing parameters of the search.public static void search()
public static void searchWithHistory(SearchSetting s)
s
to the
search history and performs the search.s
- search settingspublic static void searchWithoutHistory(SearchSetting s)
s
without saving it to search history.s
- search settingspublic static void search(java.lang.String search, SearchMode mode)
search
and the search mode mode
.search
- the search string to usemode
- the search mode to usestatic void search(SearchSetting s)
public static java.util.Collection<IPrimitive> searchAndReturn(java.lang.String search, SearchMode mode)
search
and the search mode mode
and returns the result of the search.search
- the search string to usemode
- the search mode to useprotected void updateEnabledState()
updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
,
JosmAction.listenToLayerChange()
public java.util.List<ActionParameter<?>> getActionParameters()
ParameterizedAction
getActionParameters
in interface ParameterizedAction