Package com.vaadin.ui

Examples of com.vaadin.ui.AbsoluteLayout.addComponent()


     * Add component w/o giving positions, assert that everything is unset
     */
    public void testNoPosition() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

        assertNull(layout.getPosition(b).getTopValue());
        assertNull(layout.getPosition(b).getBottomValue());
        assertNull(layout.getPosition(b).getLeftValue());
        assertNull(layout.getPosition(b).getRightValue());
View Full Code Here


        table.addItem(new Object[] { "Araujo", "D.1", 8, 8, " ", 16 }, 1);
        table.addItem(new Object[] { "Claudio", "D.2", 2, 10, " ", 12 }, 2);
        table.setPageLength(12);

        vT.addComponent(table, "left: 50px; top: 50px;");
        return vT;

    }

    private VerticalLayout GDocs(String end) throws MalformedURLException {
View Full Code Here

     * Add component, setting all attributes using CSS, assert getter agree
     */
    public void testFullCss() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

        assertEquals(CSS_VALUE, layout.getPosition(b).getTopValue());
        assertEquals(CSS_VALUE, layout.getPosition(b).getBottomValue());
        assertEquals(CSS_VALUE, layout.getPosition(b).getLeftValue());
        assertEquals(CSS_VALUE, layout.getPosition(b).getRightValue());
View Full Code Here

     * Add component, setting some attributes using CSS, assert getters agree
     */
    public void testPartialCss() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, PARTIAL_CSS);

        assertEquals(CSS_VALUE, layout.getPosition(b).getTopValue());
        assertNull(layout.getPosition(b).getBottomValue());
        assertEquals(CSS_VALUE, layout.getPosition(b).getLeftValue());
        assertNull(layout.getPosition(b).getRightValue());
View Full Code Here

     * CSS; assert getters agree and the appropriate attributes are unset.
     */
    public void testPartialCssReset() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

        layout.getPosition(b).setCSSString(PARTIAL_CSS);

        assertEquals(CSS_VALUE, layout.getPosition(b).getTopValue());
        assertNull(layout.getPosition(b).getBottomValue());
View Full Code Here

    public void testSetPosition() {
        final Float SIZE = Float.valueOf(12);

        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

        layout.getPosition(b).setTopValue(SIZE);
        layout.getPosition(b).setRightValue(SIZE);
        layout.getPosition(b).setBottomValue(SIZE);
        layout.getPosition(b).setLeftValue(SIZE);
View Full Code Here

     */
    public void testSetPosition2() {
        final Float SIZE = Float.valueOf(12);
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

        layout.getPosition(b).setTop(SIZE, Sizeable.Unit.CM);
        layout.getPosition(b).setRight(SIZE, Sizeable.Unit.EX);
        layout.getPosition(b).setBottom(SIZE, Sizeable.Unit.INCH);
        layout.getPosition(b).setLeft(SIZE, Sizeable.Unit.MM);
View Full Code Here

     * calls, assert getters agree.
     */
    public void testUnsetPosition() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

        layout.getPosition(b).setTopValue(null);
        layout.getPosition(b).setRightValue(null);
        layout.getPosition(b).setBottomValue(null);
        layout.getPosition(b).setLeftValue(null);
View Full Code Here

        css.setId("layout" + debugIdCounter++);
        addComponent(css);

        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setCaption("Abs layout");
        abs.addComponent(new Label("Some content"));
        abs.setComponentError(new UserError("A error message..."));
        abs.setId("layout" + debugIdCounter++);

        addComponent(abs);
View Full Code Here

        final AbsoluteLayout al = new AbsoluteLayout();
        al.setCaption("AbsoluteLayout");
        al.setStyleName("borders");
        al.setWidth("300px");
        al.setHeight("500px");
        al.addComponent(new TextField("This is its caption",
                "This is a textfield"), "top: 60px; left: 0px; width: 100px;");
        al.addComponent(new TextField("Another textfield caption",
                "This is another textfield"),
                "top: 120px; left: 20px; width: 100px;");
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.