class OutputDock : SimpleComponent() { override meth register() { if (settings().enableOutputDock && findDock("Output") == null) { OutputDockBehaviour().dockBehaviour( Side.BOTTOM, false ) } } } class OutputDockBehaviour : TextBehaviour( "Output" ) { val clear = Action( "Clear", this:>clear2 ) .icon("clean") val scrollWith = boolProperty( "Scroll with output", true ) .icon( "scroll_with" ) val streamer = PrintToTextBehaviour(this) init { iconName = "output" showLineNumbers = false disableHistory() scrollWith.listen( this:>changedScrollWith ) } meth changedScrollWith() { streamer.scrollWithOutput = scrollWith.value } // Feature Bug. Function types cannot access methods in super class. meth clear2() { clear() } override meth toolbar() = listOf( spacer, spacer, scrollWith, clear ) override meth attached( container : Container ) { super.attached(container) streamer.captureOut() streamer.captureErr() } override meth detached() { super.detached() streamer.restoreOut() streamer.restoreErr() } }