Search in sources :

Example 41 with CssLayout

use of com.vaadin.ui.CssLayout in project cuba by cuba-platform.

the class WebAbstractTree method initComponent.

public void initComponent(CubaTree component) {
    componentComposition = new CssLayout();
    componentComposition.setPrimaryStyleName("c-tree-composition");
    componentComposition.setWidthUndefined();
    componentComposition.addComponent(component);
    component.setSizeFull();
    component.addShortcutListener(new ShortcutListener("tableEnter", com.vaadin.event.ShortcutAction.KeyCode.ENTER, null) {

        @Override
        public void handleAction(Object sender, Object target) {
            if (target == WebAbstractTree.this.component) {
                if (enterPressAction != null) {
                    enterPressAction.actionPerform(WebAbstractTree.this);
                } else {
                    handleClickAction();
                }
            }
        }
    });
}
Also used : CssLayout(com.vaadin.ui.CssLayout) ShortcutListener(com.vaadin.event.ShortcutListener)

Example 42 with CssLayout

use of com.vaadin.ui.CssLayout in project vaadin-app-layout by appreciated.

the class PaperElementsDemo method getDemoView.

@Override
protected Component getDemoView() {
    PaperButton basicButton = PaperButton.create("Basic button");
    basicButton.setRaised(true);
    basicButton.addEventListener("click", args -> {
        Notification.show("Clicked");
    });
    PaperButton notRaisedButton = PaperButton.create("Not raised");
    notRaisedButton.setRaised(false);
    PaperButton noInkButton = PaperButton.create("No ink");
    noInkButton.setRaised(true);
    noInkButton.setNoink(true);
    PaperButton disabledButton = PaperButton.create("Disabled");
    disabledButton.setDisabled(true);
    Layout horizontal = Layout.horizontal();
    horizontal.setJustified(true);
    horizontal.setAttribute("style", "width: 600px");
    horizontal.appendChild(basicButton);
    horizontal.appendChild(notRaisedButton);
    horizontal.appendChild(noInkButton);
    horizontal.appendChild(disabledButton);
    PaperSlider slider = PaperSlider.create();
    slider.setValue(50);
    slider.addEventListener("change", arguments -> {
        Notification.show("Value changed to " + slider.getValue());
    });
    Layout vertical = Layout.vertical();
    vertical.appendHtml("<h2>Slider</h2>");
    vertical.appendChild(slider);
    vertical.appendHtml("<h2>Buttons</h2>");
    vertical.appendChild(horizontal);
    CssLayout wrapper = new CssLayout();
    Root root = ElementIntegration.getRoot(wrapper);
    root.appendChild(vertical);
    return wrapper;
}
Also used : CssLayout(com.vaadin.ui.CssLayout) Root(org.vaadin.elements.Root) CssLayout(com.vaadin.ui.CssLayout)

Example 43 with CssLayout

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

the class AbstractPageModContentFactoryImpl method createRowItem.

protected final void createRowItem(final ResponsiveRow row, final Button button, final String description) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    button.addStyleName("itembox");
    button.addStyleName("title");
    Responsive.makeResponsive(button);
    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) Label(com.vaadin.ui.Label)

Example 44 with CssLayout

use of com.vaadin.ui.CssLayout in project Java-Vaadin-and-Spring-Framework by Jahidul007.

the class MyUI method init.

