List of usage examples for com.vaadin.ui Label setDescription
public void setDescription(String description)
From source file:org.eclipse.hawkbit.ui.distributions.dstable.DistributionSetDetails.java
License:Open Source License
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) { final VerticalLayout verticalLayout = new VerticalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull();/*from w ww .j a va 2 s . c o m*/ final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(""); softwareModule.setValue(softwareModuleName); softwareModule.setDescription(softwareModuleName); softwareModule.setId(softwareModuleName + "-label"); horizontalLayout.addComponent(softwareModule); horizontalLayout.setExpandRatio(softwareModule, 1F); verticalLayout.addComponent(horizontalLayout); return verticalLayout; }
From source file:org.eclipse.hawkbit.ui.filtermanagement.CreateOrUpdateFilterTable.java
License:Open Source License
private Component getStatusIcon(final Object itemId) { final Item row1 = getItem(itemId); final TargetUpdateStatus targetStatus = (TargetUpdateStatus) row1 .getItemProperty(SPUILabelDefinitions.VAR_TARGET_STATUS).getValue(); final Label label = new LabelBuilder().name("").buildLabel(); label.setContentMode(ContentMode.HTML); if (targetStatus == TargetUpdateStatus.PENDING) { label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_PENDING)); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_YELLOW); label.setValue(FontAwesome.ADJUST.getHtml()); } else if (targetStatus == TargetUpdateStatus.REGISTERED) { label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_REGISTERED)); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_LIGHT_BLUE); label.setValue(FontAwesome.DOT_CIRCLE_O.getHtml()); } else if (targetStatus == TargetUpdateStatus.ERROR) { label.setDescription(i18n.getMessage(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_ERROR))); label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_RED); label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); } else if (targetStatus == TargetUpdateStatus.IN_SYNC) { label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_GREEN); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_STATUS_INSYNC)); label.setValue(FontAwesome.CHECK_CIRCLE.getHtml()); } else if (targetStatus == TargetUpdateStatus.UNKNOWN) { label.setStyleName(SPUIStyleDefinitions.STATUS_ICON_BLUE); label.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TARGET_STATUS_UNKNOWN)); label.setValue(FontAwesome.QUESTION_CIRCLE.getHtml()); }/* w w w . j a v a 2 s . c o m*/ return label; }
From source file:org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryTable.java
License:Open Source License
/** * Get status icon.// w w w . ja va 2 s.c om * * @param status * as Status * @return Label as UI */ private Label getStatusIcon(final Action.Status status) { final Label label = new LabelBuilder().name("").buildLabel(); final String statusIconPending = "statusIconPending"; label.setContentMode(ContentMode.HTML); if (Action.Status.FINISHED == status) { label.setDescription(i18n.get("label.finished")); label.setStyleName(STATUS_ICON_GREEN); label.setValue(FontAwesome.CHECK_CIRCLE.getHtml()); } else if (Action.Status.ERROR == status) { label.setDescription(i18n.get("label.error")); label.setStyleName("statusIconRed"); label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); } else if (Action.Status.WARNING == status) { label.setStyleName("statusIconOrange"); label.setDescription(i18n.get("label.warning")); label.setValue(FontAwesome.EXCLAMATION_CIRCLE.getHtml()); } else if (Action.Status.RUNNING == status) { // dynamic spinner label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.running")); label.setValue(FontAwesome.ADJUST.getHtml()); } else if (Action.Status.CANCELING == status) { label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.cancelling")); label.setValue(FontAwesome.TIMES_CIRCLE.getHtml()); } else if (Action.Status.CANCELED == status) { label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.cancelled")); label.setStyleName(STATUS_ICON_GREEN); label.setValue(FontAwesome.TIMES_CIRCLE.getHtml()); } else if (Action.Status.RETRIEVED == status) { label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.retrieved")); label.setValue(FontAwesome.CIRCLE_O.getHtml()); } else if (Action.Status.DOWNLOAD == status) { label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.download")); label.setValue(FontAwesome.CLOUD_DOWNLOAD.getHtml()); } else if (Action.Status.SCHEDULED == status) { label.setStyleName(statusIconPending); label.setDescription(i18n.get("label.scheduled")); label.setValue(FontAwesome.HOURGLASS_1.getHtml()); } else { label.setDescription(""); label.setValue(""); } return label; }
From source file:org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryTable.java
License:Open Source License
private Component actionLabelWithTimeForceIcon(final Action actionWithActiveStatus, final Label actionLabel) { final long currentTimeMillis = System.currentTimeMillis(); final HorizontalLayout hLayout = new HorizontalLayout(); final Label autoForceLabel = new LabelBuilder().name("").id("action.history.table.timedforceId") .buildLabel();// w w w . j av a 2 s . co m actionLabel.setValue(FontAwesome.BOLT.getHtml()); autoForceLabel.setContentMode(ContentMode.HTML); autoForceLabel.setValue(FontAwesome.HISTORY.getHtml()); hLayout.addComponent(actionLabel); hLayout.addComponent(autoForceLabel); if (actionWithActiveStatus.isHitAutoForceTime(currentTimeMillis)) { autoForceLabel.setDescription("autoforced"); autoForceLabel.setStyleName(STATUS_ICON_GREEN); autoForceLabel.setDescription("auto forced since " + SPDateTimeUtil .getDurationFormattedString(actionWithActiveStatus.getForcedTime(), currentTimeMillis, i18n)); } else { autoForceLabel.setDescription("auto forcing in " + SPDateTimeUtil .getDurationFormattedString(currentTimeMillis, actionWithActiveStatus.getForcedTime(), i18n)); autoForceLabel.setStyleName("statusIconPending"); autoForceLabel.setValue(FontAwesome.HISTORY.getHtml()); } return hLayout; }
From source file:org.eclipse.hawkbit.ui.management.actionhistory.ActionHistoryTable.java
License:Open Source License
/** * Create Status Label./* w ww. ja va 2 s. c o m*/ * * @param activeValue * as String * @return Labeal as UI */ private static Label createActiveStatusLabel(final String activeValue, final boolean endedWithError) { final Label label = new LabelBuilder().name("").buildLabel(); label.setContentMode(ContentMode.HTML); if (SPUIDefinitions.SCHEDULED.equals(activeValue)) { label.setDescription("Scheduled"); label.setValue(FontAwesome.HOURGLASS_1.getHtml()); } else if (SPUIDefinitions.ACTIVE.equals(activeValue)) { label.setDescription("Active"); label.setStyleName("statusIconActive"); } else if (SPUIDefinitions.IN_ACTIVE.equals(activeValue)) { if (endedWithError) { label.setStyleName("statusIconRed"); } else { label.setStyleName("statusIconNeutral"); } label.setDescription("In-active"); label.setValue(FontAwesome.CHECK_CIRCLE.getHtml()); } else { label.setValue(""); } return label; }
From source file:org.eclipse.hawkbit.ui.management.footer.ActionTypeOptionGroupLayout.java
License:Open Source License
private void createOptionGroup() { actionTypeOptionGroup = new FlexibleOptionGroup(); actionTypeOptionGroup.addItem(ActionTypeOption.SOFT); actionTypeOptionGroup.addItem(ActionTypeOption.FORCED); actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED); selectDefaultOption();//from ww w . jav a 2 s .c o m final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.FORCED); forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); // set Id for Forced radio button. forceItem.setId("save.action.radio.forced"); addComponent(forceItem); final Label forceLabel = new Label(); forceLabel.setStyleName("statusIconPending"); forceLabel.setIcon(FontAwesome.BOLT); forceLabel.setCaption("Forced"); forceLabel.setDescription(i18n.getMessage("tooltip.forced.item")); forceLabel.setStyleName("padding-right-style"); addComponent(forceLabel); final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.SOFT); softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID); softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(softItem); final Label softLabel = new Label(); softLabel.setSizeFull(); softLabel.setCaption("Soft"); softLabel.setDescription(i18n.getMessage("tooltip.soft.item")); softLabel.setStyleName("padding-right-style"); addComponent(softLabel); final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.AUTO_FORCED); autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); // setted Id for Time Forced radio button. autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED); addComponent(autoForceItem); final Label autoForceLabel = new Label(); autoForceLabel.setStyleName("statusIconPending"); autoForceLabel.setIcon(FontAwesome.HISTORY); autoForceLabel.setCaption("Time Forced"); autoForceLabel.setDescription(i18n.getMessage("tooltip.timeforced.item")); autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(autoForceLabel); forcedTimeDateField = new DateField(); forcedTimeDateField.setInvalidAllowed(false); forcedTimeDateField.setInvalidCommitted(false); forcedTimeDateField.setEnabled(false); forcedTimeDateField.setStyleName("dist-window-forcedtime"); final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); forcedTimeDateField.setValue( Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant())); forcedTimeDateField.setImmediate(true); forcedTimeDateField.setTimeZone(tz); forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale()); forcedTimeDateField.setResolution(Resolution.MINUTE); forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL); addComponent(forcedTimeDateField); }
From source file:org.eclipse.hawkbit.ui.management.miscs.AbstractActionTypeOptionGroupLayout.java
License:Open Source License
protected void addForcedItemWithLabel() { final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.FORCED); forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); forceItem.setId(UIComponentIdProvider.SAVE_ACTION_RADIO_FORCED); addComponent(forceItem);/*from w ww.ja v a2 s . c om*/ final Label forceLabel = new Label(); forceLabel.setStyleName("statusIconPending"); forceLabel.setIcon(FontAwesome.BOLT); forceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED)); forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM)); forceLabel.setStyleName("padding-right-style"); addComponent(forceLabel); }
From source file:org.eclipse.hawkbit.ui.management.miscs.AbstractActionTypeOptionGroupLayout.java
License:Open Source License
protected void addSoftItemWithLabel() { final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.SOFT); softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID); softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(softItem);//from w w w.j a v a 2 s . c o m final Label softLabel = new Label(); softLabel.setSizeFull(); softLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT)); softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM)); softLabel.setStyleName("padding-right-style"); addComponent(softLabel); }
From source file:org.eclipse.hawkbit.ui.management.miscs.ActionTypeOptionGroupAssignmentLayout.java
License:Open Source License
private void addAutoForceItemWithLabelAndDateField() { final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.AUTO_FORCED); autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED); addComponent(autoForceItem);/* w ww . ja va2 s. co m*/ final Label autoForceLabel = new Label(); autoForceLabel.setStyleName("statusIconPending"); autoForceLabel.setIcon(FontAwesome.HISTORY); autoForceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_TIME_FORCED)); autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM)); autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(autoForceLabel); forcedTimeDateField = new DateField(); forcedTimeDateField.setInvalidAllowed(false); forcedTimeDateField.setInvalidCommitted(false); forcedTimeDateField.setEnabled(false); forcedTimeDateField.setStyleName("dist-window-forcedtime"); final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); forcedTimeDateField.setValue( Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant())); forcedTimeDateField.setImmediate(true); forcedTimeDateField.setTimeZone(tz); forcedTimeDateField.setLocale(HawkbitCommonUtil.getCurrentLocale()); forcedTimeDateField.setResolution(Resolution.MINUTE); forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL); addComponent(forcedTimeDateField); }
From source file:org.eclipse.hawkbit.ui.management.miscs.ActionTypeOptionGroupLayout.java
License:Open Source License
private void createOptionGroup() { actionTypeOptionGroup = new FlexibleOptionGroup(); actionTypeOptionGroup.addItem(ActionTypeOption.SOFT); actionTypeOptionGroup.addItem(ActionTypeOption.FORCED); actionTypeOptionGroup.addItem(ActionTypeOption.AUTO_FORCED); selectDefaultOption();// w ww .ja va 2 s .c o m final FlexibleOptionGroupItemComponent forceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.FORCED); forceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); forceItem.setId(UIComponentIdProvider.SAVE_ACTION_RADIO_FORCED); addComponent(forceItem); final Label forceLabel = new Label(); forceLabel.setStyleName("statusIconPending"); forceLabel.setIcon(FontAwesome.BOLT); forceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_FORCED)); forceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_FORCED_ITEM)); forceLabel.setStyleName("padding-right-style"); addComponent(forceLabel); final FlexibleOptionGroupItemComponent softItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.SOFT); softItem.setId(UIComponentIdProvider.ACTION_DETAILS_SOFT_ID); softItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(softItem); final Label softLabel = new Label(); softLabel.setSizeFull(); softLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_SOFT)); softLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_SOFT_ITEM)); softLabel.setStyleName("padding-right-style"); addComponent(softLabel); final FlexibleOptionGroupItemComponent autoForceItem = actionTypeOptionGroup .getItemComponent(ActionTypeOption.AUTO_FORCED); autoForceItem.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); autoForceItem.setId(UIComponentIdProvider.ACTION_TYPE_OPTION_GROUP_SAVE_TIMEFORCED); addComponent(autoForceItem); final Label autoForceLabel = new Label(); autoForceLabel.setStyleName("statusIconPending"); autoForceLabel.setIcon(FontAwesome.HISTORY); autoForceLabel.setCaption(i18n.getMessage(UIMessageIdProvider.CAPTION_ACTION_TIME_FORCED)); autoForceLabel.setDescription(i18n.getMessage(UIMessageIdProvider.TOOLTIP_TIMEFORCED_ITEM)); autoForceLabel.setStyleName(STYLE_DIST_WINDOW_ACTIONTYPE); addComponent(autoForceLabel); forcedTimeDateField = new DateField(); forcedTimeDateField.setInvalidAllowed(false); forcedTimeDateField.setInvalidCommitted(false); forcedTimeDateField.setEnabled(false); forcedTimeDateField.setStyleName("dist-window-forcedtime"); final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); forcedTimeDateField.setValue( Date.from(LocalDateTime.now().plusWeeks(2).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant())); forcedTimeDateField.setImmediate(true); forcedTimeDateField.setTimeZone(tz); forcedTimeDateField.setLocale(HawkbitCommonUtil.getLocale()); forcedTimeDateField.setResolution(Resolution.MINUTE); forcedTimeDateField.addStyleName(ValoTheme.DATEFIELD_SMALL); addComponent(forcedTimeDateField); }