Class AbstractApplicationAction

All Implemented Interfaces:
EventListener, javafx.event.EventHandler<javafx.event.ActionEvent>, Action, PropertyBean, Disableable
Direct Known Subclasses:
AboutAction, AbstractActivityAction, AbstractFocusOwnerAction, AbstractOpenFileAction, AbstractPreferencesAction, AbstractSelectionAction, ClearRecentFilesMenuAction, ExitAction, NewFileAction, OpenRecentFileAction

public abstract class AbstractApplicationAction extends AbstractAction
This abstract class can be extended to implement an Action that acts on an Application.

An AbstractApplicationAction is disabled when it has disablers Disableable or when its application is disabled.

Author:
Werner Randelshofer.
  • Field Details

  • Constructor Details

    • AbstractApplicationAction

      public AbstractApplicationAction(@NonNull Application app)
      Creates a new instance.
      Parameters:
      app - the application
  • Method Details

    • createErrorMessage

      protected @NonNull String createErrorMessage(@Nullable Throwable t)
    • getApplication

      public final @NonNull Application getApplication()
    • onActionPerformed

      protected final void onActionPerformed(@NonNull javafx.event.ActionEvent event)
      Description copied from class: AbstractAction
      This method is invoked when the action is not disabled and the event is not consumed.
      Specified by:
      onActionPerformed in class AbstractAction
      Parameters:
      event - the action event
    • onActionPerformed

      protected abstract void onActionPerformed(@NonNull javafx.event.ActionEvent event, @NonNull Application app)
      This method is invoked when the action is not disabled and the event is not consumed.
      Parameters:
      event - the action event
      app - the applicatoin
    • createAlert

      protected @NonNull javafx.scene.control.Alert createAlert(javafx.scene.control.Alert.AlertType alertType, String message, String headerText)