Example usage for com.vaadin.ui Embedded addStyleName

List of usage examples for com.vaadin.ui Embedded addStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui Embedded addStyleName.

Prototype

@Override
    public void addStyleName(String style) 

Source Link

Usage

From source file:org.activiti.explorer.ui.task.SubTaskComponent.java

License:Apache License

protected void populateSubTasks(List<HistoricTaskInstance> subTasks) {
    if (!subTasks.isEmpty()) {
        for (final HistoricTaskInstance subTask : subTasks) {
            // icon
            Embedded icon = null;/*from  w  w w  .  j a  v  a  2  s .co  m*/

            if (subTask.getEndTime() != null) {
                icon = new Embedded(null, Images.TASK_FINISHED_22);
            } else {
                icon = new Embedded(null, Images.TASK_22);
            }
            icon.setWidth(22, UNITS_PIXELS);
            icon.setWidth(22, UNITS_PIXELS);
            subTaskLayout.addComponent(icon);

            // Link to subtask
            Button subTaskLink = new Button(subTask.getName());
            subTaskLink.addStyleName(Reindeer.BUTTON_LINK);
            subTaskLink.addListener(new ClickListener() {
                public void buttonClick(ClickEvent event) {
                    ExplorerApp.get().getViewManager().showTaskPage(subTask.getId());
                }
            });
            subTaskLayout.addComponent(subTaskLink);
            subTaskLayout.setComponentAlignment(subTaskLink, Alignment.MIDDLE_LEFT);

            if (subTask.getEndTime() == null) {
                // Delete icon only appears when task is not finished yet
                Embedded deleteIcon = new Embedded(null, Images.DELETE);
                deleteIcon.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
                deleteIcon.addListener(new DeleteSubTaskClickListener(subTask, this));
                subTaskLayout.addComponent(deleteIcon);
                subTaskLayout.setComponentAlignment(deleteIcon, Alignment.MIDDLE_RIGHT);
            } else {
                // Next line of grid
                subTaskLayout.newLine();
            }
        }
    } else {
        Label noSubTasksLabel = new Label(i18nManager.getMessage(Messages.TASK_NO_SUBTASKS));
        noSubTasksLabel.setSizeUndefined();
        noSubTasksLabel.addStyleName(Reindeer.LABEL_SMALL);
        subTaskLayout.addComponent(noSubTasksLabel);
    }

}

From source file:org.activiti.explorer.ui.task.TaskEventsPanel.java

License:Apache License

protected void addTaskEventPicture(final org.activiti.engine.task.Event taskEvent, GridLayout eventGrid) {
    final Picture userPicture = identityService.getUserPicture(taskEvent.getUserId());
    Embedded authorPicture = null;

    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  v  a2 s . c  om
        }, "event_" + taskEvent.getUserId() + "."
                + Constants.MIMETYPE_EXTENSION_MAPPING.get(userPicture.getMimeType()), ExplorerApp.get());
        authorPicture = new Embedded(null, imageresource);
    } else {
        authorPicture = new Embedded(null, Images.USER_50);
    }

    authorPicture.setType(Embedded.TYPE_IMAGE);
    authorPicture.setHeight("48px");
    authorPicture.setWidth("48px");
    authorPicture.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_PICTURE);
    eventGrid.addComponent(authorPicture);
}

From source file:org.activiti.explorer.ui.task.TaskRelatedContentComponent.java

License:Apache License

protected void addAttachmentsToTable(List<Attachment> attachments) {
    for (Attachment attachment : attachments) {
        AttachmentRenderer renderer = attachmentRendererManager.getRenderer(attachment);
        Item attachmentItem = table.addItem(attachment.getId());
        attachmentItem.getItemProperty("name").setValue(renderer.getOverviewComponent(attachment, this));
        attachmentItem.getItemProperty("type").setValue(new Embedded(null, renderer.getImage(attachment)));

        Embedded deleteButton = new Embedded(null, Images.DELETE);
        deleteButton.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
        deleteButton.addListener((ClickListener) new DeleteClickedListener(attachment));
        attachmentItem.getItemProperty("delete").setValue(deleteButton);
    }//from w w w .  j  a  v a  2 s  .c  o  m

    if (!table.getItemIds().isEmpty()) {
        table.setVisible(true);
    }
    table.setPageLength(table.size());
}

