2727import org .patternfly .core .Expandable ;
2828import org .patternfly .core .Modifiers .Inline ;
2929import org .patternfly .core .Modifiers .Plain ;
30+ import org .patternfly .core .Severity ;
3031import org .patternfly .handler .CloseHandler ;
3132import org .patternfly .handler .ToggleHandler ;
3233import org .patternfly .layout .Classes ;
@@ -83,7 +84,7 @@ public class Alert extends BaseComponent<HTMLDivElement, Alert> implements Inlin
8384
8485 // ------------------------------------------------------ factory
8586
86- public static Alert alert (AlertType type , String title ) {
87+ public static Alert alert (Severity type , String title ) {
8788 return new Alert (type , title );
8889 }
8990
@@ -96,7 +97,7 @@ public static Alert alert(AlertType type, String title) {
9697 int timeout ;
9798 Button closeButton ;
9899 CloseHandler <Alert > closeHandler ;
99- private final AlertType alertType ;
100+ private final Severity severity ;
100101 private final String title ;
101102 private final HTMLElement iconContainer ;
102103 private final HTMLParagraphElement titleElement ;
@@ -107,22 +108,22 @@ public static Alert alert(AlertType type, String title) {
107108 private AlertActionGroup actionGroup ;
108109 private ToggleHandler <Alert > toggleHandler ;
109110
110- Alert (AlertType alertType , String title ) {
111- super (div ().css (component (alert ), alertType .status .modifier )
112- .aria (label , alertType .aria )
111+ Alert (Severity severity , String title ) {
112+ super (div ().css (component (alert ), severity .status .modifier )
113+ .aria (label , severity .aria )
113114 .element (),
114115 ComponentType .Alert );
115- this .alertType = alertType ;
116+ this .severity = severity ;
116117 this .title = title ;
117118 this .timeout = NO_TIMEOUT ;
118119 this .timeoutHandle = 0 ;
119120
120121 add (iconContainer = div ().css (component (alert , icon ))
121- .add (inlineIcon (alertType . iconClass ))
122+ .add (inlineIcon (severity . icon ))
122123 .element ());
123124 add (titleElement = p ().css (component (alert , Classes .title ))
124125 .add (span ().css (screenReader )
125- .textContent (alertType .aria + ":" ))
126+ .textContent (severity .aria + ":" ))
126127 .add (title )
127128 .element ());
128129 Attachable .register (this , this );
@@ -199,7 +200,7 @@ public Alert closable() {
199200
200201 public Alert closable (CloseHandler <Alert > closeHandler ) {
201202 insertAfter (div ().css (component (alert , Classes .action ))
202- .add (closeButton = button (times , "Close " + alertType .aria + ": " + title )
203+ .add (closeButton = button (times , "Close " + severity .aria + ": " + title )
203204 .plain ()
204205 .on (click , event -> close (event , true )))
205206 .element (), titleElement );
@@ -230,7 +231,7 @@ public Alert expandable(ToggleHandler<Alert> toggleHandler) {
230231 .add (toggleButton = button ().plain ()
231232 .on (click , e -> toggle ())
232233 .aria (expanded , false )
233- .aria (label , alertType .aria + ": " + title + " details" )
234+ .aria (label , severity .aria + ": " + title + " details" )
234235 .add (span ().css (component (alert , toggle , icon ))
235236 .add (inlineIcon (angleRight ))))
236237 .element ());
0 commit comments