Class TvmRemovableComposite<W extends org.teavm.jso.dom.html.HTMLElement,​C extends UiWidget>

    • Constructor Detail

      • TvmRemovableComposite

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

      • getCompositeElement

        protected org.teavm.jso.dom.html.HTMLElement getCompositeElement()
        Returns:
        the HTMLElement that actually contains the children.
      • removeChild

        public boolean removeChild​(C child)
        Description copied from interface: UiRemovableComposite
        This method removes the given child from this panel.
        Specified by:
        removeChild in interface UiRemovableComposite<W extends org.teavm.jso.dom.html.HTMLElement>
        Parameters:
        child - is the UiWidget to remove from this panel.
        Returns:
        true if the given child has been removed successfully, false otherwise (no such child exists).
        See Also:
        List.remove(Object)
      • removeChild

        public C removeChild​(int index)
        Description copied from interface: UiRemovableComposite
        This method removes the child at the given index from this panel.
        Specified by:
        removeChild in interface UiRemovableComposite<W extends org.teavm.jso.dom.html.HTMLElement>
        Parameters:
        index - is the index of the child to remove. It has to be in the range from 0 to UiComposite.getChildCount() - 1.
        Returns:
        the removed child that has previously been at the given index.
        See Also:
        List.remove(int)
      • addChild

        protected void addChild​(C child,
                                int index)
        Parameters:
        child - the child to add.
        index - the index where to insert the child.
      • addChildWidget

        protected void addChildWidget​(C child,
                                      int index)
        Parameters:
        child - the widget to add as child to the DOM.
        index - the index where to insert the child.
        See Also:
        TvmMutableComposite.addChild(UiWidget, int)
      • getChildIndexOffset

        protected int getChildIndexOffset()
        Returns:
        the offset for the child index in the composite element. Can be overridden to return the number of internal child elements.
      • setEnabledNative

        protected void setEnabledNative​(boolean enabled)
        Overrides:
        setEnabledNative in class TvmWidget<W extends org.teavm.jso.dom.html.HTMLElement>
        Parameters:
        enabled - the new enabled state. Use true to enable and false to disable this widget.