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