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

java.lang.Object
org.opencms.ui.util.CmsComponentField<T>
Type Parameters:
T - the tpye of the wrapped component

public class CmsComponentField<T extends com.vaadin.ui.Component> extends 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.

  • Constructor Details

  • Method Details

    • newInstance

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

      Returns:
      the new instance
    • get

      public T get()
      Gets the wrapped component.

      Returns:
      the wrapped component
    • set

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

      Parameters:
      value - the wrapped component