public class CloseFileAction extends AbstractSaveUnsavedChangesAction
DefaultSDIApplication
automatically 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 ApplicationModel
in method
ApplicationModel.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
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ID |
ENABLED_PROPERTY, VIEW_PROPERTY
Constructor and Description |
---|
CloseFileAction(Application app,
View view)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doIt(View view) |
actionPerformed, getChooser, saveView, saveViewToURI
getActiveView, getApplication, getPropertyName, installViewListeners, isEnabled, setEnabled, setPropertyName, uninstallViewListeners, updateEnabled, updateView, updateView
public static final java.lang.String ID
public CloseFileAction(Application app, View view)
protected void doIt(View view)
doIt
in class AbstractSaveUnsavedChangesAction