From source file:org.activiti.explorer.ui.task.UserDetailsComponent.java

License:Apache License

protected void addUserPicture() {
    Resource pictureResource = Images.USER_32; // default icon
    if (user != null) {
        final Picture userPicture = identityService.getUserPicture(user.getId());
        if (userPicture != null) {
            pictureResource = new StreamResource(new StreamSource() {
                public InputStream getStream() {
                    return userPicture.getInputStream();
                }//from  w  w  w  .ja  v  a2 s .  co m
            }, user.getId(), ExplorerApp.get());

        }
    }
    Embedded picture = new Embedded(null, pictureResource);

    picture.setType(Embedded.TYPE_IMAGE);
    picture.addStyleName(ExplorerLayout.STYLE_TASK_EVENT_PICTURE);
    if (user != null) {
        // Only set fixed height and width when user has image, otherwise icon's dimensions will be used
        picture.setHeight("32px");
        picture.setWidth("32px");
    }
    addComponent(picture);

    // Add profile popup listener
    if (user != null) {
        picture.addStyleName(ExplorerLayout.STYLE_CLICKABLE);
        picture.addListener(new com.vaadin.event.MouseEvents.ClickListener() {
            public void click(ClickEvent event) {
                viewManager.showProfilePopup(user.getId());
            }
        });
    }
}

From source file:org.diretto.web.richwebclient.view.sections.UploadSection.java

/**
 * Uploads the currently processed file.
 * /*from  ww w  .j a v a 2  s . co m*/
 * @param uploadSettings The {@code UploadSettings} of the file
 * @param filesWithSameSettings A {@code List} with the names of the files
 *        which should get the given {@code UploadSettings} as presetting
 */
public void upload(final UploadSettings uploadSettings, List<String> filesWithSameSettings) {
    final FileInfo fileInfo = currentFile;

    settings.put(fileInfo.getName(), uploadSettings);

    for (String fileName : filesWithSameSettings) {
        preSettings.put(fileName, uploadSettings);
    }

    new Thread(new Runnable() {
        @Override
        public void run() {
            ProgressIndicator progressIndicator = multipleUpload.upload(fileInfo);

            synchronized (application) {
                VerticalLayout uploadBoxLayout = new VerticalLayout();
                mainLayout.addComponent(uploadBoxLayout);

                HorizontalLayout fileInfoLayout = new HorizontalLayout();
                uploadBoxLayout.addComponent(fileInfoLayout);

                Label nameLabel = StyleUtils.getLabelBold(fileInfo.getName());
                fileInfoLayout.addComponent(nameLabel);
                fileInfoLayout.addComponent(StyleUtils.getLabelSmallHTML("&nbsp;&nbsp;&nbsp;"));
                fileInfoLayout.setComponentAlignment(nameLabel, Alignment.MIDDLE_LEFT);

                BigDecimal fileSize = new BigDecimal((((double) fileInfo.getSize()) / 1000000.0d));
                fileSize = fileSize.setScale(2, BigDecimal.ROUND_HALF_UP);

                Label typeSizeLabel = StyleUtils.getLabelSmallHTML(
                        fileInfo.getType() + "&nbsp;&nbsp;--&nbsp;&nbsp;" + fileSize.toPlainString() + " MB");
                fileInfoLayout.addComponent(typeSizeLabel);
                fileInfoLayout.setComponentAlignment(typeSizeLabel, Alignment.MIDDLE_LEFT);

                uploadBoxLayout.addComponent(StyleUtils.getVerticalSpace("100%", "8px"));

                uploadBoxLayout.addComponent(progressIndicator);

                uploadBoxLayout.addComponent(StyleUtils.getVerticalSpace("100%", "8px"));

                HorizontalLayout resultLayout = new HorizontalLayout();
                uploadBoxLayout.addComponent(resultLayout);

                Label uploadedLabel = StyleUtils.getLabelSmallHTML("Uploaded:&nbsp;");
                resultLayout.addComponent(uploadedLabel);
                resultLayout.setComponentAlignment(uploadedLabel, Alignment.MIDDLE_LEFT);

                Embedded uploadedEmbedded = new Embedded(null, ResourceUtils.RUNO_ICON_32_GLOBE_RESOURCE);
                uploadedEmbedded.addStyleName("image-opacity-65");
                uploadedEmbedded.setType(Embedded.TYPE_IMAGE);
                uploadedEmbedded.setImmediate(true);
                uploadedEmbedded.setWidth("22px");
                uploadedEmbedded.setHeight("22px");
                resultLayout.addComponent(uploadedEmbedded);

                uploadedEmbeddeds.put(fileInfo, uploadedEmbedded);

                resultLayout.addComponent(StyleUtils.getLabelSmallHTML("&nbsp;&nbsp;&nbsp;"));

                Label publishedLabel = StyleUtils.getLabelSmallHTML("Published:&nbsp;");
                resultLayout.addComponent(publishedLabel);
                resultLayout.setComponentAlignment(publishedLabel, Alignment.MIDDLE_LEFT);

                Embedded publishedEmbedded = new Embedded(null, ResourceUtils.RUNO_ICON_32_GLOBE_RESOURCE);
                publishedEmbedded.addStyleName("image-opacity-65");
                publishedEmbedded.setType(Embedded.TYPE_IMAGE);
                publishedEmbedded.setImmediate(true);
                publishedEmbedded.setWidth("22px");
                publishedEmbedded.setHeight("22px");
                resultLayout.addComponent(publishedEmbedded);

                publishedEmbeddeds.put(fileInfo, publishedEmbedded);

                mainLayout.addComponent(StyleUtils.getVerticalSpace("100%", "5px"));

                requestRepaint();
            }
        }
    }).start();

    handleNextFile();
}

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

