Class Text
- java.lang.Object
-
- org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
-
- org.openstreetmap.josm.gui.tagging.presets.items.TextItem
-
- org.openstreetmap.josm.gui.tagging.presets.items.KeyedItem
-
- org.openstreetmap.josm.gui.tagging.presets.items.Text
-
-
Nested Class Summary
-
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 String
alternative_autocomplete_keys
A comma separated list of alternative keys to use for autocompletion.String
auto_increment
May contain a comma separated list of integer increments or decrements, e.g.private static int
auto_increment_selected
String
default_
The default value for the item.short
length
The length of the text box (number of characters allowed).String
originalValue
The original valueString
use_last_as_default
whether the last value is used as default.private JComponent
value
private TemplateEntry
valueTemplate
-
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 Text()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCommands(List<Tag> changedTags)
Adds the new tags to apply to selected OSM primitives when the preset holding this item is applied.boolean
addToPanel(JPanel p, TaggingPresetItemGuiSupport support)
Called byTaggingPreset.createPanel(java.util.Collection<org.openstreetmap.josm.data.osm.OsmPrimitive>)
during tagging preset panel creation.KeyedItem.MatchType
getDefaultMatch()
Returns the default match.private static String
getValue(Component comp)
Collection<String>
getValues()
Returns the list of values.private static void
saveHorizontalSpace(AbstractButton button)
private void
setupListeners(AutoCompTextField<AutoCompletionItem> textField, TaggingPresetItemGuiSupport support)
void
setValue_template(String pattern)
Set the value template.-
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
-
auto_increment_selected
private static int auto_increment_selected
-
default_
public String default_
The default value for the item. If not specified, the current value of the key is chosen as default (if applicable). Defaults to "".
-
originalValue
public String originalValue
The original value
-
use_last_as_default
public String use_last_as_default
whether the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".
-
auto_increment
public String auto_increment
May contain a comma separated list of integer increments or decrements, e.g. "-2,-1,+1,+2". A button will be shown next to the text field for each value, allowing the user to select auto-increment with the given stepping. Auto-increment only happens if the user selects it. There is also a button to deselect auto-increment. Default is no auto-increment. Mutually exclusive withuse_last_as_default
.
-
length
public short length
The length of the text box (number of characters allowed).
-
alternative_autocomplete_keys
public String alternative_autocomplete_keys
A comma separated list of alternative keys to use for autocompletion.
-
value
private JComponent value
-
valueTemplate
private transient TemplateEntry valueTemplate
-
-
Constructor Detail
-
Text
public Text()
-
-
Method Detail
-
addToPanel
public 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.
-
saveHorizontalSpace
private static void saveHorizontalSpace(AbstractButton button)
-
addCommands
public void addCommands(List<Tag> changedTags)
Description copied from class:TaggingPresetItem
Adds the new tags to apply to selected OSM primitives when the preset holding this item is applied.- Overrides:
addCommands
in classTextItem
- Parameters:
changedTags
- The list of changed tags to modify if needed
-
getDefaultMatch
public KeyedItem.MatchType getDefaultMatch()
Description copied from class:KeyedItem
Returns the default match.- Specified by:
getDefaultMatch
in classKeyedItem
- Returns:
- the default match
-
getValues
public Collection<String> getValues()
Description copied from class:KeyedItem
Returns the list of values.
-
setValue_template
public void setValue_template(String pattern) throws SAXException
Set the value template.- Parameters:
pattern
- The value_template pattern.- Throws:
SAXException
- If an error occured while parsing.
-
setupListeners
private void setupListeners(AutoCompTextField<AutoCompletionItem> textField, TaggingPresetItemGuiSupport support)
-
-