Class TvmActiveWidget<W extends org.teavm.jso.dom.html.HTMLElement>

    • Constructor Detail

      • TvmActiveWidget

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

      • onFocusGain

        protected void onFocusGain​(org.teavm.jso.dom.events.Event event)
        Parameters:
        event - the focus Event.
      • onFocusLoss

        protected void onFocusLoss​(org.teavm.jso.dom.events.Event event)
        Parameters:
        event - the blur Event.
      • getAccessKey

        public char getAccessKey()
        Specified by:
        getAccessKey in interface UiActiveWidget
        Returns:
        the access key of this widget. If the access key is pressed together with the [shift] and [alt] keys this widget will be invoked means that it is clicked. If not an action item (button, link, etc.) it will get the focus. Will be UiActiveWidget.ACCESS_KEY_NONE if no access key is defined.
      • isFocused

        public boolean isFocused()
        Specified by:
        isFocused in interface UiWidget
        Returns:
        true if this widget is active and currently has the focus (the cursor is placed in the widget e.g. a text input and it will receive keyboard events), false otherwise.
      • setFocused

        public boolean setFocused()
        Description copied from interface: UiWidget
        This method sets the focus to this widget. In case of a UiComposite it will set the focus to the first child capable of taking the focus.
        NOTE:
        You can only set the focus. To actually remove it, you need to set it in a different widget.
        Specified by:
        setFocused in interface UiWidget
        Returns:
        true if the focus has been set successfully, false otherwise. You can normally ignore the result. It is only relevant for composite widgets such as panels, that delegate the call recursively and may not contain any child that can take the focus.
      • setEnabledNative

        protected abstract 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.