License:Apache License

private ComponentContainer getSearchFilter(final Entity entity, final UserAction ua,
        final OpenGroupsApplication app, final ActionContext ac) {
    final ComboBox select = new ComboBox();
    select.setImmediate(true);//from  w w  w. j  a v  a  2s .c om
    select.setNullSelectionAllowed(true);
    select.setNewItemsAllowed(true);
    String stringToBigError = OpenGroupsResources.getMessage("search.string.to.big.error");
    select.addValidator(new StringLengthValidator(stringToBigError, 0, 1000, true));
    select.setWidth("350px");

    final String paramName = "searchString";
    String searchValue = (String) entity.getFilterValue(paramName);
    if (searchValue != null) {
        select.addItem(searchValue);
        select.setValue(searchValue);
    }

    // HorizontalLayout layout = new HorizontalLayout();
    // layout.setSpacing(true);
    // layout.setSizeUndefined();

    // final String searchCaption = OpenGroupsResources.getMessage("search");
    // Button searchButton = new Button(searchCaption);
    // searchButton.addListener(new ClickListener() {
    //
    // @Override
    // public void buttonClick(ClickEvent event) {
    // select.validate();
    // String value = (String) select.getValue();
    // if (value != null && "".equals(value.trim())) {
    // value = null;
    // }
    // FilterOption fo = new FilterOption(searchCaption, paramName, value);
    // entity.setFilter(fo);
    // refreshList(entity, ua, app, entity.getState().getLastUsedContainer());
    // }
    // });

    select.addListener(new ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            select.validate();
            String value = (String) select.getValue();
            if (value != null && "".equals(value.trim())) {
                value = null;
            }
            FilterOption fo = new FilterOption(null, paramName, value);
            entity.setFilter(fo);
            /* set current page to 1 */
            entity.getState().resetPageInfoForCurrentAction();
            refreshList(entity, ua, app, entity.getState().getLastUsedContainer(), ac);
        }
    });

    CssLayout container = new CssLayout();
    container.setSizeUndefined();
    Embedded eicon = new Embedded(null,
            OpenGroupsResources.getIcon(OpenGroupsIconsSet.SEARCH, OpenGroupsIconsSet.MEDIUM));
    eicon.setDescription(getMessage("search"));
    eicon.addStyleName("middle-left right-margin-10");
    select.addStyleName("middle-left");
    //   Label label = new Label(getMessage("search"));
    //   container.addComponent(label);
    container.addComponent(eicon);
    container.addComponent(select);
    return container;
}

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

License:Apache License

