Search in sources :

Example 46 with CssLayout

use of com.vaadin.ui.CssLayout in project cia by Hack23.

the class AbstractMenuItemFactoryImpl method createButtonLink.

/**
 * Creates the button link.
 *
 * @param row
 *            the panel content
 * @param linkText
 *            the link text
 * @param icon
 *            the icon
 * @param command
 *            the command
 * @param description
 *            the description
 */
protected static final void createButtonLink(final ResponsiveRow row, final String linkText, final Resource icon, final ClickListener command, final String description) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    final Button button = new Button(linkText);
    Responsive.makeResponsive(button);
    button.setStyleName(LINK_STYLE_NAME);
    button.addStyleName("title");
    button.addClickListener(command);
    button.setIcon(icon);
    button.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(button);
    final Label descriptionLabel = new Label(description);
    descriptionLabel.addStyleName("itembox");
    Responsive.makeResponsive(descriptionLabel);
    descriptionLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(descriptionLabel);
    row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE, DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
Also used : CssLayout(com.vaadin.ui.CssLayout) Button(com.vaadin.ui.Button) Label(com.vaadin.ui.Label)

Example 47 with CssLayout

use of com.vaadin.ui.CssLayout in project cia by Hack23.

the class DashboardViewOverviewPageModContentFactoryImpl method createDashboardMonarch.

private void createDashboardMonarch(final ResponsiveRow row) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-dashboard-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    final Label titleLabel = new Label("Monarch");
    Responsive.makeResponsive(titleLabel);
    titleLabel.addStyleName("title");
    titleLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(titleLabel);
    final Label headOfStateLabel = new Label("Head of state(King): Carl Gustaf Folke Hubertus since 15 September 1973");
    Responsive.makeResponsive(headOfStateLabel);
    headOfStateLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(headOfStateLabel);
    final Label nextHeadOfStateLabel = new Label("Future head of state(Queen): Victoria Ingrid Alice Désirée;");
    Responsive.makeResponsive(nextHeadOfStateLabel);
    nextHeadOfStateLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(nextHeadOfStateLabel);
    addMonarchIncomeSpending(layout);
    row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE, DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
Also used : CssLayout(com.vaadin.ui.CssLayout) Label(com.vaadin.ui.Label)

Example 48 with CssLayout

use of com.vaadin.ui.CssLayout in project cia by Hack23.

the class DashboardViewOverviewPageModContentFactoryImpl method createDashboardPartRiskBySeverity.

private void createDashboardPartRiskBySeverity(final ResponsiveRow row) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-dashboard-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    final Label titleLabel = new Label("Number of risk by severity");
    Responsive.makeResponsive(titleLabel);
    titleLabel.addStyleName("title");
    titleLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(titleLabel);
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    Responsive.makeResponsive(horizontalLayout);
    final DataContainer<RuleViolation, String> dataContainer = getApplicationManager().getDataContainer(RuleViolation.class);
    final List<RuleViolation> ruleViolations = dataContainer.getAll();
    for (final Entry<Status, List<RuleViolation>> statusEntry : ruleViolations.stream().collect(Collectors.groupingBy(RuleViolation::getStatus)).entrySet()) {
        horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("" + statusEntry.getKey(), statusEntry.getValue().size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "" + statusEntry.getKey()));
    }
    layout.addComponent(horizontalLayout);
    row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE, DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
