org.openstreetmap.josm.gui.tagging
Class TagTable.DeleteAction

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by org.openstreetmap.josm.gui.dialogs.relation.RunnableAction
          extended by org.openstreetmap.josm.gui.tagging.TagTable.DeleteAction
All Implemented Interfaces:
java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.util.EventListener, javax.swing.Action, javax.swing.event.ListSelectionListener
Enclosing class:
TagTable

 class TagTable.DeleteAction
extends RunnableAction
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.


Field Summary
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
TagTable.DeleteAction()
           
 
Method Summary
protected  void deleteTagNames()
          delete a selection of tag names
protected  void deleteTags()
          delete a selection of tags
protected  void deleteTagValues()
          delete a selection of tag values
 void run()
           
protected  void updateEnabledState()
           
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          listens to the table selection model
 
Methods inherited from class org.openstreetmap.josm.gui.dialogs.relation.RunnableAction
actionPerformed
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagTable.DeleteAction

public TagTable.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


run

public void run()
Specified by:
run in interface java.lang.Runnable
Specified by:
run in class RunnableAction

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
listens to the table selection model

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

updateEnabledState

protected void updateEnabledState()


JOSM