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.vaadin.tori.view.thread.PostComponent.java

License:Apache License

private void editPost() {
    final CssLayout editorWrapper = new CssLayout();
    editorWrapper.setSizeFull();
    ToriScheduler.get().scheduleDeferred(new ScheduledCommand() {
        @Override//w w  w . j a  v  a2  s  . c om
        public void execute() {
            PostEditor postEditor = new PostEditor(post.getRawBody(), post.isFormatBBCode(),
                    PostComponent.this);
            editorWrapper.addComponent(postEditor);
            addStyleName("editing");
        }
    });
    getRpcProxy(PostComponentClientRpc.class).editPost(editorWrapper);
    if (editorComponent != null) {
        removeComponent(editorComponent);
    }
    editorComponent = editorWrapper;
    addComponent(editorComponent);
}

From source file:ro.zg.netcell.vaadin.action.application.OpenEntityWithUpstreamHierarchy.java

License:Apache License

@Override
public void handle(ActionContext actionContext) throws Exception {
    OpenGroupsApplication app = actionContext.getApp();
    Entity selectedEntity = actionContext.getEntity();
    UserAction ua = actionContext.getUserAction();

    Map<String, Object> params = ua.getActionParams();
    params.putAll(selectedEntity.getFilterValues());
    params.put("pageNumber", 1);
    /* we need to bring all the hierarchy and display it on the same page */
    params.put("itemsOnPage", 5000);
    params.put("entityId", selectedEntity.getId());
    params.put("withContent", true);
    params.put("userId", app.getCurrentUserId());

    ComponentContainer container = actionContext.getTargetContainer();
    container.removeAllComponents();/*  www .  j  a  v a2 s  .  com*/
    container.setSizeFull();
    //   VerticalLayout hierarchyContainer = new VerticalLayout();
    CssLayout hierarchyContainer = new CssLayout();
    hierarchyContainer.setSizeFull();
    container.addComponent(hierarchyContainer);

    displayHierarchyList(selectedEntity, ua, app, hierarchyContainer, params);
    //   VerticalLayout entityContainer = new VerticalLayout();
    CssLayout entityContainer = new CssLayout();
    container.addComponent(entityContainer);

    getActionsManager().executeAction(ActionsManager.OPEN_ENTITY_WITH_ACTIONS, selectedEntity, app,
            entityContainer, false, actionContext);
}

From source file:ro.zg.netcell.vaadin.action.user.LoginHandler.java

License:Apache License

private ComponentContainer getLoginView(ActionContext actionContext) {

    OpenGroupsApplication app = actionContext.getApp();
    Map<String, Map<String, String>> loginTypes = (Map<String, Map<String, String>>) app.getAppConfigManager()
            .getApplicationConfigParam(ApplicationConfigParam.LOGIN_TYPES);

    System.out.println("login types: " + loginTypes);

    HorizontalLayout hl = new HorizontalLayout();
    hl.setSizeFull();// w  ww .  j av a 2  s  . c  o  m

    if (loginTypes == null || loginTypes.containsKey(LOCAL_LOGIN_TYPE)) {
        Component localView = getLocalLoginView(actionContext);
        hl.addComponent(localView);
        hl.setExpandRatio(localView, 2f);
    }

    if (loginTypes != null) {
        Map<String, String> openIdProviders = loginTypes.get(OPENID_LOGIN_TYPE);

        if (openIdProviders != null) {
            CssLayout openIdLayout = new CssLayout();
            openIdLayout.setSizeFull();
            openIdLayout.addStyleName("openid-login-pane");

            VerticalLayout openIdContainer = new VerticalLayout();
            openIdContainer.setSizeFull();
            openIdContainer.setMargin(true);
            openIdLayout.addComponent(openIdContainer);

            //      Label openIdLoginMessage = new Label(OpenGroupsResources.getMessage("openid.login.message"));
            //      openIdLoginMessage.addStyleName("openid-title");
            //      openIdContainer.addComponent(openIdLoginMessage);
            //      openIdContainer.setExpandRatio(openIdLoginMessage, 0.1f);

            for (Map.Entry<String, String> e : openIdProviders.entrySet()) {

                Component providerLink = getOpenidLoginComponent(actionContext, e);
                openIdContainer.addComponent(providerLink);
                openIdContainer.setComponentAlignment(providerLink, Alignment.MIDDLE_CENTER);
                openIdContainer.setExpandRatio(providerLink, 1f);

            }

            hl.addComponent(openIdLayout);
            hl.setComponentAlignment(openIdLayout, Alignment.MIDDLE_CENTER);
            hl.setExpandRatio(openIdLayout, 1f);
        }
    }
    return hl;
}