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();
}
}
}
});
}
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;
}
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);
}
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());
}
});
}
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);
}
Aggregations