Also used : Status(com.hack23.cia.model.internal.application.data.rules.impl.Status) CssLayout(com.vaadin.ui.CssLayout) CounterStatisticsCard(com.github.markash.ui.component.card.CounterStatisticsCard) Label(com.vaadin.ui.Label) List(java.util.List) RuleViolation(com.hack23.cia.model.internal.application.data.rules.impl.RuleViolation) CounterStatisticModel(com.github.markash.ui.component.card.CounterStatisticModel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 49 with CssLayout

use of com.vaadin.ui.CssLayout in project cia by Hack23.

the class DashboardViewOverviewPageModContentFactoryImpl method createDashboardParliament.

private void createDashboardParliament(final ResponsiveRow row) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-dashboard-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    final Label titleLabel = new Label("Parliament");
    Responsive.makeResponsive(titleLabel);
    // button.setStyleName(LINK_STYLE_NAME);
    titleLabel.addStyleName("title");
    titleLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(titleLabel);
    final HorizontalLayout horizontalLayout = new HorizontalLayout();
    Responsive.makeResponsive(horizontalLayout);
    final DataContainer<ViewRiksdagenPolitician, String> parliamentRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPolitician.class);
    final List<ViewRiksdagenPolitician> parliamentMembers = parliamentRoleMemberDataContainer.findListByProperty(new Object[] { Boolean.TRUE }, ViewRiksdagenPolitician_.activeParliament);
    horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("Members", parliamentMembers.size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "Members"));
    final DataContainer<ViewRiksdagenMinistry, String> ministryDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenMinistry.class);
    final DataContainer<ViewRiksdagenPartySummary, String> partyDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPartySummary.class);
    final List<ViewRiksdagenPartySummary> listparties = partyDataContainer.findListByProperty(new Object[] { Boolean.TRUE }, ViewRiksdagenPartySummary_.activeParliament);
    horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("Parties", listparties.size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "Parties"));
    final DataContainer<ViewRiksdagenCommittee, String> committeeDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenCommittee.class);
    final List<ViewRiksdagenCommittee> listCommittees = committeeDataContainer.findListByProperty(new Object[] { Boolean.TRUE }, ViewRiksdagenCommittee_.active);
    horizontalLayout.addComponent(new CounterStatisticsCard(VaadinIcons.WARNING, new CounterStatisticModel("Committees", listCommittees.size()).withShow(StatisticShow.Sum).withIconHidden().withShowOnlyStatistic(true), "Committees"));
    layout.addComponent(horizontalLayout);
    addParliamentIncomeSpending(layout);
    row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE, DISPLAYS_SIZE_XM_DEVICE, DISPLAY_SIZE_MD_DEVICE, DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
Also used : CounterStatisticsCard(com.github.markash.ui.component.card.CounterStatisticsCard) Label(com.vaadin.ui.Label) HorizontalLayout(com.vaadin.ui.HorizontalLayout) ViewRiksdagenCommittee(com.hack23.cia.model.internal.application.data.committee.impl.ViewRiksdagenCommittee) CssLayout(com.vaadin.ui.CssLayout) ViewRiksdagenMinistry(com.hack23.cia.model.internal.application.data.ministry.impl.ViewRiksdagenMinistry) ViewRiksdagenPartySummary(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartySummary) CounterStatisticModel(com.github.markash.ui.component.card.CounterStatisticModel) ViewRiksdagenPolitician(com.hack23.cia.model.internal.application.data.politician.impl.ViewRiksdagenPolitician)

Example 50 with CssLayout

use of com.vaadin.ui.CssLayout in project Eclipse-Kuksa-Automotive-Edge-Extension by max-grzanna.

the class AppsListView method listApps.

public void listApps(String text, String categoryId) {
    int currentpage = 1;
    int limit = 9;
    int total;
    Page<App> appsList = findByText(text, categoryId, currentpage - 1, limit);
    total = (int) appsList.getTotalElements();
    CssLayout appslayoutnew = new CssLayout();
    appslayoutnew = AppGridView.crateAppGridView(appsList, 3);
    mainlayout.removeAllComponents();
    mainlayout.addComponent(navHeaderLayout);
    mainlayout.addComponent(actions);
    mainlayout.addComponent(appslayoutnew);
    paginationComponent = createPaginationComponent(total, currentpage, limit);
    mainlayout.addComponent(paginationComponent);
    setCompositionRoot(mainlayout);
}
Also used : App(org.eclipse.kuksa.appstore.model.App) CssLayout(com.vaadin.ui.CssLayout)

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