TreeBehaviour

abstract class TreeBehaviour(title: String, contexts: Context) : Behaviour

Constructors

Link copied to clipboard
constructor(title: String, vararg contexts: Context)

Properties

Link copied to clipboard
Link copied to clipboard

Set in attached and reset to null in detached.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
internal override var view: TreeBehaviourView?

Set in attached and reset to null in detached.

Functions

Link copied to clipboard
open override fun attached(container: Container)

Sets container and view. Both are set back to null in detached.

Link copied to clipboard
open fun contains(context: Context): Boolean

Does this Behaviour contain the given context?

Link copied to clipboard
open override fun detached()

Sets container and view to null. This is the opposite to attached.

Link copied to clipboard
open fun display(context: Context)

A request to display the given context.

Link copied to clipboard
open fun focus()

Focus on the "important" part. The default behaviour calls focusArea with an area of 0, which sets the input focus to the behaviour's main content.

Link copied to clipboard
open fun focusArea(area: Int)

Forwards the message to BehaviourView.focusArea.

Link copied to clipboard
fun message(message: String)
Link copied to clipboard
open fun openContext(contexts: List<Context>, alternate: Boolean): Boolean

When an item is a grid/table/tree is double-clicked, middle-clicked or ENTER is pressed, this method give this Behaviour an option to perform an action, instead of using the default behaviour. If you DO open the item yourself, return true.

Link copied to clipboard

Additional features which can be activated via a shortcut. You do NOT need to include features which also appear in toolbar or statusBar, because these shortcuts are added automatically.

Link copied to clipboard
open fun statusBar(): List<Feature>

Similar to toolbar, but adds features to the local status-bar (not the MAIN status bar at the very bottom of the scene).

Link copied to clipboard
fun timedMessage(message: String, milliseconds: Double)
Link copied to clipboard
open fun toolbar(): List<Feature>

Return Features which should appear in the behaviour's toolbar. NOTE, This is NOT the main toolbar (below the MenuBar at the top of the scene), it is local to the current tab.

Link copied to clipboard
fun watchFile(file: File)

To make use of this, your Behaviour must implement FileWatcher When this behaviour is attached, whenever a file in this list is modified, then FileWatcher.modified is called.

Link copied to clipboard
fun watchFolder(folder: File)

To make use of this, your Behaviour must implement FolderWatcher When this behaviour is attached, whenever a file is created/deleted in any of the folders listed, then FolderWatcher.deleted or FolderWatcher.created is called.