Class DialogAction

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

    public abstract class DialogAction
    extends LocalizedAction
    Abstract action for displaying a dialog. The abstract methods are executed as follows:
    See Also:
    Serialized Form
    • 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 
      Modifier Constructor Description
      protected DialogAction​(java.util.ResourceBundle bundle, java.lang.String resourcePrefix)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void actionPerformed​(java.awt.event.ActionEvent event)  
      protected abstract boolean displayDialog​(javax.swing.JComponent owner)
      Called from the Swing event thread.
      protected boolean handleLoadException​(java.lang.Throwable th)  
      protected boolean handleSaveException​(java.lang.Throwable th)  
      protected abstract void loadDialogData()
      Load data to populate the dialog (called from a background thread).
      protected abstract void saveDialogData()
      Save changes (called from a background thread).
      protected abstract void setSaveResultOnUI()
      Update the UI (called from the Swing event thread).
      • 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
    • Constructor Detail

      • DialogAction

        protected DialogAction​(java.util.ResourceBundle bundle,
                               java.lang.String resourcePrefix)
    • Method Detail

      • actionPerformed

        public final void actionPerformed​(java.awt.event.ActionEvent event)
      • handleLoadException

        protected boolean handleLoadException​(java.lang.Throwable th)
      • handleSaveException

        protected boolean handleSaveException​(java.lang.Throwable th)
      • loadDialogData

        protected abstract void loadDialogData()
        Load data to populate the dialog (called from a background thread).
      • displayDialog

        protected abstract boolean displayDialog​(javax.swing.JComponent owner)
        Called from the Swing event thread.
        Parameters:
        owner - the component that invoked the action
        Returns:
        true to save changes (i.e. call saveDialogData() and setSaveResultOnUI())
      • saveDialogData

        protected abstract void saveDialogData()
        Save changes (called from a background thread).
      • setSaveResultOnUI

        protected abstract void setSaveResultOnUI()
        Update the UI (called from the Swing event thread).