style: 清理代码

This commit is contained in:
octopus_yan 2024-09-08 21:52:39 +08:00
parent 95404edc92
commit 09ca87f4f4

View File

@ -9,7 +9,7 @@ import java.util.Optional;
/**
* @author octopus_yan
*/
public class AlertBuilder extends BaseBuilder<Alert, ButtonType> {
public class AlertBuilder extends BaseBuilder<AlertBuilder, Alert> {
public AlertBuilder(Alert alert, Window owner) {
super(alert, owner);
@ -19,7 +19,7 @@ public class AlertBuilder extends BaseBuilder<Alert, ButtonType> {
* AlertUtil.confirm
*/
public void show(AlertUtil.OnClickListener listener) {
Optional<ButtonType> result = alert.showAndWait();
Optional<ButtonType> result = dialog.showAndWait();
result.ifPresent(r -> listener.onClicked(r.getText()));
}
@ -27,7 +27,7 @@ public class AlertBuilder extends BaseBuilder<Alert, ButtonType> {
* AlertUtil.confirm
*/
public void show(AlertUtil.OnChoseListener listener) {
Optional<ButtonType> result = alert.showAndWait();
Optional<ButtonType> result = dialog.showAndWait();
result.ifPresent(r -> {
if (r == ButtonType.OK) {
listener.confirm();