Package org.patternfly.core


package org.patternfly.core
Core classes and interfaces for PatternFly Java.

This package provides the foundational building blocks used throughout PatternFly Java components and layouts. It includes utilities for ARIA attributes, data attributes, component context management, observable values, and common types.

Key Classes and Interfaces

ARIA and Data Attributes

  • Aria - Constants for ARIA attribute names (aria-label, aria-expanded, etc.)
  • Attributes - Common HTML attribute constants
  • Dataset - Constants for data-* attribute names used in PatternFly components
  • Roles - Constants for ARIA role attribute values
  • Ouia - Open UI Automation (OUIA) data attribute utilities for testing
  • OuiaSupport - Mixin interface for custom components to participate in OUIA

Component Infrastructure

  • ComponentContext - Interface for storing and retrieving arbitrary values within a component
  • ObservableValue - A value wrapper that notifies subscribers when changed, enabling reactive patterns
  • AsyncStatus - Enumeration representing asynchronous operation states

Utilities

  • Tuple and Tuples - Simple key-value pair types
  • Numbers - Numeric utility functions
  • Timeouts - Common timeout constants
  • Validation - Validation helpers for property ranges and enums
  • LanguageDirection - Language direction enumeration (LTR/RTL)
  • Version - Version information for the PatternFly Java library

Integration with Elemento

PatternFly Java builds upon Elemento's builder API, providing a fluent, type-safe approach to creating web components. The ComponentContext interface extends Elemento's TypedBuilder to provide consistent builder patterns across all PatternFly components.

Observable Values

The ObservableValue class enables reactive programming patterns by allowing components to subscribe to value changes. Example usage:

ObservableValue<String> value = ObservableValue.ov("initial");
value.subscribe((current, previous) -> console.log("Value changed: " + current));
value.set("new value"); // Triggers subscriber notification
See Also:
  • Class
    Description
    Provides constants for common ARIA attribute names used across PatternFly components.
    Defines the status of an asynchronous operation.
    Provides constants for common HTML attribute names used across PatternFly components.
    ComponentContext<E extends Element, B extends TypedBuilder<E,B>>
    The ComponentContext interface represents a context for a component, providing methods to store and retrieve arbitrary values associated with keys.
    Provides constants for data-* attribute names used across PatternFly components.
    Represents the text direction (left-to-right or right-to-left) of an element.
    Utility methods for numeric calculations such as percentage computation.
    Inspired by FrontendMasters/obervablish-values.
     
    Support for Open UI Automation.
    OuiaSupport<E extends HTMLElement, B extends TypedBuilder<E,B>>
    Interface for components that support Open UI Automation.
    Provides constants for WAI-ARIA role attribute values used across PatternFly components.
    Provides timeout constants (in milliseconds) used across PatternFly components.
    Tuple<K,V>
    An immutable key-value pair.
    Tuples<K,V>
    An ordered collection of Tuple instances with lookup by key or value.
    Utility methods for validating property values such as numeric ranges and enum memberships.