Package com.vaadin.ui

Examples of com.vaadin.ui.CustomComponent$ComponentIterator


    @Override
    protected void setup() {
        final Label label = new Label("Short content");
        label.setWidth(null);

        addComponent(new CustomComponent() {
            {
                GridLayout mainLayout = new GridLayout(1, 1);
                mainLayout.addComponent(label);
                mainLayout.setSizeUndefined();
                setSizeUndefined();
View Full Code Here


    }

    private CustomComponent wrap(String caption, String themeImage) {
        Embedded image = new Embedded(caption, new ThemeResource(
                "../runo/icons/64/" + themeImage));
        CustomComponent cc = new CustomComponent(image);
        return cc;
    }
View Full Code Here

        Label text = new Label(
                "1_long_line_that_should_be_clipped<br/>2_long_line_that_should_be_clipped<br/>3_long_line_that_should_be_clipped<br/>4_long_line_that_should_be_clipped<br/>",
                ContentMode.HTML);

        final CustomComponent cc = new CustomComponent(text);
        cc.setWidth("20px");
        cc.setHeight("20px");

        final TextField w = new TextField("Width");
        w.setValue("20px");
        w.addListener(new TextField.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                cc.setWidth(w.getValue());
            }
        });
        addComponent(w);
        final TextField h = new TextField("Height");
        h.setValue("20px");
        h.addListener(new TextField.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                cc.setHeight(h.getValue());
            }
        });
        addComponent(h);
        Button b = new Button("apply");
        addComponent(b);
View Full Code Here

            Layout lo = (Layout) app.getMainWindow().getContent();
            lo.setParent(null);
            return lo;
        } catch (final Exception e) {
            try {
                final CustomComponent cc = (CustomComponent) c.newInstance();
                cc.setSizeFull();
                return cc;
            } catch (final Exception e1) {
                e1.printStackTrace();
                VerticalLayout lo = new VerticalLayout();
                lo.addComponent(new Label(
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        Label label = new Label("In panel");
        label.setId("label");
        final CustomComponent cc = new CustomComponent(new Panel(
                "In CustomComponent", label));

        Button hideButton = new Button("Hide CustomComponent");
        hideButton.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                cc.setVisible(false);
            }
        });

        addComponent(cc);
        addComponent(hideButton);
View Full Code Here

public class CustomComponentHideContent extends AbstractTestUI {

    @Override
    protected void setup(VaadinRequest request) {
        final Label content = new Label("This is the content");
        CustomComponent customComponent = new CustomComponent(content);
        addComponent(customComponent);

        addComponent(new Button("Toggle content visibility",
                new Button.ClickListener() {
                    @Override
View Full Code Here

    protected void setup() {
        NativeButton nb = new NativeButton(
                "100%x100% button. Click to reduce CustomComponent size");
        nb.setSizeFull();

        final CustomComponent cc = new CustomComponent(nb);
        cc.setWidth("500px");
        cc.setHeight("500px");

        nb.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                cc.setWidth((cc.getWidth() - 20) + "px");
                cc.setHeight((cc.getHeight() - 20) + "px");

            }
        });

        addComponent(cc);
View Full Code Here

    protected void setup(VaadinRequest request) {
        TabSheet ts = new TabSheet();
        ts.addComponent(createPopupView(createSmallTabSheet()));
        ts.addComponent(createTable());
        ts.addComponent(createPanel());
        ts.addComponent(new CustomComponent(new Panel(
                "Panel in custom component", new Button("In panel"))));

        addComponent(ts);
    }
View Full Code Here

    }

    @Override
    protected void setup(VaadinRequest request) {
        final GridLayout layout1 = generateLayout();
        final CustomComponent cc = new CustomComponent(layout1);
        cc.setWidth("500px");
        addComponent(cc);

        Button testButton = new Button("Reduce GridLayout parent width",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        cc.setWidth((cc.getWidth() - 100) + "px");
                    }

                });
        addComponent(testButton);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.CustomComponent$ComponentIterator

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.