Package org.openstreetmap.josm.gui.io
Class UploadDialogModel
- java.lang.Object
-
- javax.swing.table.AbstractTableModel
-
- org.openstreetmap.josm.gui.tagging.TagEditorModel
-
- org.openstreetmap.josm.gui.io.UploadDialogModel
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.table.TableModel
public class UploadDialogModel extends TagEditorModel
A model for the upload dialog- Since:
- 18173
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.tagging.TagEditorModel
TagEditorModel.EndEditListener
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Stringagentthe user-agentstatic java.lang.StringCOMMENTthe "comment" changeset OSM keyprivate static java.lang.StringCREATED_BYthe "created_by" changeset OSM keyprivate booleanhashtagswhether to extract hashtags from commentprivate booleanlockeda lock to prevent loopsstatic java.lang.StringSOURCEthe "source" changeset OSM key-
Fields inherited from class org.openstreetmap.josm.gui.tagging.TagEditorModel
PROP_DIRTY, tags
-
-
Constructor Summary
Constructors Constructor Description UploadDialogModel()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.StringaddHashTagsFromDataSet(java.lang.String comment, DataSet dataSet)Returns the given comment with appended hashtags from dataset changeset tags, if not already present.private voiddoPut(java.lang.String key, java.lang.String value)Inserts/updates/deletes a tag.(package private) java.lang.StringfindHashTags(java.lang.String comment)Extracts the list of hashtags from the comment text.voidfireTableDataChanged()java.lang.StringgetValue(java.lang.String key)Get the value of a key.static booleanisCommentOrSource(java.lang.String key)Determines if the key is "comment" or "source".voidput(java.lang.String key, java.lang.String value)Inserts/updates/deletes a tag.voidputAll(java.util.Map<java.lang.String,java.lang.String> map)Inserts/updates/deletes all tags frommap.voidputAll(DataSet dataSet)Inserts all tags from aDataSet.-
Methods inherited from class org.openstreetmap.josm.gui.tagging.TagEditorModel
add, add, addPropertyChangeListener, appendNewTag, applyToPrimitive, clear, commitPendingEdit, createDeleteTagsCommand, createUpdateTagCommand, delete, deleteTagNames, deleteTags, deleteTagValues, ensureOneTag, fireDirtyStateChanged, forPrimitive, get, get, getColumnCount, getColumnSelectionModel, getKeys, getRowCount, getRowSelectionModel, getTagCollection, getTaggingPresetTypes, getTags, getTags, getValueAt, includesTag, initFromPrimitive, initFromTags, initFromTags, isCellEditable, isDirty, prepend, removePropertyChangeListener, setDirty, setEndEditListener, setValueAt, sort, updateTagName, updateTags, updateTagValue
-
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getColumnName, getListeners, getTableModelListeners, removeTableModelListener
-
-
-
-
Field Detail
-
CREATED_BY
private static final java.lang.String CREATED_BY
the "created_by" changeset OSM key- See Also:
- Constant Field Values
-
COMMENT
public static final java.lang.String COMMENT
the "comment" changeset OSM key- See Also:
- Constant Field Values
-
SOURCE
public static final java.lang.String SOURCE
the "source" changeset OSM key- See Also:
- Constant Field Values
-
agent
private final java.lang.String agent
the user-agent
-
hashtags
private final boolean hashtags
whether to extract hashtags from comment
-
locked
private boolean locked
a lock to prevent loops
-
-
Constructor Detail
-
UploadDialogModel
public UploadDialogModel()
-
-
Method Detail
-
fireTableDataChanged
public void fireTableDataChanged()
- Overrides:
fireTableDataChangedin classjavax.swing.table.AbstractTableModel
-
getValue
public java.lang.String getValue(java.lang.String key)
Get the value of a key.- Parameters:
key- The key to retrieve- Returns:
- The value (may be null)
-
findHashTags
java.lang.String findHashTags(java.lang.String comment)
Extracts the list of hashtags from the comment text.- Parameters:
comment- The comment with the hashtags- Returns:
- the hashtags separated by ";" or null
-
addHashTagsFromDataSet
static java.lang.String addHashTagsFromDataSet(java.lang.String comment, DataSet dataSet)
Returns the given comment with appended hashtags from dataset changeset tags, if not already present.- Parameters:
comment- changeset comment. Can be nulldataSet- optional dataset, which can contain hashtags in its changeset tags- Returns:
- comment with dataset changesets tags, if any, not duplicated
-
doPut
private void doPut(java.lang.String key, java.lang.String value)
Inserts/updates/deletes a tag.Existing keys are updated. Others are added. A value of
nulldeletes the key.- Parameters:
key- The key of the tag to insert.value- The value of the tag to insert.
-
put
public void put(java.lang.String key, java.lang.String value)
Inserts/updates/deletes a tag.Existing keys are updated. Others are added. A value of
nulldeletes the key.- Parameters:
key- The key of the tag to insert.value- The value of the tag to insert.
-
putAll
public void putAll(java.util.Map<java.lang.String,java.lang.String> map)
Inserts/updates/deletes all tags frommap.Existing keys are updated. Others are added. A value of
nulldeletes the key.- Parameters:
map- a map of tags to insert or update
-
putAll
public void putAll(DataSet dataSet)
Inserts all tags from aDataSet.- Parameters:
dataSet- The DataSet to take tags from.
-
isCommentOrSource
public static boolean isCommentOrSource(java.lang.String key)
Determines if the key is "comment" or "source".- Parameters:
key- changeset key- Returns:
trueif the key is "comment" or "source"- Since:
- 18283
-
-