Example usage for com.vaadin.ui Layout setWidth

List of usage examples for com.vaadin.ui Layout setWidth

Introduction

In this page you can find the example usage for com.vaadin.ui Layout setWidth.

Prototype

public void setWidth(String width);

Source Link

Document

Sets the width of the component using String presentation.

Usage

From source file:com.arcusys.liferay.vaadinplugin.ui.DetailsWindow.java

License:Apache License

private Layout createVaadinDetails() {

    Layout vaadinDetailLayout = new VerticalLayout();
    vaadinDetailLayout.setWidth("900px");

    VerticalLayout vaadinDetails = new VerticalLayout();
    vaadinDetails.setMargin(new MarginInfo(true, true, false, true));

    Version currentVersion = ControlPanelPortletUtil.getPortalVaadinVersion();
    VaadinVersion currentVaadinInfo = VaadinVersion.getVaadinVersion(currentVersion);
    Collection<VaadinFileInfo> fileInfos = currentVaadinInfo.getVaadinFilesInfo();

    Collections.sort((List<VaadinFileInfo>) fileInfos, new Comparator<VaadinFileInfo>() {
        @Override//w w  w  .  ja  va 2 s  .c  om
        public int compare(VaadinFileInfo o1, VaadinFileInfo o2) {
            if (o1 == null)
                return -1;
            if (o2 == null)
                return 1;
            return o1.getOrderPriority().compareTo(o2.getOrderPriority());
        }
    });

    for (VaadinFileInfo info : fileInfos) {
        VerticalLayout infoLayout = new VerticalLayout();
        infoLayout.setCaption(info.getName());

        infoLayout.setMargin(new MarginInfo(false, true, true, false));

        Layout versionLayout = new HorizontalLayout();
        versionLayout.setSizeUndefined();
        versionLayout.addComponent(new Label("Version: "));
        String vaadinJarVersion;
        try {
            vaadinJarVersion = ControlPanelPortletUtil.getPortalVaadinJarVersion(
                    info.getPlace() + ControlPanelPortletUtil.FileSeparator + info.getName());
        } catch (Exception ex) {
            vaadinJarVersion = "";
            log.warn("Version for " + vaadinJarVersion + " couldn't be read.", ex);
        }

        versionLayout.addComponent(new Label(vaadinJarVersion));

        infoLayout.addComponent(versionLayout);

        Layout pathLayout = new HorizontalLayout();

        pathLayout.setSizeUndefined();
        pathLayout.addComponent(new Label("Path: "));
        String path = info.getPlace();
        pathLayout.addComponent(new Label(path));

        infoLayout.addComponent(pathLayout);

        vaadinDetails.addComponent(infoLayout);
    }

    vaadinDetailLayout.addComponent(vaadinDetails);
    return vaadinDetailLayout;
}

From source file:nz.co.senanque.vaadinsupport.tableeditor.EditorWindowImpl.java

License:Apache License

public void initialize(List<String> fields) {
    Layout main = new VerticalLayout();
    setLayout(main);/*from w  w w . j  a  va 2 s .c  om*/
    main.setWidth(getWindowWidth());
    main.setStyleName(Panel.STYLE_LIGHT);

    setFields(fields);
    m_form.setSizeFull();

    main.addComponent(m_form);

    save = m_form.createButton("save", new SubmitButtonPainter(m_maduraSessionManager), this);
    delete = m_form.createButton("delete", new SimpleButtonPainter(m_maduraSessionManager), this);
    close = m_form.createButton("close", new SimpleButtonPainter(m_maduraSessionManager), this);

    extraFields();
    HorizontalLayout actions = new HorizontalLayout();
    actions.addComponent(save);

    save.addListener(this);

    actions.addComponent(delete);
    delete.addListener(this);
    close.addListener(this);
    actions.addComponent(close);

    main.addComponent(actions);
}