mixinafReflux::Resource
afReflux::Resource
@
Js
Resources are navigatable objects that may be represented by an URI. For example, the Explorer application has a FileResource
and a HttpResource
.
- children
virtual Uri[] children()
Return child resources. Used by
ResourceTree
. The returned strings should be resolvable byReflux
.Defaults to empty list.
- compare
virtual override Int compare(Obj that)
Returns a comparison of the resource URIs (minus any frags).
- displayName
virtual Str displayName()
A display name for the resource. File resources may show their OS specific variant rather than Fantom's canonical URI form.
The display name is displayed in the address bar.
Defaults to
uri.toStr
.- equals
virtual override Bool equals(Obj? that)
Compares the resource URIs (minus any frags).
- hasChildren
virtual Bool hasChildren()
If generating child resources is in-efficient, override this method for optimisation.
Defaults to
children.size > 0
.- hash
virtual override Int hash()
Returns a hash of the resource URI (minus any frag).
- icon
virtual Image? icon()
An (optional) icon that represents this resource.
- name
abstract Str name()
A short human readable name for this resource - does not need to be unique.
name
is typically displayed in tabs and tables.- parent
virtual Uri? parent()
Return the parent resource. Root resources should return
null
. The returned string should be resolvable byReflux
.Used by
ResourceTree
.Defaults to
null
.- populatePopup
virtual Menu populatePopup(Menu menu)
By populating an existing menu, it allows Panels to create the initial menu.
- resolveChild
virtual Resource? resolveChild(Uri childUri)
Override to manually resolve children. Do this if you have cached values for the children, or want to override with a
once
method. Ifnull
is returned, the child is resolved through Reflux. Overriding this method is an optional optimisation hook.- resolveParent
virtual Resource? resolveParent()
Override to manually resolve the parent. Do this if you have a cached value, or want to override with a
once
method. Ifnull
is returned, the parent is resolved through Reflux. Overriding this method is an optional optimisation hook.- uri
abstract Uri uri()
The URI that equates to this resource.
- viewTypes
virtual Type[] viewTypes()
The Views that may display this resource.
Defaults to empty list.