Example usage for com.vaadin.ui CssLayout setSizeFull

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

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.kani.Application.java

License:Apache License

private void loadProtectedResources() {
    String applicationTitle = getMessage("title");
    main = new Window(applicationTitle);
    mainLayout = (VerticalLayout) main.getContent();
    mainLayout.setMargin(false);//from w w w  .  ja v a 2  s  .com
    mainLayout.setStyleName("blue");
    setMainWindow(main);

    mainLayout.setSizeFull();
    mainLayout.addComponent(getMenu());

    HorizontalLayout header = new HorizontalLayout();

    header.addComponent(getHeader());
    header.addComponent(getToolbar());
    mainLayout.addComponent(header);

    CssLayout margin = new CssLayout();
    margin.setMargin(false, true, true, true);
    margin.setSizeFull();
    tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    margin.addComponent(tabSheet);
    mainLayout.addComponent(margin);
    mainLayout.setExpandRatio(margin, 1);

    for (String viewKey : views.keySet()) {
        Object view = views.get(viewKey);
        String viewName = getMessage(viewKey, "title");
        Method createMethod;
        try {
            createMethod = view.getClass().getMethod("create", org.kani.Application.class);
            Component viewContent = (Component) createMethod.invoke(view, this);

            String viewIconPath = getMessage(viewKey, "icon");
            Resource viewIcon = new ClassResource(viewIconPath, this);

            tabSheet.addTab(viewContent, viewName, viewIcon);
        } catch (Exception e) {
            logger.log(Level.SEVERE, String.format("Could not initialize view %s", viewKey), e);
        }
    }
}

From source file:org.lunifera.example.vaadin.databinding.DatabindingDemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    VaadinObservables.getRealm(getUI());

    CssLayout layout = new CssLayout();
    layout.setSizeFull();
    setContent(layout);//  ww  w .  java2s  .c om

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();
    tabsheet.addTab(new ValueBindings(), "Value bindings");
    tabsheet.addTab(new SelectionBindings(), "Selection bindings");
    tabsheet.addTab(new LocaleBindings(), "Locales combo");
    try {
        tabsheet.addTab(new ECViewVerticalLayout(), "ECView Vertical");
        tabsheet.addTab(new ECViewHorizontalLayout(), "ECView Horizontal");
        tabsheet.addTab(new ECViewGridLayout(), "ECView Gridlayout");
        tabsheet.addTab(new ECViewTabSheet(), "ECView Tabsheet");
        tabsheet.addTab(new ECViewDatabinding(), "ECView Bindings");
    } catch (ContextException e) {
        e.printStackTrace();
    }
    layout.addComponent(tabsheet);
}

From source file:org.lunifera.example.vaadin.ecview.ECViewDemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    setStyleName(Reindeer.LAYOUT_BLACK);

    VaadinObservables.getRealm(getUI());

    CssLayout layout = new CssLayout();
    layout.setSizeFull();
    setContent(layout);//from   w  ww.  j  a va2s. c o  m

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();
    try {
        // tabsheet.addTab(new ECViewVerticalLayout(), "ECView Vertical");
        // tabsheet.addTab(new ECViewHorizontalLayout(),
        // "ECView Horizontal");
        // tabsheet.addTab(new ECViewGridLayout(), "ECView Gridlayout");
        // tabsheet.addTab(new ECViewTabSheet(), "ECView Tabsheet");
        // tabsheet.addTab(new ECViewDatabinding(), "ECView Bindings");
        // tabsheet.addTab(new ECViewEntityGenerator(),
        // "ECView Entity Generator");
        // tabsheet.addTab(new ECViewDtoGenerator(),
        // "ECView Dto Generator");
        tabsheet.addTab(new ECViewMasterDetail(), "ECView Master Detail");
    } catch (ContextException e) {
        e.printStackTrace();
    }
    layout.addComponent(tabsheet);
}

From source file:org.opencms.ui.apps.CmsFileExplorer.java

License:Open Source License

/**
 * @see org.opencms.ui.apps.I_CmsWorkplaceApp#initUI(org.opencms.ui.apps.I_CmsAppUIContext)
 *//*w  w  w .  jav a 2s . c o  m*/
