PatternFly Java 0.7.3 API

PatternFly Java

PatternFly Java is a 💯 Java implementation of PatternFly without any JavaScript dependencies (except for charts).

PatternFly Java's Its goal is to provide an easy-to-use, elegant, and efficient API to build complex web applications with PatternFly in Java. PatternFly Java integrates with and builds upon Elemento's builder API. It works with both GWT and J2CL.

API Design

PatternFly Java integrates with and builds upon Elemento's builder API. Static factory methods are used to create the components, and public instance methods add child elements and modify the component.

Static Factory Methods

These methods are used to create a component. They are usually named after the component, are overloaded to accept required and optional arguments, and return an instance of the newly created component:

Button button1 = button("Click me!");
Button button2 = button("PatternFly", "https://www.patternfly.org");

Add Methods

These methods add subcomponents to a main component. They are usually called add<SubComponent>() and return the main component so that the method call can be chained with other methods:

Dropdown dropdown = dropdown()
        .addToggle(menuToggle("Dropdown"))
        .addMenu(menu()
                .addContent(menuContent()
                        .addList(menuList()
                                .addItem(actionMenuItem("item-0", "Action")))));

Builder / Modifier Methods

These methods modify the current component. They return the current component so that the method call can be chained with other methods:

Card card = card()
        .flat()
        .rounded()
        .large();

These methods set ARIA-related attributes in the component. They're usually named aria<Attribute>() and return the component so that the method call can be chained with other methods:

Navigation navigation = navigation(flat)
        .ariaScrollBackLabel("� back")
        .ariaScrollForwardLabel("� forward");

Event Handlers

These methods add event handlers for various events to the component. They are usually named on<Event>(), accept an event handler, and return the component so that the method call can be chained with other methods. PatternFly Java defines some common event handlers that are reused in all components.

Drawer drawer = drawer().id("drw")
        .onToggle((e, c, expanded) -> console.log("Drawer expanded: " + expanded));

Common Interfaces

Common behavior across all components is implemented by base classes and interfaces. All components extend from either BaseComponent or BaseComponentSVG. These base classes implement interfaces from Elemento to manipulate the component element.

In addition, components implement these interfaces to provide a common API:

  • Modifiers The sub-interfaces defined in this 'umbrella' interface are used to toggle one specific flag of a component. For example, card().plain() toggles the plain flag of the card component and is defined in the Modifiers.Plain interface.
  • Closeable Implemented by components that provide some kind of popup that can be closed.
  • ComponentContext, HasIdentifier, and HasItems These interfaces are often implemented by components that have a parent-child relationship.
  • ComponentIcon and ComponentIconAndText These interfaces are implemented by components that provide text resp. an icon and a text.
  • ComponentProgress Implemented by components that provide some kind of progress.
  • Expandable Implemented by components that provide some kind of expandable content.
  • HasValue and HasObservableValue These interfaces are implemented by components that provide a value or an observable value.

Modules

PatternFly Java consists of these Maven modules (a-z):

PatternFly Java Module Dependencies

