class TagEditHelper extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) class |
TagEditHelper.AbstractTagsDialog |
(package private) class |
TagEditHelper.AddTagsDialog |
class |
TagEditHelper.EditTagDialog |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
changedKey |
static int |
DEFAULT_LRU_TAGS_NUMBER |
(package private) java.util.Comparator<AutoCompletionListItem> |
defaultACItemComparator |
private java.lang.String |
lastAddKey |
private java.lang.String |
lastAddValue |
static int |
MAX_LRU_TAGS_NUMBER |
private java.lang.String |
objKey |
static BooleanProperty |
PROPERTY_FIX_TAG_LOCALE |
static IntegerProperty |
PROPERTY_RECENT_TAGS_NUMBER |
static BooleanProperty |
PROPERTY_REMEMBER_TAGS |
private java.util.Map<Tag,java.lang.Void> |
recentTags |
(package private) java.util.Collection<OsmPrimitive> |
sel |
private javax.swing.table.DefaultTableModel |
tagData |
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> |
valueCount |
Constructor and Description |
---|
TagEditHelper(javax.swing.table.DefaultTableModel propertyData,
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> valueCount) |
Modifier and Type | Method and Description |
---|---|
void |
addTag()
Open the add selection dialog and add a new key/value to the table (and
to the dataset, of course).
|
void |
editTag(int row,
boolean focusOnKey)
Edit the value in the tags table row.
|
private static java.util.List<java.lang.String> |
getAutocompletionKeys(java.lang.String key)
For a given key k, return a list of keys which are used as keys for
auto-completing values to increase the search space.
|
java.lang.String |
getChangedKey()
If during last editProperty call user changed the key name, this key will be returned
Elsewhere, returns null.
|
void |
loadTagsIfNeeded()
Load recently used tags from preferences if needed.
|
void |
resetChangedKey() |
void |
saveTagsIfNeeded()
Store recently used tags in preferences if needed.
|
private boolean |
warnOverwriteKey(java.lang.String action,
java.lang.String togglePref)
Warns user about a key being overwritten.
|
private final javax.swing.table.DefaultTableModel tagData
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> valueCount
java.util.Collection<OsmPrimitive> sel
private java.lang.String changedKey
private java.lang.String objKey
java.util.Comparator<AutoCompletionListItem> defaultACItemComparator
private java.lang.String lastAddKey
private java.lang.String lastAddValue
public static final int DEFAULT_LRU_TAGS_NUMBER
public static final int MAX_LRU_TAGS_NUMBER
private final java.util.Map<Tag,java.lang.Void> recentTags
public static final BooleanProperty PROPERTY_FIX_TAG_LOCALE
public static final BooleanProperty PROPERTY_REMEMBER_TAGS
public static final IntegerProperty PROPERTY_RECENT_TAGS_NUMBER
TagEditHelper(javax.swing.table.DefaultTableModel propertyData, java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Integer>> valueCount)
public void addTag()
public void editTag(int row, boolean focusOnKey)
row
- The row of the table from which the value is edited.focusOnKey
- Determines if the initial focus should be set on key instead of valuepublic java.lang.String getChangedKey()
null
public void resetChangedKey()
private static java.util.List<java.lang.String> getAutocompletionKeys(java.lang.String key)
key
- the key kpublic void loadTagsIfNeeded()
public void saveTagsIfNeeded()
private boolean warnOverwriteKey(java.lang.String action, java.lang.String togglePref)
action
- The action done by the user. Must state what key is changedtogglePref
- The preference to save the checkbox state totrue
if the user accepts to overwrite key, false
otherwise