Example usage for com.vaadin.ui Component setHeight

List of usage examples for com.vaadin.ui Component setHeight

Introduction

In this page you can find the example usage for com.vaadin.ui Component setHeight.

Prototype

public void setHeight(String height);

Source Link

Document

Sets the height of the component using String presentation.

Usage

From source file:edu.nps.moves.mmowgli.modules.userprofile.UserProfileMyIdeasPanel2.java

License:Open Source License

private void showFavoritesOrBuilds2(Component c) {
    //getRightLayout().setSizeUndefined();  // if layout is full size, content goes in center, we want top
    getRightLayout().addComponent(c);/*  w  w  w  .  j a v  a2s. com*/
    getRightLayout().setComponentAlignment(c, Alignment.TOP_CENTER);
    c.setWidth("670px");
    c.setHeight("720px");
    lastTable = c;
}

From source file:info.magnolia.ui.vaadin.richtext.TextAreaStretcher.java

License:Open Source License

public TextAreaStretcher() {
    registerRpc(new TextAreaStretcherServerRpc() {
        @Override//w w  w. j  av a  2 s .  c  o  m
        public void toggle(int initialWidth, int initialHeight) {
            getState().isCollapsed = !getState().isCollapsed;
            final Component parent = (Component) getParent();
            if (getState().isCollapsed) {
                // Restore size info from the state.
                parent.setWidth(getState().collapsedStateWidth);
                parent.setHeight(getState().collapsedStateHeight);
            } else {

                // We save the initial dimensions and clear size info from the state.
                getState().collapsedStateHeight = parent.getHeight() + parent.getHeightUnits().toString();
                getState().collapsedStateWidth = parent.getWidth() + parent.getWidthUnits().toString();
                parent.setWidth("");
                parent.setHeight("");
            }
        }
    });
}

From source file:org.activiti.explorer.ui.management.identity.UserDetailPanel.java

License:Apache License

protected void loadPicture() {
    Component pictureComponent = null;
    final Picture userPicture = identityService.getUserPicture(user.getId());
    if (userPicture != null) {
        StreamResource imageresource = new StreamResource(new StreamSource() {
            private static final long serialVersionUID = 1L;

            public InputStream getStream() {
                return userPicture.getInputStream();
            }//from  w  w w .j  a va2  s. c  om
        }, user.getId() + "." + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()),
                ExplorerApp.get());
        pictureComponent = new Embedded(null, imageresource);
    } else {
        pictureComponent = new Label("");
    }
    pictureComponent.setHeight("200px");
    pictureComponent.setWidth("200px");
    pictureComponent.addStyleName(ExplorerLayout.STYLE_PROFILE_PICTURE);
    userDetailsLayout.addComponent(pictureComponent);
    userDetailsLayout.setComponentAlignment(pictureComponent, Alignment.MIDDLE_CENTER);
}

From source file:org.lunifera.mobile.vaadin.ecview.presentation.internal.NavigationPagePresentation.java

License:Open Source License

/**
 * Sets the alignment to the component./*from  w w  w  . j  ava  2 s .  c  o m*/
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setSizeUndefined();
        switch (yAlignment) {
        case BOTTOM_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.FormLayoutPresentation.java

License:Open Source License

/**
 * Sets the alignment to the component.//  w ww.  j a v a  2s .co m
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setWidth("-1%");
        child.setHeight("-1%");
        switch (yAlignment) {
        case BOTTOM_CENTER:
            formLayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            formLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            formLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            formLayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            formLayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            formLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            formLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            formLayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            formLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            formLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            formLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            formLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            formLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            formLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            formLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            formLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.GridLayoutPresentation.java

License:Open Source License

/**
 * Sets the alignment to the component.//from  ww  w .j  a  v  a2 s  .c o m
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setWidth("-1%");
        child.setHeight("-1%");
        switch (yAlignment) {
        case BOTTOM_CENTER:
            gridlayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            gridlayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            gridlayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            gridlayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            gridlayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            gridlayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            gridlayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            gridlayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            gridlayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            gridlayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            gridlayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            gridlayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            gridlayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            gridlayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            gridlayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            gridlayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.HorizontalLayoutPresentation.java

License:Open Source License

/**
 * Sets the alignment to the component./*from   www  . j a  v a  2s.  c om*/
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setWidth("-1%");
        child.setHeight("-1%");
        switch (yAlignment) {
        case BOTTOM_CENTER:
            horizontalLayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            horizontalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            horizontalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            horizontalLayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            horizontalLayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            horizontalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            horizontalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            horizontalLayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            horizontalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}

From source file:org.lunifera.runtime.web.ecview.presentation.vaadin.internal.VerticalLayoutPresentation.java

License:Open Source License

/**
 * Sets the alignment to the component./*  w  w  w  . java 2  s.com*/
 * 
 * @param child
 * @param yAlignment
 */
protected void applyAlignment(Component child, YAlignment yAlignment) {

    if (yAlignment != null) {
        child.setWidth("-1%");
        child.setHeight("-1%");
        switch (yAlignment) {
        case BOTTOM_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_CENTER);
            break;
        case BOTTOM_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            child.setWidth("100%");
            break;
        case BOTTOM_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_LEFT);
            break;
        case BOTTOM_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.BOTTOM_RIGHT);
            break;
        case MIDDLE_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_CENTER);
            break;
        case MIDDLE_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            child.setWidth("100%");
            break;
        case MIDDLE_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_LEFT);
            break;
        case MIDDLE_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.MIDDLE_RIGHT);
            break;
        case TOP_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            break;
        case TOP_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            break;
        case TOP_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            break;
        case TOP_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            break;
        case FILL_CENTER:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_CENTER);
            child.setHeight("100%");
            break;
        case FILL_FILL:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setWidth("100%");
            child.setHeight("100%");
            break;
        case FILL_LEFT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_LEFT);
            child.setHeight("100%");
            break;
        case FILL_RIGHT:
            verticalLayout.setComponentAlignment(child, Alignment.TOP_RIGHT);
            child.setHeight("100%");
            break;
        default:
            break;
        }
    }
}

From source file:org.semanticsoft.vaaclipse.widgets.WorkbenchWindow.java

License:Open Source License

public void setLeftBar(Component bar) {
    if (bar == null) {
        leftBarContainer.removeAllComponents();
        return;//from   ww w  .j a  v  a2 s .  co m
    }

    bar.setWidth(-1);
    bar.setHeight("100%");

    leftBarContainer.removeAllComponents();
    leftBarContainer.addComponent(bar);
}

From source file:org.semanticsoft.vaaclipse.widgets.WorkbenchWindow.java

License:Open Source License

public void setRightBar(Component bar) {
    if (bar == null) {
        rightBarContainer.removeAllComponents();
        return;//from w w  w .  jav a  2s  . co m
    }

    bar.setWidth(-1);
    bar.setHeight("100%");

    rightBarContainer.removeAllComponents();
    rightBarContainer.addComponent(bar);
}