private void addUserHeaderActions(final OpenGroupsApplication app, final ActionContext ac)
        throws ContextAwareException {
    UserActionList actionList = getGlobalActions(ActionLocations.HEADER);
    if (actionList == null) {
        return;//from   w  w w  . jav  a 2  s. c  o  m
    }
    Collection<UserAction> userActions = actionList.getActions().values();
    OpenGroupsMainWindow window = ac.getWindow();
    User user = app.getCurrentUser();

    CssLayout header = window.getHeader();
    header.removeAllComponents();

    if (user != null) {

        Embedded usericon = new Embedded(null,
                OpenGroupsResources.getIcon(OpenGroupsIconsSet.USER, OpenGroupsIconsSet.MEDIUM));
        usericon.addStyleName("middle-left right-margin-10");
        header.addComponent(usericon);

        Label userInfo = new Label(/*app.getMessage("login.user.info") + ": " +*/ user.getUsername());
        userInfo.setSizeUndefined();
        header.addComponent(userInfo);
        userInfo.addStyleName("username-label");

    }

    /* get the current user types */
    //   List<String> userTypes = UsersManager.getInstance().getCurrentUserTypes(null, app);
    for (final UserAction ua : userActions) {
        /*
         * if the current user is not allowed to read/view the current action then skip it
         */
        //       if (!ua.allowRead(userTypes)) {
        if (!ua.isVisible(ac)) {
            continue;
        }
        Button actButton = new Button(ua.getDisplayName());

        actButton.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                // app.executeAction(ua, null);
                ua.executeHandler(null, app, null, ac);
            }
        });

        header.addComponent(actButton);
        actButton.addStyleName("middle-right left-margin-10");

    }

    Component rootLink = getRootEntityLink(app);
    Component metaLink = getMetaEntityLink(app);
    rootLink.setSizeUndefined();
    metaLink.setSizeUndefined();

    /* add quick links */
    header.addComponent(rootLink);
    header.addComponent(metaLink);
    rootLink.addStyleName("middle-right left-margin-10");
    metaLink.addStyleName("middle-right left-margin-10");
}

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

License:Apache License

