public abstract class ComboMultiSelect extends KeyedItem
Modifier and Type | Class and Description |
---|---|
protected static class |
ComboMultiSelect.ConcatenatingJList
Class that allows list values to be assigned and retrieved as a comma-delimited
string (extracted from TaggingPreset)
|
static class |
ComboMultiSelect.PresetListEntry |
KeyedItem.MatchType, KeyedItem.Usage
Modifier and Type | Field and Description |
---|---|
protected JComponent |
component |
String |
default_ |
String |
delimiter |
String |
display_values |
private boolean |
initialized |
protected Map<String,ComboMultiSelect.PresetListEntry> |
lhm |
String |
locale_display_values
The localized version of
display_values . |
String |
locale_short_descriptions
The localized version of
short_descriptions . |
String |
locale_text
The localized version of
KeyedItem.text . |
protected Object |
originalValue |
private static ListCellRenderer<ComboMultiSelect.PresetListEntry> |
RENDERER |
String |
short_descriptions |
protected KeyedItem.Usage |
usage |
String |
use_last_as_default |
String |
values |
String |
values_context
The context used for translating
values |
String |
values_from |
boolean |
values_no_i18n
Disabled internationalisation for value to avoid mistakes, see #11696
|
String |
values_searchable
whether to use values for search via
TaggingPresetSelector |
boolean |
values_sort
Whether to sort the values, defaults to true.
|
DIFFERENT, key, LAST_VALUES, match, PROP_FILL_DEFAULT, text, text_context
Constructor and Description |
---|
ComboMultiSelect() |
determineBooleanUsage, determineTextUsage, matches, toString
fixPresetString, getLocaleText, getType, initAutoCompletionField, initAutoCompletionField, loadImageIcon, parseInteger
private static final ListCellRenderer<ComboMultiSelect.PresetListEntry> RENDERER
public String locale_text
KeyedItem.text
.public String values_from
public String values_context
values
public boolean values_no_i18n
public boolean values_sort
public String display_values
public String locale_display_values
display_values
.public String short_descriptions
public String locale_short_descriptions
short_descriptions
.public String use_last_as_default
public String values_searchable
TaggingPresetSelector
protected JComponent component
protected final Map<String,ComboMultiSelect.PresetListEntry> lhm
private boolean initialized
protected KeyedItem.Usage usage
protected Object originalValue
public ComboMultiSelect()
public static String[] splitEscaped(char delimiter, String s)
delimiter
- the delimiter, e.g. a comma. separates the entries and
must be escaped within one entrys
- the stringprotected abstract Object getSelectedItem()
protected abstract void addToPanelAnchor(JPanel p, String def, boolean presetInitiallyMatches)
protected char getDelChar()
public Collection<String> getValues()
public Collection<String> getDisplayValues()
public boolean addToPanel(JPanel p, Collection<OsmPrimitive> sel, boolean presetInitiallyMatches)
TaggingPresetItem
TaggingPreset.createPanel(java.util.Collection<org.openstreetmap.josm.data.osm.OsmPrimitive>)
during tagging preset panel creation.
All components defining this tagging preset item must be added to given panel.addToPanel
in class TaggingPresetItem
p
- The panel where components must be addedsel
- The related selected OSM primitivespresetInitiallyMatches
- Whether this TaggingPreset
already matched before applying,
i.e. whether the map feature already existed on the primitive.true
if this item adds semantic tagging elements, false
otherwise.private void initListEntries()
private void initListEntriesFromAttributes()
protected String getDisplayIfNull()
public void addCommands(List<Tag> changedTags)
TaggingPresetItem
addCommands
in class TaggingPresetItem
changedTags
- The list of changed tags to modify if neededpublic void addListEntry(ComboMultiSelect.PresetListEntry e)
public void addListEntries(Collection<ComboMultiSelect.PresetListEntry> e)
protected ListCellRenderer<ComboMultiSelect.PresetListEntry> getListCellRenderer()
public KeyedItem.MatchType getDefaultMatch()
getDefaultMatch
in class KeyedItem