You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+41-6Lines changed: 41 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -111,10 +111,18 @@ In general the API for an component can be classified into these groups:
111
111
112
112
## Static Factory Methods
113
113
114
-
These methods are used to create a component. They are usually named after the component and return an instance of the newly created component:
114
+
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:
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.
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.
136
+
These methods modify the current componemt. They return the current component so that the method call can be chained with other methods.
129
137
138
+
```java
139
+
Card card = card()
140
+
.flat()
141
+
.rounded()
142
+
.large();
143
+
```
130
144
145
+
## ARIA Related Methods
131
146
132
-
## Builder / Modifier Methods
147
+
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.
133
148
134
-
## ARIA Related Methods
149
+
```java
150
+
Navigation navigation = navigation(flat)
151
+
.ariaScrollBackLabel("← back")
152
+
.ariaScrollForwardLabel("→ forward");
153
+
```
135
154
136
155
## Event Handlers
137
156
157
+
These methods add event handlers for various event to the component. They are usually named `on<Event>()` and return the component so that the method call can be chained with other methods.
These methods do something with the component or return a value, a property or some other kind of information.
167
+
168
+
```java
169
+
Switch switch_ = switch_("id", "name");
170
+
boolean value = switch_.value();
171
+
```
172
+
173
+
---
174
+
140
175
The best way to experience the API is to take a look at the code snippets of the various components and layouts in the [showcase](https://patternfly-java.github.io/).
0 commit comments