Module Description
patternfly-java-bom Bill of materials
patternfly-java-codeeditor PatternFly codeeditor
patternfly-java-components PatternFly components
patternfly-java-core Core PatternFly Java classes
patternfly-java-finder PatternFly Java Finder extension
patternfly-java-gwt PatternFly Java for GWT
patternfly-java-icons PatternFly Java icons
patternfly-java-j2cl PatternFly Java for J2CL
patternfly-java-layouts PatternFly Java layouts
Packages
Package
Description
Provides PatternFly chart implementations for building data visualizations in Java.
Provides the PatternFly bullet chart component for comparing a primary measure against qualitative ranges and markers.
Provides the PatternFly donut chart component for displaying proportional data in a ring shape.
Provides the PatternFly pie chart component for displaying proportional data as a circle.
Provides the PatternFly donut utilization and donut threshold chart components for displaying capacity and usage data.
Provides PatternFly component implementations for building web applications in Java.
Provides the PatternFly accordion component for displaying collapsible content panels.
Provides the PatternFly alert component for displaying notification messages to users.
Provides the PatternFly avatar component for displaying user profile images.
Provides the PatternFly backdrop component.
Provides the PatternFly back to top component for scrolling navigation.
Provides the PatternFly badge component for displaying counts and status indicators.
Provides the PatternFly banner component for displaying prominent messages across the top of a page.
Provides the PatternFly brand component for displaying product logos and branding images.
Provides the PatternFly breadcrumb component for hierarchical navigation.
Provides the PatternFly button component for triggering actions and navigation.
Provides the PatternFly card component and its subcomponents for displaying information in a contained, flexible layout.
Provides the PatternFly code block component for displaying blocks of formatted code with optional actions.
Provides the PatternFly content component for rendering styled text elements such as headings, paragraphs, and lists.
Provides the PatternFly divider component for visually separating content with a horizontal or vertical line.
Provides the PatternFly drawer component and its subcomponents for displaying a collapsible panel alongside content.
Provides the PatternFly empty state component and its subcomponents for displaying placeholder content when no data is available.
Provides the PatternFly expandable section component and its subcomponents for toggling the visibility of content.
Provides form components for building structured data entry interfaces.
Provides helper text components for displaying supplementary information alongside form controls.
Provides hint components for displaying contextual banners with supplementary information.
Provides the icon component for rendering styled SVG icons with configurable size and status.
Provides input group components for combining form controls with text, icons, or buttons.
Provides jump links components for navigating within a page using anchor-based scroll navigation.
Provides label and label group components for displaying compact, categorized metadata.
Provides list components for displaying collections of items in various formats.
Provides menu components for building dropdowns, selects, and general-purpose menus.
Provides the PatternFly modal dialog component and its subcomponents.
Provides the PatternFly navigation component and its subcomponents.
Provides the PatternFly notification badge and notification drawer components.
Provides the PatternFly number input component.
Provides the PatternFly page layout component and its subcomponents.
Provides the PatternFly panel component and its subcomponents.
Provides the PatternFly popover component and its subcomponents.
Provides the PatternFly progress component.
Provides the PatternFly progress stepper component and its subcomponents.
Provides the PatternFly skeleton component.
Provides the PatternFly skip to content component.
Provides the PatternFly slider component and its subcomponents.
Provides a spinner component to indicate that an action is in progress.
Provides a switch (toggle) component for binary on/off selections.
Provides table components for displaying structured data in rows and columns.
Provides a tabs component for organizing content into separate views within the same page.
Provides text input group components for search, filter, and text input with utilities.
Provides a timestamp component for displaying dates and times in various formats.
Provides a title component for styled heading elements.
Provides a toggle group component for selecting one or multiple options from a group of buttons.
Provides a toolbar component for organizing actions, filters, and controls in a horizontal layout.
Provides a tooltip component for displaying contextual information on hover or focus.
Provides a tree view component for displaying hierarchical data.
Provides a truncate component for shortening long text with an ellipsis.
Provides a wizard component for guiding users through a multi-step workflow.
 
 
 
Core classes and interfaces for PatternFly Java.
Data provider API for managing items and state in data-driven components.
 
 
Flexible filtering API for objects with support for multiple attributes and operators.
Common event handler interfaces used throughout PatternFly Java components.
Provides classes and interfaces for working with predefined SVG icons in PatternFly Java.
PatternFly layouts provide structure and positioning for content on a page.
Provides the PatternFly bullseye layout for centering content both vertically and horizontally within a container.
Provides the PatternFly flex layout for building custom layouts with full control over spacing, direction, alignment, justification, wrapping, and width.
Provides the PatternFly gallery layout for arranging content in a responsive grid with uniform rows and columns that wrap automatically.
Provides the PatternFly grid layout for placing content on a fixed 12-column grid system.
Provides the PatternFly level layout for distributing content evenly across a horizontal row.
Provides the PatternFly split layout for distributing content horizontally with support for a fill item, wrapping, and spacing control.
Provides the PatternFly stack layout for positioning items vertically, with one or more items filling the available vertical space.
Overlay management for floating UI elements such as tooltips and popovers.
Deprecated JavaScript-based positioning using Popper.js.
Styling utilities including CSS classes, modifiers, breakpoints, and CSS variables.
PatternFly design tokens for Java.