@Override
public void handle(final ActionContext actionContext) throws Exception {
    final ComponentContainer container = actionContext.getTargetContainer();

    container.removeAllComponents();//w ww .  j  av a  2s . c  om
    // container.setSizeFull();
    // container.setMargin(false);
    final OpenGroupsApplication app = actionContext.getApp();
    final Entity entity = actionContext.getEntity();

    EntityState entityState = entity.getState();
    boolean isOpened = entityState.isOpened();
    String complexEntityType = entity.getComplexType();
    ApplicationConfigManager appConfigManager = app.getAppConfigManager();
    List<String> subtyesList = appConfigManager.getSubtypesForComplexType(complexEntityType);

    // Panel currentContainer = (Panel) container;
    ComponentContainer currentContainer = container;
    entity.setEntityContainer(container);

    CssLayout headerContainer = new CssLayout();
    headerContainer.addStyleName("entity-header-container");
    currentContainer.addComponent(headerContainer);

    // CssLayout titleContainer = new CssLayout();
    // titleContainer.setWidth("80%");
    // titleContainer.addStyleName(OpenGroupsStyles.MIDDLE_LEFT);
    // headerContainer.addComponent(titleContainer);

    // titleContainer.setSizeFull();
    // /* show level */
    // String levelMsg = getMessage("level");
    // Label levelLabel = new Label(levelMsg+" "+entity.getDepth());
    // titleContainer.addComponent(levelLabel);

    /* show entity type */
    if (entity.getState().isEntityTypeVisible()) {
        String entityTypeCaption = getMessage(entity.getComplexType());

        String size = OpenGroupsIconsSet.MEDIUM;
        if (entity.getContent() != null) {
            size = OpenGroupsIconsSet.LARGE;
        }
        // Label typeIcon = new Label();
        // typeIcon.setDescription(entityTypeCaption);
        // typeIcon.setIcon(OpenGroupsResources.getIcon(entity.getComplexType().toLowerCase(),
        // size));
        // typeIcon.setSizeUndefined();
        // typeIcon.addStyleName("top-left right-margin-20");
        // headerContainer.addComponent(typeIcon);
        Embedded eicon = new Embedded(null,
                OpenGroupsResources.getIcon(entity.getComplexType().toLowerCase(), size));
        eicon.setDescription(entityTypeCaption);
        eicon.addStyleName("top-left right-margin-20");

        headerContainer.addComponent(eicon);

        // Embedded eicon2 = new Embedded("",
        // OpenGroupsResources.getIcon(entity.getComplexType().toLowerCase(),
        // size));
        // eicon2.setDescription(entityTypeCaption);
        // eicon2.addStyleName("top-left right-margin-20");
        // headerContainer.addComponent(eicon2);

    }

    // Label test = new Label("test");
    // test.setSizeUndefined();
    // test.addStyleName("top-left");
    // headerContainer.addComponent(test);

    /* add last action for this entity */
    if (entity.getLastActionType() != null) {
        String actionType = entity.getLastActionType();
        String msg = getMessage(actionType);
        // Label actionLabel = new Label();
        // actionLabel.setDescription(msg);
        // actionLabel.setIcon(OpenGroupsResources.getIcon(actionType,
        // OpenGroupsIconsSet.MEDIUM));
        // actionLabel.setSizeUndefined();
        // actionLabel.addStyleName(OpenGroupsStyles.MIDDLE_LEFT);
        // titleContainer.addComponent(actionLabel);
        Embedded actionIcon = new Embedded(null,
                OpenGroupsResources.getIcon(actionType, OpenGroupsIconsSet.MEDIUM));
        actionIcon.setDescription(msg);
        actionIcon.addStyleName("top-left right-margin-20");
        headerContainer.addComponent(actionIcon);

    }

    EntityLink selectedCause = entity.getSelectedCause();
    /* display title */
    /* if the entity is open */
    /* treat leafs like all posts 21.08.2012 */
    if (isOpened /*
                 * || (subtyesList == null && entity.getLastActionType() ==
                 * null)
                 */) {
        Label title = new Label(entity.getTitle());
        if (isOpened) {
            title.addStyleName(OpenGroupsStyles.TITLE_LINK);
        } else {
            title.addStyleName("list-issue-title");
        }
        // title.addStyleName("top-left");
        // title.setSizeFull();
        title.setWidth("80%");
        // title.setHeight("100%");

        headerContainer.addComponent(title);

    } else {
        // Button titleLink = new Button(entity.getTitle());
        // titleLink.setWidth("100%");
        // titleLink.addStyleName(BaseTheme.BUTTON_LINK);
        // titleLink.addStyleName("issue-title");
        // titleLink.setDescription(entity.getContentPreview());
        Label titleLink = null;
        /* treat leafs like all posts 21.08.2012 */
        // if (subtyesList != null) {
        titleLink = OpenGroupsUtil.getLinkForEntity(entity, app);
        titleLink.setDescription(entity.getContentPreview());
        titleLink.addStyleName("list-issue-title");
        // }
        // /* is a leaf entity in the recent activity list */
        // else {
        // String parentTitle = selectedCause.getParentTitle();
        // Entity parentEntity = new Entity(selectedCause.getParentId());
        // parentEntity.setTitle(parentTitle);
        //
        // parentEntity.getState().setDesiredActionsPath(
        // complexEntityType +
        // Defaults.getDefaultActionForEntityType(complexEntityType));
        // titleLink = OpenGroupsUtil.getLinkForEntity(parentEntity, app,
        // entity.getTitle());
        // titleLink.setDescription(entity.getContentPreview());
        // titleLink.addStyleName("list-issue-title");
        //
        // }

        // titleLink.setWidth("75%");
        titleLink.addStyleName("top-left");
        headerContainer.addComponent(titleLink);
        // titleContainer.setExpandRatio(titleLink, 10f);
        // currentContainer.addStyleName("list-item");
    }

    /* add parent link */
    if (selectedCause != null && !isOpened && entity.getContent() == null) {
        // CssLayout parentInfoContainer = new CssLayout();
        // parentInfoContainer.addStyleName(OpenGroupsStyles.TOP_RIGHT);
        // headerContainer.addComponent(parentInfoContainer);
        // headerContainer.setColumnExpandRatio(1, 1f);
        // headerContainer.setComponentAlignment(parentInfoContainer,
        // Alignment.TOP_RIGHT);
        /* if parent entity is the current selected entity, say it */
        Entity mainEntity = actionContext.getMainEntity();
        if (selectedCause.getParentId() == mainEntity.getId()) {
            // String currentMsg = getMessage(mainEntity.getComplexType() +
            // ".current");
            // Label currentEntityLabel = new Label(currentMsg);
            // currentEntityLabel.setSizeUndefined();
            // currentEntityLabel.addStyleName("top-right");
            // headerContainer.addComponent(currentEntityLabel);
            // titleContainer.setExpandRatio(currentEntityLabel, 2f);
        } else {/* add link to the parent entity */
            String parentTitle = selectedCause.getParentTitle();
            final Entity parentEntity = new Entity(selectedCause.getParentId());
            parentEntity.setTitle(parentTitle);

            Label parentLink = OpenGroupsUtil.getLinkForEntityWithImage(parentEntity, app,
                    OpenGroupsResources.getIconPath(OpenGroupsIconsSet.PARENT, OpenGroupsIconsSet.MEDIUM));
            parentLink.setDescription(parentTitle);
            parentLink.setSizeUndefined();
            parentLink.addStyleName(OpenGroupsStyles.TOP_RIGHT);
            // CssLayout imgContainer = new CssLayout();
            // imgContainer.setWidth("24px");
            // imgContainer.setHeight("24px");
            // imgContainer.addStyleName(OpenGroupsStyles.TOP_RIGHT);
            // imgContainer.addComponent(parentLink);
            // parentInfoContainer.addComponent(imgContainer);
            headerContainer.addComponent(parentLink);
        }
    }

    /* display header actions */
    if (isOpened) {
        UserActionList headerActions = getAvailableActions(entity, ActionLocations.HEADER);
        boolean allowRefresh = appConfigManager.getComplexEntityBooleanParam(entity.getComplexType(),
                ComplexEntityParam.ALLOW_REFRESH);
        boolean hasHeaderActions = headerActions != null && headerActions.getActions() != null;
        if (allowRefresh || hasHeaderActions) {
            HorizontalLayout actionsContainer = new HorizontalLayout();
            actionsContainer.addStyleName(OpenGroupsStyles.TOP_RIGHT);
            actionsContainer.setSpacing(true);
            // /* add refresh button */
            // if (allowRefresh) {
            // actionsContainer.addComponent(getRefreshButton(entity, app));
            // }
            // if (hasHeaderActions) {
            // for (final UserAction ha :
            // headerActions.getActions().values()) {
            // Button actButton = getButtonForAction(ha, entity, app);
            // actionsContainer.addComponent(actButton);
            // }
            // }
            headerContainer.addComponent(actionsContainer);
            // headerContainer.setColumnExpandRatio(1, 1f);
            // headerContainer.setComponentAlignment(actionsContainer,
            // Alignment.TOP_RIGHT);
            entity.setHeaderActionLinksContainer(actionsContainer);
            refreshHeaderActionLinks(entity, app, actionContext);
        }

    }

    /* display tags */
    List<Tag> tags = entity.getTags();
    if (tags != null) {
        if (tags.size() > 0) {
            String tagsList = "";
            for (int i = 0; i < tags.size(); i++) {
                Tag tag = tags.get(i);
                tagsList += tag.getTagName();
                if ((tags.size() - i) > 1) {
                    tagsList += ", ";
                }
            }
            String tagsLabelString = app.getMessage("tags.label") + tagsList;
            currentContainer.addComponent(new Label(tagsLabelString));
        }
    }

    CssLayout statusPane = new CssLayout();
    statusPane.addStyleName("entity-status-pane");

    currentContainer.addComponent(statusPane);

    if (appConfigManager.getComplexEntityBooleanParam(complexEntityType, ComplexEntityParam.SHOW_POST_INFO)) {
        String insertDateString = entity.getInsertDate().toString();
        Label insertDate = new Label(app.getMessage("posted") + DateUtil.removeNanos(insertDateString));
        statusPane.addComponent(insertDate);
        // statusPane.setColumnExpandRatio(0, 1f);
    }

    CssLayout statsSummaryPane = new CssLayout();
    statsSummaryPane.addStyleName("entity-stats-summary-pane");
    // statsSummaryPane.setSizeFull();
    // statsSummaryPane.setWidth("100%");

    currentContainer.addComponent(statsSummaryPane);

    /* add votes */
    if (appConfigManager.getComplexEntityBooleanParam(complexEntityType, ComplexEntityParam.ALLOW_VOTING)) {
        // HorizontalLayout votesPane = new HorizontalLayout();
        // votesPane.setMargin(false);
        // votesPane.addStyleName("middle-left");
        // votesPane.addStyleName("margin-right");
        // statsSummaryPane.addComponent(votesPane);
        // statsSummaryPane.setExpandRatio(votesPane, 1f);
        // statsSummaryPane.setComponentAlignment(votesPane,
        // Alignment.MIDDLE_LEFT);

        Label votesLabel = new Label(app.getMessage("votes") + ":&nbsp;");
        votesLabel.setContentMode(Label.CONTENT_XHTML);
        votesLabel.setSizeUndefined();
        votesLabel.addStyleName("middle-left");
        // votesPane.addComponent(votesLabel);
        Label proVotes = FormatingUtils.coloredLabel(entity.getProVotes(), "336633");
        proVotes.addStyleName("middle-left");
        proVotes.setSizeUndefined();
        // votesPane.addComponent(proVotes);
        Label dash = new Label("-");
        dash.addStyleName("middle-left");
        dash.setSizeUndefined();
        // votesPane.addComponent(new Label("-"));
        Label opposedVotes = FormatingUtils.coloredLabel(entity.getOpposedVotes(), "660000");
        // votesPane.addComponent(opposedVotes);
        opposedVotes.addStyleName("middle-left");
        opposedVotes.addStyleName("right-margin-10");
        opposedVotes.setSizeUndefined();

        statsSummaryPane.addComponent(votesLabel);
        statsSummaryPane.addComponent(proVotes);
        statsSummaryPane.addComponent(dash);
        statsSummaryPane.addComponent(opposedVotes);

    }
    List<TypeRelationConfig> subtypes = appConfigManager.getSubtypesForType(entity.getComplexTypeId());
    // if (subtyesList != null) {
    if (subtypes != null) {
        Map<String, Long> firstLevelSubtypesCount = entity.getSubtypeEntitiesCount();
        Map<String, Long> allSubtypesCount = entity.getRecursiveSubtypeEntitiesCount();

        // for (String s : subtyesList) {
        // String subtype = s.toLowerCase();
        for (TypeRelationConfig trc : subtypes) {
            String targetComplexType = trc.getTargetComplexType();
            String subtype = targetComplexType.toLowerCase();
            String displayName = app.getMessage("subtype." + subtype);

            Entity refEntity = new Entity(entity.getId());

            refEntity.getState().setDesiredActionsPath(
                    targetComplexType + Defaults.getDefaultActionForEntityType(targetComplexType));
            Label subtypeLink = OpenGroupsUtil.getLinkForEntity(refEntity, app, displayName);

            String valueString = ": " + firstLevelSubtypesCount.get(subtype);

            // if (getAppConfigManager().getComplexEntityBooleanParam(s,
            // ComplexEntityParam.ALLOW_RECURSIVE_LIST)) {
            if (appConfigManager.getTypeRelationBooleanConfigParam(trc.getId(),
                    TypeRelationConfigParam.ALLOW_RECURSIVE_LIST)) {
                Long recCount = allSubtypesCount.get(subtype);
                if (recCount != null) {
                    valueString += " / " + recCount;
                }
            }
            Label sl = new Label(valueString);
            sl.setWidth(null);
            sl.addStyleName("middle-left");
            sl.addStyleName("right-margin-10");

            subtypeLink.setWidth(null);
            subtypeLink.addStyleName("middle-left");

            statsSummaryPane.addComponent(subtypeLink);
            statsSummaryPane.addComponent(sl);
            // statsSummaryPane.setExpandRatio(sl, 1f);
            // statsSummaryPane.setComponentAlignment(sl,
            // Alignment.MIDDLE_LEFT);
        }
    }

    displaySummaryActions(entity, app, statsSummaryPane, actionContext);

    // statusPane.addComponent(statsSummaryPane, 1, 0);
    // statusPane.setColumnExpandRatio(1, 1.8f);
    // statusPane.setComponentAlignment(statsSummaryPane,
    // Alignment.MIDDLE_RIGHT);

    // summaryLayout.setComponentAlignment(statsSummaryPane,
    // Alignment.MIDDLE_RIGHT);

    /* add the content */
    Object contentObj = entity.getContent();
    if (contentObj != null) {
        // content.setSizeFull();
        Panel contentContainer = new Panel();
        // CssLayout contentContainer = new CssLayout();
        contentContainer.addStyleName("text-content");
        currentContainer.addComponent(contentContainer);

        Label content = new Label(contentObj.toString());
        content.setContentMode(Label.CONTENT_XHTML);
        // content.addStyleName("text-label");
        contentContainer.addComponent(content);

        /* if the content is visible, display footer actions */
        displayFooterActions(entity, app, currentContainer, actionContext);
    }

}