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 constantsDataset- Constants for data-* attribute names used in PatternFly componentsRoles- Constants for ARIA role attribute valuesOuia- Open UI Automation (OUIA) data attribute utilities for testingOuiaSupport- Mixin interface for custom components to participate in OUIA
Component Infrastructure
ComponentContext- Interface for storing and retrieving arbitrary values within a componentObservableValue- A value wrapper that notifies subscribers when changed, enabling reactive patternsHasValue- Interface for components that expose a typed valueHasObservableValue- Interface for components that bind to anObservableValueHasItems- Interface for components that contain a collection of itemsHasIdentifier- Interface for (sub)components with an identifierOrdered- Interface for components that maintain elements in a specific orderAddItemHandler,RemoveItemHandler,UpdateItemHandler- Handlers for item lifecycle eventsAurHandler- Utility for managing add, update, and remove handlers together
Utilities
TupleandTuples- Simple key-value pair typesNumbers- Numeric utility functionsTimeouts- Common timeout constantsValidation- Validation helpers for property ranges and enumsLanguageDirection- 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:
-
ClassDescriptionA functional interface that defines a handler for adding items to components.Provides constants for common ARIA attribute names used across PatternFly components.Provides constants for common HTML attribute names used across PatternFly components.A utility class for managing add, update, and remove event handlers for a component.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.This interface represents a (sub)component that has an identifier.HasItems<E extends elemental2.dom.Element, C extends HasItems<E,C, S>, S extends HasIdentifier<? extends elemental2.dom.HTMLElement, ?>> The HasItems interface represents a component that can contain a collection of items.Interface for components that can bind to anObservableValueand react to value changes.HasValue<T>Interface for components that expose a typed value, such as form controls and inputs.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.Ordered<E extends elemental2.dom.Element, C extends HasItems<E,C, S>, S extends HasIdentifier<? extends elemental2.dom.HTMLElement, ?>> The Ordered interface maintains its elements in a specific order.Support for Open UI Automation.Interface for components that support Open UI Automation.Functional interface for handling the removal of items from a component that contains a collection of items.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 ofTupleinstances with lookup by key or value.A functional interface that defines a handler invoked when an item is updated in a component implementingHasItems.Utility methods for validating property values such as numeric ranges and enum memberships.