/** * Constructs an empty TextArea. */ public TextArea() { setValue(""); }
/** * Constructs a TextArea with given caption and value. * * @param caption * the caption for the field * @param value * the value for the field */ public TextArea(String caption, String value) { this(caption); setValue(value); }
@Override public void clear() { setValue(""); }
/** * Sets the content of the {@linkplain #configTextArea}. * * @param newConfigContent The new configuration content. */ public void setConfigContent(String newConfigContent) { configContent = newConfigContent; if (newConfigContent.split("\n").length >= Config.CONFIG_SNIPPET_MAX_LINES) { configTextArea.setValue("The generated configuration snippet is too long to show here. Please download the files and edit/view with the editor of choice."); } else { configTextArea.setValue(newConfigContent); } }
@Override public void readDesign(Element design, DesignContext designContext) { super.readDesign(design, designContext); setValue(DesignFormatter.decodeFromTextNode(design.html()), false, true); }
cancelButton.addClickListener((event) -> { cancel(pingFuture); resultArea.setValue(resultArea.getValue() + "\n" + "Ping cancelled by user"); getUI().setPollInterval(initialPollInterval); setRunning(false); pingButton.addClickListener((event) -> { try { resultArea.setValue(""); // Clear getUI().setPollInterval(POLL_INTERVAL); final String error = "'" + pingRequest.getIpAddress() + "' is not a valid IP Address"; Notification.show(error); resultArea.setValue(error); return; if (pingFuture != null && !pingFuture.isCancelled()) { setRunning(!summary.isComplete()); resultArea.setValue(PingStringUtils.renderAll(summary)); if (summary.isComplete()) { getUI().setPollInterval(initialPollInterval);
shareLinkField.setValue(shareLink); shareLinkField.setReadOnly(true); shareLinkField.setRows(3);