| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,12 +30,14 @@ | |||
| 30 | 30 | import org.patternfly.component.HasItems; | |
| 31 | 31 | import org.patternfly.component.RemoveItemHandler; | |
| 32 | 32 | import org.patternfly.component.UpdateItemHandler; | |
| 33 | + import org.patternfly.component.alert.Alert; | ||
| 33 | 34 | import org.patternfly.style.Modifiers.Horizontal; | |
| 34 | 35 | ||
| 35 | 36 | import elemental2.dom.HTMLFormElement; | |
| 36 | 37 | ||
| 37 | 38 | import static org.jboss.elemento.Elements.failSafeRemoveFromParent; | |
| 38 | 39 | import static org.jboss.elemento.Elements.insertFirst; | |
| 40 | + import static org.patternfly.component.form.FormAlert.formAlert; | ||
| 39 | 41 | import static org.patternfly.style.Classes.component; | |
| 40 | 42 | import static org.patternfly.style.Classes.form; | |
| 41 | 43 | import static org.patternfly.style.Classes.limitWidth; | |
@@ -97,10 +99,46 @@ public Form add(FormGroup item) { | |||
| 97 | 99 | return aur.added(item); | |
| 98 | 100 | } | |
| 99 | 101 | ||
| 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 | + */ | ||
| 109 | + public Form addAlert(Alert alert) { | ||
| 110 | + return add(alert); | ||
| 111 | + } | ||
| 112 | + | ||
| 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 | + */ | ||
| 120 | + public Form add(Alert alert) { | ||
| 121 | + return add(formAlert().addAlert(alert)); | ||
| 122 | + } | ||
| 123 | + | ||
| 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 | + */ | ||
| 100 | 131 | public Form addAlert(FormAlert alert) { | |
| 101 | 132 | return add(alert); | |
| 102 | 133 | } | |
| 103 | 134 | ||
| 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 | + */ | ||
| 104 | 142 | public Form add(FormAlert alert) { | |
| 105 | 143 | alerts.add(alert); | |
| 106 | 144 | insertFirst(element(), alert.element()); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments