Package com.vaadin.ui

Examples of com.vaadin.ui.Layout$AlignmentHandler


  }

  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


    }

    public class TabComposite extends CustomComponent {

        public TabComposite() {
            Layout mainLayout = new VerticalLayout();
            addComponent(mainLayout);
            setCompositionRoot(mainLayout);

            Component table = new Table();
            table.setWidth("100%");
            table.setId(TABLE);
            mainLayout.addComponent(table);
        }
View Full Code Here

        getMainWindow()
                .addComponent(
                        new Label(
                                "Defining spacing must be possible also with pure CSS"));

        Layout gl;
        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        gl.setStyleName("t2232");
        fillAndAdd(gl);

        gl = new GridLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        gl.setStyleName("t2232");
        fillAndAdd(gl);

        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        ((SpacingHandler) gl).setSpacing(true);
        fillAndAdd(gl);

        gl = new GridLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        ((SpacingHandler) gl).setSpacing(true);
        fillAndAdd(gl);

        gl = new VerticalLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        fillAndAdd(gl);

        gl = new GridLayout();
        gl.setWidth("100%");
        gl.setHeight("200px");
        fillAndAdd(gl);

    }
View Full Code Here

        setMainWindow(main);

        main.addComponent(new Label(
                "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks."));

        final Layout lo = new VerticalLayout();

        Button b = new Button("b");

        main.addComponent(b);
        main.addComponent(lo);
View Full Code Here

        private Ticket2998 workoutLog;

        public WorkoutEditor(Ticket2998 app) {
            super("Edit workout");
            workoutLog = app;
            Layout main = new VerticalLayout();
            setContent(main);
            main.setSizeUndefined();
            main.setStyleName(Reindeer.PANEL_LIGHT);

            FormLayout form = new FormLayout();
            form.setSizeUndefined();
            date.setResolution(DateField.RESOLUTION_MIN);
            form.addComponent(date);
            form.addComponent(kilomiters);
            form.addComponent(title);
            main.addComponent(form);

        }
View Full Code Here

        switchToFormsButton.setEnabled(true);

        b.setEnabled(false);
        Iterator<Component> i = mainLayout.getComponentIterator();
        i.next();
        Layout l = (Layout) i.next();

        mainLayout.replaceComponent(l, newLayout);
    }
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        final Window window = new Window("Test window");
        addWindow(window);

        final Layout layout1 = new VerticalLayout();
        Button button1 = new Button("Button 1");
        layout1.addComponent(button1);

        final Layout layout2 = new VerticalLayout();
        Button button2 = new Button("Button 2");
        layout2.addComponent(button2);

        window.setContent(layout1);

        button1.addListener(new ClickListener() {
View Full Code Here

    }

    @Override
    protected void setup() {
        Layout l = getLayout();

        populateContainer(hier);

        // sort(indexedContainer);

        tree1 = new Tree("Tree with wrapped IndexedContainer");
        tree1.setContainerDataSource(hier);
        tree1.setItemCaptionPropertyId("name");
        for (Object id : hier.rootItemIds()) {
            tree1.expandItemsRecursively(id);
        }
        l.addComponent(tree1);

        // This contains a bug, changes not reflected back to client
        Button modify = new Button("Modify and sort (has a bug)",
                new ClickListener() {
                    private static final long serialVersionUID = 1L;

                    @Override
                    public void buttonClick(ClickEvent event) {
                        // Get first item
                        Object itemId = indexedContainer.getIdByIndex(0);
                        Item item = indexedContainer.getItem(itemId);
                        Property<String> property = item
                                .getItemProperty("name");
                        // Prepend with Z so item should get sorted later
                        property.setValue("Z " + property.getValue());
                        // this does not work alone, requires extraneous
                        // setContainerDataSource for server-side changes to be
                        // reflected back to client-side
                        sort(indexedContainer);
                    }
                });
        l.addComponent(modify);

        Table t = new Table("Table with indexed container", indexedContainer);

        l.addComponent(t);
    }
View Full Code Here

        LegacyWindow w = new LegacyWindow();
        setMainWindow(w);
        w.getContent().setSizeFull();
        ((SpacingHandler) w.getContent()).setSpacing(true);

        Layout layout = new GridLayout(3, 3);
        populateLayout(layout);
        w.addComponent(layout);
        layout = new HorizontalLayout();
        populateLayout(layout);
        w.addComponent(layout);
View Full Code Here

        assertOrder(layout, new int[] { 2, 3, 1, 0 });
    }

    @Test
    public void testConstructorWithComponents() {
        Layout layout = new CssLayout(children);
        assertOrder(layout, new int[] { 0, 1, 2, 3 });
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Layout$AlignmentHandler

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.