Package com.vaadin.ui

Examples of com.vaadin.ui.RichTextArea


        }
        return createDefaultField(type, fieldType);
    }

    protected RichTextArea createRichTextArea() {
        RichTextArea rta = new RichTextArea();
        rta.setImmediate(true);

        return rta;
    }
View Full Code Here


        layout.addComponent(ts);

        for (Class<? extends Component> c : classes) {
            ts.addTab(createComponent(c), c.getSimpleName(), null);
        }
        rta = new RichTextArea();
        rta.setVisible(false);
        ts.addTab(rta, "Hidden rta", null);

        Button b = new Button("Show area", new ClickListener() {
View Full Code Here

        Component c = containerToComponent.get(ts.getSelectedTab());
        c.setVisible(!c.isVisible());
    }

    private Component createComponent(Class<? extends Component> c) {
        RichTextArea textArea = new RichTextArea();
        textArea.setVisible(false);
        textArea.setCaption("This is the textArea");
        textArea.setWidth("200px");
        textArea.setHeight("100px");
        textAreas.add(textArea);
        Component cc = null;

        try {
            cc = c.newInstance();
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return null;
        }
        // if (c == OrderedLayout.class) {
        // cc = new VerticalLayout();
        // } else
        if (c == Accordion.class) {
            // Label l = new Label("Filler");
            // l.setCaption("Filler label");
            // cc.addComponent(l);
        }

        if (c == Form.class) {
            Form f = (Form) cc;
            f.setFormFieldFactory(new FormFieldFactory() {

                @Override
                public Field<?> createField(Item item, Object propertyId,
                        Component uiContext) {
                    formTextArea = new RichTextArea();
                    formTextArea.setVisible(false);
                    return formTextArea;
                }

            });
            f.setItemDataSource(new BeanItem<Object>(new Object() {
                private int a;

                @SuppressWarnings("unused")
                public int getA() {
                    return a;
                }

                @SuppressWarnings("unused")
                public void setA(int a) {
                    this.a = a;
                }
            }));
            containerToComponent.put(f, formTextArea);
            return f;
        }
        containerToComponent.put(cc, textArea);
        if (cc instanceof ComponentContainer) {
            ((ComponentContainer) cc).addComponent(textArea);
        }

        if (AbstractSplitPanel.class.isAssignableFrom(c)) {
            AbstractSplitPanel sp = (AbstractSplitPanel) cc;
            sp.setWidth("300px");
            sp.setHeight("300px");
            sp.addComponent(new Label("Label"));
            textArea.setSizeFull();
        }
        if (c == Panel.class) {
            VerticalLayout layout = new VerticalLayout();
            layout.setMargin(true);
            ((Panel) cc).setContent(layout);
            containerToComponent.put(cc, layout);
            layout.setVisible(false);
            textArea.setVisible(true);
            return cc;
        }

        return cc;
    }
View Full Code Here

        fields.add(tree);
        fields.add(new TwinColSelect());
        fields.add(new PasswordField());
        fields.add(new TextField());
        fields.add(new TextArea());
        fields.add(new RichTextArea());
        fields.add(new CheckBox());
        fields.add(new Slider());

        clearTabIndexes.click();
View Full Code Here

        test(layout, optionGroup);

        final ProgressIndicator pi = new ProgressIndicator();
        test(layout, pi);

        final RichTextArea rta = new RichTextArea();
        test(layout, rta);

        final Select select = new Select("Select " + count++);
        test(layout, select);
View Full Code Here

    @Override
    protected void setup() {
        HorizontalLayout main = new HorizontalLayout();
        getMainWindow().setContent(main);

        RichTextArea first = new RichTextArea();
        RichTextArea second = new RichTextArea();
        RichTextArea third = new RichTextArea();

        first.setWidth("150px");
        first.setHeight("400px");
        second.setSizeFull();
        third.setSizeUndefined();

        VerticalLayout secondLayout = new VerticalLayout();
        secondLayout.setWidth("200px");
        secondLayout.setHeight("200px");
        secondLayout.addComponent(second);
View Full Code Here

            }
        };
        pi.setHeight("0px");
        addComponent(pi);

        rta = new RichTextArea();
        rta.setId("rta");
        rta.setImmediate(true);
        addComponent(rta);
    }
View Full Code Here

        final TextField testField = new TextField("");
        testField.setId("field");
        addComponent(testField);

        final RichTextArea rText = new RichTextArea();
        rText.setWidth("300px");
        rText.setHeight("300px");

        final Window subWindow = new Window("SubWindow");
        subWindow.setWidth("500px");
        subWindow.setHeight("500px");
        subWindow.setModal(true);
View Full Code Here

    public void createNewView() {
        main.removeAllComponents();
        main.addComponent(new Label(
                "RTE uses google richtextArea and their examples toolbar."));

        rte = new RichTextArea();
        rte.addListener(this);

        main.addComponent(rte);

        main.addComponent(new Button("commit content to label below"));
View Full Code Here

        PasswordField pf = new PasswordField();
        pf.setId("textfield" + debugIdCounter++);
        addComponent(pf);

        RichTextArea rta = new RichTextArea();
        rta.setId("textfield" + debugIdCounter++);
        addComponent(rta, 0, 1, 6, 1);

    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.RichTextArea

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.