Fragment

interface Fragment

A Fragment is a reusable container for a Component. This Component can be accessed by root.

A Fragment usually contains view logic that works with the controls that are present in root.

Samples

import org.hexworks.cobalt.events.api.Subscription
import org.hexworks.zircon.api.Components
import org.hexworks.zircon.api.component.Fragment
import org.hexworks.zircon.api.uievent.ComponentEventType
fun main() { 
   //sampleStart 
   class ConfirmButton : Fragment {

    override val root = Components.button()
        .withText("Confirm")
        .build()

    fun onConfirm(fn: () -> Unit): Subscription {
        return root.processComponentEvents(ComponentEventType.ACTIVATED) {
            fn()
        }
    }
} 
   //sampleEnd
}

Functions

equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
toString
Link copied to clipboard
common
open fun toString(): String

Properties

root
Link copied to clipboard
common
abstract val root: Component
The Component this Fragment contains.

Inheritors

ModalFragment
Link copied to clipboard
HorizontalTabBar
Link copied to clipboard
Selector
Link copied to clipboard
Tab
Link copied to clipboard
VerticalTabBar
Link copied to clipboard
ConfirmButton
Link copied to clipboard

Sources

(source)
Link copied to clipboard