Class FloatingType

java.lang.Object
com.jbstrap.ui.bootstrap.FloatingType
All Implemented Interfaces:
StyleElement

public final class FloatingType extends Object implements StyleElement
These utility classes float an element to the left or right, or disable floating, based on the current viewport size using the CSS float property. !important is included to avoid specificity issues. These use the same viewport breakpoints as our grid system. Please be aware float utilities have no effect on flex items.
Since:
4.0
Author:
JBStrap
  • Method Details

    • FLOAT_NONE

      public static FloatingType FLOAT_NONE()
      Disables component flolating for all screen sizes.
      Returns:
      The new instance of the floating type
    • FLOAT_LEFT

      public static FloatingType FLOAT_LEFT()
      Aligns the component to the left for all screen sizes.
      Returns:
      The new instance of the floating type
    • FLOAT_RIGHT

      public static FloatingType FLOAT_RIGHT()
      Aligns the component to the right for all screen sizes.
      Returns:
      The new instance of the floating type
    • FLOAT_NONE

      public static FloatingType FLOAT_NONE(ScreenSize screenSize)
      Disables component floating for the specified and bigger screen sizes.
      Parameters:
      screenSize - Screen size Available screen sizes are listed in the ScreenSize enum.
      Returns:
      The new instance of the floating type
    • FLOAT_LEFT

      public static FloatingType FLOAT_LEFT(ScreenSize screenSize)
      Aligns the component to the left for the specified or bigger screen sizes.
      Parameters:
      screenSize - Screen size Available screen sizes are listed in the ScreenSize enum.
      Returns:
      The new instance of the floating type
    • FLOAT_RIGHT

      public static FloatingType FLOAT_RIGHT(ScreenSize screenSize)
      Aligns the component to the right for the specified or bigger screen sizes.
      Parameters:
      screenSize - Screen size Available screen sizes are listed in the ScreenSize enum.
      Returns:
      The new instance of the floating type
    • apply

      public void apply(Component<?> component)
      Specified by:
      apply in interface StyleElement
      Parameters:
      component - The component
    • remove

      public void remove(Component<?> component)
      Specified by:
      remove in interface StyleElement
      Parameters:
      component - The component
    • getStyleClassName

      public String getStyleClassName()
      Specified by:
      getStyleClassName in interface StyleElement
      Returns:
      The style class name or null if is not style class for the style settings
    • removeAllFLoatSettings

      public static void removeAllFLoatSettings(Component<?> component)
      Removes all alignment settings from the specified component.
      Parameters:
      component - Component instance