org.jhotdraw.app.action.file
Class CloseFileAction
- java.lang.Object
-
- javax.swing.AbstractAction
-
- org.jhotdraw.app.action.AbstractViewAction
-
- org.jhotdraw.app.action.AbstractSaveUnsavedChangesAction
-
- org.jhotdraw.app.action.file.CloseFileAction
-
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.Action
public class CloseFileAction extends AbstractSaveUnsavedChangesAction
Closes the active view after letting the user save unsaved changes.DefaultSDIApplicationautomatically exits when the user closes the last view.This action is called when the user selects the Close item in the File menu. The menu item is automatically created by the application.
If you want this behavior in your application, you have to create it and put it in your
ApplicationModelin methodApplicationModel.initApplication(org.jhotdraw.app.Application).You should include this action in applications which use at least one of the following actions, so that the user can close views that he/she created:
NewFileAction,NewWindowAction,OpenFileAction,OpenDirectoryAction.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringID-
Fields inherited from class org.jhotdraw.app.action.AbstractViewAction
ENABLED_PROPERTY, VIEW_PROPERTY
-
-
Constructor Summary
Constructors Constructor and Description CloseFileAction(Application app, View view)Creates a new instance.
-
Method Summary
-
Methods inherited from class org.jhotdraw.app.action.AbstractSaveUnsavedChangesAction
actionPerformed
-
Methods inherited from class org.jhotdraw.app.action.AbstractViewAction
getActiveView, getApplication, isEnabled, setEnabled
-
-
-
-
Field Detail
-
ID
public static final java.lang.String ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CloseFileAction
public CloseFileAction(Application app, @Nullable View view)
Creates a new instance.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG