abstract class flux::View
sys::Obj fwt::Widget fwt::Pane fwt::ContentPane flux::View
View is a plugin designed to view or edit a Resource
.
See pod doc for details.
- buildStatusBar
-
virtual Widget? buildStatusBar()
Build a view specific status bar to merge into the frame. This method is called after
onLoad
, but before mounting. Return null for no status bar. - buildToolBar
-
virtual Widget? buildToolBar()
Build a view specific toolbar to merge into the frame. This method is called after
onLoad
, but before mounting. Return null for no toolbar. SeeFrame.command
if you wish to use predefined commands like cut/copy/paste. - commandStack
-
CommandStack commandStack
Get the command history for undo/redo.
- dirty
-
Bool dirty := false
The dirty state indicates if unsaved changes have been made to the view. Views should set dirty to true on modification. Dirty is automatically cleared
onSave
. - frame
-
Frame? frame { internal set }
Get the top level flux frame associated with this view.
- make
-
new make()
Constructor.
- onActive
-
virtual Void onActive()
Callback when the view is selected as the current tab. This method should be used to enable predefined commands such as find or replace which the view will handle.
- onCommand
-
virtual Void onCommand(Str id, Event? event)
Callback when predefined view managed commands such as find and replace are invoked. Before view managed commands are routed to the view, they must be enabled in the onActive callback. A convenient technique is to route to handler methods via trap:
trap("on${id.capitalize}", [event])
- onGotoMark
-
virtual Void onGotoMark(Mark mark)
Callback when the view should jump to the specified mark. The mark's uri will always be the same as this view's resource. But the mark might also specify a specific line number and column number.
- onInactive
-
virtual Void onInactive()
Callback when the view is deactivated because the user has selected another tab.
- onLoad
-
abstract Void onLoad()
Callback to load the
resource
. At this point the view can accessframe
, but has not been mounted yet. - onMarks
-
virtual Void onMarks(Mark[] marks)
Callback when the frame's list of marks is updated. This callback can be used for the view to highlight mark locations. The list of marks is the same as
Frame.marks
and might contain marks outside of this view's uri. - onSave
-
virtual Void onSave()
Callback to save the view's modification to the
resource
. Save is only called for a dirty view. - onUnload
-
virtual Void onUnload()
Callback when the view is being unloaded.
- reload
-
Void reload()
Reload this view.
- resource
-
Resource? resource { internal set }
Current resource loaded into this view.