Module org.jhotdraw8.application
Package org.jhotdraw8.application.action
Class AbstractActivityAction<A extends Activity>
java.lang.Object
org.jhotdraw8.application.AbstractDisableable
org.jhotdraw8.application.action.AbstractAction
org.jhotdraw8.application.action.AbstractApplicationAction
org.jhotdraw8.application.action.AbstractActivityAction<A>
- Type Parameters:
A- the activity type
- All Implemented Interfaces:
EventListener,javafx.event.EventHandler<javafx.event.ActionEvent>,Action,PropertyBean,Disableable
- Direct Known Subclasses:
AbstractFindAction,AbstractSaveFileAction,AbstractSaveUnsavedChangesAction,BrowseFileDirectoryAction,PrintFileAction,RedoAction,RevertFileAction,ToggleBooleanAction,ToggleViewPropertyAction,UndoAction
This abstract class can be extended to implement an
Action that acts
on the active Activity, or on a specific Activity.
If the active view or the specified view is disabled, the AbstractViewControllerAction is disabled as well.
- Author:
- Werner Randelshofer
-
Property Summary
Properties inherited from class org.jhotdraw8.application.action.AbstractAction
selectedProperties inherited from class org.jhotdraw8.application.AbstractDisableable
disabledProperties inherited from interface org.jhotdraw8.fxbase.control.Disableable
disabled -
Field Summary
Fields inherited from class org.jhotdraw8.application.action.AbstractApplicationAction
appFields inherited from class org.jhotdraw8.application.action.AbstractAction
propertiesFields inherited from class org.jhotdraw8.application.AbstractDisableable
disabled, disablersFields inherited from interface org.jhotdraw8.application.action.Action
ACCELERATOR_KEY, ID_KEY, LABEL, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, SELECTED_PROPERTY, SHORT_DESCRIPTION, SMALL_ICONFields inherited from interface org.jhotdraw8.fxbase.control.Disableable
DISABLED_PROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractActivityAction(@NonNull A activity) Creates a new instance which acts on the specified activity of the application. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidonActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull A activity) This method is invoked when the action is not disabled and the event is not consumed.protected final voidonActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull Application app) This method is invoked when the action is not disabled and the event is not consumed.Methods inherited from class org.jhotdraw8.application.action.AbstractApplicationAction
createAlert, createErrorMessage, getApplication, onActionPerformedMethods inherited from class org.jhotdraw8.application.action.AbstractAction
getProperties, handle, selectedPropertyMethods inherited from class org.jhotdraw8.application.AbstractDisableable
disabledProperty, disablersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.application.action.Action
getId, getLabel, isSelected, setSelectedMethods inherited from interface org.jhotdraw8.fxbase.control.Disableable
addDisabler, disabledProperty, disablers, isDisabled, removeDisablerMethods inherited from interface org.jhotdraw8.fxbase.beans.PropertyBean
get, getNonNull, getProperty, put, remove, set, setNonNull, valueAt
-
Constructor Details
-
AbstractActivityAction
Creates a new instance which acts on the specified activity of the application.- Parameters:
activity- The activity. If activity is null then the action acts on the active activity of the application. Otherwise, it will act on the specified activity.
-
-
Method Details
-
getActivity
-
onActionPerformed
protected final void onActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull Application app) Description copied from class:AbstractApplicationActionThis method is invoked when the action is not disabled and the event is not consumed.- Specified by:
onActionPerformedin classAbstractApplicationAction- Parameters:
event- the action eventapp- the applicatoin
-
onActionPerformed
protected abstract void onActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull A activity) This method is invoked when the action is not disabled and the event is not consumed.- Parameters:
event- the action eventactivity- the activity
-