Class Combo
-
public class Combo extends ComboMultiSelect
Combobox type.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
Combo.ChooseColorAction
(package private) class
Combo.ComponentListener
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect
ComboMultiSelect.ComboMultiSelectListCellRenderer
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem
KeyedItem.MatchType, KeyedItem.Usage
-
-
Field Summary
Fields Modifier and Type Field Description protected AutoCompComboBoxModel<AutoCompletionItem>
autoCompModel
protected JosmComboBox<PresetListEntry>
combobox
protected AutoCompComboBoxModel<PresetListEntry>
dropDownModel
boolean
editable
Whether the combo box is editable, which means that the user can add other values as text.int
length
The length of the combo box (number of characters allowed).-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect
default_, delimiter, display_values, locale_display_values, locale_short_descriptions, originalValue, presetListEntries, seenValues, short_descriptions, usage, use_last_as_default, values, values_context, values_from, values_no_i18n, values_searchable, values_sort
-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem
DIFFERENT, DIFFERENT_I18N, key, LAST_VALUES, match, PROP_FILL_DEFAULT
-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.items.TextItem
icon, icon_size, locale_text, text, text_context
-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
DISPLAY_KEYS_AS_HINT
-
-
Constructor Summary
Constructors Constructor Description Combo()
Constructs a newCombo
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addEntry(PresetListEntry entry)
protected boolean
addToPanel(JPanel p, TaggingPresetItemGuiSupport support)
Called byTaggingPreset.createPanel(java.util.Collection<org.openstreetmap.josm.data.osm.OsmPrimitive>)
during tagging preset panel creation.private PresetListEntry
find(String value)
Finds the PresetListEntry that matches value.protected Color
getColor()
protected PresetListEntry
getSelectedItem()
Returns the value selected in the combobox or a synthetic value if a multiselect.protected void
setColor(Color color)
-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.items.ComboMultiSelect
addCommands, addLabel, addListEntries, addListEntry, getDefaultMatch, getDisplayValues, getInitialValue, getValues, initListEntries, initListEntriesFromAttributes, isForceUseLastAsDefault, isUseLastAsDefault, setUse_last_as_default, splitEscaped
-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem
determineBooleanUsage, determineTextUsage, getKeyTooltipText, getPopupMenu, isKeyRequired, matches, toString
-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.items.TextItem
addIcon, fieldsToString, getIcon, initializeLocaleText
-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
fixPresetString, getAllForKeys, getLocaleText, getType, initAutoCompletionField, initAutoCompletionField, loadImageIcon, matches, parseInteger
-
-
-
-
Field Detail
-
editable
public boolean editable
Whether the combo box is editable, which means that the user can add other values as text. Default istrue
. Iffalse
it is readonly, which means that the user can only select an item in the list.
-
length
public int length
The length of the combo box (number of characters allowed).
-
combobox
protected JosmComboBox<PresetListEntry> combobox
-
dropDownModel
protected AutoCompComboBoxModel<PresetListEntry> dropDownModel
-
autoCompModel
protected AutoCompComboBoxModel<AutoCompletionItem> autoCompModel
-
-
Constructor Detail
-
Combo
public Combo()
Constructs a newCombo
.
-
-
Method Detail
-
addEntry
private void addEntry(PresetListEntry entry)
-
addToPanel
protected boolean addToPanel(JPanel p, TaggingPresetItemGuiSupport support)
Description copied from class:TaggingPresetItem
Called byTaggingPreset.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.- Specified by:
addToPanel
in classTaggingPresetItem
- Parameters:
p
- The panel where components must be addedsupport
- supporting class for creating the GUI- Returns:
true
if this item adds semantic tagging elements,false
otherwise.
-
find
private PresetListEntry find(String value)
Finds the PresetListEntry that matches value.Looks in the model for an element whose
value
matchesvalue
.- Parameters:
value
- The value to match.- Returns:
- The entry or null
-
getSelectedItem
protected PresetListEntry getSelectedItem()
Description copied from class:ComboMultiSelect
Returns the value selected in the combobox or a synthetic value if a multiselect.- Specified by:
getSelectedItem
in classComboMultiSelect
- Returns:
- the value
-
-