List of usage examples for com.vaadin.ui.themes ValoTheme LABEL_SMALL
String LABEL_SMALL
To view the source code for com.vaadin.ui.themes ValoTheme LABEL_SMALL.
Click Source Link
From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadConfirmationWindow.java
License:Open Source License
private static Label getWarningLabel() { final Label warningIconLabel = new Label(); warningIconLabel.addStyleName(ValoTheme.LABEL_SMALL); warningIconLabel.setHeightUndefined(); warningIconLabel.setContentMode(ContentMode.HTML); warningIconLabel.setValue(FontAwesome.WARNING.getHtml()); warningIconLabel.addStyleName("warningLabel"); warningIconLabel.setVisible(false);/*from w ww . j ava 2 s.co m*/ return warningIconLabel; }
From source file:org.eclipse.hawkbit.ui.common.builder.LabelBuilder.java
License:Open Source License
private Label createLabel() { final Label label = new Label(name); label.setVisible(visible);/*from w w w. j av a 2 s .c o m*/ final StringBuilder style = new StringBuilder(ValoTheme.LABEL_SMALL); style.append(' '); style.append(ValoTheme.LABEL_BOLD); label.addStyleName(style.toString()); if (id != null) { label.setId(id); } return label; }
From source file:org.eclipse.hawkbit.ui.decorators.SPUIButtonStyleNoBorderWithIcon.java
License:Open Source License
@Override public Button decorate(final Button button, final String style, final boolean setStyle, final Resource icon) { this.button = button; button.setSizeFull();/*from w w w .j av a2 s . c o m*/ button.addStyleName(ValoTheme.LABEL_SMALL); button.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); setOrAddButtonStyle(style, setStyle); setButtonIcon(icon); return button; }
From source file:org.eclipse.hawkbit.ui.management.targettable.TargetDetails.java
License:Open Source License
private Label buildAttributesUpdateLabel() { final Label attributesUpdateLabel = new Label(); attributesUpdateLabel.setStyleName(ValoTheme.LABEL_SMALL); attributesUpdateLabel.setValue(getI18n().getMessage("label.target.attributes.update.pending")); return attributesUpdateLabel; }
From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTable.java
License:Open Source License
private Label getTargetPollTime(final Object itemId) { final Label statusLabel = new Label(); statusLabel.addStyleName(ValoTheme.LABEL_SMALL); statusLabel.setHeightUndefined();/*from ww w. j a v a2 s . c om*/ statusLabel.setContentMode(ContentMode.HTML); final String pollStatusToolTip = (String) getContainerDataSource().getItem(itemId) .getItemProperty(SPUILabelDefinitions.VAR_POLL_STATUS_TOOL_TIP).getValue(); if (StringUtils.hasText(pollStatusToolTip)) { statusLabel.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); statusLabel.setDescription(pollStatusToolTip); } else { statusLabel.setValue(FontAwesome.CLOCK_O.getHtml()); statusLabel.setDescription(getI18n().getMessage(UIMessageIdProvider.TOOLTIP_IN_TIME)); } return statusLabel; }
From source file:org.eclipse.hawkbit.ui.management.targettable.TargetTableHeader.java
License:Open Source License
private void addFilterTextField(final DistributionSetIdName distributionSetIdName) { final Button filterLabelClose = SPUIComponentProvider.getButton("drop.filter.close", "", "", "", true, FontAwesome.TIMES_CIRCLE, SPUIButtonStyleNoBorder.class); filterLabelClose.addClickListener(clickEvent -> closeFilterByDistribution()); final Label filteredDistLabel = new Label(); filteredDistLabel.setStyleName(ValoTheme.LABEL_COLORED + " " + ValoTheme.LABEL_SMALL); String name = HawkbitCommonUtil.getDistributionNameAndVersion(distributionSetIdName.getName(), distributionSetIdName.getVersion()); if (name.length() > SPUITargetDefinitions.DISTRIBUTION_NAME_MAX_LENGTH_ALLOWED) { name = new StringBuilder(name.substring(0, SPUITargetDefinitions.DISTRIBUTION_NAME_LENGTH_ON_FILTER)) .append("...").toString(); }//from w w w.j a v a2 s . com filteredDistLabel.setValue(name); filteredDistLabel.setSizeUndefined(); getFilterDroppedInfo().removeAllComponents(); getFilterDroppedInfo().setSizeFull(); getFilterDroppedInfo().addComponent(filteredDistLabel); getFilterDroppedInfo().addComponent(filterLabelClose); getFilterDroppedInfo().setExpandRatio(filteredDistLabel, 1.0F); eventBus.publish(this, TargetFilterEvent.FILTER_BY_DISTRIBUTION); }
From source file:org.eclipse.hawkbit.ui.rollout.rolloutgrouptargets.RolloutGroupTargetsListHeader.java
License:Open Source License
@Override protected HorizontalLayout getHeaderCaptionLayout() { headerCaption = new LabelBuilder().name("").buildCaptionLabel(); headerCaption.setStyleName(ValoTheme.LABEL_BOLD + " " + ValoTheme.LABEL_SMALL); final Button rolloutsListViewLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, SPUIButtonStyleNoBorder.class); rolloutsListViewLink/* ww w .j a v a2s. c o m*/ .setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); rolloutsListViewLink.setDescription(i18n.getMessage("message.rollouts")); rolloutsListViewLink.setCaption(i18n.getMessage("message.rollouts")); rolloutsListViewLink.addClickListener(value -> showRolloutListView()); rolloutNameLink = SPUIComponentProvider.getButton(null, "", "", null, false, null, SPUIButtonStyleNoBorder.class); rolloutNameLink.setStyleName(ValoTheme.LINK_SMALL + " " + "on-focus-no-border link rollout-caption-links"); rolloutNameLink.setDescription(i18n.getMessage("dashboard.rollouts.caption")); rolloutNameLink.addClickListener(value -> showRolloutGroupListView()); final HorizontalLayout headerCaptionLayout = new HorizontalLayout(); headerCaptionLayout.addComponent(rolloutsListViewLink); headerCaptionLayout.addComponent(new Label(">")); headerCaptionLayout.addComponent(rolloutNameLink); headerCaptionLayout.addComponent(new Label("> ")); headerCaptionLayout.addComponent(headerCaption); return headerCaptionLayout; }
From source file:org.ikasan.dashboard.ui.topology.window.ErrorCategorisationWindow.java
License:BSD License
/** * Helper method to initialise this object. * //w w w .j a va 2s. c om * @param message */ protected void init() { setModal(true); setHeight("90%"); setWidth("90%"); this.existingCategorisedErrorsTable = new Table(); this.existingCategorisedErrorsTable.setWidth("100%"); this.existingCategorisedErrorsTable.setHeight(200, Unit.PIXELS); this.existingCategorisedErrorsTable.addContainerProperty("Module Name", String.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Module Name", .1f); this.existingCategorisedErrorsTable.addContainerProperty("Flow Name", String.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Flow Name", .1f); this.existingCategorisedErrorsTable.addContainerProperty("Component Name", String.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Component Name", .1f); this.existingCategorisedErrorsTable.addContainerProperty("Action", String.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Action", .1f); this.existingCategorisedErrorsTable.addContainerProperty("Error Category", Label.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Error Category", .1f); this.existingCategorisedErrorsTable.addContainerProperty("Error Message", String.class, null); this.existingCategorisedErrorsTable.setColumnExpandRatio("Error Message", .5f); this.existingCategorisedErrorsTable.addStyleName("wordwrap-table"); this.existingCategorisedErrorsTable.addStyleName(ValoTheme.TABLE_NO_STRIPES); this.existingCategorisedErrorsTable.setCellStyleGenerator(new Table.CellStyleGenerator() { @Override public String getStyle(Table source, Object itemId, Object propertyId) { ErrorCategorisationLink errorCategorisationLink = (ErrorCategorisationLink) itemId; if (propertyId == null) { // Styling for row if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.TRIVIAL)) { return "ikasan-green-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.MAJOR)) { return "ikasan-green-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.CRITICAL)) { return "ikasan-orange-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.BLOCKER)) { return "ikasan-red-small"; } } if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.TRIVIAL)) { return "ikasan-green-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.MAJOR)) { return "ikasan-green-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.CRITICAL)) { return "ikasan-orange-small"; } else if (errorCategorisationLink.getErrorCategorisation().getErrorCategory() .equals(ErrorCategorisation.BLOCKER)) { return "ikasan-red-small"; } return "ikasan-small"; } }); this.existingCategorisedErrorsTable.addItemClickListener(new ItemClickEvent.ItemClickListener() { @Override public void itemClick(ItemClickEvent itemClickEvent) { logger.info("table item slected: " + (ErrorCategorisationLink) itemClickEvent.getItemId()); errorCategorisationLink = (ErrorCategorisationLink) itemClickEvent.getItemId(); errorCategorisation = errorCategorisationLink.getErrorCategorisation(); errorCategorisationItem = new BeanItem<ErrorCategorisation>(errorCategorisation); errorCategorisationLinkItem = new BeanItem<ErrorCategorisationLink>(errorCategorisationLink); moduleNameTextField .setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("moduleName")); flowNameTextField.setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("flowName")); componentNameTextField .setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("flowElementName")); errorCategoryCombo.setPropertyDataSource(errorCategorisationItem.getItemProperty("errorCategory")); errorMessageTextArea .setPropertyDataSource(errorCategorisationItem.getItemProperty("errorDescription")); actionCombo.setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("action")); exceptionClassTextField .setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("exceptionClass")); errorMessageTextArea.markAsDirty(); actionCombo.markAsDirty(); errorCategoryCombo.markAsDirty(); componentNameTextField.markAsDirty(); flowNameTextField.markAsDirty(); moduleNameTextField.markAsDirty(); } }); refreshExistingCategorisedErrorsTable(); layout.setSizeFull(); layout.setSpacing(true); layout.setMargin(true); layout.setColumnExpandRatio(0, .25f); layout.setColumnExpandRatio(1, .75f); if (this.errorCategorisationLink == null) { clear(); } Label configuredResourceIdLabel = new Label("Error Categorisation"); configuredResourceIdLabel.setStyleName(ValoTheme.LABEL_HUGE); layout.addComponent(configuredResourceIdLabel, 0, 0, 1, 0); if (this.module == null && this.flow == null && this.component == null) { Label errorCategorisationHintLabel = new Label(); errorCategorisationHintLabel.setCaptionAsHtml(true); errorCategorisationHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You are creating an error categorisation for server wide errors. This categorisation will be applied" + " against errors that occur server wide, that do not have a more focused error categorisation."); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_LIGHT); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(errorCategorisationHintLabel, 0, 1, 1, 1); } else if (this.flow == null && this.component == null) { Label errorCategorisationHintLabel = new Label(); errorCategorisationHintLabel.setCaptionAsHtml(true); errorCategorisationHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You are creating an error categorisation for module wide errors. This categorisation will be applied" + " against errors that occur within this module, that do not have a more focused error categorisation."); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_LIGHT); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(errorCategorisationHintLabel, 0, 1, 1, 1); } else if (this.component == null) { Label errorCategorisationHintLabel = new Label(); errorCategorisationHintLabel.setCaptionAsHtml(true); errorCategorisationHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You are creating an error categorisation for flow wide errors. This categorisation will be applied" + " against errors that occur within this flow, that do not have a more focused error categorisation."); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_LIGHT); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(errorCategorisationHintLabel, 0, 1, 1, 1); } else { Label errorCategorisationHintLabel = new Label(); errorCategorisationHintLabel.setCaptionAsHtml(true); errorCategorisationHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You are creating an error categorisation against a component. This is the most focused error categorisation" + " that can be applied. This categorisation will be applied against errors that occur on this component."); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_LIGHT); errorCategorisationHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(errorCategorisationHintLabel, 0, 1, 1, 1); } if (this.module != null) { Label moduleNameLabel = new Label(); moduleNameLabel.setContentMode(ContentMode.HTML); moduleNameLabel.setValue(VaadinIcons.ARCHIVE.getHtml() + " Module Name:"); moduleNameLabel.setSizeUndefined(); layout.addComponent(moduleNameLabel, 0, 2); layout.setComponentAlignment(moduleNameLabel, Alignment.MIDDLE_RIGHT); moduleNameTextField.setRequired(true); moduleNameTextField.setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("moduleName")); moduleNameTextField.setReadOnly(true); moduleNameTextField.setWidth("80%"); layout.addComponent(moduleNameTextField, 1, 2); } if (this.flow != null) { Label flowNameLabel = new Label(); flowNameLabel.setContentMode(ContentMode.HTML); flowNameLabel.setValue(VaadinIcons.AUTOMATION.getHtml() + " Flow Name:"); flowNameLabel.setSizeUndefined(); layout.addComponent(flowNameLabel, 0, 3); layout.setComponentAlignment(flowNameLabel, Alignment.MIDDLE_RIGHT); flowNameTextField.setRequired(true); flowNameTextField.setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("flowName")); flowNameTextField.setReadOnly(true); flowNameTextField.setWidth("80%"); layout.addComponent(flowNameTextField, 1, 3); } if (this.component != null) { Label componentNameLabel = new Label(); componentNameLabel.setContentMode(ContentMode.HTML); componentNameLabel.setValue(VaadinIcons.COG.getHtml() + " Component Name:"); componentNameLabel.setSizeUndefined(); layout.addComponent(componentNameLabel, 0, 4); layout.setComponentAlignment(componentNameLabel, Alignment.MIDDLE_RIGHT); componentNameTextField.setRequired(true); componentNameTextField .setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("flowElementName")); componentNameTextField.setReadOnly(true); componentNameTextField.setWidth("80%"); layout.addComponent(componentNameTextField, 1, 4); } Label exceptionClassLabel = new Label(); exceptionClassLabel.setContentMode(ContentMode.HTML); exceptionClassLabel.setValue("Exception Class:"); exceptionClassLabel.setSizeUndefined(); layout.addComponent(exceptionClassLabel, 0, 5); layout.setComponentAlignment(exceptionClassLabel, Alignment.MIDDLE_RIGHT); this.exceptionClassTextField.setWidth("80%"); exceptionClassTextField .setPropertyDataSource(errorCategorisationLinkItem.getItemProperty("exceptionClass")); layout.addComponent(exceptionClassTextField, 1, 5); Label actionLabel = new Label(); actionLabel.setContentMode(ContentMode.HTML); actionLabel.setValue("Action:"); actionLabel.setSizeUndefined(); layout.addComponent(actionLabel, 0, 6); layout.setComponentAlignment(actionLabel, Alignment.MIDDLE_RIGHT); Label errorCategoryLabel = new Label("Error Category:"); errorCategoryLabel.setSizeUndefined(); layout.addComponent(errorCategoryLabel, 0, 7); layout.setComponentAlignment(errorCategoryLabel, Alignment.MIDDLE_RIGHT); this.setupComboBoxesAndItems(); Label errorMessageLabel = new Label("Error Message:"); errorMessageLabel.setSizeUndefined(); layout.addComponent(errorMessageLabel, 0, 8); layout.setComponentAlignment(errorMessageLabel, Alignment.TOP_RIGHT); errorMessageTextArea.addValidator(new StringLengthValidator( "You must define an error message between 1 and 2048 characters in length!", 1, 2048, false)); errorMessageTextArea.setValidationVisible(false); errorMessageTextArea.setPropertyDataSource(errorCategorisationItem.getItemProperty("errorDescription")); errorMessageTextArea.setRequired(true); errorMessageTextArea.setWidth("650px"); errorMessageTextArea.setRows(8); errorMessageTextArea.setRequiredError("An error message is required!"); layout.addComponent(errorMessageTextArea, 1, 8); GridLayout buttonLayouts = new GridLayout(4, 1); buttonLayouts.setSpacing(true); Button saveButton = new Button("Save"); saveButton.setStyleName(ValoTheme.BUTTON_SMALL); saveButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { try { errorCategoryCombo.validate(); errorMessageTextArea.validate(); actionCombo.validate(); } catch (InvalidValueException e) { errorCategoryCombo.setValidationVisible(true); errorMessageTextArea.setValidationVisible(true); actionCombo.setValidationVisible(true); errorCategoryCombo.markAsDirty(); errorMessageTextArea.markAsDirty(); actionCombo.markAsDirty(); return; } try { errorCategorisationService.save(errorCategorisationItem.getBean()); errorCategorisationLink.setErrorCategorisation(errorCategorisationItem.getBean()); errorCategorisationService.save(errorCategorisationLink); } catch (Exception e) { if (e.getCause() instanceof ConstraintViolationException) { Notification.show( "An error occurred trying to save an error categorisation: Action type must be unique for a given node!", Type.ERROR_MESSAGE); } else { Notification.show( "An error occurred trying to save an error categorisation: " + e.getMessage(), Type.ERROR_MESSAGE); } } refreshExistingCategorisedErrorsTable(); Notification.show("Saved!"); } }); Button clearButton = new Button("Clear"); clearButton.setStyleName(ValoTheme.BUTTON_SMALL); clearButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { clear(); } }); Button deleteButton = new Button("Delete"); deleteButton.setStyleName(ValoTheme.BUTTON_SMALL); deleteButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { ErrorCategorisation ec = errorCategorisationLink.getErrorCategorisation(); errorCategorisationService.delete(errorCategorisationLink); errorCategorisationService.delete(ec); existingCategorisedErrorsTable.removeItem(errorCategorisationLink); clear(); } }); Button cancelButton = new Button("Cancel"); cancelButton.setStyleName(ValoTheme.BUTTON_SMALL); cancelButton.addClickListener(new Button.ClickListener() { public void buttonClick(ClickEvent event) { close(); } }); buttonLayouts.addComponent(saveButton); buttonLayouts.addComponent(clearButton); buttonLayouts.addComponent(deleteButton); buttonLayouts.addComponent(cancelButton); layout.addComponent(buttonLayouts, 0, 9, 1, 9); layout.setComponentAlignment(buttonLayouts, Alignment.MIDDLE_CENTER); Label existingCategorisationLabel = new Label("Existing Error Categorisations"); existingCategorisationLabel.setStyleName(ValoTheme.LABEL_HUGE); layout.addComponent(existingCategorisationLabel, 0, 10, 1, 10); Label uniquenessHintLabel = new Label(); uniquenessHintLabel.setCaptionAsHtml(true); uniquenessHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You can only create one error categorisation per Action type for a give node. If you attempt to create more you will receive an error when" + " trying to save."); uniquenessHintLabel.addStyleName(ValoTheme.LABEL_LIGHT); uniquenessHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(uniquenessHintLabel, 0, 11, 1, 11); Label editHintLabel = new Label(); editHintLabel.setCaptionAsHtml(true); editHintLabel.setCaption(VaadinIcons.QUESTION_CIRCLE_O.getHtml() + " You can can click on a row in the table below to edit an error categorisation."); editHintLabel.addStyleName(ValoTheme.LABEL_BOLD); editHintLabel.addStyleName(ValoTheme.LABEL_SMALL); layout.addComponent(editHintLabel, 0, 12, 1, 12); layout.addComponent(this.existingCategorisedErrorsTable, 0, 13, 1, 13); layout.setComponentAlignment(this.existingCategorisedErrorsTable, Alignment.MIDDLE_CENTER); Panel paramPanel = new Panel(); paramPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); paramPanel.setWidth("100%"); paramPanel.setContent(layout); GridLayout wrapper = new GridLayout(); // wrapper.setMargin(true); wrapper.setSizeFull(); wrapper.addComponent(paramPanel); this.setContent(wrapper); }
From source file:org.jpos.qi.minigl.AccountsView.java
License:Open Source License
@Override protected HorizontalLayout createHeader(String title) { HorizontalLayout header = super.createHeader(title); if (isGeneralView()) { Label refDebit = new Label(FontAwesome.SQUARE.getHtml() + " DEBIT accounts"); Label refCredit = new Label(FontAwesome.SQUARE.getHtml() + " CREDIT accounts"); refDebit.setContentMode(ContentMode.HTML); refCredit.setContentMode(ContentMode.HTML); refDebit.setStyleName("debit-color"); refCredit.setStyleName("credit-color"); refDebit.addStyleName(ValoTheme.LABEL_SMALL); refCredit.addStyleName(ValoTheme.LABEL_SMALL); Button collapse = new Button(getApp().getMessage("collapseAll"), event -> { ((TreeGrid) getGrid()).collapse(expandedItems.toArray()); });/*from w ww . j a v a2s . co m*/ collapse.setStyleName(ValoTheme.BUTTON_LINK); collapse.addStyleName(ValoTheme.BUTTON_SMALL); HorizontalLayout l = new HorizontalLayout(refDebit, refCredit, collapse); l.setSpacing(true); l.setComponentAlignment(refDebit, Alignment.BOTTOM_CENTER); l.setComponentAlignment(refCredit, Alignment.BOTTOM_CENTER); l.setComponentAlignment(collapse, Alignment.BOTTOM_CENTER); header.addComponent(l); header.setComponentAlignment(l, Alignment.MIDDLE_RIGHT); } return header; }
From source file:uk.co.intec.keyDatesApp.pages.MainView.java
License:Apache License
/** * Removes any existing row data loaded to the page and loads * ViewEntryWrappers passed to this method. If no entries were passed to the * method, the message "No entries found matching criteria" is displayed. * Otherwise writes the entries to the page, grouped under the date each Key * Date is for./*w w w . ja v a2 s .c o m*/ * * @param data * Map of data where key is a java.sql.Date (so does not include * a time element) and value is the wrapped ViewEntries for that * date. */ public void loadRowData(final Map<Object, List<ViewEntryWrapper>> data) { body.removeAllComponents(); if (null == data || data.isEmpty()) { final Label msg = new Label("No entries found matching criteria"); msg.setStyleName(ValoTheme.LABEL_FAILURE); body.addComponent(msg); } else { for (final Object key : data.keySet()) { if (key instanceof java.sql.Date) { // It will be! // Add the header final VerticalLayout catContainer = new VerticalLayout(); catContainer.addStyleName(ValoTheme.MENU_TITLE); catContainer.addStyleName("category-header"); final Label category = new Label(); final java.sql.Date sqlDate = (java.sql.Date) key; category.setValue(DATE_ONLY.format(sqlDate)); catContainer.addComponent(category); body.addComponent(catContainer); // Load the entries for (final ViewEntryWrapper veWrapped : data.get(key)) { final VerticalLayout entryRow = new VerticalLayout(); final KeyDateEntryWrapper entry = (KeyDateEntryWrapper) veWrapped; final StringBuilder suffixTitle = new StringBuilder(""); if (getViewWrapper().getViewName().equals(KeyDateViewWrapper.ViewType.BY_DATE)) { if (StringUtils.isNotEmpty(entry.getCustomer())) { suffixTitle.append(" (" + entry.getCustomer()); if (StringUtils.isNotEmpty(entry.getContact())) { suffixTitle.append(" - " + entry.getContact()); } suffixTitle.append(")"); } } else { if (StringUtils.isNotEmpty(entry.getContact())) { suffixTitle.append(" - " + entry.getContact()); } } final Button title = new Button(entry.getTitle() + suffixTitle.toString()); title.addStyleName(ValoTheme.BUTTON_LINK); // Add click event title.addClickListener(new DocLinkListener(KeyDateView.VIEW_NAME, entry.getNoteId())); entryRow.addComponent(title); // Add summary, if appropriate if (StringUtils.isNotEmpty(entry.getDescription())) { final Label summary = new Label(entry.getDescription()); summary.setContentMode(ContentMode.HTML); summary.addStyleName(ValoTheme.LABEL_SMALL); summary.addStyleName("view-desc"); entryRow.addComponent(summary); } body.addComponent(entryRow); } } } } }