Class TvmWidget<W extends org.teavm.jso.JSObject>

    • Constructor Detail

      • TvmWidget

        public TvmWidget​(W widget)
        The constructor.
        Parameters:
        widget - the TeaVM widget.
    • Method Detail

      • getTopWidget

        public org.teavm.jso.JSObject getTopWidget()
        Returns:
        the top-level native widget of this wrapper. In many cases this is the same as UiNativeWidgetWrapper.getWidget() but in some cases this may be some kind of internal composite containing the main widget.
      • getWidget

        public W getWidget()
        Returns:
        the underlying native widget wrapped by this UiNativeWidget.
      • setWidget

        protected void setWidget​(W widget)
        Parameters:
        widget - the TeaVM widget to initialize.
      • getElement

        public abstract org.teavm.jso.dom.html.HTMLElement getElement()
        Returns:
        the HTMLElement representing this widget.
      • onClick

        protected void onClick​(org.teavm.jso.dom.events.Event event)
        Parameters:
        event - the click Event.
      • removeAllChildren

        protected static void removeAllChildren​(org.teavm.jso.dom.xml.Node node)
        Parameters:
        node - the Node to remove all children from.
      • getTopNode

        public static org.teavm.jso.dom.xml.Node getTopNode​(UiWidget uiWidget)
        Parameters:
        uiWidget - the UiWidget.
        Returns:
        the containing JavaFx Node.
      • insertFirst

        protected static void insertFirst​(org.teavm.jso.dom.xml.Node parent,
                                          org.teavm.jso.dom.xml.Node child)
        Parameters:
        parent - the parent Node.
        child - the child Node to insert as first child.
      • insertAt

        protected static void insertAt​(org.teavm.jso.dom.xml.Node parent,
                                       org.teavm.jso.dom.xml.Node child,
                                       int index)
        Parameters:
        parent - the parent Node.
        child - the child Node to insert as child at the given index. May be -1 to insert at the end.
        index - the position to insert the child at.
      • newButton

        public static org.teavm.jso.dom.html.HTMLButtonElement newButton()
        Returns:
        a new HTMLButtonElement.
      • newAnchor

        public static org.teavm.jso.dom.html.HTMLAnchorElement newAnchor()
        Returns:
        a new HTMLAnchorElement.
      • newInput

        public static org.teavm.jso.dom.html.HTMLInputElement newInput()
        Returns:
        a new HTMLInputElement.
      • newInput

        public static org.teavm.jso.dom.html.HTMLInputElement newInput​(String type)
        Parameters:
        type - the input type.
        Returns:
        a new HTMLInputElement.
      • newOutput

        public static org.teavm.jso.dom.html.HTMLElement newOutput()
        Returns:
        a new output element.
      • newTextArea

        public static org.teavm.jso.dom.html.HTMLTextAreaElement newTextArea()
        Returns:
        a new HTMLTextAreaElement.
      • newSelect

        public static org.teavm.jso.dom.html.HTMLSelectElement newSelect()
        Returns:
        a new HTMLSelectElement.
      • newForm

        public static org.teavm.jso.dom.html.HTMLFormElement newForm()
        Returns:
        a new HTMLFormElement.
      • newImage

        public static org.teavm.jso.dom.html.HTMLImageElement newImage()
        Returns:
        a new HTMLImageElement.
      • newVideo

        public static org.teavm.jso.dom.html.HTMLVideoElement newVideo()
        Returns:
        a new HTMLVideoElement.
      • newAudio

        public static org.teavm.jso.dom.html.HTMLAudioElement newAudio()
        Returns:
        a new HTMLAudioElement.
      • newCanvas

        public static org.teavm.jso.dom.html.HTMLCanvasElement newCanvas()
        Returns:
        a new HTMLCanvasElement.
      • newFieldSet

        public static org.teavm.jso.dom.html.HTMLElement newFieldSet()
        Returns:
        a new fieldset element.
      • newLegend

        public static org.teavm.jso.dom.html.HTMLElement newLegend()
        Returns:
        a new legend element.
      • newLabel

        public static org.teavm.jso.dom.html.HTMLElement newLabel()
        Returns:
        a new label element.
      • newDiv

        public static org.teavm.jso.dom.html.HTMLElement newDiv()
        Returns:
        a new div element.
      • newNav

        public static org.teavm.jso.dom.html.HTMLElement newNav()
        Returns:
        a new nav(igation) element.
      • newUl

        public static org.teavm.jso.dom.html.HTMLElement newUl()
        Returns:
        a new unordered list element.
      • newLi

        public static org.teavm.jso.dom.html.HTMLElement newLi()
        Returns:
        a new list item element.
      • newSpan

        public static org.teavm.jso.dom.html.HTMLElement newSpan()
        Returns:
        a new span element.
      • newHr

        public static org.teavm.jso.dom.html.HTMLElement newHr()
        Returns:
        a new horizontal ruler.
      • newDatalist

        public static org.teavm.jso.dom.html.HTMLElement newDatalist()
        Returns:
        a new datalist element.
      • newOption

        public static org.teavm.jso.dom.html.HTMLOptionElement newOption​(org.teavm.jso.dom.html.HTMLDocument document)
        Parameters:
        document - the HTMLDocument.
        Returns:
        a new option.
      • newOption

        public static org.teavm.jso.dom.html.HTMLOptionElement newOption​(org.teavm.jso.dom.html.HTMLElement parent,
                                                                         String value)
        Parameters:
        parent - the parent HTMLElement - typically a datalist.
        value - the value of the option.
        Returns:
        a new option.
      • newTable

        public static org.teavm.jso.dom.html.HTMLElement newTable()
        Returns:
        a new table element.
      • newTableHead

        public static org.teavm.jso.dom.html.HTMLElement newTableHead()
        Returns:
        a new table header element.
      • newTableBody

        public static org.teavm.jso.dom.html.HTMLElement newTableBody()
        Returns:
        a new table body element.
      • newTableFoot

        public static org.teavm.jso.dom.html.HTMLElement newTableFoot()
        Returns:
        a new table footer element.
      • newTableRow

        public static org.teavm.jso.dom.html.HTMLElement newTableRow()
        Returns:
        a new table row (tr).
      • newTableDataCell

        public static org.teavm.jso.dom.html.HTMLElement newTableDataCell()
        Returns:
        a new table data cell (td).
      • newTableHeaderCell

        public static org.teavm.jso.dom.html.HTMLElement newTableHeaderCell()
        Returns:
        a new table header cell (th).
      • newHeader

        public static org.teavm.jso.dom.html.HTMLElement newHeader()
        Returns:
        a new header element.
      • newFooter

        public static org.teavm.jso.dom.html.HTMLElement newFooter()
        Returns:
        a new footer element.
      • newSection

        public static org.teavm.jso.dom.html.HTMLElement newSection()
        Returns:
        a new section element.
      • newASide

        public static org.teavm.jso.dom.html.HTMLElement newASide()
        Returns:
        a new aside element.
      • newMain

        public static org.teavm.jso.dom.html.HTMLElement newMain()
        Returns:
        a new main element.
      • newElement

        public static org.teavm.jso.dom.html.HTMLElement newElement​(String tag)
        Parameters:
        tag - the tag name.
        Returns:
        a new div element.
      • newIcon

        public static org.teavm.jso.dom.html.HTMLElement newIcon​(String name)
        Parameters:
        name - the CSS class name of the icon.
        Returns:
        a new HTMLElement.