public abstract class KeyedItem extends TaggingPresetItem
Modifier and Type | Class and Description |
---|---|
protected static class |
KeyedItem.MatchType
Enum denoting how a match (see
TaggingPresetItem.matches(java.util.Map<java.lang.String, java.lang.String>) ) is performed. |
protected static class |
KeyedItem.Usage
Usage information on a key
|
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
DIFFERENT
Translatation of "<different>".
|
java.lang.String |
key
This specifies the property key that will be modified by the item.
|
(package private) static java.util.Map<java.lang.String,java.lang.String> |
LAST_VALUES
Last value of each key used in presets, used for prefilling corresponding fields
|
java.lang.String |
match
Allows to change the matching process, i.e., determining whether the tags of an OSM object fit into this preset.
|
protected static BooleanProperty |
PROP_FILL_DEFAULT |
java.lang.String |
text
The text to display
|
java.lang.String |
text_context
The context used for translating
text |
Constructor and Description |
---|
KeyedItem() |
Modifier and Type | Method and Description |
---|---|
protected static KeyedItem.Usage |
determineBooleanUsage(java.util.Collection<OsmPrimitive> sel,
java.lang.String key) |
protected static KeyedItem.Usage |
determineTextUsage(java.util.Collection<OsmPrimitive> sel,
java.lang.String key) |
abstract KeyedItem.MatchType |
getDefaultMatch()
Returns the default match.
|
protected java.lang.String |
getKeyTooltipText() |
abstract java.util.Collection<java.lang.String> |
getValues()
Returns the list of values.
|
boolean |
isKeyRequired()
Determines whether key or key+value are required.
|
java.lang.Boolean |
matches(java.util.Map<java.lang.String,java.lang.String> tags)
Tests whether the tags match this item.
|
java.lang.String |
toString() |
addCommands, addToPanel, fixPresetString, getLocaleText, getType, initAutoCompletionField, initAutoCompletionField, loadImageIcon, matches, parseInteger
protected static final java.lang.String DIFFERENT
protected static final BooleanProperty PROP_FILL_DEFAULT
static final java.util.Map<java.lang.String,java.lang.String> LAST_VALUES
public java.lang.String key
public java.lang.String text
public java.lang.String text_context
text
public java.lang.String match
Key
and "none" for Text
, Combo
, MultiSelect
and Check
.public KeyedItem()
protected static KeyedItem.Usage determineTextUsage(java.util.Collection<OsmPrimitive> sel, java.lang.String key)
protected static KeyedItem.Usage determineBooleanUsage(java.util.Collection<OsmPrimitive> sel, java.lang.String key)
public boolean isKeyRequired()
public abstract KeyedItem.MatchType getDefaultMatch()
public abstract java.util.Collection<java.lang.String> getValues()
protected java.lang.String getKeyTooltipText()
public java.lang.Boolean matches(java.util.Map<java.lang.String,java.lang.String> tags)
TaggingPresetItem
matches
in class TaggingPresetItem
tags
- the tags of an OsmPrimitive
true
if matches (positive), null
if neutral, false
if mismatches (negative).public java.lang.String toString()
toString
in class java.lang.Object