de.michab.mack.actions
Class ActExitApplication

java.lang.Object
  extended byjavax.swing.AbstractAction
      extended byde.michab.mack.ConfigurableAction
          extended byde.michab.mack.actions.ActExitApplication
All Implemented Interfaces:
javax.swing.Action, java.awt.event.ActionListener, java.lang.Cloneable, java.util.EventListener, java.io.Serializable, java.awt.event.WindowListener

public final class ActExitApplication
extends ConfigurableAction
implements java.awt.event.WindowListener

The application exit action. Linked to an application's main window via the offered window listener interface.

The action reads the key ACT_APP_EXIT.really.leave from the resource bundle. If this is set to a non-empty string value, then this is shown in a confirmation dialog, ensuring that the user really wants to leave the app. If this is empty or the key doesn't exist the application is terminated without confirmation.

Author:
Michael Binz
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, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
ActExitApplication()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Asks the user if he really wants to leave the application and terminates in case of a positive answer.
 void configureFrom(java.util.ResourceBundle r)
          Performs local localisation.
 void windowActivated(java.awt.event.WindowEvent we)
          Empty implementation.
 void windowClosed(java.awt.event.WindowEvent we)
          Shuts down the application, never returns.
 void windowClosing(java.awt.event.WindowEvent we)
          First step in application shutdown.
 void windowDeactivated(java.awt.event.WindowEvent we)
          Empty implementation.
 void windowDeiconified(java.awt.event.WindowEvent we)
          Empty implementation.
 void windowIconified(java.awt.event.WindowEvent we)
          Empty implementation.
 void windowOpened(java.awt.event.WindowEvent we)
          Initialises the internal application frame reference.
 
Methods inherited from class de.michab.mack.ConfigurableAction
getDialogRoot, getKey, getToolbarComponent, localize, localize, localizeIcon
 
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

ActExitApplication

public ActExitApplication()
Method Detail

configureFrom

public void configureFrom(java.util.ResourceBundle r)
Performs local localisation.

Overrides:
configureFrom in class ConfigurableAction
Parameters:
r - The resource bundle to use for localisation.

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Asks the user if he really wants to leave the application and terminates in case of a positive answer.

Specified by:
actionPerformed in interface java.awt.event.ActionListener
Parameters:
e - The action event.
See Also:
ActionListener.actionPerformed(ActionEvent)

windowClosed

public void windowClosed(java.awt.event.WindowEvent we)
Shuts down the application, never returns. Was cool to meet it. After this method the shutdown handlers execute.

Specified by:
windowClosed in interface java.awt.event.WindowListener
Parameters:
we - The window event.
See Also:
windowClosing(WindowEvent)

windowClosing

public void windowClosing(java.awt.event.WindowEvent we)

First step in application shutdown. Somebody tried to close the main frame. Method decides whether the application should be shut down and disposes() the frame, which results in a call to windowClosed().

Note that the action will switch the defaultCloseOperation property of its frame to DO_NOTHING_ON_CLOSE.

Specified by:
windowClosing in interface java.awt.event.WindowListener
Parameters:
we - The window event.
See Also:
windowClosed(WindowEvent)

windowOpened

public void windowOpened(java.awt.event.WindowEvent we)
Initialises the internal application frame reference.

Specified by:
windowOpened in interface java.awt.event.WindowListener
Parameters:
we - The window event.

windowActivated

public void windowActivated(java.awt.event.WindowEvent we)
Empty implementation.

Specified by:
windowActivated in interface java.awt.event.WindowListener
Parameters:
we - The window event.

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent we)
Empty implementation.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener
Parameters:
we - The window event.

windowIconified

public void windowIconified(java.awt.event.WindowEvent we)
Empty implementation.

Specified by:
windowIconified in interface java.awt.event.WindowListener
Parameters:
we - The window event.

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent we)
Empty implementation.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener
Parameters:
we - The window event.