verinec.validation.gui.menu.actions
Class CloseAction
java.lang.Object
javax.swing.AbstractAction
verinec.validation.gui.menu.actions.CloseAction
- All Implemented Interfaces:
- ActionListener, Serializable, Cloneable, EventListener, Action
public class CloseAction
- extends AbstractAction
Closes actual selected editor.
If needed it asks if the file should be saved.
This class is implemented as a Singleton. Instances can be get using @see #getInstance(ValidationGui)
- Version:
- $Revision: 47 $
- Author:
- Dominik Jungo
- See Also:
- Serialized Form
|
Method Summary |
void |
actionPerformed(ActionEvent arg0)
checks if document was changed, if yes asks if it should be saved or not and then closes it. |
static CloseAction |
getInstance(ValidationGui gui)
returns and instance of this class. the singleton pattern ensures that there is only one instance of it. an instance is created, linked with a static variable and returned if this wasn't done before or the instance created before is just returned. |
instance
private static CloseAction instance
gui
private ValidationGui gui
CloseAction
private CloseAction(String name,
ValidationGui gui)
actionPerformed
public void actionPerformed(ActionEvent arg0)
- checks if document was changed, if yes asks if it should be saved or not and then closes it.
- See Also:
ActionListener.actionPerformed(java.awt.event.ActionEvent)
getInstance
public static CloseAction getInstance(ValidationGui gui)
- returns and instance of this class. the singleton pattern ensures that there is only one instance of it. an instance is created, linked with a static variable and returned if this wasn't done before or the instance created before is just returned.
- Parameters:
gui - the validator gui
- Returns:
- an instance of this class