Package com.vaadin.ui

Examples of com.vaadin.ui.TextArea


        ol.setSpacing(true);

        // ol.setWidth("");
        ol.setCaption("OverFilled with fixed width (" + ol.getWidth()
                + "px) and dynamic height");
        TextArea tf;

        for (int i = 0; i < 10; i++) {
            tf = new TextArea("200x200px Field");
            tf.setCaption("This one has a caption");
            tf.setWidth("200px");
            tf.setHeight(((i + 1) * 50) + "px");
            tf.setValue(tf.getWidth() + "x" + tf.getHeight() + " TextField");
            tf.setRequired(true);
            // tf.setComponentError(new UserError("It's broken!"));

            // tf.setHeight("100%");
            // tf.setWidth("100px");
            tf.setRows(2);
            ol.addComponent(tf);
        }

        return ol;
    }
View Full Code Here


        ol.setSpacing(true);

        // ol.setWidth("");
        ol.setCaption("100 % filled with fixed width (" + ol.getWidth()
                + "px) and fixed height (" + ol.getHeight() + "px)");
        TextArea ta;

        ta = new TextArea();
        ta.setCaption("This one has a caption");
        ta.setValue("60% expand TextField");
        ta.setWidth("100%");
        ta.setHeight("100%");
        // ta.setRequired(true);
        // ta.setComponentError(new UserError("It's broken!"));

        // ta.setHeight("100%");
        // ta.setWidth("100px");
        ta.setRows(2);
        ol.addComponent(ta);
        ol.setExpandRatio(ta, 60);

        ta = new TextArea();
        ta.setValue("100px 100px TextField");
        ta.setWidth("100px");
        ta.setHeight("100px");
        ta.setRows(2);
        ol.addComponent(ta);
        ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER);

        //

        ta = new TextArea("40%x40% Field");
        // ta.setCaption(null);
        ta.setValue("40% expand (40% height) TextField");
        ta.setWidth("100%");
        ta.setHeight("40%");
        ol.addComponent(ta);
        ol.setExpandRatio(ta, 40);
        // ta.setRequired(true);
        ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);

        ta.setRows(2);

        return ol;
    }
View Full Code Here

        ol.setSpacing(false);

        // ol.setWidth("");
        ol.setCaption("100 % filled with fixed width (" + ol.getWidth()
                + "px) and fixed height (" + ol.getHeight() + "px)");
        TextArea ta;

        ta = new TextArea();
        // ta.setCaption("This one has a caption");
        ta.setValue("80% x 20% TextField");
        ta.setWidth("80%");
        ta.setHeight("20%");
        // ta.setRequired(true);
        // ta.setComponentError(new UserError("It's broken!"));

        // ta.setHeight("100%");
        // ta.setWidth("100px");
        ta.setRows(2);
        ol.addComponent(ta);
        //

        ta = new TextArea("20%x60% Field");
        ta.setCaption(null);
        ta.setValue("20% x 60% TextField");
        ta.setWidth("20%");
        ta.setHeight("60%");
        // ta.setRequired(true);
        ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);

        ta.setRows(2);
        ol.addComponent(ta);

        return ol;
    }
View Full Code Here

        ol.setSpacing(true);

        // ol.setWidth("");
        ol.setCaption("Underfilled with fixed width (" + ol.getWidth()
                + "px) and fixed height (" + ol.getHeight() + "px)");
        TextArea ta;

        ta = new TextArea("60%x100% Field");
        ta.setCaption("Short capt");
        ta.setValue("60% x 100% TextField");
        ta.setWidth("60%");
        ta.setHeight("100%");
        ta.setRequired(true);
        ta.setRows(2);

        ol.addComponent(ta);
        ol.setComponentAlignment(ta, Alignment.MIDDLE_CENTER);

        ta = new TextArea("200px x 200px Field");
        // ta.setIcon(new ThemeResource("icons/16/document-add.png"));
        ta.setValue("200x200 field");
        ta.setRows(2);
        // ta.setSizeFull();
        ta.setHeight("200px");
        ta.setWidth("200px");
        ol.addComponent(ta);
        ol.setComponentAlignment(ta, Alignment.TOP_LEFT);

        ta = new TextArea("200px x 200px Field");
        // ta.setIcon(new ThemeResource("icons/16/document-add.png"));
        ta.setValue("200x200 field");
        ta.setRows(2);
        // ta.setSizeFull();
        ta.setHeight("200px");
        ta.setWidth("200px");
        ol.addComponent(ta);
        ol.setComponentAlignment(ta, Alignment.BOTTOM_RIGHT);
        return ol;
    }
View Full Code Here

        return tf;
    }

    private static TextArea createTextArea() {
        TextArea ta = new TextArea();
        ta.setCaption("Text area");
        ta.setValue("So we have some text to select");
        ta.setWidth("400px");
        ta.setHeight("50px");

        return ta;
    }
View Full Code Here

    @Override
    protected void setup() {
        TabSheet tabsheet = new TabSheet();
        tabsheet.setWidth(null);
        tabsheet.setHeight("200px");
        TextArea tf = new TextArea();
        tf.setRows(2);
        tf.setHeight("300px");
        tf.setWidth("200px");
        tabsheet.addTab(
                tf,
                "A text area that is 200px wide, the tab bar for the tabsheet is wider",
                null);
        TextArea tf2 = new TextArea("Another tab", "b");
        tf2.setWidth("1000px");
        tf2.setHeight("50px");
        tabsheet.addTab(tf2);
        addComponent(tabsheet);
    }
View Full Code Here

public class ComboboxInPopupViewWithItems extends TestBase {

    @Override
    protected void setup() {
        addComponent(new TextArea("Some component"));
        addComponent(new PopupView(new PopupContent()));

    }
View Full Code Here

        vl = new VerticalLayout();
        vl.setHeight("40px");
        vl.setWidth("200px");

        TextArea ta = new TextArea();
        ta.setRows(2); // make it text area, instead of oneliner
        ta.setSizeFull();
        vl.addComponent(ta);
        vl.setCaption("Fullsize textarea in 100px height 200px width box");
        cssLayout.addComponent(vl);

        vl = new VerticalLayout();
View Full Code Here

    protected void setup() {
        getLayout().setSizeFull();

        AbsoluteLayout al = new AbsoluteLayout();

        TextArea ta = new TextArea();
        ta.setValue("When resizing the layout this text area should also get resized");
        ta.setSizeFull();
        al.addComponent(ta, "left: 10px; right: 10px; top: 10px; bottom: 10px;");

        HorizontalSplitPanel horizPanel = new HorizontalSplitPanel();
        horizPanel.setSizeFull();
        horizPanel.setFirstComponent(al);
View Full Code Here

@SuppressWarnings("serial")
public class NewItemsESCPress extends TestBase {

    @Override
    protected void setup() {
        final TextArea addedItems = new TextArea("Last added items:");
        addedItems.setRows(10);
        addComponent(addedItems);

        final ComboBox box = new ComboBox("New items are allowed");
        box.setNewItemsAllowed(true);
        box.setNewItemHandler(new NewItemHandler() {
            @Override
            public void addNewItem(String newItemCaption) {
                String value = addedItems.getValue();
                addedItems.setValue(value + newItemCaption + "\n");
                box.addItem(newItemCaption);
            }
        });
        box.setImmediate(true);
        addComponent(box);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.TextArea

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.