G-Earth/Extensions/G-Translator_1.0.2/decompiled/gearth/misc/ConfirmationDialog.java
Administrator 368b92d87a G-Earth 1.5.4 beta 22 - Initial release
Komplettes G-Earth Paket inkl. JRE, Extensions und Tools.

Extensions:
- G-BuildTools, G-Click Ultimate, G-Loader, G-Manipulate
- G-Presets, G-Translator, G-Trigger, G-itemViewer
- Market Utils, Packet Info Explorer, Plants
- RandomRoomVisitor, RoomLogger, Sanbovir Photo Inspector
- SpyFriends, WallAligner, XabboScripter, xabbo
2026-03-16 09:45:04 +01:00

59 lines
1.9 KiB
Java

/*
* Decompiled with CFR 0.152.
*
* Could not load the following classes:
* javafx.scene.Group
* javafx.scene.Node
* javafx.scene.control.Alert
* javafx.scene.control.Alert$AlertType
* javafx.scene.control.ButtonType
* javafx.scene.control.CheckBox
* javafx.scene.control.DialogPane
*/
package gearth.misc;
import java.util.HashSet;
import java.util.Set;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.scene.control.CheckBox;
import javafx.scene.control.DialogPane;
public class ConfirmationDialog {
private static Set<String> ignoreDialogs = new HashSet<String>();
public static Alert createAlertWithOptOut(Alert.AlertType type, final String dialogKey, String title, String headerText, String message, final String optOutMessage, ButtonType ... buttonTypes) {
Alert alert = new Alert(type);
alert.getDialogPane().applyCss();
Node graphic = alert.getDialogPane().getGraphic();
alert.setDialogPane(new DialogPane(){
protected Node createDetailsButton() {
CheckBox optOut = new CheckBox();
optOut.setText(optOutMessage);
optOut.setOnAction(event -> {
if (optOut.isSelected()) {
ignoreDialogs.add(dialogKey);
}
});
return optOut;
}
});
alert.getDialogPane().getButtonTypes().addAll((Object[])buttonTypes);
alert.getDialogPane().setContentText(message);
alert.getDialogPane().setExpandableContent((Node)new Group());
alert.getDialogPane().setExpanded(true);
alert.getDialogPane().setGraphic(graphic);
alert.setTitle(title);
alert.setHeaderText(headerText);
return alert;
}
public static boolean showDialog(String dialogKey) {
return !ignoreDialogs.contains(dialogKey);
}
}