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:io.bitsquare.gui.components.paymentmethods.CashDepositForm.java

@Override
public void addFormForDisplayAccount() {
    gridRowFrom = gridRow;/*from   ww  w . j  a  v a 2 s .  co  m*/
    String countryCode = cashDepositAccountContractData.getCountryCode();

    addLabelTextField(gridPane, gridRow, "Account name:", paymentAccount.getAccountName(),
            Layout.FIRST_ROW_AND_GROUP_DISTANCE);
    addLabelTextField(gridPane, ++gridRow, "Payment method:",
            BSResources.get(paymentAccount.getPaymentMethod().getId()));
    addLabelTextField(gridPane, ++gridRow, "Country:",
            getCountryBasedPaymentAccount().getCountry() != null
                    ? getCountryBasedPaymentAccount().getCountry().name
                    : "");
    addLabelTextField(gridPane, ++gridRow, "Currency:",
            paymentAccount.getSingleTradeCurrency().getNameAndCode());
    addAcceptedBanksForDisplayAccount();
    addHolderNameAndIdForDisplayAccount();
    addLabelTextField(gridPane, ++gridRow, "Account holder email:",
            cashDepositAccountContractData.getHolderEmail());

    if (BankUtil.isBankNameRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, "Bank name:",
                cashDepositAccountContractData.getBankName()).second.setMouseTransparent(false);

    if (BankUtil.isBankIdRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getBankIdLabel(countryCode),
                cashDepositAccountContractData.getBankId()).second.setMouseTransparent(false);

    if (BankUtil.isBranchIdRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getBranchIdLabel(countryCode),
                cashDepositAccountContractData.getBranchId()).second.setMouseTransparent(false);

    if (BankUtil.isAccountNrRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getAccountNrLabel(countryCode),
                cashDepositAccountContractData.getAccountNr()).second.setMouseTransparent(false);

    if (BankUtil.isAccountTypeRequired(countryCode))
        addLabelTextField(gridPane, ++gridRow, BankUtil.getAccountTypeLabel(countryCode),
                cashDepositAccountContractData.getAccountType()).second.setMouseTransparent(false);

    String requirements = cashDepositAccountContractData.getRequirements();
    boolean showRequirements = requirements != null && !requirements.isEmpty();
    if (showRequirements) {
        TextArea textArea = addLabelTextArea(gridPane, ++gridRow, "Extra requirements:", "").second;
        textArea.setMinHeight(30);
        textArea.setMaxHeight(30);
        textArea.setEditable(false);
        textArea.setId("text-area-disabled");
        textArea.setText(requirements);
    }

    addAllowedPeriod();
}

From source file:acmi.l2.clientmod.l2smr.Controller.java

private void onException(String text, Throwable ex) {
    ex.printStackTrace();/* w  ww. j  a  v a2  s . c o m*/

    Platform.runLater(() -> {
        if (SHOW_STACKTRACE) {
            Alert alert = new Alert(Alert.AlertType.ERROR);
            alert.setTitle("Error");
            alert.setHeaderText(null);
            alert.setContentText(text);

            StringWriter sw = new StringWriter();
            PrintWriter pw = new PrintWriter(sw);
            ex.printStackTrace(pw);
            String exceptionText = sw.toString();

            Label label = new Label("Exception stacktrace:");

            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();
        } else {
            //noinspection ThrowableResultOfMethodCallIgnored
            Throwable t = getTop(ex);

            Alert alert = new Alert(Alert.AlertType.ERROR);
            alert.setTitle(t.getClass().getSimpleName());
            alert.setHeaderText(text);
            alert.setContentText(t.getMessage());

            alert.showAndWait();
        }
    });
}

From source file:com.github.drbookings.ui.controller.MainController.java

private void showAbout() {

    final Alert alert = new Alert(AlertType.INFORMATION);
    alert.setTitle("About DrBookings");
    final TextArea label = new TextArea();

    label.setEditable(false);
    label.setPrefHeight(400);//from  w w w.j  a va 2 s. c om
    label.setPrefWidth(400);
    label.getStyleClass().add("copyable-label");

    final StringBuilder sb = new StringBuilder();

    try {
        sb.append("Application version\t").append(Manifests.read("Implementation-Version")).append("\n");
        sb.append("Build time\t\t").append(Manifests.read("Build-Time")).append("\n");
    } catch (final Exception e) {
        if (logger.isInfoEnabled()) {
            logger.error("Failed to add manifest entry", e.getLocalizedMessage());
        }
    }

    label.setText(sb.toString());
    alert.setHeaderText("proudly brought to you by kerner1000");
    alert.setContentText(null);
    alert.getDialogPane().setContent(label);
    alert.showAndWait();
}

From source file:UI.MainStageController.java

/**
 * creates the file not found alert box//from   w  w  w . java 2s  . c  om
 */
private void fileNotFoundAlertBox() {
    fileNotFoundAlert = new Alert(Alert.AlertType.ERROR);
    fileNotFoundAlert.setTitle("File not found");
    fileNotFoundAlert.setHeaderText("File not found");
    fileNotFoundAlert.setContentText("Could not find the file you were looking for");

    //style the alert
    DialogPane dialogPane = fileNotFoundAlert.getDialogPane();
    dialogPane.getStylesheets().add("/UI/alertStyle.css");

    Exception fileNotFoundException = new FileNotFoundException("Could not find your selected file");

    //create expandable exception
    StringWriter sw = new StringWriter();
    PrintWriter pw = new PrintWriter(sw);
    fileNotFoundException.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.
    fileNotFoundAlert.getDialogPane().setExpandableContent(expContent);
    fileNotFoundAlert.showAndWait();
}