Klasse UiStyle

java.lang.Object
de.esoco.process.ui.UiElement<UiStyle>
de.esoco.process.ui.style.UiStyle

public class UiStyle extends UiElement<UiStyle>
Contains properties that define the style of a UiComponent.
  • Konstruktordetails

    • UiStyle

      public UiStyle()
      Creates an empty instance.
    • UiStyle

      public UiStyle(UiStyle style)
      Creates a new instance from an existing style.
      Parameter:
      style - The style to copy the properties from
  • Methodendetails

    • addStyleName

      public static String addStyleName(String styleName, String additionalName)
      Adds an additional style name to an existing style name and returns the corresponding string.
      Parameter:
      styleName - The existing style name (NULL or empty for none)
      additionalName - The style name to add
      Gibt zurück:
      The resulting style name (may be empty but will never be NULL)
    • addStyleName

      public final UiStyle addStyleName(String additionalName)
      Adds a style name to the current style name.
      Parameter:
      additionalName - The style name to add
      Gibt zurück:
      This instance for fluent invocation
    • applyPropertiesTo

      public void applyPropertiesTo(UiComponent<?,?> component)
      Applies the properties of this element to the given component. Will only be invoked if the properties have changed.
      Setzt außer Kraft:
      applyPropertiesTo in Klasse UiElement<UiStyle>
      Parameter:
      component - The target component
    • backgroundColor

      public final UiStyle backgroundColor(de.esoco.lib.property.Color color)
      Sets the background color.
      Parameter:
      color - The HTML color string
      Gibt zurück:
      This instance for fluent invocation
    • border

      public final UiStyle border(String border)
      Sets the component border.
      Parameter:
      border - The HTML border definition string
      Gibt zurück:
      This instance for fluent invocation
    • css

      public final UiStyle css(String propertyName, String value)
      Sets a CSS style property for the parameter. The names of multi-word CSS properties must be given in CamelCase form without hyphens, starting with a lower case letter (e.g. 'font-size' must be set as 'fontSize').

      This method is optimized to ignore NULL values if the property doesn't exist already. Therefore invoking code doesn't need to perform null checks to prevent adding empty CSS values (e.g. from NULL-initialized variables).

      Parameter:
      propertyName - The name of the CSS property
      value - The value of the CSS property or NULL to clear
      Gibt zurück:
      This instance for fluent invocation
    • css

      public final UiStyle css(String propertyName, de.esoco.lib.property.HasCssName value)
      Applies a CSS property.
      Parameter:
      propertyName - The name of the CSS property to apply
      value - The property value to apply or NULL to clear
      Gibt zurück:
      This instance for fluent invocation
    • defaultStyleName

      public final UiStyle defaultStyleName(String styleName)
      Sets the default style name that should always be applied. The style name can consist of multiple words that are separated by spaces.
      Parameter:
      styleName - The new default style name
      Gibt zurück:
      This instance for fluent invocation
    • fontSize

      public final UiStyle fontSize(int size, SizeUnit unit)
      Sets the font size.
      Parameter:
      size - The size value
      unit - The size unit
      Gibt zurück:
      This instance for fluent invocation
    • fontWeight

      public final UiStyle fontWeight(String weight)
      Sets the font weight.
      Parameter:
      weight - The font weight HTML value
      Gibt zurück:
      This instance for fluent invocation
    • foregroundColor

      public UiStyle foregroundColor(de.esoco.lib.property.Color color)
      Sets the foreground color.
      Parameter:
      color - The HTML color string
      Gibt zurück:
      This instance for fluent invocation
    • getStyleName

      public final String getStyleName()
      Returns the style name(s) of a component.
      Gibt zurück:
      The style name (empty string for none)
    • lineHeight

      public final UiStyle lineHeight(int height, SizeUnit unit)
      Sets the height of a text line in the component.
      Parameter:
      height - The height value
      unit - The height unit
      Gibt zurück:
      This instance for fluent invocation
    • margin

      public final UiStyle margin(String margin)
      Sets the component margin.
      Parameter:
      margin - padding The HTML margin definition string
      Gibt zurück:
      This instance for fluent invocation
    • padding

      public final UiStyle padding(String padding)
      Sets the component padding.
      Parameter:
      padding - The HTML padding definition string
      Gibt zurück:
      This instance for fluent invocation
    • styleName

      public final UiStyle styleName(String styleName)
      Sets the style name. The style name can consist of multiple words that are separated by spaces.
      Parameter:
      styleName - The style name
      Gibt zurück:
      This instance for fluent invocation
    • textAlign

      public final UiStyle textAlign(de.esoco.lib.property.Alignment textAlignment)
      Sets the horizontal alignment of text in the component.
      Parameter:
      textAlignment - The horizontal text alignment
      Gibt zurück:
      This instance for fluent invocation