Module org.jhotdraw8.application
Class AbstractSaveFileAction
java.lang.Object
org.jhotdraw8.application.AbstractDisableable
org.jhotdraw8.application.action.AbstractAction
org.jhotdraw8.application.action.AbstractApplicationAction
org.jhotdraw8.application.action.AbstractActivityAction<FileBasedActivity>
org.jhotdraw8.application.action.file.AbstractSaveFileAction
- All Implemented Interfaces:
EventListener,javafx.event.EventHandler<javafx.event.ActionEvent>,Action,PropertyBean,Disableable
- Direct Known Subclasses:
ExportFileAction,SaveFileAction
Saves the changes in the active view. If the active view has not an URI, an
URIChooser is presented.- 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
FieldsModifier and TypeFieldDescriptionstatic final org.jhotdraw8.fxcollection.typesafekey.Key<Supplier<URIChooser>> static final org.jhotdraw8.fxcollection.typesafekey.Key<URIChooser> 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
ConstructorsConstructorDescriptionAbstractSaveFileAction(FileBasedActivity activity, String id, boolean saveAs) Creates a new instance.AbstractSaveFileAction(FileBasedActivity activity, String id, boolean saveAs, Resources resources) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected @Nullable javafx.scene.control.Dialog<SequencedMap<org.jhotdraw8.fxcollection.typesafekey.Key<?>, Object>> createOptionsDialog(javafx.scene.input.DataFormat format) protected URIChoosergetChooser(FileBasedActivity view) protected voidonActionPerformed(javafx.event.ActionEvent evt, FileBasedActivity activity) This method is invoked when the action is not disabled and the event is not consumed.protected abstract voidonSaveSucceeded(FileBasedActivity v, URI uri, javafx.scene.input.DataFormat format) protected voidsaveFileChooseOptions(FileBasedActivity v, URI uri, javafx.scene.input.DataFormat format, WorkState<Void> workState) protected voidsaveFileChooseUri(FileBasedActivity v, WorkState<Void> workState) protected voidsaveFileToUri(FileBasedActivity view, URI uri, javafx.scene.input.DataFormat format, Map<org.jhotdraw8.fxcollection.typesafekey.Key<?>, Object> options, WorkState<Void> workState) Methods inherited from class org.jhotdraw8.application.action.AbstractActivityAction
getActivity, onActionPerformedMethods 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
-
SAVE_CHOOSER_KEY
-
SAVE_CHOOSER_FACTORY_KEY
public static final org.jhotdraw8.fxcollection.typesafekey.Key<Supplier<URIChooser>> SAVE_CHOOSER_FACTORY_KEY
-
-
Constructor Details
-
AbstractSaveFileAction
Creates a new instance.- Parameters:
activity- the viewid- the idsaveAs- whether to force a file dialog
-
AbstractSaveFileAction
public AbstractSaveFileAction(FileBasedActivity activity, String id, boolean saveAs, Resources resources) Creates a new instance.- Parameters:
activity- the viewid- the idsaveAs- whether to force a file dialogresources- the resources are used for setting labels and icons for the action
-
-
Method Details
-
getChooser
-
onActionPerformed
Description copied from class:AbstractActivityActionThis method is invoked when the action is not disabled and the event is not consumed.- Specified by:
onActionPerformedin classAbstractActivityAction<FileBasedActivity>- Parameters:
evt- the action eventactivity- the activity
-
saveFileChooseUri
-
saveFileChooseOptions
protected void saveFileChooseOptions(FileBasedActivity v, URI uri, javafx.scene.input.DataFormat format, WorkState<Void> workState) -
saveFileToUri
-
createOptionsDialog
protected @Nullable javafx.scene.control.Dialog<SequencedMap<org.jhotdraw8.fxcollection.typesafekey.Key<?>,Object>> createOptionsDialog(javafx.scene.input.DataFormat format) -
onSaveSucceeded
protected abstract void onSaveSucceeded(FileBasedActivity v, URI uri, javafx.scene.input.DataFormat format)
-