Class ValueLabel<T>

    • Constructor Detail

      • ValueLabel

        public ValueLabel()
      • ValueLabel

        @UiConstructor
        public ValueLabel​(Renderer<? super T> renderer)
        Creates an empty value label.
        Parameters:
        renderer -
      • ValueLabel

        protected ValueLabel​(Element element,
                             Renderer<? super T> renderer)
        This constructor may be used by subclasses to explicitly use an existing element. This element must be either a <span> or a <div> element.
        Parameters:
        element - the element to be used
    • Method Detail

      • wrap

        public static <T> ValueLabel<T> wrap​(Element element,
                                             Renderer<? super T> renderer)
        Creates a ValueLabel widget that wraps an existing <span> element.

        The ValueLabel's value will be null, whether the element being wrapped has content or not. Use wrap(Element, Renderer, Parser) to parse the initial element's content to initialize the ValueLabel's value.

        This element must already be attached to the document. If the element is removed from the document, you must call RootPanel.detachNow(Widget).

        Parameters:
        element - the element to be wrapped
        renderer - the renderer used to render values into the element
      • wrap

        public static <T> ValueLabel<T> wrap​(Element element,
                                             Renderer<? super T> renderer,
                                             Parser<? extends T> parser)
                                      throws java.text.ParseException
        Creates a ValueLabel widget that wraps an existing <span> element.

        The ValueLabel's value will be initialized with the element's content, passed through the parser.

        This element must already be attached to the document. If the element is removed from the document, you must call RootPanel.detachNow(Widget).

        Parameters:
        element - the element to be wrapped
        renderer - the renderer used to render values into the element
        parser - the parser used to initialize the ValueLabel's value from the element's content
        Throws:
        java.text.ParseException