Fantom

 

abstract class flux::Resource

sys::Obj
  flux::Resource

Source

Resource represents the objects a user navigates, views, and edits in a flux application. Resources are mapped to objects via the indexed prop flux.resource.{target}={resource}, where both "target" and "resource" are qualied type names. Subclasses must define a make(Uri, Obj) constructor.

See pod doc for details.

children

virtual Resource[]? children()

Source

Get the navigation children of the resource. Return an empty list or null to indicate no children. Default returns null.

hasChildren

virtual Bool hasChildren()

Source

Return if this resource has or might have children. This is an optimization to display the expansion control in a tree without loading all the children. The default calls children.

icon

virtual Image icon()

Source

Get a 16x16 icon for the resource.

name

abstract Str name()

Source

Get the display name of the resource.

virtual Menu? popup(Frame? frame, Event? event)

Source

Make a popup menu for this resource or return null. The default popup menu returns the viewsMenu.

resolve

const static Resource resolve(Uri uri)

Source

Resolve a uri into a resource:

  1. Resolve uri to obj via Uri.get
  2. If obj is Resource, return it
  3. Resolve to obj type to resource type via flux.resource.{qname}
    indexed property for type hierarchy

Throw UnresolvedErr if the uri can't be resolved, and UnsupportedErr if resource can't be mapped to a resource.

roots

const static Resource[] roots()

Source

Get the root resources.

toStr

virtual override Str toStr()

Source

Return uri.

uri

abstract Uri uri()

Source

Get the absolute Uri of this resource.

views

virtual Type[] views()

Source

Get the list of available View types for the resource. The first view should be the default view. The default implementation searches the type database index props formatted as "flux.view.{target}={view}", where "target" is this type (and its inherited classes, and "view" is view type qname.

viewsMenu

virtual Menu? viewsMenu(Frame? frame, Event? event)

Source

Return a menu to hyperlink to the views supported by this resource.