Klasse UiComponent<T,C extends UiComponent<T,C>>

java.lang.Object
org.obrel.core.RelatedObject
de.esoco.process.param.ParameterWrapper<T,C>
de.esoco.process.ui.UiComponent<T,C>
Alle implementierten Schnittstellen:
org.obrel.core.Relatable
Bekannte direkte Unterklassen:
UiContainer, UiControl, UiIcon, UiImage, UiProgressBar, UiTextComponent, UiWebView

public abstract class UiComponent<T,C extends UiComponent<T,C>> extends ParameterWrapper<T,C>
The base class for all process UI components.
  • Konstruktordetails

    • UiComponent

      protected UiComponent(UiContainer<?> parent, Class<? super T> datatype)
      Creates a new instance for a certain datatype.
      Parameter:
      parent - The parent container
      datatype - The datatype of the component value
    • UiComponent

      protected UiComponent(UiContainer<?> parent, InteractionFragment fragment, org.obrel.core.RelationType<T> paramType)
      Creates a new instance for a certain parameter relation type.
      Parameter:
      parent - The parent container
      fragment - The fragment this component belongs to
      paramType - The parameter relation type
  • Methodendetails

    • cell

      public final UiLayout.Cell cell()
      Returns the UiLayout cell in which this component has been placed. If the parent container has a layout that creates subclasses of the UiLayout.Cell class which provide layout-specific methods the sub-type cells can be queried with cell(Class).
      Gibt zurück:
      The layout cell
    • cell

      public final <C extends UiLayout.Cell> C cell(Class<C> cellType)
      Returns the layout cell in which this component has been placed, cast to a specific sub-type of the UiLayout.Cell class. The application must make sure that the given type is actually used by the parent container's layout or else an exception will occur.
      Parameter:
      cellType - A sub-type of UiLayout.Cell that must match the actual cell type
      Gibt zurück:
      The layout cell, cast to the given type
    • getParent

      public final UiContainer<?> getParent()
      Returns the parent container.
      Gibt zurück:
      The parent
    • getRootView

      public UiRootView getRootView()
      Returns the root view of this component's hierarchy.
      Gibt zurück:
      The root view
    • getView

      public UiView<?> getView()
      Returns the parent view of this component.
      Gibt zurück:
      The parent view
    • height

      public C height(int height, SizeUnit unit)
      Sets the height of this component.
      Parameter:
      height - The height value
      unit - The height unit
      Gibt zurück:
      This instance for concatenation
    • label

      public C label(String label)
      Sets a label for this component. How exactly the label is rendered and where it is placed dependend on the parent container and it's layout.
      Parameter:
      label - The label text or NULL for none
      Gibt zurück:
      This instance for concatenation
    • placeBefore

      public C placeBefore(UiComponent<?,?> beforeComponent)
      Places this component before another component in the same parent container.
      Parameter:
      beforeComponent - The component to place this component before
      Gibt zurück:
      This instance for concatenation
      Löst aus:
      IllegalArgumentException - If the given component is not found in the parent container
    • resid

      public C resid(String resourceId)
      Sets a resource ID for this instance by setting the UI property ContentProperties.RESOURCE_ID.
      Setzt außer Kraft:
      resid in Klasse ParameterWrapper<T,C extends UiComponent<T,C>>
      Parameter:
      resourceId - The resource ID string
      Gibt zurück:
      This instance for concatenation
    • size

      public C size(int width, int height, SizeUnit unit)
      Sets the size of this component.
      Parameter:
      width - The width
      height - The height
      unit - The unit of the size values
      Gibt zurück:
      This instance for concatenation
    • style

      public UiStyle style()
      Returns the style object of this component which provides methods to modify the component's appearance.
      Gibt zurück:
      The component style
    • style

      public UiStyle style(UiStyle style)
      Sets the style of this component to a copy of an existing style definition.
      Parameter:
      style - The style object to apply
      Gibt zurück:
      The component style to allow subsequent modifications
    • styleName

      public C styleName(String styleName)
      Shortcut to set the style name in the style() object.
      Parameter:
      styleName - the new style name
      Gibt zurück:
      This instance
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse org.obrel.core.RelatedObject
    • tooltip

      public C tooltip(String tooltip)
      Sets the tooltip to be displayed for this component.
      Parameter:
      tooltip - The tooltip text or NULL for none
      Gibt zurück:
      This instance
    • visibleOn

      public C visibleOn(de.esoco.lib.property.LayoutVisibility visibilty)
      Sets the visibility in responsive layouts.
      Parameter:
      visibilty - The visibility
      Gibt zurück:
      This instance for concatenation
    • width

      public C width(int width, SizeUnit unit)
      Sets the width of this component.
      Parameter:
      width - The width value
      unit - The width unit
      Gibt zurück:
      This instance for concatenation
    • applyProperties

      protected void applyProperties()
      Will be invoked to apply all properties of this component to the corresponding process parameter before it is rendered.
    • attachTo

      protected void attachTo(UiContainer<?> parent)
      Attaches this component to it's parent container. This will be invoked just after the construction of a component instance.
      Parameter:
      parent - The parent container
    • getComponentStyleName

      protected String getComponentStyleName()
      Returns the style name for this component. By default this is the simple class name of this component. Subclasses should override this if the class name is ambiguous and needs further specification. This is typically the case for non-static inner classes of composites which often have names that start without the 'Ui' prefix.
      Gibt zurück:
      The component style name
    • getImage

      protected UiImageDefinition<?> getImage()
      Returns the image of this component if set.
      Gibt zurück:
      The component image or NULL for none
    • getValueImpl

      protected final T getValueImpl()
      Internal method to return the value of this component's parameter. This is intended to be used by subclasses only which should provide a type-specific public method (like String getText()).
      Gibt zurück:
      The current value
    • icon

      protected C icon(UiIconSupplier iconSupplier)
      Sets an icon for this component. This method is protected to provide the icon handling functionality for all subclasses. Subclasses that support the setting of icon should override this method as public.
      Parameter:
      iconSupplier - The component icon (NULL for none)
      Gibt zurück:
      This instance so that this method can be used for fluent implementations
    • image

      protected C image(UiImageDefinition<?> image)
      Sets an image for this component. This method is protected to provide the image handling functionality for all subclasses. Subclasses that support the setting of images should override this method as public.
      Parameter:
      image - The component image
      Gibt zurück:
      This instance so that this method can be used for fluent implementations
    • setValueImpl

      protected final C setValueImpl(T value)
      Internal method to set the value of this component's parameter. This is intended to be used by subclasses which should provide a type-specific public method (like setText(String)).
      Parameter:
      value - The new value
      Gibt zurück:
      This instance so that this method can be used for fluent implementations
    • update

      protected void update()
      Will be invoked by applyProperties() on each UI update. The default implementation does nothing: