Package com.vaadin.ui

Examples of com.vaadin.ui.TextArea


    @Override
    protected void setup() {

        HorizontalLayout hl = new HorizontalLayout();

        TextArea areaUndefined = new TextArea();
        areaUndefined.setSizeUndefined();
        areaUndefined.setValue("Undefined height");
        hl.addComponent(areaUndefined);

        TextArea areaDefined = new TextArea();
        areaDefined.setHeight("200px");
        areaDefined.setValue("200px height");
        hl.addComponent(areaDefined);

        TextArea areaRelativeBottom = new TextArea();
        areaRelativeBottom.setHeight("50%");
        areaRelativeBottom.setValue("50% height, bottom align");
        hl.addComponent(areaRelativeBottom);
        hl.setComponentAlignment(areaRelativeBottom, Alignment.BOTTOM_LEFT);

        TextArea areaRelativeCenter = new TextArea();
        areaRelativeCenter.setHeight("50%");
        areaRelativeCenter.setValue("50% height, center align");
        hl.addComponent(areaRelativeCenter);
        hl.setComponentAlignment(areaRelativeCenter, Alignment.MIDDLE_LEFT);

        TextArea areaRelativeTop = new TextArea();
        areaRelativeTop.setHeight("50%");
        areaRelativeTop.setValue("50% height, top align");
        hl.addComponent(areaRelativeTop);
        hl.setComponentAlignment(areaRelativeTop, Alignment.TOP_LEFT);

        addComponent(hl);
    }
