Class TabbedSaveAction

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<TextFile>, java.util.EventListener, javax.swing.Action
    Direct Known Subclasses:
    SaveAllAction, SaveFileAction

    abstract class TabbedSaveAction
    extends javax.swing.AbstractAction
    implements java.lang.Iterable<TextFile>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static javax.swing.JFileChooser chooser
      File chooser component.
      private static long serialVersionUID  
      protected javax.swing.JTabbedPane tabbedPane  
      • 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 
      Modifier Constructor Description
      protected TabbedSaveAction​(javax.swing.JTabbedPane _tabbedPane)  
      protected TabbedSaveAction​(javax.swing.JTabbedPane _tabbedPane, java.lang.String _name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent _event)
      protected java.lang.String getFileName​(int _index)
      Get the file name for the supplied index
      protected TextFile getTextFile​(int _index)
      Get the text file object associated with the supplied index
      • 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
      • Methods inherited from interface java.lang.Iterable

        forEach, iterator, spliterator
    • Field Detail

      • chooser

        private static javax.swing.JFileChooser chooser
        File chooser component. Make static so that previous save location is stored
      • tabbedPane

        protected final javax.swing.JTabbedPane tabbedPane
    • Constructor Detail

      • TabbedSaveAction

        protected TabbedSaveAction​(javax.swing.JTabbedPane _tabbedPane)
      • TabbedSaveAction

        protected TabbedSaveAction​(javax.swing.JTabbedPane _tabbedPane,
                                   java.lang.String _name)
    • Method Detail

      • getTextFile

        protected TextFile getTextFile​(int _index)
        Get the text file object associated with the supplied index
        Parameters:
        _index - The tabbed pane index
        Returns:
        The text file object for the referenced tab
      • getFileName

        protected java.lang.String getFileName​(int _index)
        Get the file name for the supplied index
        Parameters:
        _index - The tabbed pane index
        Returns:
        The file name for the referenced tab
      • actionPerformed

        public final void actionPerformed​(java.awt.event.ActionEvent _event)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener