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

Source

Void addUndoRedo(|->Void undo, |->Void redo)

Add a pair of Undo / Redo commands.

confirmClose

Source

virtual Bool confirmClose(Bool force)

Callback when the view is being closed. Return false if the view should be kept open.

Note: If force is true then the view will close regardless of the return value.

By default this returns true.

isDirty

Source

Bool isDirty

Returns true if the resource has unsaved change. Views are responsible for setting this themselves.

load

Source

virtual Void load(Resource resource)

Callback when the View should load the given resource.

By default this sets the resource, name and icon.

make

Source

new make(|This in)

Subclasses should define the following ctor:

new make(|This| in) : super(in) { ... }
onDrop

Source

virtual Bool onDrop(File[] droppedFiles)

Callback to handle dropped files. Return true to specify the drop event has been handled.

redo

Source

Void redo()

Redoes the last command.

refresh

Source

virtual override Void refresh(Resource? resource := null)

Callback for when the panel should refresh it's contents.

By default this calls load().

resource

Source

Resource? resource

The resource associated with this view. Set via load().

reuseView

Source

virtual Bool reuseView(Resource resource)

Return true if the View should re-used for the given resource.

By default this returns false.

save

Source

virtual Void save()

Callback when the View should save its resource. Only called when isDirty is true.

By default this just clears the dirty flag.

undo

Source

Void undo()

Undoes the last command.