public class SearchAction extends JosmAction implements ParameterizedAction
Modifier and Type | Class and Description |
---|---|
private static class |
SearchAction.DescriptionTextBuilder |
private static class |
SearchAction.SearchKeywordRow |
static class |
SearchAction.SearchMode |
static class |
SearchAction.SearchSetting |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SEARCH_HISTORY_SIZE |
private static SearchAction.SearchSetting |
lastSearch |
static int |
MAX_LENGTH_SEARCH_EXPRESSION_DISPLAY
Maximum number of characters before the search expression is shortened for display purposes.
|
private static String |
SEARCH_EXPRESSION |
private static LinkedList<SearchAction.SearchSetting> |
searchHistory |
sc
changeSupport, enabled
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
SearchAction()
Constructs a new
SearchAction . |
destroy, getCurrentDataSet, getEditLayer, getShortcut, initEnabledState, installAdapters, setTooltip, updateEnabledState
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, 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 String SEARCH_EXPRESSION
private static final LinkedList<SearchAction.SearchSetting> searchHistory
private static SearchAction.SearchSetting lastSearch
public SearchAction()
SearchAction
.public static Collection<SearchAction.SearchSetting> getSearchHistory()
public static void saveToHistory(SearchAction.SearchSetting s)
public static List<String> getSearchExpressionHistory()
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void actionPerformed(ActionEvent e, Map<String,Object> parameters)
actionPerformed
in interface ParameterizedAction
public static SearchAction.SearchSetting showSearchDialog(SearchAction.SearchSetting initialValues)
private static void buildHints(JPanel right)
private static void buildHintsNew(JPanel right, HistoryComboBox hcbSearchString)
public static void search()
public static void searchWithHistory(SearchAction.SearchSetting s)
s
to the
search history and performs the search.s
- public static void searchWithoutHistory(SearchAction.SearchSetting s)
public static int getSelection(SearchAction.SearchSetting s, Collection<OsmPrimitive> sel, Predicate<OsmPrimitive> p)
public static void getSelection(SearchAction.SearchSetting s, Collection<OsmPrimitive> all, Property<OsmPrimitive,Boolean> p)
s
- the search settingsall
- the collection of all the primitives that should be consideredp
- the property that should be set/unset if something is foundpublic static void search(String search, SearchAction.SearchMode mode)
public static void search(SearchAction.SearchSetting s)
protected void updateEnabledState()
updateEnabledState
in class JosmAction
JosmAction.updateEnabledState(Collection)
,
JosmAction.initEnabledState()
public List<ActionParameter<?>> getActionParameters()
getActionParameters
in interface ParameterizedAction
public static String escapeStringForSearch(String s)