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
false
if the view should be kept open.Note: If
force
istrue
then the view will close regardless of the return value.By default this returns
true
.- isDirty
Bool isDirty
Returns
true
if the resource has unsaved change.Views
are 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
true
to 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? resource
The resource associated with this view. Set via
load()
.- reuseView
virtual Bool reuseView(Resource resource)
Return
true
if 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
isDirty
istrue
.By default this just clears the dirty flag.
- undo
Void undo()
Undoes the last command.