public void initUI(I_CmsAppUIContext context) {

    m_appContext = context;
    m_appContext.setMenuDialogContext(
            new CmsExplorerDialogContext(ContextType.appToolbar, m_fileTable, this, null));
    HorizontalSplitPanel sp = new HorizontalSplitPanel();
    sp.setSizeFull();
    sp.setFirstComponent(m_fileTree);
    CmsFileExplorerSettings settings;
    try {
        settings = OpenCms.getWorkplaceAppManager().getAppSettings(A_CmsUI.getCmsObject(),
                CmsFileExplorerSettings.class);

        m_fileTable.setTableState(settings);
    } catch (Exception e) {
        LOG.error("Error while reading file explorer settings from user.", e);
    }
    sp.setSecondComponent(m_fileTable);

    sp.setSplitPosition(LAYOUT_SPLIT_POSITION, Unit.PIXELS);

    context.setAppContent(sp);
    context.showInfoArea(true);
    HorizontalLayout inf = new HorizontalLayout();
    inf.setSizeFull();
    inf.setSpacing(true);
    inf.setMargin(true);
    m_siteSelector.setWidth("379px");
    inf.addComponent(m_siteSelector);
    CssLayout crumbWrapper = new CssLayout();
    crumbWrapper.setSizeFull();
    crumbWrapper.setPrimaryStyleName(OpenCmsTheme.CRUMB_WRAPPER);
    crumbWrapper.addComponent(m_crumbs);

    m_infoPath.setWidth("100%");
    crumbWrapper.addComponent(m_infoPath);
    inf.addComponent(crumbWrapper);
    inf.setExpandRatio(crumbWrapper, 1);

    m_searchField.setWidth("200px");
    inf.addComponent(m_searchField);
    context.setAppInfo(inf);

    initToolbarButtons(context);
    m_fileTable.updateColumnWidths(A_CmsUI.get().getPage().getBrowserWindowWidth() - LAYOUT_SPLIT_POSITION);
}

From source file:org.openeos.vaadin.main.internal.MainApplication.java

License:Apache License

@Override
public void init() {
    // TODO Make better implementation, not literal
    if (notificationManager == null) {
        throw new IllegalStateException();
    }//from  www  .  j av  a 2  s.  co  m
    if (applicationLifecycleManager == null) {
        throw new IllegalStateException();
    }
    logger.info("Initializing Main Application");

    // setTheme(Reindeer.THEME_NAME);
    // setTheme(Runo.THEME_NAME);
    // setTheme("demo");
    setTheme("uno");

    main = new Window("Dynamic Vaadin OSGi Demo");
    mainLayout = (VerticalLayout) main.getContent();
    mainLayout.setMargin(false);
    //mainLayout.setStyleName(Reindeer.L "blue");
    setMainWindow(main);

    mainLayout.setSizeFull();
    mainLayout.addComponent(getMenu());

    mainLayout.addComponent(getHeader());

    CssLayout margin = new CssLayout();
    margin.setMargin(false, true, true, true);
    margin.setSizeFull();
    tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    tabSheet.setCloseHandler(closeHandler);
    margin.addComponent(tabSheet);
    mainLayout.addComponent(margin);
    mainLayout.setExpandRatio(margin, 1);

    for (IVaadinMenuContributor contributor : menuContributorsList) {
        contributor.contribute(menubar, this);
    }

    if (getContext() != null) {
        getContext().addTransactionListener(this);
    }

    initialized = true;

    applicationLifecycleManager.init(this);
}

From source file:org.opennms.features.topology.app.internal.ui.ToolbarPanel.java

License:Open Source License

private CssLayout createGroup(Component... components) {
    CssLayout group = new CssLayout();
    group.addStyleName("toolbar-component-group");
    group.setSizeFull();
    for (Component eachComponent : components) {
        eachComponent.setPrimaryStyleName("toolbar-group-item");
        group.addComponent(eachComponent);
    }//w  w  w  .ja  va2s. c  o  m
    return group;
}

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

License:Apache License

