Class TextItem
- java.lang.Object
-
- org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
-
- org.openstreetmap.josm.gui.tagging.presets.items.TextItem
-
- Direct Known Subclasses:
KeyedItem
,Label
,Link
,Optional
,PresetLink
public abstract class TextItem extends TaggingPresetItem
A tagging preset item displaying a localizable text.- Since:
- 6190
-
-
Field Summary
Fields Modifier and Type Field Description String
icon
The location of icon file to displayshort
icon_size
The size of displayed icon.String
locale_text
The localized version oftext
String
text
The text to displayString
text_context
The context used for translatingtext
-
Fields inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
DISPLAY_KEYS_AS_HINT
-
-
Constructor Summary
Constructors Constructor Description TextItem()
-
Method Summary
All 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.protected void
addIcon(JLabel label)
Defines the label icon from this entry's iconprotected String
fieldsToString()
ImageIcon
getIcon()
Returns the entry icon, if any.protected void
initializeLocaleText(String defaultText)
String
toString()
-
Methods inherited from class org.openstreetmap.josm.gui.tagging.presets.TaggingPresetItem
addToPanel, fixPresetString, getAllForKeys, getLocaleText, getType, initAutoCompletionField, initAutoCompletionField, loadImageIcon, matches, matches, parseInteger
-
-
-
-
Field Detail
-
text_context
public String text_context
The context used for translatingtext
-
locale_text
public String locale_text
The localized version oftext
-
icon_size
public short icon_size
The size of displayed icon. If not set, default is 16px
-
-
Constructor Detail
-
TextItem
public TextItem()
-
-
Method Detail
-
initializeLocaleText
protected final void initializeLocaleText(String defaultText)
-
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.- Specified by:
addCommands
in classTaggingPresetItem
- Parameters:
changedTags
- The list of changed tags to modify if needed
-
fieldsToString
protected String fieldsToString()
-
addIcon
protected void addIcon(JLabel label)
Defines the label icon from this entry's icon- Parameters:
label
- the component- Since:
- 17605
-
getIcon
public ImageIcon getIcon()
Returns the entry icon, if any.- Returns:
- the entry icon, or
null
- Since:
- 17605
-
-