Module org.jhotdraw8.application
Class OpenRecentFileAction
java.lang.Object
org.jhotdraw8.application.AbstractDisableable
org.jhotdraw8.application.action.AbstractAction
org.jhotdraw8.application.action.AbstractApplicationAction
org.jhotdraw8.application.action.file.OpenRecentFileAction
- All Implemented Interfaces:
EventListener,javafx.event.EventHandler<javafx.event.ActionEvent>,Action,PropertyBean,Disableable
Loads the specified URI into an empty view. If no empty view is available, a
new view is created.
Features
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.
-
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
FieldsFields 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
ConstructorsConstructorDescriptionOpenRecentFileAction(Application app, @NonNull URI uri, javafx.scene.input.DataFormat format) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoiddoIt(@NonNull FileBasedActivity view, boolean disposeView) protected voidonActionPerformed(@NonNull javafx.event.ActionEvent evt, @NonNull Application app) This method is invoked when the action is not disabled and the event is not consumed.protected voidopenViewFromURI(@NonNull FileBasedActivity v, @NonNull URI uri, javafx.scene.input.DataFormat format) 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
-
Field Details
-
ID
- See Also:
-
-
Constructor Details
-
OpenRecentFileAction
public OpenRecentFileAction(Application app, @NonNull URI uri, javafx.scene.input.DataFormat format) Creates a new instance.- Parameters:
app- the applicationuri- the uriformat- the data format that should be used to access the URI
-
-
Method Details
-
onActionPerformed
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:
evt- the action eventapp- the applicatoin
-
doIt
-
openViewFromURI
protected void openViewFromURI(@NonNull FileBasedActivity v, @NonNull URI uri, javafx.scene.input.DataFormat format)
-