Class CmsComponentField<T extends com.vaadin.ui.Component>

  • Type Parameters:
    T - the tpye of the wrapped component

    public class CmsComponentField<T extends com.vaadin.ui.Component>
    extends java.lang.Object
    Container wrapping a single UI component.

    This seemingly useless class is used as a typesafe way to add component-valued fields to component classes which use the Vaadin declarative UI mechanism when you don't want them to be bound automatically to something in the declarative UI HTML file. We could just use arrays of size 1 instead, but using a custom class is probably easier to understand.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get()
      Gets the wrapped component.
      static <U extends com.vaadin.ui.Component>
      Convenience method for creating a new instance.
      void set​(T value)
      Sets the wrapped component.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • newInstance

        public static <U extends com.vaadin.ui.Component> CmsComponentField<U> newInstance()
        Convenience method for creating a new instance.

        the new instance
      • get

        public T get()
        Gets the wrapped component.

        the wrapped component
      • set

        public void set​(T value)
        Sets the wrapped component.

        value - the wrapped component