FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

docs: improve Javadoc across Form component methods · patternfly-java/patternfly-java@d173beb · GitHub

Commit d173beb

Browse files
committed
docs: improve Javadoc across Form component methods
Rewrite verbose multi-paragraph Javadoc to concise single-line style matching project conventions. Add missing Javadoc to factory method, add/builder/api methods, and clearAlerts().
1 parent a2d7821 commit d173beb

1 file changed

Lines changed: 13 additions & 28 deletions

File tree

  • components/src/main/java/org/patternfly/component/form

‎components/src/main/java/org/patternfly/component/form/Form.java‎

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public class Form extends BaseComponent<HTMLFormElement, Form> implements
5656

5757
// ------------------------------------------------------ factory
5858

59+
/** Creates a new form component with browser validation disabled. */
5960
public static Form form() {
6061
return new Form();
6162
}
@@ -76,6 +77,7 @@ public static Form form() {
7677

7778
// ------------------------------------------------------ add
7879

80+
/** Adds multiple form groups created by the given display function. */
7981
public <T> Form addItems(Iterable<T> items, Function<T, FormGroup> display) {
8082
for (T item : items) {
8183
FormGroup group = display.apply(item);
@@ -84,10 +86,12 @@ public <T> Form addItems(Iterable<T> items, Function<T, FormGroup> display) {
8486
return this;
8587
}
8688

89+
/** Same as {@link #add(FormGroup)} */
8790
public Form addItem(FormGroup item) {
8891
return add(item);
8992
}
9093

94+
/** Same as {@link #add(FormGroup)} */
9195
public Form addGroup(FormGroup group) {
9296
return add(group);
9397
}
@@ -99,66 +103,46 @@ public Form add(FormGroup item) {
99103
return aur.added(item);
100104
}
101105

102-
/**
103-
* Adds an alert to the form. The alert will be displayed in the context of the form, allowing the user to see
104-
* context-specific notifications or warnings.
105-
*
106-
* @param alert the alert to be added to the form
107-
* @return the updated form instance with the added alert
108-
*/
106+
/** Same as {@link #add(Alert)}. Convenience shortcut that wraps the alert in a {@link FormAlert}. */
109107
public Form addAlert(Alert alert) {
110108
return add(alert);
111109
}
112110

113-
/**
114-
* Adds an alert to the form. This method integrates the specified alert into the form's structure, allowing it to be
115-
* displayed within the form for user visibility and context-specific notifications or warnings.
116-
*
117-
* @param alert the alert to be added to the form
118-
* @return the updated instance of the form after adding the alert
119-
*/
111+
/** Wraps the alert in a new {@link FormAlert} and inserts it at the top of the form. */
120112
public Form add(Alert alert) {
121113
return add(formAlert().addAlert(alert));
122114
}
123115

124-
/**
125-
* Adds a {@link FormAlert} to the form. The alert will be displayed within the form, allowing for context-specific
126-
* notifications or warnings to be presented to the user.
127-
*
128-
* @param alert the {@link FormAlert} to be added to the form
129-
* @return the updated {@link Form} instance with the added alert
130-
*/
116+
/** Same as {@link #add(FormAlert)} */
131117
public Form addAlert(FormAlert alert) {
132118
return add(alert);
133119
}
134120

135-
/**
136-
* Adds a {@link FormAlert} to this form. The alert will be displayed within the form, providing context-specific
137-
* notifications or warnings to the user.
138-
*
139-
* @param alert the {@link FormAlert} to be added to the form
140-
* @return the updated {@link Form} instance with the added alert
141-
*/
121+
/** Adds a {@link FormAlert} and inserts it at the top of the form. */
142122
public Form add(FormAlert alert) {
143123
alerts.add(alert);
144124
insertFirst(element(), alert.element());
145125
return this;
146126
}
147127

128+
/** Adds a {@link FormSection} to the form. */
148129
public Form addSection(FormSection section) {
149130
return add(section);
150131
}
151132

133+
/** Adds a {@link FormFieldGroup} to the form. */
152134
public Form addFieldGroup(FormFieldGroup fieldGroup) {
153135
return add(fieldGroup);
154136
}
155137

138+
/** Adds a {@link FormActionGroup} to the form. */
156139
public Form addActionGroup(FormActionGroup actionGroup) {
157140
return add(actionGroup);
158141
}
159142

160143
// ------------------------------------------------------ builder
161144

145+
/** Limits the form width to a maximum width. Adds {@linkplain Classes#modifier(String) modifier(limitWidth)}. */
162146
public Form limitWidth() {
163147
return css(modifier(limitWidth));
164148
}
@@ -238,6 +222,7 @@ public void clear() {
238222
}
239223
}
240224

225+
/** Removes all alerts from this form. */
241226
public void clearAlerts() {
242227
for (FormAlert alert : alerts) {
243228
failSafeRemoveFromParent(alert);

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL