abstract classafReflux::View
sys::Obj afReflux::Panel afReflux::View
@Js
Views are Panels that are associated with an (editable) resource.
For a View to be displayed, a Resource must list it as one of its viewTypes().
Views are automatically added to the EventHub, so to receive events they only need to implement the required event mixin.
- addUndoRedo
Void addUndoRedo(|->Void undo, |->Void redo)Add a pair of Undo / Redo commands.
- confirmClose
virtual Bool confirmClose(Bool force)Callback when the view is being closed. Return
falseif the view should be kept open.Note: If
forceistruethen the view will close regardless of the return value.By default this returns
true.- isDirty
Bool isDirtyReturns
trueif the resource has unsaved change.Viewsare responsible for setting this themselves.- load
virtual Void load(Resource resource)Callback when the View should load the given resource.
By default this sets the resource, name and icon.
- make
new make(|This in)Subclasses should define the following ctor:
new make(|This| in) : super(in) { ... }- onDrop
virtual Bool onDrop(File[] droppedFiles)Callback to handle dropped files. Return
trueto specify the drop event has been handled.- redo
Void redo()Redoes the last command.
- refresh
virtual override Void refresh(Resource? resource := null)Callback for when the panel should refresh it's contents.
By default this calls
load().- resource
Resource? resourceThe resource associated with this view. Set via
load().- reuseView
virtual Bool reuseView(Resource resource)Return
trueif the View should re-used for the given resource.By default this returns
false.- save
virtual Void save()Callback when the View should save its resource. Only called when
isDirtyistrue.By default this just clears the dirty flag.
- undo
Void undo()Undoes the last command.