Search in sources :

Example 31 with CssLayout

use of com.vaadin.ui.CssLayout in project opencms-core by alkacon.

the class CmsPermissionViewTable method getLayoutFromEntry.

/**
 * Makes item for table.<p>
 *
 * @param cms CmsObject
 * @param entry ACE
 * @param view permission table
 * @param resPath parentResource (or null)
 * @return VerticalLayout
 */
private VerticalLayout getLayoutFromEntry(CmsObject cms, CmsAccessControlEntry entry, final CmsPermissionView view, String resPath) {
    VerticalLayout res = new VerticalLayout();
    res.setSpacing(false);
    I_CmsPrincipal principal = null;
    try {
        principal = CmsPrincipal.readPrincipalIncludingHistory(cms, entry.getPrincipal());
    } catch (CmsException e) {
        principal = new CmsGroup(entry.getPrincipal(), null, "", "", 0);
    }
    if (principal != null) {
        CmsResourceInfo info = CmsAccountsApp.getPrincipalInfo(principal);
        if (view.isEditable()) {
            CssLayout cssl = new CssLayout();
            Button removeButton = new Button(FontOpenCms.TRASH_SMALL);
            removeButton.addStyleName("borderless o-toolbar-button o-resourceinfo-toolbar o-toolbar-icon-visible");
            removeButton.addClickListener(new ClickListener() {

                private static final long serialVersionUID = -6112693137800596485L;

                public void buttonClick(ClickEvent event) {
                    view.deletePermissionSet();
                }
            });
            cssl.addComponent(removeButton);
            info.setButtonWidget(cssl);
        }
        res.addComponent(info);
        if (resPath != null) {
            Label resLabel = new Label(CmsVaadinUtils.getMessageText(Messages.GUI_PERMISSION_INHERITED_FROM_1, resPath));
            resLabel.addStyleName("o-report");
            res.addComponent(resLabel);
        }
    }
    res.addComponent(view);
    return res;
}
Also used : I_CmsPrincipal(org.opencms.security.I_CmsPrincipal) CmsResourceInfo(org.opencms.ui.components.CmsResourceInfo) CssLayout(com.vaadin.ui.CssLayout) Button(com.vaadin.ui.Button) CmsGroup(org.opencms.file.CmsGroup) ClickEvent(com.vaadin.ui.Button.ClickEvent) CmsException(org.opencms.main.CmsException) Label(com.vaadin.v7.ui.Label) VerticalLayout(com.vaadin.v7.ui.VerticalLayout) ClickListener(com.vaadin.ui.Button.ClickListener)

Example 32 with CssLayout

use of com.vaadin.ui.CssLayout in project SORMAS-Project by hzi-braunschweig.

the class DiseaseSectionStatisticsComponent method buildCountLayout.

protected void buildCountLayout(DashboardStatisticsCountElement... dashboardStatisticsCountElements) {
    CssLayout countLayout = createCountLayout(true);
    for (DashboardStatisticsCountElement dashboardStatisticsCountElement : dashboardStatisticsCountElements) {
        addComponentToCountLayout(countLayout, dashboardStatisticsCountElement);
    }
    addComponent(countLayout);
}
Also used : DashboardStatisticsCountElement(de.symeda.sormas.ui.dashboard.statistics.DashboardStatisticsCountElement) CssLayout(com.vaadin.ui.CssLayout)

Example 33 with CssLayout

use of com.vaadin.ui.CssLayout in project SORMAS-Project by hzi-braunschweig.

the class DashboardStatisticsSubComponent method createCountLayout.

public CssLayout createCountLayout(boolean addMarginBottom) {
    CssLayout countLayout = new CssLayout();
    countLayout.setWidthUndefined();
    if (addMarginBottom) {
        CssStyles.style(countLayout, CssStyles.VSPACE_3);
    }
    return countLayout;
}
Also used : CssLayout(com.vaadin.ui.CssLayout)

Example 34 with CssLayout

use of com.vaadin.ui.CssLayout in project SORMAS-Project by hzi-braunschweig.

the class ContactsDashboardStatisticsComponent method addSecondComponent.

