Example usage for com.vaadin.ui CssLayout setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

From source file:org.escidoc.browser.ui.maincontent.ParentsView.java

License:Open Source License

@SuppressWarnings("serial")
private Component buildParentsList() {
    // ViewConstants.PARENTS
    final Panel panel = new Panel();
    panel.setSizeFull();/*from  ww w  .  ja  v  a2s . c om*/
    panel.setStyleName(Runo.PANEL_LIGHT);

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();

    final CssLayout cssLayout = new CssLayout();
    cssLayout.setHeight("20px");
    buildPanelHeader(cssLayout, ViewConstants.PARENTS);
    ThemeResource ICON = new ThemeResource("images/assets/plus.png");

    Button btnAdd = new Button();
    btnAdd.setStyleName(BaseTheme.BUTTON_LINK);
    btnAdd.addStyleName("floatright paddingtop3");
    btnAdd.setWidth("20px");
    btnAdd.setIcon(ICON);
    btnAdd.addListener(new Button.ClickListener() {

        @Override
        public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {

            final Window subwindow = new Window("Manage Organizational Unit Parents");
            subwindow.setModal(true);
            subwindow.setWidth("650px");
            VerticalLayout layout = (VerticalLayout) subwindow.getContent();
            layout.setMargin(true);
            layout.setSpacing(true);

            try {
                subwindow.addComponent(new OrgUnitParentEditView(orgUnitProxy, orgUnitProxy.getParentList(),
                        router, orgUnitController));
            } catch (EscidocClientException e) {
                orgUnitController.showError(e);
            }
            Button close = new Button("Close", new Button.ClickListener() {

                @Override
                public void buttonClick(@SuppressWarnings("unused") com.vaadin.ui.Button.ClickEvent event) {
                    (subwindow.getParent()).removeWindow(subwindow);
                }
            });
            layout.addComponent(close);
            layout.setComponentAlignment(close, Alignment.TOP_RIGHT);

            mainWindow.addWindow(subwindow);
        }
    });
    cssLayout.addComponent(btnAdd);
    vl.addComponent(cssLayout);
    List<ResourceModel> l = orgUnitProxy.getParentList();
    OUParentTableVH parentTable = new OUParentTableVH(orgUnitProxy, router, orgUnitController);
    parentTable.buildTable();
    vl.addComponent(parentTable);
    vl.setExpandRatio(parentTable, 9f);
    // TODO here comes table
    panel.setContent(vl);
    return panel;
}

From source file:org.escidoc.browser.ui.maincontent.SearchResultsView.java

License:Open Source License

private CssLayout configureLayout() {
    setWidth("100.0%");
    setHeight("92%");
    setMargin(true);/*from www  . j a  v a2 s . c o m*/
    final CssLayout cssLayout = new CssLayout();
    cssLayout.setWidth("100%");
    cssLayout.setHeight("100%");
    addAdvancedSearchBtn(cssLayout);
    return cssLayout;
}

From source file:org.hip.vif.web.util.UploadComponent.java

License:Open Source License

private Component createDropBox(final IBibliographyTask inTask) {
    final CssLayout lDropPane = new CssLayout();
    lDropPane.setWidth("200px"); //$NON-NLS-1$
    lDropPane.setHeight("40px"); //$NON-NLS-1$
    lDropPane.addStyleName("v-textfield"); //$NON-NLS-1$
    final Label lHint = new Label(Activator.getMessages().getMessage("ui.upload.drop.box")); //$NON-NLS-1$
    lHint.setStyleName("vif-drop-hint"); //$NON-NLS-1$
    lDropPane.addComponent(lHint);/*from  w  ww. ja va  2  s .  co m*/

    final DragAndDropWrapper outDrop = new DragAndDropWrapper(lDropPane);
    outDrop.setDropHandler(new DropHandler() {
        @Override
        public AcceptCriterion getAcceptCriterion() { // NOPMD
            return AcceptAll.get();
        }

        @Override
        public void drop(final DragAndDropEvent inEvent) { // NOPMD
            final Transferable lTransferable = inEvent.getTransferable();
            if (lTransferable instanceof WrapperTransferable) {
                final Html5File[] lFiles = ((WrapperTransferable) lTransferable).getFiles();
                for (final Html5File lFile : lFiles) {
                    lFile.setStreamVariable(createStreamVariable(lFile.getFileName(), inTask));
                }
            }
        }
    });

    outDrop.setSizeUndefined();
    outDrop.setImmediate(true);
    return outDrop;
}

From source file:org.vaadin.alump.fancylayouts.demo.PanelDemo.java

License:Apache License

/**
 * Sample content with simple table (disabled as table is so broken in
 * Vaadin 7). To get table work you probably need some special timer.
 * /*  w  w w.j ava 2  s .c  o  m*/
 * @return
 */
// private ComponentContainer createPanelContentC() {
// VerticalLayout layout = new VerticalLayout();
// layout.setWidth("100%");
// layout.setMargin(true);
// layout.setSpacing(true);
//
// Label label = new Label ("Table is quite broken in Vaadin 7?");
// layout.addComponent(label);
//
// Table table = new Table();
// table.setWidth("400px");
// table.setHeight("500px");
// table.addContainerProperty("Name", String.class, "");
// table.addContainerProperty("Phone Number", String.class, "");
// table.addItem(new Object[] { "Matti Meiklinen", "555 234 2344" },
// "Matti");
// table.addItem(new Object[] { "Donald Duck", "555 332 7782" }, "Donald");
//
// layout.addComponent(table);
//
// return layout;
// }

