Class VStyle

java.lang.Object
org.vaadin.firitin.util.VStyle
All Implemented Interfaces:
com.vaadin.flow.dom.Style, Serializable

public class VStyle extends Object implements com.vaadin.flow.dom.Style
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from interface com.vaadin.flow.dom.Style

    com.vaadin.flow.dom.Style.AlignItems, com.vaadin.flow.dom.Style.AlignSelf, com.vaadin.flow.dom.Style.BoxSizing, com.vaadin.flow.dom.Style.Clear, com.vaadin.flow.dom.Style.Display, com.vaadin.flow.dom.Style.FlexBasis, com.vaadin.flow.dom.Style.FlexDirection, com.vaadin.flow.dom.Style.FlexWrap, com.vaadin.flow.dom.Style.FloatCss, com.vaadin.flow.dom.Style.FontWeight, com.vaadin.flow.dom.Style.JustifyContent, com.vaadin.flow.dom.Style.Overflow, com.vaadin.flow.dom.Style.Position, com.vaadin.flow.dom.Style.TextAlign, com.vaadin.flow.dom.Style.Visibility, com.vaadin.flow.dom.Style.WhiteSpace
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    VStyle(com.vaadin.flow.dom.Style wrapped)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(com.vaadin.flow.component.Component component)
    Applies the styles defined in this VStyle to the given component.
    void
    apply(com.vaadin.flow.component.Component component, String cssSelector)
    Applies the styles defined in this VStyle to an element specified by the context component and css selector.
    void
    applyToShadowRoot(com.vaadin.flow.component.Component component, String cssSelector)
    Applies the styles defined in this VStyle to an element specified by the context component and css selector, but specifically to the shadow root of the component.
     
    get(String name)
     
    in.virit.color.Color
     
    in.virit.color.Color
     
     
    boolean
    has(String name)
     
    remove(String name)
     
    set(String name, String value)
     
    setBackgroundColor(in.virit.color.Color color)
     
    setColor(in.virit.color.Color color)
     
    static VStyle
    wrap(com.vaadin.flow.dom.Style original)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.dom.Style

    setAlignItems, setAlignSelf, setBackground, setBackgroundColor, setBorder, setBorderBottom, setBorderLeft, setBorderRadius, setBorderRight, setBorderTop, setBottom, setBoxShadow, setBoxSizing, setClear, setColor, setCursor, setDisplay, setFlexBasis, setFlexBasis, setFlexDirection, setFlexGrow, setFlexShrink, setFlexWrap, setFloat, setFont, setFontSize, setFontWeight, setFontWeight, setFontWeight, setHeight, setJustifyContent, setLeft, setLineHeight, setMargin, setMarginBottom, setMarginInlineEnd, setMarginInlineStart, setMarginLeft, setMarginRight, setMarginTop, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, setOpacity, setOutline, setOverflow, setPadding, setPaddingBottom, setPaddingLeft, setPaddingRight, setPaddingTop, setPosition, setRight, setScale, setTextAlign, setTextDecoration, setTop, setTransform, setTransformOrigin, setTransition, setVisibility, setWhiteSpace, setWidth, setZIndex
  • Constructor Details

    • VStyle

      public VStyle(com.vaadin.flow.dom.Style wrapped)
    • VStyle

      public VStyle()
  • Method Details

    • wrap

      public static VStyle wrap(com.vaadin.flow.dom.Style original)
    • getColor

      public in.virit.color.Color getColor()
    • setColor

      public VStyle setColor(in.virit.color.Color color)
    • getBackgroundColor

      public in.virit.color.Color getBackgroundColor()
    • setBackgroundColor

      public VStyle setBackgroundColor(in.virit.color.Color color)
    • get

      public String get(String name)
      Specified by:
      get in interface com.vaadin.flow.dom.Style
    • set

      public VStyle set(String name, String value)
      Specified by:
      set in interface com.vaadin.flow.dom.Style
    • remove

      public VStyle remove(String name)
      Specified by:
      remove in interface com.vaadin.flow.dom.Style
    • clear

      public VStyle clear()
      Specified by:
      clear in interface com.vaadin.flow.dom.Style
    • has

      public boolean has(String name)
      Specified by:
      has in interface com.vaadin.flow.dom.Style
    • getNames

      public Stream<String> getNames()
      Specified by:
      getNames in interface com.vaadin.flow.dom.Style
    • apply

      public void apply(com.vaadin.flow.component.Component component)
      Applies the styles defined in this VStyle to the given component.
      Parameters:
      component - the component to which the styles will be applied
    • apply

      public void apply(com.vaadin.flow.component.Component component, String cssSelector)
      Applies the styles defined in this VStyle to an element specified by the context component and css selector.

      Note that the styles are applied to the element after it has been rendered using JS. If you happen to use "preserve on refresh" feature of Vaadin, you might need to call this method again after the refresh, as the styles are not preserved automatically.

      Parameters:
      component - the component to which the styles will be applied
      cssSelector - the CSS selector to target the specific element within the component
    • applyToShadowRoot

      public void applyToShadowRoot(com.vaadin.flow.component.Component component, String cssSelector)
      Applies the styles defined in this VStyle to an element specified by the context component and css selector, but specifically to the shadow root of the component.

      Note that the styles are applied to the element after it has been rendered using JS. If you happen to use "preserve on refresh" feature of Vaadin, you might need to call this method again after the refresh, as the styles are not preserved automatically.

      Parameters:
      component - the component to which the styles will be applie
      cssSelector - the CSS selector to target the specific element within the component's shadow root