public class QuitAction extends CloseAllAction implements QuitApplicationService
App
.app, id, MODIFIERS_TOOLTIP_KEY, NO_MNEMONIC, SELECTED_ICON_KEY, UNSELECTED_ICON_KEY
changeSupport, enabled
PART_ID
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
Constructor and Description |
---|
QuitAction() |
Modifier and Type | Method and Description |
---|---|
protected void |
disposeApplication()
Terminate the
App . |
protected void |
exec()
Second step of
LengthyAction.doIt() . |
boolean |
quitApplication(boolean discardChanges)
Exit the application.
|
void |
setIcon(Icon icon)
Convenience method: equivalent to
putValue(SMALL_ICON, icon) . |
void |
updateEnabled()
This action should enable or disable itself using standard method
setEnabled(boolean).
|
canCloseAll, canDiscardAllChanges, closingAll, init
isSaveAllNeeded, saveAll, savingAll
doIt, finish
actionPerformed, activeEditorChanged, applyPreferences, destroyApp, editingContextChanged, flushPreferences, getAccelerator, getApp, getDialogTitle, getIcon, getId, getLabel, getMnemonic, getMnemonicIndex, getModifiersToolTip, getSelectedIcon, getToolTip, getUnselectedIcon, hasListeners, initApp, isEditingContextSensitive, isSelected, namespacePrefixesChanged, saveStateChanged, setAccelerator, setDisabledIcons, setLabel, setMnemonic, setMnemonicIndex, setModifiersToolTip, setSelected, setSelectedIcon, setToolTip, setUnselectedIcon, undoStateChanged, validityStateChanged, wasCtrlClick, wasRightClick, wasShiftClick
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
protected void exec()
LengthyAction
LengthyAction.doIt()
. Actual execution of the action. A busy
cursor is displayed during this step.exec
in class CloseAllAction
protected void disposeApplication()
App
. After that, the App is no longer usable.
AppList
.
App.dispose()
.
System.exit(0)
when AppList.getAppList(com.xmlmind.xmleditapp.desktop.App)
is null
or empty.
public void updateEnabled()
AppAction
This method is invoked:
updateEnabled
in class CloseAllAction
AppAction.activeEditorChanged()
,
AppAction.editingContextChanged()
public void setIcon(Icon icon)
AppAction
putValue(SMALL_ICON, icon)
.public boolean quitApplication(boolean discardChanges)
QuitApplicationService
quitApplication
in interface QuitApplicationService
discardChanges
- if true
, document changes if any
are discarded without asking the user to confirm.true
if application is about to exit;
false
otherwise