Example usage for javafx.scene.control TextArea setEditable

List of usage examples for javafx.scene.control TextArea setEditable

Introduction

In this page you can find the example usage for javafx.scene.control TextArea setEditable.

Prototype

public final void setEditable(boolean value) 

Source Link

Usage

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);
    taChangeLog.setWrapText(true);/*from   w w  w.j  a v  a  2s .  c  om*/

    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:de.rkl.tools.tzconv.TimezoneConverter.java

private TextArea createMainTextArea() {
    final TextArea mainArea = new TextArea();
    mainArea.setEditable(false);
    updateTextAreaContent(mainArea, applicationModel.mainDateTime.getValue());
    applicationModel.mainDateTime.addListener((observable, oldValue, newValue) -> {
        updateTextAreaContent(mainArea, newValue);
    });/*from ww w.  j  a v  a2  s.c om*/
    applicationModel.selectedZoneIds.addListener((observable, oldValue, newValue) -> {
        updateTextAreaContent(mainArea, applicationModel.mainDateTime.getValue());
    });
    applicationModel.templateFile.addListener((observable, oldValue, newValue) -> {
        updateTextAreaContent(mainArea, applicationModel.mainDateTime.getValue());
    });
    return mainArea;
}

From source file:de.perdoctus.ebikeconnect.gui.MainWindowController.java

public void showAbout() throws IOException {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.initOwner(tabPane.getScene().getWindow());
    alert.initModality(Modality.WINDOW_MODAL);
    alert.setWidth(640);//from   w w w.j av  a  2s.  c o  m
    alert.setTitle(rb.getString("application-name"));
    alert.setHeaderText(rb.getString("application-name") + " Version " + rb.getString("app-version"));

    final String aboutInfo = IOUtils.toString(getClass().getResourceAsStream("/about-info.txt"), "UTF-8");
    alert.setContentText(aboutInfo);

    final String licenseInfo = IOUtils.toString(getClass().getResourceAsStream("/license-info.txt"), "UTF-8");

    final Label label = new Label(rb.getString("licenses"));
    final TextArea licenses = new TextArea(licenseInfo);
    licenses.setMaxWidth(Double.MAX_VALUE);
    licenses.setEditable(false);

    GridPane expContent = new GridPane();
    expContent.setMaxWidth(Double.MAX_VALUE);
    expContent.add(label, 0, 0);
    expContent.add(licenses, 0, 1);

    alert.getDialogPane().setExpandableContent(expContent);
    alert.show();

}

From source file:io.bitsquare.gui.components.paymentmethods.USPostalMoneyOrderForm.java

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;//w ww  .  j  a v a  2s .  co m
    addLabelTextField(gridPane, gridRow, "Account name:", usPostalMoneyOrderAccount.getAccountName(),
            Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++gridRow, "Payment method:",
            BSResources.get(usPostalMoneyOrderAccount.getPaymentMethod().getId()));
    addLabelTextField(gridPane, ++gridRow, "Account holder name:", usPostalMoneyOrderAccount.getHolderName());
    TextArea textArea = addLabelTextArea(gridPane, ++gridRow, "Postal address:", "").second;
    textArea.setText(usPostalMoneyOrderAccount.getPostalAddress());
    textArea.setPrefHeight(60);
    textArea.setEditable(false);
    addLabelTextField(gridPane, ++gridRow, "Currency:",
            usPostalMoneyOrderAccount.getSingleTradeCurrency().getNameAndCode());
    addAllowedPeriod();
}

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);
    textArea.setWrapText(true);//w w w.  ja  va 2 s  .c  o  m

    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. ja  va  2  s. com
            "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: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;//from  ww w . ja  v a2 s.  co  m
        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:be.makercafe.apps.makerbench.Main.java

@Override
public void start(Stage primaryStage) {
    setupWorkspace();//from  w  ww  . java2 s .  c  o m
    rootContextMenu = createViewerContextMenu();
    viewer = createViewer();

    this.stage = primaryStage;
    BorderPane p = new BorderPane();

    p.setTop(createMenuBar());

    // p.setLeft(viewer);
    tabFolder = new TabPane();
    BorderPane bodyPane = new BorderPane();
    TextArea taConsole = new TextArea();
    taConsole.setPrefSize(Double.MAX_VALUE, 200.0);
    taConsole.setEditable(false);

    Console console = new Console(taConsole);
    PrintStream ps = new PrintStream(console, true);
    System.setOut(ps);
    System.setErr(ps);

    bodyPane.setBottom(taConsole);
    bodyPane.setCenter(tabFolder);
    SplitPane splitpane = new SplitPane();
    splitpane.getItems().addAll(viewer, bodyPane);
    splitpane.setDividerPositions(0.0f, 1.0f);
    p.setCenter(splitpane);

    Scene scene = new Scene(p, 1024, 800);
    //scene.getStylesheets().add(this.getClass().getResource("/styles/java-keywords.css").toExternalForm());

    primaryStage.setResizable(true);
    primaryStage.setTitle("Makerbench");
    primaryStage.setScene(scene);
    //primaryStage.getIcons().add(new Image("/path/to/stackoverflow.jpg"));
    primaryStage.show();
}

From source file:jp.ac.tohoku.ecei.sb.metabolome.lims.gui.MainWindowController.java

@FXML
void onTableClicked(MouseEvent event) {
    if (event.getClickCount() != 2)
        return;//from w  w w .  jav  a 2  s .  c om
    TableView tableView = ((TableView) event.getSource());
    TableView.TableViewFocusModel focusModel = (TableView.TableViewFocusModel) tableView.focusModelProperty()
            .getValue();
    TablePosition position = focusModel.getFocusedCell();
    if (position.getTableColumn() == null)
        return;
    ObservableValue value = position.getTableColumn().getCellObservableValue(position.getRow());
    String valueStr = value.getValue().toString();
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.setHeaderText(String.format("Value at ID:%d  %s",
            ((LIMSData) tableView.getItems().get(position.getRow())).getId(),
            position.getTableColumn().getText()));
    if (valueStr.length() > 300)
        alert.setContentText(valueStr.substring(0, 300) + "...");
    else
        alert.setContentText(valueStr);

    TextArea textArea = new TextArea(valueStr);
    textArea.setEditable(false);
    alert.getDialogPane().setExpandableContent(textArea);

    event.consume();
    alert.show();
}

From source file:frontend.GUIController.java

@FXML
void showAbout(ActionEvent event) {
    /*Dialogs.create()/*from  w  w w  . j ava2  s  .c om*/
    .title("About")
    .message(getLicense())
    .showInformation();*/
    Alert alert = new Alert(AlertType.INFORMATION);
    alert.initOwner(stage);
    alert.initModality(Modality.APPLICATION_MODAL);
    alert.setTitle("SAIL 1.1: About");
    alert.setHeaderText("SAIL 1.1 details");
    alert.setContentText("SAIL 1.1");
    Label label = new Label("SAIL License details:");

    TextArea textArea = new TextArea(getLicense());
    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();

}