/** * Sets the number of rows in the text area. * * @param rows * the number of rows for this text area. * @see TextArea#setRows(int) * @return this for method chaining */ public default S withRows(int rows) { ((TextArea) this).setRows(rows); return (S) this; } }
/** * 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); }
final TextArea resultArea = new TextArea(); resultArea.setRows(15); resultArea.setSizeFull(); 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);
setHeight("540px"); editor = new TextArea(); editor.setPropertyDataSource(new TextFileProperty(file)); editor.setImmediate(false); editor.setSizeFull(); editor.setRows(30); editor.setReadOnly(readOnly);
shareWindow.setWidth(400, Sizeable.Unit.PIXELS); TextArea shareLinkField = new TextArea(); shareLinkField.setValue(shareLink); shareLinkField.setReadOnly(true); shareLinkField.setRows(3); shareLinkField.setWidth(100, Sizeable.Unit.PERCENTAGE);
eventLayout.addComponent(eventLabel); eventDescr.setWidth("100%"); eventDescr.setRows(10); eventDescr.setRequired(true); eventDescr.setNullRepresentation(""); eventLayout.addComponent(eventDescr); eventLayout.addComponent(logMsgDest); logMsgContent.setWidth("100%"); logMsgContent.setRows(10); logMsgContent.setRequired(true); logMsgContent.setNullRepresentation(""); eventLayout.addComponent(logMsgContent); eventLayout.addComponent(eventSeverity); eventDescr.setWidth("100%"); eventDescr.setRows(10); eventDescr.setRequired(true); eventDescr.setNullRepresentation(""); eventLayout.addComponent(eventDescr); eventOperInstruct.setWidth("100%"); eventOperInstruct.setRows(10); eventOperInstruct.setNullRepresentation(""); eventLayout.addComponent(eventOperInstruct);
private TabContent(OutputDataKey key) { configTextArea.setSizeFull(); configTextArea.addStyleName("borderless"); descriptionLabel = new Label( UIHelper.loadContentFromFile(getClass(), key.getDescriptionFilename()), ContentMode.HTML); VerticalLayout leftLayout = new VerticalLayout(descriptionLabel); leftLayout.setMargin(true); addComponent(configTextArea); addComponent(leftLayout); setSizeFull(); setLocked(false); setSplitPosition(75, Unit.PERCENTAGE); setCaption(key.getTitle()); }
/** * Constructs a TextArea with given property data source. * * @param dataSource * the data source for the field */ public TextArea(Property dataSource) { this(); setPropertyDataSource(dataSource); }
@Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); design.html(DesignFormatter.encodeForTextNode(getValue())); }
/** * Constructs an empty TextArea. */ public TextArea() { setValue(""); }
@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); }