Package com.vaadin.ui

Examples of com.vaadin.ui.GridLayout$OverlapsException


        this.title = title;
    }

    @Override
    public void init() {
        final GridLayout layout = new GridLayout(1, 3);
        layout.setWidth("100%");
        layout.setMargin(false);
        setMainWindow(new Window(this.title, layout));
       
        final BeanContainer<String, Task> beans = new BeanContainer<String, Task>(Task.class);
        beans.setBeanIdProperty("id");

        final Form form = new Form();
        form.setLocale(Locale.GERMAN);
        final Table table = new Table(this.title, beans);
        MenuBar menu = createMenuBar(beans, table);
        layout.addComponent(menu);
       
        table.setSelectable(true);
        table.setImmediate(true);
        table.setVisibleColumns(VISIBLE_COLUMNS);
        table.addListener(new Property.ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                Object selectedId = table.getValue();
                @SuppressWarnings("unchecked")
                BeanItem<Task> item = (BeanItem<Task>) table.getItem(selectedId);
                form.setItemDataSource(item);
                form.setVisibleItemProperties(VISIBLE_COLUMNS);
           }
        });
        update(beans);
        layout.addComponent(table);

        Object first = table.getItemIds().iterator().next();
        Item item = table.getItem(first);
        form.setItemDataSource(item);

        form.setCaption("Edit Task");
        form.setVisibleItemProperties(VISIBLE_COLUMNS);
        form.setImmediate(true);
        form.addListener(new Property.ValueChangeListener() {
            public void valueChange(ValueChangeEvent event) {
                @SuppressWarnings("unchecked")
                BeanItem<Task> item = (BeanItem<Task>) form.getItemDataSource();
                taskService.updateTask(item.getBean());
            }
        });
        layout.addComponent(form);
    }
View Full Code Here


    userArea.addComponent(loggedInUser);
    return userArea;
  }

  protected GridLayout buildRightArea(String username) {
    GridLayout right = new GridLayout(1, 1);
    right.setWidth(100f, Unit.PERCENTAGE);
    Layout loggedInUser = buildUserArea(username);
    right.addComponent(loggedInUser, 0, 0);
    right.setComponentAlignment(loggedInUser, Alignment.MIDDLE_RIGHT);
    return right;
  }
View Full Code Here

        return 11614;
    }

    @Override
    protected void setup() {
        GridLayout layout = new GridLayout(3, 3);
        layout.setWidth("1000px");
        layout.setHeight("1000px");
        addComponent(layout);

        Button b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
                centered.center();
                getMainWindow().addWindow(centered);
            }
        });
        layout.addComponent(b, 0, 0);

        b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
                centered.center();
                getMainWindow().addWindow(centered);
            }
        });
        layout.addComponent(b, 1, 1);

        b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
                centered.center();
                getMainWindow().addWindow(centered);
            }
        });
        layout.addComponent(b, 2, 2);

    }
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);
        // setTheme("tests-tickets");
        w.setContent(new GridLayout(2, 2));
        // w.getLayout().setSizeFull();
        createUI((Layout) w.getContent());
    }
View Full Code Here

    private void gridLayout(Layout layout) {
        Panel p = new Panel("GridLayout");
        layout.addComponent(p);

        GridLayout gl = new GridLayout(1, 4);
        gl.setMargin(true);
        gl.setCaption("Horizontal");
        Button b;

        b = new Button("Wide button");
        b.setWidth("500px");
        gl.addComponent(b);

        addButtons(gl);

        p.setContent(gl);

        /* VERTICAL */

        gl = new GridLayout(4, 1);
        gl.setMargin(true);
        gl.setCaption("Vertical");

        addButtons(gl);

        b = new Button("High button");
        b.setHeight("200px");
        gl.addComponent(b);

        p.setContent(gl);

    }
View Full Code Here

    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);

        // VerticalLayout l = new VerticalLayout();
        GridLayout l = new GridLayout();
        w.setContent(l);

        l.setHeight("504px");

        for (int i = 1; i <= 5; i++) {
            Button b = new Button("Button " + i
                    + " should be 100px or 101px high");
            b.setHeight("100%");
            l.addComponent(b);
        }
    }
View Full Code Here

        setMainWindow(main);

        HorizontalLayout pl = new HorizontalLayout();
        Panel p = new Panel("Test wrapper for gridlayout margin/spacing", pl);

        gl = new GridLayout(3, 3);
        gl.setMargin(true);
        for (int i = 0; i < 3 * 3; i++) {
            gl.addComponent(new Button("test"));
        }
        pl.addComponent(gl);
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getName());
        setMainWindow(w);
        // setTheme("tests-ticket");
        GridLayout layout = new GridLayout(10, 10);
        w.setContent(layout);
        createUI(layout);
    }
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);
        // setTheme("tests-tickets");
        GridLayout layout = new GridLayout(10, 10);
        w.setContent(layout);
        createUI(layout);
    }
View Full Code Here

    @Override
    public void init() {
        LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
        setMainWindow(w);

        GridLayout gl = new GridLayout(3, 3);
        gl.setSpacing(true);
        gl.addComponent(new Label("Before form"));
        gl.newLine();

        form = new Form(gl);
        form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));

        gl.addComponent(new Label("After form"));

        w.addComponent(form);

        w.addComponent(new Button("new item", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));

            }

        }));
        w.addComponent(new Button("new bigger item",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setItemDataSource(new BeanItem<MyBean>(
                                new MyBiggerBean()));

                    }

                }));
        w.addComponent(new Button("new grid layout",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setLayout(new GridLayout());

                    }

                }));
        w.addComponent(new Button("new form layout",
View Full Code Here

TOP

Related Classes of com.vaadin.ui.GridLayout$OverlapsException

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.