本文整理汇总了Java中com.vaadin.ui.TextArea类的典型用法代码示例。如果您正苦于以下问题:Java TextArea类的具体用法?Java TextArea怎么用?Java TextArea使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextArea类属于com.vaadin.ui包,在下文中一共展示了TextArea类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: extend
import com.vaadin.ui.TextArea; //导入依赖的package包/类
public void extend(final TextArea textArea, List<String> users, List<String> projects) {
if (textArea.getId() == null) {
textArea.setId(UUID.randomUUID().toString().replace("-", ""));
}
StringBuilder execute = new StringBuilder("htextcomplete('#");
execute.append(textArea.getId());
execute.append("', [");
for (String user : users) {
execute.append("'").append(user).append("',");
}
execute.deleteCharAt(execute.length() - 1);
execute.append("], [");
for (String project : projects) {
execute.append("'").append(project).append("',");
}
execute.deleteCharAt(execute.length() - 1);
execute.append("])");
super.extend(textArea);
com.vaadin.ui.JavaScript.getCurrent().execute(execute.toString());
}
示例2: getCopyPasteLayout
import com.vaadin.ui.TextArea; //导入依赖的package包/类
private VerticalLayout getCopyPasteLayout() {
VerticalLayout layout = new VerticalLayout();
Label label = new Label("Paste the complete Content of your java-file here:");
layout.addComponent(label);
layout.setComponentAlignment(label, Alignment.TOP_CENTER);
copyPasteTextfield = new TextArea();
copyPasteTextfield.setWordWrap(false);
copyPasteTextfield.setWidth(30.0f, Unit.REM);
copyPasteTextfield.setHeight(30.0f, Unit.REM);
layout.addComponent(copyPasteTextfield);
layout.setComponentAlignment(copyPasteTextfield, Alignment.MIDDLE_CENTER);
Button button = new Button(ADD);
button.addClickListener(x -> addPasteListener.accept(getCopyPasteText()));
layout.addComponent(button);
layout.setComponentAlignment(button, Alignment.BOTTOM_RIGHT);
return layout;
}
示例3: 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;
}
示例4: getSimpleExamle
import com.vaadin.ui.TextArea; //导入依赖的package包/类
private Component getSimpleExamle() {
VerticalLayout vlo = new VerticalLayout();
vlo.setMargin(true);
vlo.setHeight("100%");
vlo.setWidth("100%");
vlo.setSpacing(true);
vlo.addComponent(getTestButtons());
for (int i = 0; i < components.length; i++) {
components[i] = new TextArea();
((TextArea) components[i]).setValue(texts[i]);
components[i].setSizeFull();
}
bl = new BorderLayout();
vlo.addComponent(bl);
vlo.setExpandRatio(bl, 1);
bl.addComponent(components[0], BorderLayout.Constraint.NORTH);
bl.addComponent(components[1], BorderLayout.Constraint.SOUTH);
bl.addComponent(components[2], BorderLayout.Constraint.CENTER);
bl.addComponent(components[3], BorderLayout.Constraint.EAST);
bl.addComponent(components[4], BorderLayout.Constraint.WEST);
return vlo;
}
示例5: createDescription
import com.vaadin.ui.TextArea; //导入依赖的package包/类
/**
* Creates the description.
*
* @return the text area
*/
private static TextArea createDescription() {
final TextArea totalpartytoplistLabel = new TextArea(
"Party Ranking by topic",
"Time served in Parliament:ALL:CURRENT:"
+ "\nTime served in Committees:ALL:CURRENT:"
+ "\nTime served in Government:ALL:CURRENT:"
+ "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType"
+ "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType"
+ "\nTop votes NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
+ "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
+ "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
+ "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
+ "\nSearch by name");
totalpartytoplistLabel.setSizeFull();
totalpartytoplistLabel.setStyleName("Level2Header");
return totalpartytoplistLabel;
}
示例6: createDescription
import com.vaadin.ui.TextArea; //导入依赖的package包/类
/**
* Creates the description.
*
* @return the text area
*/
private static TextArea createDescription() {
final TextArea totalpoliticantoplistLabel = new TextArea("Politician Ranking by topic",
"Time served in Parliament:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
+ "\nTime served in Committees:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
+ "\nTime served in Government:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
+ "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"
+ "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"
+ "\nTop votes:ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
+ "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
+ "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
+ "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
+ "\nSearch by name");
totalpoliticantoplistLabel.setSizeFull();
totalpoliticantoplistLabel.setStyleName("Level2Header");
return totalpoliticantoplistLabel;
}
示例7: 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()));
}
示例8: buildDialogLayout
import com.vaadin.ui.TextArea; //导入依赖的package包/类
@Override
protected void buildDialogLayout() {
final VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setSpacing(true);
mainLayout.setMargin(true);
checkPerGraph = new CheckBox(ctx.tr("sparqlUpdate.dialog.perGraph"));
checkPerGraph.setWidth("100%");
mainLayout.addComponent(checkPerGraph);
mainLayout.setExpandRatio(checkPerGraph, 0.0f);
txtQuery = new TextArea(ctx.tr("sparqlUpdate.dialog.query"));
txtQuery.setSizeFull();
txtQuery.setRequired(true);
txtQuery.addValidator(createSparqlUpdateQueryValidator());
txtQuery.setImmediate(true);
mainLayout.addComponent(txtQuery);
mainLayout.setExpandRatio(txtQuery, 1.0f);
setCompositionRoot(mainLayout);
}
示例9: buildDialogLayout
import com.vaadin.ui.TextArea; //导入依赖的package包/类
@Override
protected void buildDialogLayout() {
final VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setSpacing(true);
mainLayout.setMargin(true);
optMessageType = new OptionGroup(ctx.tr("rdfvalidation.dialog.optMessageType.caption"));
optMessageType.addItem(DPUContext.MessageType.ERROR);
optMessageType.addItem(DPUContext.MessageType.WARNING);
optMessageType.setValue(optMessageType.getItem(0));
mainLayout.addComponent(optMessageType);
txtAskQuery = new TextArea(ctx.tr("rdfvalidation.dialog.txtAskQuery.caption"));
txtAskQuery.setSizeFull();
txtAskQuery.setNullRepresentation("");
txtAskQuery.setNullSettingAllowed(true);
mainLayout.addComponent(txtAskQuery);
mainLayout.setExpandRatio(txtAskQuery, 1.0f);
setCompositionRoot(mainLayout);
}
示例10: buildDialogLayout
import com.vaadin.ui.TextArea; //导入依赖的package包/类
@Override
protected void buildDialogLayout() {
final VerticalLayout mainLayout = new VerticalLayout();
mainLayout.setSizeFull();
mainLayout.setSpacing(true);
mainLayout.setMargin(true);
checkPerGraph = new CheckBox(ctx.tr("SparqlConstructVaadinDialog.perGraphMode"));
checkPerGraph.setWidth("100%");
mainLayout.addComponent(checkPerGraph);
mainLayout.setExpandRatio(checkPerGraph, 0.0f);
txtQuery = new TextArea(ctx.tr("SparqlConstructVaadinDialog.constructQuery"));
txtQuery.setSizeFull();
txtQuery.setRequired(true);
txtQuery.addValidator(createSparqlQueryValidator());
txtQuery.setImmediate(true);
mainLayout.addComponent(txtQuery);
mainLayout.setExpandRatio(txtQuery, 1.0f);
setCompositionRoot(mainLayout);
}
示例11: initBeanFormFieldFactory
import com.vaadin.ui.TextArea; //导入依赖的package包/类
@Override
protected AbstractBeanFieldGroupEditFieldFactory<ProjectRole> initBeanFormFieldFactory() {
return new AbstractBeanFieldGroupEditFieldFactory<ProjectRole>(editForm) {
private static final long serialVersionUID = 1L;
@Override
protected Field<?> onCreateField(Object propertyId) {
if (propertyId.equals("description")) {
final TextArea textArea = new TextArea();
textArea.setNullRepresentation("");
return textArea;
} else if (propertyId.equals("rolename")) {
final TextField tf = new TextField();
if (isValidateForm) {
tf.setNullRepresentation("");
tf.setRequired(true);
tf.setRequiredError("Please enter a role name");
}
return tf;
}
return null;
}
};
}
示例12: ImportFromClipboardWindow
import com.vaadin.ui.TextArea; //导入依赖的package包/类
public ImportFromClipboardWindow(String typeName, String columnsStringLabel) {
super(Constants.uiImportFromClipboard);
setResizable(false);
setWidth("420px");
TextArea textArea = new TextArea();
textArea.addListener(this);
textArea.setImmediate(true);
textArea.setBuffered(true);
textArea.setWidth("100%");
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.addComponent(new Label(Constants.uiImportFromClipboardInstructions(columnsStringLabel), Label.CONTENT_XHTML));
layout.addComponent(textArea);
setContent(layout);
textArea.focus();
}
示例13: buildHorizontalLayout_1
import com.vaadin.ui.TextArea; //导入依赖的package包/类
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
// common part: create layout
horizontalLayout_1 = new HorizontalLayout();
horizontalLayout_1.setImmediate(false);
horizontalLayout_1.setWidth("100.0%");
horizontalLayout_1.setHeight("-1px");
horizontalLayout_1.setMargin(false);
// textArea
textArea = new TextArea();
textArea.setImmediate(false);
textArea.setWidth("100.0%");
textArea.setHeight("-1px");
horizontalLayout_1.addComponent(textArea);
horizontalLayout_1.setExpandRatio(textArea, 1.0f);
return horizontalLayout_1;
}
示例14: buildVerticalLayoutFile
import com.vaadin.ui.TextArea; //导入依赖的package包/类
private VerticalLayout buildVerticalLayoutFile() {
// common part: create layout
verticalLayoutFile = new VerticalLayout();
verticalLayoutFile.setImmediate(false);
verticalLayoutFile.setWidth("100.0%");
verticalLayoutFile.setHeight("100.0%");
verticalLayoutFile.setMargin(false);
// textAreaFile
textAreaFile = new TextArea();
textAreaFile.setCaption("Comentarios");
textAreaFile.setImmediate(false);
textAreaFile.setWidth("100.0%");
textAreaFile.setHeight("-1px");
verticalLayoutFile.addComponent(textAreaFile);
// horizontalLayoutFileToolbox
horizontalLayoutFileToolbox = buildHorizontalLayoutFileToolbox();
verticalLayoutFile.addComponent(horizontalLayoutFileToolbox);
return verticalLayoutFile;
}
示例15: addLogArea
import com.vaadin.ui.TextArea; //导入依赖的package包/类
private void addLogArea() {
logArea = new TextArea( "Coordinator Logs" );
// TODO make this file point configurable
file = new File( "/var/log/chop-webapp.log" );
try {
r = new RandomAccessFile( file, "r" );
}
catch ( FileNotFoundException e ) {
LOG.error( "Error while accessing file {}: {}", file, e );
}
logArea.setHeight( "100%" );
logArea.setWidth( "100%" );
getApplicationLog();
addComponent( logArea );
this.setComponentAlignment( logArea, Alignment.TOP_CENTER );
this.setExpandRatio( logArea, 0.95f );
}