expContent.add(textArea, 0, 1); alert.getDialogPane().setExpandableContent(expContent);
expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); alert.getDialogPane().setExpandableContent(expContent); final Function1<Node, Boolean> _function_4 = (Node it) -> { return Boolean.valueOf((it instanceof Label));
dialogPane.setExpandableContent(root);
/** * Initializes the components used in the {@link ErrorDialog} */ private void initialise() { contentTextProperty().bind(Bindings.createStringBinding( () -> Optional.ofNullable(getException()).map(Exception::getMessage).orElse(null), exception)); getDialogPane().setExpandableContent(createExpandableContent()); // ensure that the dialog resizes correctly when the expanded state changes getDialogPane().expandedProperty().addListener(observable -> Platform.runLater(() -> { getDialogPane().requestLayout(); final Window window = getDialogPane().getScene().getWindow(); window.sizeToScene(); })); getDialogPane().setMinHeight(Region.USE_PREF_SIZE); }
alert.getButtonTypes().addAll(reconnect); alert.getDialogPane().setExpandableContent(expContent); ButtonType result = alert.showAndWait().orElse(null);
public static void showException(String title, String message, Exception exception) { final Alert alert = new Alert(Alert.AlertType.ERROR); alert.initStyle(StageStyle.UTILITY); alert.setTitle("Exception"); alert.setHeaderText(title); alert.setContentText(message); final StringWriter sw = new StringWriter(); final PrintWriter pw = new PrintWriter(sw); exception.printStackTrace(pw); final String exceptionText = sw.toString(); final Label label = new Label("Details:"); final TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); final GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); }
public ExceptionAlert(Throwable e, String contentText, ButtonType... buttonTypes) { super(AlertType.ERROR, contentText, buttonTypes); String exceptionText = ExceptionUtils.getFullStackTrace(e); Label label = new Label(bundle.getString("stackTraceLabel")); TextArea textArea = new TextArea(exceptionText); textArea.setEditable(false); textArea.setWrapText(true); textArea.setMaxWidth(Double.MAX_VALUE); textArea.setMaxHeight(Double.MAX_VALUE); GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); GridPane expContent = new GridPane(); expContent.setMaxWidth(Double.MAX_VALUE); expContent.add(label, 0, 0); expContent.add(textArea, 0, 1); // Set expandable Exception into the dialog pane. this.getDialogPane().setExpandableContent(expContent); } }
GridPane.setVgrow(textArea, Priority.ALWAYS); GridPane.setHgrow(textArea, Priority.ALWAYS); alert.getDialogPane().setExpandableContent(expContent);
alert.getDialogPane().setExpandableContent(expContent); ExceptionController.handleException(th, alert.getDialogPane(), reportIssueButton, textArea, alert.contentTextProperty());