Class TagTable.DeleteAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.openstreetmap.josm.gui.tagging.TagTable.DeleteAction
-
- All Implemented Interfaces:
java.awt.event.ActionListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
,javax.swing.event.ListSelectionListener
- Enclosing class:
- TagTable
class TagTable.DeleteAction extends javax.swing.AbstractAction implements javax.swing.event.ListSelectionListener
Action to be run when the user invokes a delete action on the table, for instance by pressing DEL.Depending on the shape on the current selection the action deletes individual values or entire tags from the model.
If the current selection consists of cells in the second column only, the keys of the selected tags are set to the empty string.
If the current selection consists of cell in the third column only, the values of the selected tags are set to the empty string.
If the current selection consists of cells in the second and the third column, the selected tags are removed from the model.
This action listens to the table selection. It becomes enabled when the selection is non-empty, otherwise it is disabled.
-
-
Constructor Summary
Constructors Constructor Description DeleteAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
actionPerformed(java.awt.event.ActionEvent e)
protected void
deleteTagNames()
delete a selection of tag namesprotected void
deleteTags()
delete a selection of tagsprotected void
deleteTagValues()
delete a selection of tag valuesprotected void
updateEnabledState()
void
valueChanged(javax.swing.event.ListSelectionEvent e)
listens to the table selection model-
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
-
-
-
-
Constructor Detail
-
DeleteAction
DeleteAction()
-
-
Method Detail
-
deleteTagNames
protected void deleteTagNames()
delete a selection of tag names
-
deleteTagValues
protected void deleteTagValues()
delete a selection of tag values
-
deleteTags
protected void deleteTags()
delete a selection of tags
-
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Specified by:
actionPerformed
in interfacejava.awt.event.ActionListener
-
valueChanged
public void valueChanged(javax.swing.event.ListSelectionEvent e)
listens to the table selection model- Specified by:
valueChanged
in interfacejavax.swing.event.ListSelectionListener
-
updateEnabledState
protected final void updateEnabledState()
-
-