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

Source

virtual Uri[] children()

Return child resources. Used by ResourceTree. The returned strings should be resolvable by Reflux.

Defaults to empty list.

compare

Source

virtual override Int compare(Obj that)

Returns a comparison of the resource URIs (minus any frags).

displayName

Source

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

Source

virtual override Bool equals(Obj? that)

Compares the resource URIs (minus any frags).

hasChildren

Source

virtual Bool hasChildren()

If generating child resources is in-efficient, override this method for optimisation.

Defaults to children.size > 0.

hash

Source

virtual override Int hash()

Returns a hash of the resource URI (minus any frag).

icon

Source

virtual Image? icon()

An (optional) icon that represents this resource.

name

Source

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

Source

virtual Uri? parent()

Return the parent resource. Root resources should return null. The returned string should be resolvable by Reflux.

Used by ResourceTree.

Defaults to null.

populatePopup

Source

virtual Menu populatePopup(Menu menu)

By populating an existing menu, it allows Panels to create the initial menu.

resolveChild

Source

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. If null is returned, the child is resolved through Reflux. Overriding this method is an optional optimisation hook.

resolveParent

Source

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. If null is returned, the parent is resolved through Reflux. Overriding this method is an optional optimisation hook.

uri

Source

abstract Uri uri()

The URI that equates to this resource.

viewTypes

Source

virtual Type[] viewTypes()

The Views that may display this resource.

Defaults to empty list.