private ComponentContainer buildLayout() {

    CssLayout topLayout = new CssLayout();
    topLayout.setSizeFull();

    TabSheet tabs = new TabSheet();
    topLayout.addComponent(tabs);/*from   w  w w.  j  a v  a2  s .  co m*/
    tabs.setSizeFull();

    tabs.addTab(buildWelcome(), "Welcome");
    tabs.addTab(new ImageDemo(), "FancyImage");
    tabs.addTab(new PanelDemo(), "FancyPanel");
    tabs.addTab(new CssLayoutDemo(), "FancyLayout");

    NotificationsDemo notDemo = new NotificationsDemo();
    tabs.addTab(notDemo, "FancyNotifications");

    // Add notification to top most UI elements you have. Then just give it
    // as reference to child components.
    notifications = new FancyNotifications();
    topLayout.addComponent(notifications);
    notDemo.init(notifications);

    return topLayout;
}

From source file:org.vaadin.alump.fancylayouts.FancyPanel.java

License:Apache License

/**
 * Build default content container//from w w  w  .jav a 2 s  .  c om
 * 
 * @return Default content container
 */
protected ComponentContainer createDefaultContent() {
    if (placeHolderComponent == null) {
        CssLayout layout = new CssLayout();
        layout.setStyleName("fancypanel-default-layout");
        layout.setSizeFull();
        placeHolderComponent = layout;
    }
    return placeHolderComponent;
}

From source file:org.vaadin.spring.samples.security.shared.MainUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    getPage().setTitle("Vaadin Shared Security Demo");
    // Let's register a custom error handler to make the 'access denied' messages a bit friendlier.
    setErrorHandler(new DefaultErrorHandler() {
        @Override/* ww w .  j  a  va  2  s  . c  o  m*/
        public void error(com.vaadin.server.ErrorEvent event) {
            if (SecurityExceptionUtils.isAccessDeniedException(event.getThrowable())) {
                Notification.show("Sorry, you don't have access to do that.");
            } else {
                super.error(event);
            }
        }
    });
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();

    // By adding a security item filter, only views that are accessible to the user will show up in the side bar.
    sideBar.setItemFilter(new VaadinSecurityItemFilter(vaadinSecurity));
    layout.addComponent(sideBar);

    CssLayout viewContainer = new CssLayout();
    viewContainer.setSizeFull();
    layout.addComponent(viewContainer);
    layout.setExpandRatio(viewContainer, 1f);

    Navigator navigator = new Navigator(this, viewContainer);
    // Without an AccessDeniedView, the view provider would act like the restricted views did not exist at all.
    springViewProvider.setAccessDeniedViewClass(AccessDeniedView.class);
    navigator.addProvider(springViewProvider);
    navigator.setErrorView(ErrorView.class);
    navigator.navigateTo(navigator.getState());

    setContent(layout); // Call this here because the Navigator must have been configured before the Side Bar can be attached to a UI.
}

From source file:org.vaadin.tori.component.RecentBar.java

License:Apache License

public RecentBar() {
    if (messaging != null) {
        messaging.addUserAuthoredListener(this);
        ToriUI.getCurrent().addDetachListener(new DetachListener() {
            @Override/* w  w w .  ja  va2s .  c om*/
            public void detach(final DetachEvent event) {
                messaging.removeUserAuthoredListener(RecentBar.this);
            }
        });
    }

    addStyleName("recentbar");
    setWidth(100.0f, Unit.PERCENTAGE);
    setHeight(35.0f, Unit.PIXELS);

    CssLayout layout = new CssLayout();
    layout.setSizeFull();
    setCompositionRoot(layout);

    HorizontalLayout barLayout = new HorizontalLayout();
    barLayout.setMargin(new MarginInfo(false, true, false, true));
    barLayout.setSizeFull();
    addTitleLabel(barLayout);
    addNotificationsLayout(barLayout);
    addRecentLink(barLayout);
    if (dataSource.isLoggedInUser()) {
        addMyPostsLink(barLayout);
    }
    layout.addComponent(barLayout);

    floatingComponent.extend(floatingNotification);
    layout.addComponent(floatingNotification);
    floatingNotification.setId("floatingnotification");

    ToriScheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override
        public void execute() {
            refresh();
        }
    });
}