Class 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.

    • 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

      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 names
      protected void deleteTags()
      delete a selection of tags
      protected void deleteTagValues()
      delete a selection of tag values
      protected 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
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.swing.Action

        accept
    • 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 interface java.awt.event.ActionListener
      • valueChanged

        public void valueChanged​(javax.swing.event.ListSelectionEvent e)
        listens to the table selection model
        Specified by:
        valueChanged in interface javax.swing.event.ListSelectionListener