@Override
protected void addSecondComponent() {
    secondComponent = new DashboardStatisticsSubComponent();
    // Header
    secondComponent.addHeader(I18nProperties.getString(Strings.headingUnderFollowUp), null, true);
    // Content
    secondComponent.addMainContent();
    CssLayout visitStatusCountLayout = secondComponent.createCountLayout(true);
    cooperativeContacts = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardCooperative), CountElementStyle.POSITIVE);
    secondComponent.addComponentToCountLayout(visitStatusCountLayout, cooperativeContacts);
    uncooperativeContacts = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardUncooperative), CountElementStyle.CRITICAL);
    secondComponent.addComponentToCountLayout(visitStatusCountLayout, uncooperativeContacts);
    unavailableContacts = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardUnavailable), CountElementStyle.RELEVANT);
    secondComponent.addComponentToCountLayout(visitStatusCountLayout, unavailableContacts);
    neverVisitedContacts = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardNeverVisited), CountElementStyle.MINOR);
    secondComponent.addComponentToCountLayout(visitStatusCountLayout, neverVisitedContacts);
    Label infoLabel = new Label(VaadinIcons.INFO_CIRCLE.getHtml(), ContentMode.HTML);
    infoLabel.setSizeUndefined();
    infoLabel.setDescription(I18nProperties.getDescription(Descriptions.descDashboardFollowUpInfo));
    CssStyles.style(infoLabel, CssStyles.LABEL_LARGE, CssStyles.LABEL_SECONDARY, "follow-up-status-info-button");
    secondComponent.addComponentToCountLayout(visitStatusCountLayout, infoLabel);
    secondComponent.addComponentToContent(visitStatusCountLayout);
    // Number of missed visits
    Label missedVisitsLabel = new Label(I18nProperties.getCaption(Captions.dashboardNotVisitedFor));
    CssStyles.style(missedVisitsLabel, CssStyles.LABEL_BOLD, CssStyles.LABEL_PRIMARY, CssStyles.LABEL_UPPERCASE, CssStyles.LABEL_BACKGROUND_FOCUS_LIGHT, CssStyles.LABEL_ROUNDED_CORNERS_SLIM);
    secondComponent.addComponentToContent(missedVisitsLabel);
    CssLayout missedVisitsCountLayout = secondComponent.createCountLayout(false);
    missedVisitsOneDay = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardOneDay), CountElementStyle.PRIMARY);
    secondComponent.addComponentToCountLayout(missedVisitsCountLayout, missedVisitsOneDay);
    missedVisitsTwoDays = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardTwoDays), CountElementStyle.PRIMARY);
    secondComponent.addComponentToCountLayout(missedVisitsCountLayout, missedVisitsTwoDays);
    missedVisitsThreeDays = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardThreeDays), CountElementStyle.PRIMARY);
    secondComponent.addComponentToCountLayout(missedVisitsCountLayout, missedVisitsThreeDays);
    missedVisitsGtThreeDays = new DashboardStatisticsCountElement(I18nProperties.getCaption(Captions.dashboardGtThreeDays), CountElementStyle.PRIMARY);
    secondComponent.addComponentToCountLayout(missedVisitsCountLayout, missedVisitsGtThreeDays);
    secondComponent.addComponentToContent(missedVisitsCountLayout);
    subComponentsLayout.addComponent(secondComponent, SECOND_LOC);
}
Also used : DashboardStatisticsCountElement(de.symeda.sormas.ui.dashboard.statistics.DashboardStatisticsCountElement) CssLayout(com.vaadin.ui.CssLayout) Label(com.vaadin.ui.Label) DashboardStatisticsSubComponent(de.symeda.sormas.ui.dashboard.statistics.DashboardStatisticsSubComponent)

Example 35 with CssLayout

use of com.vaadin.ui.CssLayout in project SORMAS-Project by hzi-braunschweig.

the class SubMenu method addView.

public void addView(final String name, String caption, String params, boolean isBackNavigation) {
    String target = "#!" + name + (params != null ? "/" + params : "");
    CssLayout tabItemCell = new CssLayout();
    tabItemCell.setSizeUndefined();
    tabItemCell.setPrimaryStyleName("v-tabsheet-tabitemcell");
    CssLayout tabItem = new CssLayout();
    tabItem.setId("tab-" + name.replaceAll("/", "-"));
    tabItem.setSizeUndefined();
    tabItem.setPrimaryStyleName("v-tabsheet-tabitem");
    if (isBackNavigation) {
        tabItem.addStyleName("back");
    }
    tabItemCell.addComponent(tabItem);
    Link link = new Link(caption, new ExternalResource(target));
    link.addStyleName("v-caption");
    if (isBackNavigation)
        link.setIcon(VaadinIcons.ARROW_CIRCLE_LEFT);
    tabItem.addComponent(link);
    menuItemsLayout.addComponent(tabItemCell);
    viewMenuItemMap.put(name, tabItem);
}
Also used : CssLayout(com.vaadin.ui.CssLayout) ExternalResource(com.vaadin.server.ExternalResource) Link(com.vaadin.ui.Link)

Aggregations

CssLayout (com.vaadin.ui.CssLayout)69 Label (com.vaadin.ui.Label)25 Button (com.vaadin.ui.Button)12 VerticalLayout (com.vaadin.ui.VerticalLayout)12 HorizontalLayout (com.vaadin.ui.HorizontalLayout)11 Component (com.vaadin.ui.Component)7 ClickEvent (com.vaadin.ui.Button.ClickEvent)6 ClickListener (com.vaadin.ui.Button.ClickListener)6 List (java.util.List)6 CounterStatisticModel (com.github.markash.ui.component.card.CounterStatisticModel)5 CounterStatisticsCard (com.github.markash.ui.component.card.CounterStatisticsCard)5 Page (com.vaadin.server.Page)3 Layout (com.vaadin.ui.Layout)3 HorizontalFlexLayout (de.catma.ui.layout.HorizontalFlexLayout)3 Path (java.nio.file.Path)3 EventBus (com.google.common.eventbus.EventBus)2 ViewRiksdagenGovermentRoleMember (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenGovermentRoleMember)2 ViewRiksdagenMinistry (com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry)2 ViewRiksdagenPartyRoleMember (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyRoleMember)2 ViewRiksdagenPartySummary (com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary)2