Class AbstractActivityAction<A extends Activity>

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

public abstract class AbstractActivityAction<A extends Activity> extends AbstractApplicationAction
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
  • Constructor Details

    • AbstractActivityAction

      public AbstractActivityAction(@NonNull A activity)
      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

      public @NonNull A getActivity()
    • onActionPerformed

      protected final void onActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull Application app)
      Description copied from class: AbstractApplicationAction
      This method is invoked when the action is not disabled and the event is not consumed.
      Specified by:
      onActionPerformed in class AbstractApplicationAction
      Parameters:
      event - the action event
      app - 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 event
      activity - the activity