public abstract class AbstractSaveUnsavedChangesAction extends AbstractViewAction
Action that asks
to save unsaved changes of a View before a destructive
action is performed.
If the view has no unsaved changes, method doIt is invoked immediately.
If unsaved changes are present, a dialog is shown asking whether the user
wants to discard the changes, cancel or save the changes before doing it.
If the user chooses to discard the changes, doIt is invoked immediately.
If the user chooses to cancel, the action is aborted.
If the user chooses to save the changes, the view is saved, and doIt
is only invoked after the view was successfully saved.
ENABLED_PROPERTY, VIEW_PROPERTY| Constructor and Description |
|---|
AbstractSaveUnsavedChangesAction(Application app,
View view)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt) |
protected abstract void |
doIt(View p) |
protected URIChooser |
getChooser(View view) |
protected void |
saveView(View v) |
protected void |
saveViewToURI(View v,
java.net.URI uri,
URIChooser chooser) |
getActiveView, getApplication, getPropertyName, installViewListeners, isEnabled, setEnabled, setPropertyName, uninstallViewListeners, updateEnabled, updateView, updateViewpublic AbstractSaveUnsavedChangesAction(Application app, View view)
public void actionPerformed(java.awt.event.ActionEvent evt)
protected URIChooser getChooser(View view)
protected void saveView(View v)
protected void saveViewToURI(View v, java.net.URI uri, URIChooser chooser)
protected abstract void doIt(View p)