View Full Code Here


        @Override
        public Field<?> createField(Item item, Object propertyId,
                Component uiContext) {
            if (propertyId.equals("CSSString")) {
                TextArea f = new TextArea();
                f.setRows(5);
                f.setHeight("8em");
                f.setCaption("CSS string");
                return f;
            } else if (((String) propertyId).contains("Units")) {
                NativeSelect s = new NativeSelect() {
                };
                s.addContainerProperty("caption", String.class, "");
View Full Code Here

        panel.setSizeUndefined();

        container.addComponent(panel);

        TextArea expand = new TextArea();
        expand.setId("expandedElement");
        expand.setSizeFull();
        container.addComponent(expand);

        container.setExpandRatio(expand, 1);
    }
View Full Code Here

        TextField website = new TextField("Website");
        website.setInputPrompt("http://");
        website.setWidth("100%");
        form.addComponent(website);

        TextArea shortbio = new TextArea("Short Bio");
        shortbio.setValue("Quis aute iure reprehenderit in voluptate velit esse. Cras mattis iudicium purus sit amet fermentum.");
        shortbio.setWidth("100%");
        shortbio.setRows(2);
        form.addComponent(shortbio);

        final RichTextArea bio = new RichTextArea("Bio");
        bio.setWidth("100%");
        bio.setValue("<div><p><span>Integer legentibus erat a ante historiarum dapibus.</span> <span>Vivamus sagittis lacus vel augue laoreet rutrum faucibus.</span> <span>A communi observantia non est recedendum.</span> <span>Morbi fringilla convallis sapien, id pulvinar odio volutpat.</span> <span>Ab illo tempore, ab est sed immemorabili.</span> <span>Quam temere in vitiis, legem sancimus haerentia.</span></p><p><span>Morbi odio eros, volutpat ut pharetra vitae, lobortis sed nibh.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Cum sociis natoque penatibus et magnis dis parturient.</span> <span>Quam diu etiam furor iste tuus nos eludet?</span> <span>Tityre, tu patulae recubans sub tegmine fagi  dolor.</span></p><p><span>Curabitur blandit tempus ardua ridiculus sed magna.</span> <span>Phasellus laoreet lorem vel dolor tempus vehicula.</span> <span>Etiam habebis sem dicantur magna mollis euismod.</span> <span>Hi omnes lingua, institutis, legibus inter se differunt.</span></p></div>");
View Full Code Here

        row = new HorizontalLayout();
        row.addStyleName("wrapping");
        row.setSpacing(true);
        addComponent(row);

        TextArea ta = new TextArea("Normal");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Inline icon");
        ta.setInputPrompt("Inline icon not really working");
        ta.addStyleName("inline-icon");
        ta.setIcon(testIcon.get());
        row.addComponent(ta);

        ta = new TextArea("Custom color");
        ta.addStyleName("color1");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Custom color, read-only");
        ta.addStyleName("color2");
        ta.setValue("Field value, spanning multiple lines of text");
        ta.setReadOnly(true);
        row.addComponent(ta);

        ta = new TextArea("Custom color");
        ta.addStyleName("color3");
        ta.setValue("Field value, spanning multiple lines of text");
        row.addComponent(ta);

        ta = new TextArea("Small");
        ta.addStyleName("small");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Large");
        ta.addStyleName("large");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Borderless");
        ta.addStyleName("borderless");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Right-aligned");
        ta.addStyleName("align-right");
        ta.setValue("Field value, spanning multiple lines of text");
        row.addComponent(ta);

        ta = new TextArea("Centered");
        ta.addStyleName("align-center");
        ta.setValue("Field value, spanning multiple lines of text");
        row.addComponent(ta);

        ta = new TextArea("Tiny");
        ta.addStyleName("tiny");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        ta = new TextArea("Huge");
        ta.addStyleName("huge");
        ta.setInputPrompt("Write your comment…");
        row.addComponent(ta);

        RichTextArea rta = new RichTextArea();
        rta.setValue("<b>Some</b> <i>rich</i> content");
        row.addComponent(rta);
View Full Code Here

    parent.removeComponent(editor);
  }

  @Override
  protected void createComponent() {
    editor = new TextArea();
    editor.setImmediate(true);
    editor.setEnabled(target.isEnabled());
    editor.addListener(this);
    editor.setWidth("100%");
    ((ILayout)parent).addComponent(target, editor);
View Full Code Here

import com.vaadin.ui.TextField;

public class UiTextArea extends UiText {

  protected AbstractField createTextField() {
    TextArea out = new TextArea();
    out.setHeight(getElement().getConfig().getInt("height", 200),Sizeable.UNITS_PIXELS);
    return out;
  }
View Full Code Here

    Panel notifications() {
        Panel p = new Panel("Notifications");
        VerticalLayout content = new VerticalLayout() {
            Notification notification = new Notification("");
            TextField title = new TextField("Title");
            TextArea description = new TextArea("Description");
            MenuBar style = new MenuBar();
            MenuBar type = new MenuBar();
            String typeString = "";
            String styleString = "";
            TextField delay = new TextField();
            {
                setSpacing(true);
                setMargin(true);

                title.setInputPrompt("Title for the notification");
                title.addValueChangeListener(new ValueChangeListener() {
                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        if (title.getValue() == null
                                || title.getValue().length() == 0) {
                            notification.setCaption(null);
                        } else {
                            notification.setCaption(title.getValue());
                        }
                    }
                });
                title.setValue("Notification Title");
                title.setWidth("100%");
                addComponent(title);

                description.setInputPrompt("Description for the notification");
                description.addStyleName("small");
                description.addValueChangeListener(new ValueChangeListener() {
                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        if (description.getValue() == null
                                || description.getValue().length() == 0) {
                            notification.setDescription(null);
                        } else {
                            notification.setDescription(description.getValue());
                        }
                    }
                });
                description
                        .setValue("A more informative message about what has happened. Nihil hic munitissimus habendi senatus locus, nihil horum? Inmensae subtilitatis, obscuris et malesuada fames. Hi omnes lingua, institutis, legibus inter se differunt.");
                description.setWidth("100%");
                addComponent(description);

                Command typeCommand = new Command() {
                    @Override
                    public void menuSelected(MenuItem selectedItem) {
View Full Code Here

     * @return a {@link TextArea} instance, never <code>null</code>.
     */
    final TextArea getProperties(LogEvent event) {
        Dictionary props = event.getProperties();

        TextArea area = new TextArea("", dumpProperties(props));
        area.setWidth(FILL_AREA);
        area.setRows(props.size());
        area.setWordwrap(false);
        area.setReadOnly(true);
        area.setImmediate(true);
        return area;
    }
View Full Code Here

            setWidth("100%");

            m_id = id;
            m_object = object;

            m_editor = new TextArea(null, initialText);
            m_editor.setRows(15);
            m_editor.addListener(this);
            m_editor.setImmediate(true);
            m_editor.setWidth("100%");
            m_editor.setHeight("70%");
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.