Class AddWordAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action

    public class AddWordAction
    extends javax.swing.AbstractAction
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private javax.swing.text.JTextComponent jText  
      private java.lang.String word  
      • 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
      AddWordAction​(javax.swing.text.JTextComponent jText, java.lang.String word)
      Create a action to add a word to the current user dictionary.
      AddWordAction​(javax.swing.text.JTextComponent jText, java.lang.String word, java.lang.String label)
      Create a action to add a word to the current user dictionary.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent arg0)
      Add the word to the current user directory.
      • 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
    • Field Detail

      • word

        private java.lang.String word
      • jText

        private javax.swing.text.JTextComponent jText
    • Constructor Detail

      • AddWordAction

        public AddWordAction​(javax.swing.text.JTextComponent jText,
                             java.lang.String word)
        Create a action to add a word to the current user dictionary.
        Parameters:
        jText - component that need refresh after adding to remove the red zigzag line
        word - the word that can be added
      • AddWordAction

        public AddWordAction​(javax.swing.text.JTextComponent jText,
                             java.lang.String word,
                             java.lang.String label)
        Create a action to add a word to the current user dictionary.
        Parameters:
        jText - component that need refresh after adding to remove the red zigzag line
        word - the word that can be added
        label - the display text of the action
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent arg0)
        Add the word to the current user directory.