Class OpenRecentFileAction

All Implemented Interfaces:
EventListener, javafx.event.EventHandler<javafx.event.ActionEvent>, Action, PropertyBean, Disableable

public class OpenRecentFileAction extends AbstractApplicationAction
Loads the specified URI into an empty view. If no empty view is available, a new view is created.

This action is called when the user selects an item in the Recent Files submenu of the File menu. The action and the menu item is automatically created by the application, when the ApplicationModel provides a OpenFileAction.


Features

Allow multiple views per URI
When the feature is disabled, OpenRecentFileAction prevents opening an URI which is opened in another view.
See org.jhotdraw8.application for a description of the feature.

Open last URI on launch
OpenRecentFileAction supplies data for this feature by calling Application.getRecentUris().add() when it successfully opened a file. See org.jhotdraw8.application for a description of the feature.

Author:
Werner Randelshofer.
  • Field Details

  • Constructor Details

    • OpenRecentFileAction

      public OpenRecentFileAction(Application app, URI uri, @Nullable javafx.scene.input.DataFormat format)
      Creates a new instance.
      Parameters:
      app - the application
      uri - the uri
      format - the data format that should be used to access the URI
  • Method Details