Examples of AbsoluteLayout


Examples of com.vaadin.ui.AbsoluteLayout

     * full-sized {@link AbsoluteLayout}.
     *
     * @return the created layout
     */
    private AbsoluteLayout createFullOnFull() {
        AbsoluteLayout absoluteLayout = new AbsoluteLayout();
        absoluteLayout.setSizeFull();
        absoluteLayout.setId("fullonfull-outer");
        absoluteLayout.addStyleName("cyan");
        absoluteLayout.setCaption("area with red border expected");

        AbsoluteLayout absoluteLayout2 = new AbsoluteLayout();
        absoluteLayout2.setSizeFull();
        absoluteLayout2.setId("fullonfull-inner");
        absoluteLayout2.addStyleName("redborder");

        absoluteLayout.addComponent(absoluteLayout2, "top:50px;left:100px;");
        return absoluteLayout;
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

public class AbsoluteLayoutWrapperStyles extends TestBase {

    @Override
    protected void setup() {
        AbsoluteLayout layout = new AbsoluteLayout();
        layout.setWidth("500px");
        layout.setHeight("500px");

        Label lbl = new Label("Label");
        lbl.setStyleName("my-label");
        lbl.addStyleName("my-second-label");
        layout.addComponent(lbl);

        Button btn = new Button("Button");
        btn.setStyleName("my-button");
        btn.addStyleName("my-second-button");
        layout.addComponent(btn, "top:50px;");

        addComponent(layout);
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

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

        final Label l = new Label("A Label");
        final AbsoluteLayout al = new AbsoluteLayout();
        al.setWidth("300px");
        al.setHeight("200px");
        main.addComponent(al);

        final Button b = new Button("Add", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                if (l.getParent() == null) {
                    al.addComponent(l);
                    event.getButton().setCaption("Remove");
                } else {
                    al.removeComponent(l);
                    event.getButton().setCaption("Add");
                }

            }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

public class AbsoluteLayoutPrimaryStylename extends TestBase {

    @Override
    protected void setup() {
        final AbsoluteLayout layout = new AbsoluteLayout();
        layout.setWidth("100px");
        layout.setWidth("200px");
        layout.setPrimaryStyleName("my-absolute-layout");

        Component comp1 = new NativeButton("Child 1");
        comp1.setWidth("100%");
        comp1.setHeight("50px");
        layout.addComponent(comp1);

        addComponent(layout);

        addComponent(new Button("Change primary stylename",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        layout.setPrimaryStyleName("my-second-absolute-layout");
                    }
                }));
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        return null;
    }

    @Override
    protected void setup() {
        AbsoluteLayout layout = new AbsoluteLayout();
        setTheme("tests-tickets");
        layout.setStyleName("cyan");
        layout.setWidth("1000px");
        layout.setHeight("500px");

        layout.addComponent(new Label("Hello World"));

        Button button = new Button("Centered button,z-index:10;");
        button.setSizeFull();
        layout.addComponent(button,
                "top:40%;bottom:40%;right:20%;left:20%;z-index:10;");

        Label label = new Label(
                "Exotic positioned label. Fullsize, top:100px; left:2cm; right: 3.5in; bottom:12.12mm ");
        label.setStyleName("yellow");
        label.setSizeFull();
        layout.addComponent(label,
                "top:100px; left:2cm; right: 3.5in; bottom:12.12mm");

        label = new Label("fullize, bottom:80%;left:80%;");
        label.setStyleName("green");
        label.setSizeFull();
        layout.addComponent(label, "bottom:80%;left:80%;");

        label = new Label("bottomright");
        label.setSizeUndefined();
        label.setStyleName("green");
        layout.addComponent(label, "bottom:0px; right:0px;");

        getLayout().setSizeFull();
        getLayout().addComponent(layout);

        getMainWindow().addWindow(new EditorWindow(layout));
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        });
        addComponent(required);
        addComponent(createWrappedTextField(new GridLayout(2, 1)));
        addComponent(createWrappedTextField(new VerticalLayout()));
        addComponent(createWrappedTextField(new HorizontalLayout()));
        AbsoluteLayout al = new AbsoluteLayout();
        al.setWidth("400px");
        al.setHeight("100px");
        addComponent(createWrappedTextField(al));
        addComponent(createWrappedTextField(new CssLayout()));
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        assertEquals("caption-tab2", layout.getTab(1).getCaption());
    }

    @Test
    public void inflate_absoluteLayout() {
        AbsoluteLayout layout = (AbsoluteLayout) inflater
                .inflate(getXml("absolutelayout.xml"));

        Button button = (Button) layout.getComponentIterator().next();

        // check position attributes
        assertEquals(20, layout.getPosition(button).getTopValue(), 0);
        assertEquals(10, layout.getPosition(button).getLeftValue(), 0);
        assertEquals(Unit.PIXELS, layout.getPosition(button).getTopUnits());
        assertEquals(Unit.PERCENTAGE, layout.getPosition(button).getLeftUnits());
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    @Override
    public Object getValueAs(String value, Class<?> valueType,
            Component component) {
        if (component.getParent() instanceof AbsoluteLayout) {
            AbsoluteLayout outerInstance = (AbsoluteLayout) component
                    .getParent();
            try {
                // ComponentPosition is an inner class that requires
                // an instance of the outer class as a parameter.
                ComponentPosition position = ((ComponentPosition) valueType
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        return c;
    }

    /** Create new AbsoluteLayout and add it to current component container. */
    public AbsoluteLayout absolutelayout() {
        AbsoluteLayout c = new AbsoluteLayout();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    /**
     * Create new AbsoluteLayout with given caption and add it to current
     * component container.
     */
    public AbsoluteLayout absolutelayout(String caption) {
        AbsoluteLayout c = absolutelayout();
        c.setCaption(caption);
        return c;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.