Package org.patternfly.style
Enum Breakpoint
- java.lang.Object
-
- java.lang.Enum<Breakpoint>
-
- org.patternfly.style.Breakpoint
-
- All Implemented Interfaces:
Serializable,Comparable<Breakpoint>
public enum Breakpoint extends Enum<Breakpoint>
TheBreakpointclass represents different breakpoints for responsive design.Breakpoints are used to define the varying screen widths and heights at which a website or application layout should change.
The class is implemented as an
enumwith a fixed set of predefined breakpoints:default_- The default breakpoint, used when no other breakpoint matches the given width or height.sm- The small breakpoint.md- The medium breakpoint.lg- The large breakpoint.xl- The extra large breakpoint._2xl- The 2x extra large breakpoint.
The class provides utility methods to retrieve the appropriate breakpoint based on a given width or height, using the methods
breakpoint(int width)andverticalBreakpoint(int height).Each instance of the
Breakpointclass has the following information:value- The name or identifier of the breakpoint.widthValue- The width value of the breakpoint in pixels.widthCss- The width value of the breakpoint in CSS units.heightValue- The height value of the breakpoint in pixels.heightCss- The height value of the breakpoint in CSS units.
-
-
Field Summary
Fields Modifier and Type Field Description StringheightCssintheightValueStringvalueStringwidthCssintwidthValue
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Breakpointbreakpoint(int width)Determines the breakpoint for a given width value.static BreakpointvalueOf(String name)Returns the enum constant of this type with the specified name.static Breakpoint[]values()Returns an array containing the constants of this enum type, in the order they are declared.static BreakpointverticalBreakpoint(int height)Determines the breakpoint based on the given height value.
-
-
-
Enum Constant Detail
-
default_
public static final Breakpoint default_
-
sm
public static final Breakpoint sm
-
md
public static final Breakpoint md
-
lg
public static final Breakpoint lg
-
xl
public static final Breakpoint xl
-
_2xl
public static final Breakpoint _2xl
-
-
Method Detail
-
values
public static Breakpoint[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (Breakpoint c : Breakpoint.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Breakpoint valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
breakpoint
public static Breakpoint breakpoint(int width)
Determines the breakpoint for a given width value.- Parameters:
width- the width value- Returns:
- the breakpoint corresponding to the given width value or
default_if no width matches.
-
verticalBreakpoint
public static Breakpoint verticalBreakpoint(int height)
Determines the breakpoint based on the given height value.- Parameters:
height- the height value to determine the breakpoint for- Returns:
- the Breakpoint corresponding to the given height value or
default_if no height matches.
-
-