List of usage examples for javafx.scene.control TextArea setWrapText
public final void setWrapText(boolean value)
From source file:com.canoo.dolphin.todo.client.ToDoClient.java
private void showError(String header, String content, Exception e) { e.printStackTrace();//from w w w. j a va 2 s . c om Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Error"); alert.setHeaderText(header); alert.setContentText(content); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); String exceptionText = sw.toString(); Label label = new Label("The exception stacktrace was:"); 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); alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); System.exit(-1); }
From source file:eu.over9000.skadi.ui.dialogs.UpdateAvailableDialog.java
public UpdateAvailableDialog(RemoteVersionResult newVersion) { super(AlertType.INFORMATION, null, UPDATE_BUTTON_TYPE, IGNORE_BUTTON_TYPE); this.setTitle("Update available"); this.setHeaderText(newVersion.getVersion() + " is available"); Label lbChangeLog = new Label("Changelog:"); TextArea taChangeLog = new TextArea(newVersion.getChangeLog()); taChangeLog.setEditable(false);//from w ww. j a va 2 s .co m taChangeLog.setWrapText(true); Label lbSize = new Label("Size:"); Label lbSizeValue = new Label(FileUtils.byteCountToDisplaySize(newVersion.getSize())); Label lbPublished = new Label("Published"); Label lbPublishedValue = new Label( ZonedDateTime.parse(newVersion.getPublished()).format(DateTimeFormatter.RFC_1123_DATE_TIME)); final GridPane grid = new GridPane(); RowConstraints vAlign = new RowConstraints(); vAlign.setValignment(VPos.TOP); grid.getRowConstraints().add(vAlign); grid.setHgap(10); grid.setVgap(10); grid.add(lbChangeLog, 0, 0); grid.add(taChangeLog, 1, 0); grid.add(lbPublished, 0, 1); grid.add(lbPublishedValue, 1, 1); grid.add(lbSize, 0, 2); grid.add(lbSizeValue, 1, 2); this.getDialogPane().setContent(grid); }
From source file:net.thirdy.blackmarket.controls.Dialogs.java
public static void showAbout() { Alert alert = new Alert(AlertType.INFORMATION); alert.setGraphic(new Region()); alert.setTitle("Blackmarket " + BlackmarketApplication.VERSION); alert.setContentText(""); alert.setHeaderText(""); TextArea textArea = new TextArea("Copyright 2015 Vicente de Rivera III" + "\r\n" + "\r\n http://thirdy.github.io/blackmarket" + "\r\n" + "\r\n This program is free software; you can redistribute it and/or" + "\r\n modify it under the terms of the GNU General Public License" + "\r\n as published by the Free Software Foundation; either version 2" + "\r\n of the License, or (at your option) any later version." + "\r\n" + "\r\n This program is distributed in the hope that it will be useful," + "\r\n but WITHOUT ANY WARRANTY; without even the implied warranty of" + "\r\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" + "\r\n GNU General Public License for more details." + "\r\n" + "\r\n You should have received a copy of the GNU General Public License" + "\r\n along with this program; if not, write to the Free Software" + "\r\n Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA." + "\r\n"); textArea.setEditable(false);/*from w ww. j av a 2 s . com*/ textArea.setWrapText(true); Hyperlink website = new Hyperlink("Visit Blackmarket Homepage"); website.setOnAction(e -> { try { SwingUtil.openUrlViaBrowser("http://thirdy.github.io/blackmarket/"); } catch (BlackmarketException ex) { logger.error(ex.getMessage(), ex); } }); Hyperlink exwebsite = new Hyperlink("Visit Exile Tools Homepage"); exwebsite.setOnAction(e -> { try { SwingUtil.openUrlViaBrowser("http://exiletools.com/"); } catch (BlackmarketException ex) { logger.error(ex.getMessage(), ex); } }); VBox content = new VBox(new ImageView(new Image("/images/blackmarket-logo.png")), new Label( "Blackmarket is fan-made software for Path of Exile but is not affiliated with Grinding Gear Games in any way."), new Label("A few tips:"), new Label("CTRL + Space - hot key to slide the search control pane"), new Label("CTRL + Enter - hot key to run the search"), new Label("Advance mode grants you power overwhelming of Elastic Search"), new Label("For more information and updates,"), website, new Label("Blackmarket uses Exile Tools Shop Indexer Elastic Search API:"), exwebsite, new Label("Comics by /u/gallio"), new Label("Blackmarket is 100% Free and Open Source Software under GPLv2:"), textArea); content.setSpacing(8); alert.getDialogPane().setContent(content); alert.showAndWait(); }
From source file:pah9qdmoviereviews.MovieReviewsFXMLController.java
public void displayExceptionAlert(Exception ex) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle("Exception"); alert.setHeaderText("An Exception Occurred!"); alert.setContentText(/*from w w w . j av a2 s . c o m*/ "An exception occurred. View the exception information below by clicking Show Details."); // Create expandable Exception. StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); ex.printStackTrace(pw); String exceptionText = sw.toString(); Label label = new Label("The exception stacktrace was:"); 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. alert.getDialogPane().setExpandableContent(expContent); alert.showAndWait(); }
From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java
protected void createTextAreaInput(final int numLines, final ConfigFrame cf, final String propertyName, final String initialValue, final Consumer<String> applyValue) { final TextArea inputField = new TextArea(initialValue); inputField.setPrefRowCount(numLines); inputField.setWrapText(true); inputField.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { applyValue.accept(newValue);// w w w . j a v a2 s .c o m this.getGraph().handleChange(); }); cf.addOption(propertyName, inputField); }
From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java
@Override public Node getConfigFrame() { // TODO: Remove code redundancies; element creating methods have been created in class AutomatonEdge and should be centralized! final ConfigFrame cf = new ConfigFrame("State properties"); final int nameInputLines = 1; final TextArea nameInput = new TextArea(this.name); nameInput.setPrefRowCount(nameInputLines); nameInput.setWrapText(true); nameInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { this.setName(newValue); this.getGraph().handleChange(); });/*from w w w. j a va 2s .co m*/ cf.addOption("Name", nameInput); final int descriptionInputLines = 3; this.createTextAreaInput(descriptionInputLines, cf, "Description", this.getDescription(), newValue -> this.setDescription(newValue)); final VBox typeAttributes = new VBox(); final ToggleGroup flagToggleGroup = new ToggleGroup(); typeAttributes.getChildren() .add(this.createRadioButtonForType(null, "None (intermediate node)", flagToggleGroup)); typeAttributes.getChildren().add(this.createRadioButtonForType(Type.INITIAL, "Initial", flagToggleGroup)); final RadioButton successOption = this.createRadioButtonForType(Type.SUCCESS, "Success", flagToggleGroup); typeAttributes.getChildren().add(successOption); typeAttributes.getChildren().add(this.createRadioButtonForType(Type.FAILURE, "Failure", flagToggleGroup)); cf.addOption("Type", typeAttributes); final CheckBox waitCheckBox = new CheckBox("Active"); waitCheckBox.setSelected(this.wait); waitCheckBox.setOnAction(event -> { this.setWait(waitCheckBox.isSelected()); this.getGraph().handleChange(); }); cf.addOption("Wait", waitCheckBox); final int expressionInputLines = 1; final TextArea successCheckExpInput = new TextArea(this.successCheckExp); successCheckExpInput.setStyle("-fx-font-family: monospace"); successCheckExpInput.setPrefRowCount(expressionInputLines); successCheckExpInput.setWrapText(false); successCheckExpInput.textProperty() .addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { this.setSuccessCheckExp(newValue); this.getGraph().handleChange(); }); successCheckExpInput.disableProperty().bind(successOption.selectedProperty().not()); cf.addOption("Script expression to verify if node is successful", successCheckExpInput); this.createEnterAndLeaveScriptConfig(cf); return cf; }
From source file:uk.co.everywheremusic.viewcontroller.SetupScene.java
private boolean validateForm() { boolean valid = true; String errorMessage = ""; File musicDir = new File(txtFolder.getText()); if (!musicDir.isDirectory()) { valid = false;/* ww w . j av a 2s. c om*/ errorMessage += Globals.SETUP_ERR_INVALID_FOLDER + "\n\n"; } String password = txtPassword.getText(); String confirmPassword = txtConfirmPassword.getText(); if (!password.equals(confirmPassword)) { valid = false; errorMessage += "Passwords do not match\n\n"; } if (password.equals("")) { valid = false; errorMessage += "Enter a password\n\n"; } if (!valid) { Alert alert = new Alert(AlertType.INFORMATION); alert.setTitle(Globals.SETUP_ALERT_TITLE); alert.setHeaderText(Globals.SETUP_ALERT_HEADER_TEXT); TextArea text = new TextArea(errorMessage); text.setEditable(false); text.setWrapText(true); GridPane.setVgrow(text, Priority.NEVER); GridPane.setHgrow(text, Priority.NEVER); GridPane content = new GridPane(); content.setMaxWidth(Double.MAX_VALUE); content.add(text, 0, 0); alert.getDialogPane().setContent(content); alert.showAndWait(); } return valid; }
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private void addCheckInNote(final Pane content, final BookingBean be) { final VBox b = new VBox(); b.getChildren().add(new Text("Check-in Note")); final TextArea ta0 = new TextArea(be.getCheckInNote()); ta0.setWrapText(true); ta0.setPrefHeight(80);/*from w ww .ja v a 2 s .c o m*/ b.getChildren().add(ta0); booking2CheckInNote.put(be, ta0); content.getChildren().add(b); }
From source file:com.github.drbookings.ui.controller.BookingDetailsController.java
private void addCheckOutNote(final Pane content, final BookingBean be) { final VBox b = new VBox(); b.getChildren().add(new Text("Check-out Note")); final TextArea ta0 = new TextArea(be.getCheckOutNote()); ta0.setWrapText(true); ta0.setPrefHeight(80);/* w w w .j a va 2 s . c o m*/ b.getChildren().add(ta0); booking2CheckOutNote.put(be, ta0); content.getChildren().add(b); }
From source file:de.pixida.logtest.designer.automaton.AutomatonNode.java
public void createEnterAndLeaveScriptConfig(final ConfigFrame cf) { final int scriptInputLines = 3; final TextArea onEnterScriptInput = new TextArea(this.onEnter); onEnterScriptInput.setStyle("-fx-font-family: monospace"); onEnterScriptInput.setPrefRowCount(scriptInputLines); onEnterScriptInput.setWrapText(false); onEnterScriptInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { this.setOnEnter(newValue); this.getGraph().handleChange(); });//w ww .j a v a 2 s .com cf.addOption("When entering state, run script", onEnterScriptInput); final TextArea onLeaveScriptInput = new TextArea(this.onLeave); onLeaveScriptInput.setStyle("-fx-font-family: monospace"); onLeaveScriptInput.setPrefRowCount(scriptInputLines); onLeaveScriptInput.setWrapText(false); onLeaveScriptInput.textProperty().addListener((ChangeListener<String>) (observable, oldValue, newValue) -> { this.setOnLeave(newValue); this.getGraph().handleChange(); }); cf.addOption("When leaving state, run script", onLeaveScriptInput); }