private ComponentContainer createPanelContentD() {
    CssLayout layout = new CssLayout();
    layout.addStyleName("demo-panel-d");
    layout.setWidth("100%");
    layout.setHeight("100%");

    Image image = new Image();
    image.setSource(new ThemeResource("images/meme.jpg"));
    image.addStyleName("demo-meme");
    layout.addComponent(image);

    return layout;
}

From source file:org.vaadin.spring.sidebar.components.ValoSideBar.java

License:Apache License

@Override
protected CssLayout createCompositionRoot() {
    CssLayout layout = new CssLayout();
    layout.addStyleName(ValoTheme.MENU_PART);
    if (largeIcons) {
        layout.addStyleName(ValoTheme.MENU_PART_LARGE_ICONS);
    }//w ww.j a  v a 2  s  . co m
    layout.setWidth(null);
    layout.setHeight("100%");
    if (logo != null) {
        layout.addComponent(logo);
    }
    if (headerLayout != null) {
        layout.addComponent(headerLayout);
    }
    return layout;
}

From source file:ro.zg.open_groups.gui.components.CausalHierarchyContainer.java

License:Apache License

private void init() {
    /* start depth combo */
    CssLayout startDepthContainer = new CssLayout();
    startDepthContainer.setWidth("100%");
    startDepthContainer.setHeight("22px");
    startDepthContainer.addStyleName(OpenGroupsStyles.HIERARCHY_FILTERS_BAR);

    Label startDepthLabel = new Label(OpenGroupsResources.getMessage("hierarchy.start.depth"));
    startDepthLabel.setSizeUndefined();/*  w w w .  ja v  a  2 s . c o  m*/
    startDepthLabel.addStyleName(OpenGroupsStyles.HORIZONTAL);

    startDepthSelect = new ComboBox();
    startDepthSelect.setInvalidAllowed(false);
    startDepthSelect.setNullSelectionAllowed(false);
    startDepthSelect.setNewItemsAllowed(false);
    startDepthSelect.addStyleName(OpenGroupsStyles.HORIZONTAL);
    startDepthSelect.setWidth("55px");
    startDepthSelect.setImmediate(true);

    startDepthContainer.addComponent(startDepthLabel);
    startDepthContainer.addComponent(startDepthSelect);

    // CssLayout hierarchyTitleBar = new CssLayout();
    // hierarchyTitleBar.setWidth("100%");
    // hierarchyTitleBar.addStyleName(OpenGroupsStyles.HIERARCHY_TITLE_BAR);
    // Label title = new Label("Ierarhie cauzal");
    // title.addStyleName(OpenGroupsStyles.TITLE_LINK);
    // hierarchyTitleBar.addComponent(title);

    // addComponent(hierarchyTitleBar);
    addComponent(startDepthContainer);

    /* the tree */
    hierarchyTree = new Tree();
    hierarchyTree.addStyleName(OpenGroupsStyles.HIERARCHY_TREE);
    hierarchyTree.setMultiSelect(false);
    hierarchyTree.setImmediate(true);
    hierarchyTree.setNullSelectionAllowed(true);
    hierarchyTree.setSizeUndefined();
    hierarchyTree.setContainerDataSource(new HierarchicalContainer());
    hierarchyTree.addContainerProperty("depth", Integer.class, null);
    hierarchyTree.addListener(new CollapseListener() {

        @Override
        public void nodeCollapse(CollapseEvent event) {
            Object itemId = event.getItemId();
            /* remove the subhierarchy */
            removeSubhierarchy(itemId);
        }
    });

    CssLayout treeContainer = new CssLayout();
    treeContainer.addStyleName("hierarchy-tree-container");
    treeContainer.setWidth("100%");
    treeContainer.setHeight("93%");
    treeContainer.addComponent(hierarchyTree);
    addComponent(treeContainer);
    // setExpandRatio(hierarchyTree, 1);
}

From source file:ro.zg.open_groups.gui.OpenGroupsMainWindow.java

License:Apache License

private void createLayout() {
    /* add the uri utility */
    uriUtility = new UriFragmentUtility();
    uriUtility.setWidth("0px");
    uriUtility.setHeight("0px");
    mainContent = new CssLayout();
    mainContent.addComponent(uriUtility);

    mainContent.setWidth("90%");
    mainContent.setHeight("100%");
    this.setContent(mainContent);

    uriUtility.addListener(app.getUriHandler());
    addURIHandler(app.getUriHandler());/*from  ww w .  j  a v  a 2 s . co m*/

    mainContent.setMargin(false);
    mainContent.addStyleName(OpenGroupsStyles.MAIN_PANE);

    header = new CssLayout();
    //   header.setWidth("100%");
    header.addStyleName(OpenGroupsStyles.HEADER_BAR);
    mainContent.addComponent(header);

    userActionsContainer = new CssLayout();

    CssLayout entityFrame = new CssLayout();
    entityFrame.setHeight("100%");
    // entityFrame.setWidth("100%"); uncomment this and you will have
    // problems
    entityFrame.addStyleName("entity-frame");
    entityFrame.setMargin(true);

    entityContent = new CssLayout();
    entityContent.addStyleName(OpenGroupsStyles.ENTITY_PANE);

    entityFrame.addComponent(entityContent);

    frameContent = new CssLayout();
    frameContent.setWidth("100%");
    frameContent.setHeight("90%");
    frameContent.addStyleName(OpenGroupsStyles.FRAME_PANE);

    hierarchyContainer = new CausalHierarchyContainer(app);
    hierarchyContainer.addStyleName(OpenGroupsStyles.HIERARCHY_PANE);
    hierarchyContainer.setWidth("350px");
    hierarchyContainer.setHeight("100%");
    hierarchyContainer.construct();

    frameContent.addComponent(hierarchyContainer);
    frameContent.addComponent(entityFrame);

    mainContent.addComponent(frameContent);
}