@Override
protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout layout = new VerticalLayout();
    filterText.setPlaceholder("filter by name ");
    filterText.addValueChangeListener(e -> updateList());
    filterText.setValueChangeMode(ValueChangeMode.LAZY);
    Button clearFilterTextBtn = new Button(VaadinIcons.CLOSE);
    clearFilterTextBtn.setDescription("Clear the current filter");
    clearFilterTextBtn.addClickListener(e -> filterText.clear());
    CssLayout filtering = new CssLayout();
    filtering.addComponents(filterText, clearFilterTextBtn);
    filtering.setStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    Button addCustomerBtn = new Button("Add new Customer ");
    addCustomerBtn.addClickListener(e -> {
        grid.asSingleSelect().clear();
        form.setCustomer(new Customer());
    });
    HorizontalLayout toolBar = new HorizontalLayout(filtering, addCustomerBtn);
    grid.setColumns("firstName", "lastName", "email");
    HorizontalLayout main = new HorizontalLayout(grid, form);
    main.setSizeFull();
    grid.setSizeFull();
    // add Grid to the layout
    main.setExpandRatio(grid, 1);
    layout.addComponents(toolBar, main);
    updateList();
    setContent(layout);
    form.setVisible(false);
    grid.asSingleSelect().addValueChangeListener(event -> {
        if (event.getValue() == null) {
            form.setVisible(false);
        } else {
            form.setCustomer(event.getValue());
        }
    });
}
Also used : CssLayout(com.vaadin.ui.CssLayout) Button(com.vaadin.ui.Button) VerticalLayout(com.vaadin.ui.VerticalLayout) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Example 45 with CssLayout

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

the class MinistryRankingCurrentPartiesLeaderScoreboardChartsPageModContentFactoryImpl method createDashboardGovernmentMember.

private void createDashboardGovernmentMember(final ResponsiveRow row, final Map<String, List<GovernmentBodyAnnualSummary>> governmentBodyMinistryMap, final ViewRiksdagenGovermentRoleMember viewRiksdagenGovermentRoleMember, final ViewRiksdagenPolitician viewRiksdagenPolitician) {
    final CssLayout layout = new CssLayout();
    layout.addStyleName("v-layout-content-overview-dashboard-panel-level2");
    Responsive.makeResponsive(layout);
    layout.setSizeUndefined();
    final DataContainer<ViewRiksdagenPartyRoleMember, String> partyRoleMemberDataContainer = getApplicationManager().getDataContainer(ViewRiksdagenPartyRoleMember.class);
    final Label titleLabel = new Label(viewRiksdagenGovermentRoleMember.getRoleCode() + " " + viewRiksdagenGovermentRoleMember.getFirstName() + " " + viewRiksdagenGovermentRoleMember.getLastName() + " (" + viewRiksdagenGovermentRoleMember.getParty() + ")");
    Responsive.makeResponsive(titleLabel);
    titleLabel.addStyleName("title");
    titleLabel.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(titleLabel);
    List<ViewRiksdagenPartyRoleMember> partyRole = partyRoleMemberDataContainer.findListByProperty(new Object[] { viewRiksdagenPolitician.getPersonId(), Boolean.TRUE }, ViewRiksdagenPartyRoleMember_.personId, ViewRiksdagenPartyRoleMember_.active);
    if (partyRole.size() > 0) {
        final Label partyRoleLabel = new Label(partyRole.get(0).getRoleCode() + " (" + viewRiksdagenGovermentRoleMember.getParty() + ")  since " + partyRole.get(0).getFromDate());
        Responsive.makeResponsive(partyRoleLabel);
        partyRoleLabel.addStyleName("title");
        partyRoleLabel.setWidth(100, Unit.PERCENTAGE);
        layout.addComponent(partyRoleLabel);
    }
    final Map<String, List<GovernmentBodyAnnualOutcomeSummary>> reportByMinistry = esvApi.getGovernmentBodyReportByMinistry();
    createMinistryRoleSummary(reportByMinistry, governmentBodyMinistryMap, viewRiksdagenGovermentRoleMember, viewRiksdagenPolitician, layout);
    createPoliticaExperienceSummary(governmentBodyMinistryMap, viewRiksdagenGovermentRoleMember, viewRiksdagenPolitician, 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) ViewRiksdagenPartyRoleMember(com.hack23.cia.model.internal.application.data.party.impl.ViewRiksdagenPartyRoleMember) Label(com.vaadin.ui.Label) List(java.util.List)

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