本文整理汇总了Java中com.vaadin.ui.TextArea.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java TextArea.setValue方法的具体用法?Java TextArea.setValue怎么用?Java TextArea.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.ui.TextArea
的用法示例。
在下文中一共展示了TextArea.setValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDetails
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
@Override
public Component getDetails(final RowReference rowReference) {
// Find the bean to generate details for
final Item item = rowReference.getItem();
final String message = (String) item.getItemProperty(ProxyMessage.PXY_MSG_VALUE).getValue();
final TextArea textArea = new TextArea();
textArea.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
textArea.addStyleName(ValoTheme.TEXTAREA_TINY);
textArea.addStyleName("inline-icon");
textArea.setHeight(120, Unit.PIXELS);
textArea.setWidth(100, Unit.PERCENTAGE);
textArea.setValue(message);
textArea.setReadOnly(Boolean.TRUE);
return textArea;
}
示例2: TestWindow
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
public TestWindow() {
super("Test Transformation");
setWidth(800f, Unit.PIXELS);
setHeight(600f, Unit.PIXELS);
content.setMargin(true);
TextArea textField = new TextArea();
textField.setSizeFull();
textField.setWordwrap(false);
Thread thread = Thread.currentThread();
ClassLoader previousLoader = thread.getContextClassLoader();
try {
thread.setContextClassLoader(getClass().getClassLoader());
textField.setValue(XsltProcessor.getTransformedXml(textArea.getValue(), editor.getValue(), XsltProcessor.PRETTY_FORMAT, false));
} finally {
thread.setContextClassLoader(previousLoader);
}
addComponent(textField);
content.setExpandRatio(textField, 1.0f);
addComponent(buildButtonFooter(buildCloseButton()));
}
示例3: addSystemInfo
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
@Override
public void addSystemInfo(Accordion systemInfoPanel) {
VerticalLayout layout = new VerticalLayout();
textArea = new TextArea("System Info");
textArea.addStyleName(UIConstants.FIXED_FONT);
textArea.setValue(getInfo());
textArea.setRows(20);
textArea.setHeight("400px");
textArea.setWidth("100%");
layout.addComponents(textArea);
systemInfoPanel.addTab(layout, getCaption());
}
示例4: buildNotes
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
private Component buildNotes() {
TextArea notes = new TextArea("Notes");
notes.setValue("Remember to:\n· Zoom in and out in the Sales view\n· Filter the transactions and drag a set of them to the Reports tab\n· Create a new report\n· Change the schedule of the movie theater");
notes.setSizeFull();
notes.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
Component panel = createContentWrapper(notes);
panel.addStyleName("notes");
return panel;
}
示例5: generateUi
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
/**
* Diese Methode erstellt das UI, bestehend aus Inputfeld für Projektname und
* Projektbeschreibung.
*
* @author Marco Glaser
*/
public void generateUi(){
setWidth(95, UNITS_PERCENTAGE);
setHeight(SIZE_UNDEFINED, 0);
setStyleName("projectCreationLayout");
projectNameInput = new TextField();
projectDescriptionInput = new TextArea();
gap = new Label();
secondGap = new Label();
projectNameInput.setWidth(80, UNITS_PERCENTAGE);
// projectNameInput.setHeight(30, UNITS_PIXELS);
projectNameInput.setStyleName("projectNameInput");
projectDescriptionInput.setWidth(80, UNITS_PERCENTAGE);
projectDescriptionInput.setHeight(300, UNITS_PIXELS);
projectDescriptionInput.setStyleName("projectNameInput");
gap.setHeight("20px");
secondGap.setSizeFull();
projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
projectDescriptionInput.setValue("Geben Sie hier eine Beschreibung des Projekts ein.");
addComponent(projectNameInput);
addComponent(gap);
addComponent(projectDescriptionInput);
projectNameInput.setCaption("Projektname");
projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
projectDescriptionInput.setCaption("Projektbeschreibung");
projectDescriptionInput.setValue("Geben Sie hier eine Projektbeschreibung ein");
// addComponent(secondGap);
// setExpandRatio(secondGap, 1.0f);
}
示例6: TextArea
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
protected TextArea createTextArea(String value, int lines) {
TextArea area = new TextArea();
area.setValue(value);
area.setNullRepresentation("");
area.setSizeFull();
area.setReadOnly(true);
area.setRows(lines);
return area;
}
示例7: createOldWayCopyToClipboard
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
private void createOldWayCopyToClipboard() {
Label label = new Label(
"This variant will be removed, see <a target=\"_blank\" href=\"https://github.com/vaadin4qbanos/vaadin-jsclipboard-addon/blob/master/README.md\">README</a><br>"
+ "This variant was done using the library <a href='https://clipboardjs.com/' >clipboard.js</a> as a Component");
label.setContentMode(ContentMode.HTML);
final TextArea anotherArea = new TextArea();
anotherArea.setId("clipboardTarget");
anotherArea.setValue("Another example to copy to clipboard");
ClipboardButton clipboardButton = new ClipboardButton("clipboardTarget");
clipboardButton.addSuccessListener(() -> {
Notification.show("Copy to clipboard successful");
});
clipboardButton.addErrorListener(() -> {
Notification.show("Copy to clipboard unsuccessful", Notification.Type.ERROR_MESSAGE);
});
Button source = new Button(VaadinIcons.CODE);
source.addClickListener((Button.ClickEvent event) -> {
Window win = createOldWaySourceWindow();
win.setModal(true);
UI.getCurrent().addWindow(win);
});
VerticalLayout wrapper = new VerticalLayout();
wrapper.setSpacing(true);
wrapper.setDefaultComponentAlignment(Alignment.TOP_CENTER);
wrapper.setWidth("100%");
wrapper.addComponents(new HorizontalLayout(label), anotherArea, clipboardButton, source);
addComponent(wrapper);
}
示例8: getTargetComponent
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
@Override
public Component getTargetComponent() {
final TextArea textArea = new TextArea();
textArea.setSizeFull();
textArea.setValue("Copy to clipboard textarea value....");
textArea.setId("tocopie-textarea");
return textArea;
}
示例9: ErrorWindow
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
public ErrorWindow(String intro, String message) {
super("Error");
setWidth(600f, Unit.PIXELS);
setHeight(300f, Unit.PIXELS);
content.setMargin(true);
HorizontalLayout layout = new HorizontalLayout();
Label icon = new Label();
icon.setIcon(new ThemeResource("images/error.png"));
icon.setWidth(70f, Unit.PIXELS);
layout.addComponent(icon);
Label labelIntro = new Label(intro, ContentMode.HTML);
labelIntro.setStyleName("large");
labelIntro.setWidth(530f, Unit.PIXELS);
layout.addComponent(labelIntro);
addComponent(layout);
TextArea textField = new TextArea();
textField.setSizeFull();
textField.setWordwrap(false);
textField.setValue(message);
addComponent(textField);
content.setExpandRatio(textField, 1.0f);
addComponent(buildButtonFooter(buildCloseButton()));
}
示例10: initContent
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
private void initContent() {
this.removeAllComponents();
roleComboBox = new ProjectRoleComboBox();
roleComboBox.addValueChangeListener(valueChangeEvent -> {
Integer roleId = (Integer) roleComboBox.getValue();
displayRolePermission(roleId);
});
AddViewLayout userAddLayout = new AddViewLayout(UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_INVITE_MEMBERS), FontAwesome.USER);
userAddLayout.addHeaderRight(createButtonControls());
GridFormLayoutHelper informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(1, 3);
inviteUserTokenField = new InviteUserTokenField();
informationLayout.addComponent(new MVerticalLayout(inviteUserTokenField, new ELabel(UserUIContext.getMessage
(ProjectMemberI18nEnum.USER_TOKEN_INVITE_HINT)).withStyleName(UIConstants.META_INFO)).withMargin(false),
UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_INVITEES_EMAIL), 0, 0);
informationLayout.addComponent(roleComboBox, UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_ROLE), 0, 1);
messageArea = new TextArea();
messageArea.setValue(UserUIContext.getMessage(ProjectMemberI18nEnum.MSG_DEFAULT_INVITATION_COMMENT));
informationLayout.addComponent(messageArea, UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_MESSAGE), 0, 2);
userAddLayout.addBody(informationLayout.getLayout());
userAddLayout.addBottom(createBottomPanel());
this.addComponent(userAddLayout);
}
示例11: buildUI
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
protected void buildUI() {
ButtonBar buttonBar = new ButtonBar();
addComponent(buttonBar);
if (!readOnly) {
Button testButton = buttonBar.addButton("Test", FontAwesome.FILE_CODE_O);
testButton.addClickListener(new TestClickListener());
}
filterField = buttonBar.addFilter();
filterField.addTextChangeListener(this);
HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
splitPanel.setSizeFull();
splitPanel.setSplitPosition(50, Unit.PERCENTAGE);
VerticalLayout leftLayout = new VerticalLayout();
editor = new AceEditor();
editor.setMode(AceMode.xml);
editor.setSizeFull();
editor.setHighlightActiveLine(true);
editor.setShowPrintMargin(false);
editor.addTextChangeListener(new StylesheetChangeListener());
editor.setValue(component.findSetting(XsltProcessor.XSLT_PROCESSOR_STYLESHEET).getValue());
leftLayout.addComponent(new Label("XSLT Stylesheet"));
leftLayout.addComponent(editor);
leftLayout.setExpandRatio(editor, 1.0f);
leftLayout.setSizeFull();
splitPanel.setFirstComponent(leftLayout);
VerticalLayout rightLayout = new VerticalLayout();
rightLayout.setSizeFull();
rightLayout.addComponent(new Label("Sample Input XML"));
textArea = new TextArea();
textArea.setEnabled(false);
textArea.setSizeFull();
textArea.setValue(getSampleXml());
rightLayout.addComponent(textArea);
rightLayout.setExpandRatio(textArea, 1.0f);
splitPanel.setSecondComponent(rightLayout);
addComponent(splitPanel);
setExpandRatio(splitPanel, 1.0f);
textArea.setReadOnly(readOnly);
editor.setReadOnly(readOnly);
}
示例12: createTaskSummary
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
private Component createTaskSummary(UserTask task) {
// TextField name = new TextField("Name");
// name.setValue(task.getName());
// name.setReadOnly(true);
// name.setWidth("100%");
TextField priority = new TextField("Priority");
priority.setValue(Integer.toString(task.getPriority()));
priority.setReadOnly(true);
TextField status = new TextField("Status");
status.setValue(task.getStatus().getDescription());
status.setReadOnly(true);
TextArea description = new TextArea("Description");
description.setSizeFull();
description.setValue(task.getDescription());
description.setReadOnly(true);
description.setRows(3);
ComponentContainer buttons = createSummaryButtons(task);
VerticalLayout secondColumnFields = new VerticalLayout();
secondColumnFields.setMargin(false);
secondColumnFields.setSizeFull();
secondColumnFields.addComponent(priority);
secondColumnFields.addComponent(status);
HorizontalLayout fieldsLayout = new HorizontalLayout();
fieldsLayout.setSizeFull();
fieldsLayout.setMargin(false);
fieldsLayout.setSpacing(false);
fieldsLayout.addComponent(description);
fieldsLayout.addComponent(secondColumnFields);
fieldsLayout.setExpandRatio(description, 4.0f);
fieldsLayout.setExpandRatio(secondColumnFields, 1.0f);
HorizontalLayout mainLayout = new HorizontalLayout();
mainLayout.setMargin(true);
mainLayout.setSpacing(false);
mainLayout.setSizeFull();
mainLayout.addComponent(fieldsLayout);
mainLayout.addComponent(buttons);
mainLayout.setComponentAlignment(buttons, Alignment.TOP_LEFT);
mainLayout.setExpandRatio(fieldsLayout, 1.0f);
Panel panel = new Panel("Summary");
panel.setStyleName("background-transparent");
panel.setContent(mainLayout);
return panel;
}
示例13: doLayout
import com.vaadin.ui.TextArea; //导入方法依赖的package包/类
private void doLayout(String caption, String name, String desc,
String notesForTeachers) {
setSpacing(true);
this.setWidth("100%");
showDescriptions = true;
Panel p = new Panel(caption);
p.setWidth("100%");
p.addStyleName("bubble");
p.addStyleName("info-panel-bolded");
VerticalLayout pLayout = new VerticalLayout();
pLayout.setMargin(true);
pLayout.setSpacing(true);
pLayout.setWidth("100%");
exerciseName = new TextField();
exerciseName.setWidth("100%");
exerciseName.setValue(name);
exerciseName.addStyleName("component-margin-bottom");
pLayout.addComponent(new Label(localizer
.getUIText(StubUiConstants.EXERCISE_NAME)));
pLayout.addComponent(exerciseName);
description = new CleanRichTextArea();
description.setWidth("100%");
description.setHeight("200px");
description.setValue(desc);
description.addStyleName("component-margin-bottom");
descriptionLabel = new Label(
localizer.getUIText(StubUiConstants.DEFAULT_DESCRIPTION));
pLayout.addComponent(descriptionLabel);
pLayout.addComponent(description);
notes = new TextArea();
notes.setWidth("100%");
notes.setRows(3);
notes.setValue(notesForTeachers);
notes.addStyleName("component-margin-bottom");
notesLabel = new Label(
localizer.getUIText(StubUiConstants.NOTES_FOR_TEACHERS));
pLayout.addComponent(notesLabel);
pLayout.addComponent(notes);
hideShowButton = new Button(
localizer.getUIText(StubUiConstants.HIDE_DESCRIPTIONS));
hideShowButton.addClickListener(this);
hideShowButton.setStyleName(BaseTheme.BUTTON_LINK);
pLayout.addComponent(hideShowButton);
p.setContent(pLayout);
this.addComponent(p);
}