Package org.patternfly.style
Enum Class Breakpoint
- All Implemented Interfaces:
Serializable
,Comparable<Breakpoint>
,Constable
The
Breakpoint
class 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 enum
with 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)
and verticalBreakpoint(int height)
.
Each instance of the Breakpoint
class 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Breakpoint
breakpoint
(int width) Determines the breakpoint for a given width value.static Breakpoint
Returns the enum constant of this class with the specified name.static Breakpoint[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.static Breakpoint
verticalBreakpoint
(int height) Determines the breakpoint based on the given height value.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
default_
-
sm
-
md
-
lg
-
xl
-
_2xl
-
-
Field Details
-
value
-
widthValue
public final int widthValue -
widthCss
-
heightValue
public final int heightValue -
heightCss
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
breakpoint
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
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.
-