List of usage examples for com.vaadin.ui Label setDescription
public void setDescription(String description)
From source file:org.eclipse.hawkbit.ui.management.targettable.TargetDetails.java
License:Open Source License
private void updateAttributesLabelsList(final VerticalLayout attributesLayout, final Map<String, String> attributes) { for (final Map.Entry<String, String> entry : attributes.entrySet()) { final Label conAttributeLabel = SPUIComponentProvider.createNameValueLabel( entry.getKey().concat(" : "), entry.getValue() == null ? "" : entry.getValue()); conAttributeLabel.setDescription(entry.getKey().concat(" : ") + entry.getValue()); conAttributeLabel.addStyleName("label-style"); attributesLayout.addComponent(conAttributeLabel); }/*w w w . ja va2 s . c om*/ }
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();/*www . ja va2 s .co m*/ 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.rollout.rollout.AutoStartOptionGroupLayout.java
License:Open Source License
private void createOptionGroup() { autoStartOptionGroup = new FlexibleOptionGroup(); autoStartOptionGroup.addItem(AutoStartOption.MANUAL); autoStartOptionGroup.addItem(AutoStartOption.AUTO_START); autoStartOptionGroup.addItem(AutoStartOption.SCHEDULED); selectDefaultOption();//from ww w.ja v a 2 s .c o m final FlexibleOptionGroupItemComponent manualItem = autoStartOptionGroup .getItemComponent(AutoStartOption.MANUAL); manualItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START); // set Id for Forced radio button. manualItem.setId(UIComponentIdProvider.ROLLOUT_START_MANUAL_ID); addComponent(manualItem); final Label manualLabel = new Label(); manualLabel.setStyleName("statusIconPending"); manualLabel.setIcon(FontAwesome.HAND_PAPER_O); manualLabel.setCaption(i18n.getMessage("caption.rollout.start.manual")); manualLabel.setDescription(i18n.getMessage("caption.rollout.start.manual.desc")); manualLabel.setStyleName("padding-right-style"); addComponent(manualLabel); final FlexibleOptionGroupItemComponent autoStartItem = autoStartOptionGroup .getItemComponent(AutoStartOption.AUTO_START); autoStartItem.setId(UIComponentIdProvider.ROLLOUT_START_AUTO_ID); autoStartItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START); addComponent(autoStartItem); final Label autoStartLabel = new Label(); autoStartLabel.setSizeFull(); autoStartLabel.setIcon(FontAwesome.PLAY); autoStartLabel.setCaption(i18n.getMessage("caption.rollout.start.auto")); autoStartLabel.setDescription(i18n.getMessage("caption.rollout.start.auto.desc")); autoStartLabel.setStyleName("padding-right-style"); addComponent(autoStartLabel); final FlexibleOptionGroupItemComponent scheduledItem = autoStartOptionGroup .getItemComponent(AutoStartOption.SCHEDULED); scheduledItem.setStyleName(STYLE_DIST_WINDOW_AUTO_START); // setted Id for Time Forced radio button. scheduledItem.setId(UIComponentIdProvider.ROLLOUT_START_SCHEDULED_ID); addComponent(scheduledItem); final Label scheduledLabel = new Label(); scheduledLabel.setStyleName("statusIconPending"); scheduledLabel.setIcon(FontAwesome.CLOCK_O); scheduledLabel.setCaption(i18n.getMessage("caption.rollout.start.scheduled")); scheduledLabel.setDescription(i18n.getMessage("caption.rollout.start.scheduled.desc")); scheduledLabel.setStyleName(STYLE_DIST_WINDOW_AUTO_START); addComponent(scheduledLabel); startAtDateField = new DateField(); startAtDateField.setInvalidAllowed(false); startAtDateField.setInvalidCommitted(false); startAtDateField.setEnabled(false); startAtDateField.setStyleName("dist-window-forcedtime"); final TimeZone tz = SPDateTimeUtil.getBrowserTimeZone(); startAtDateField.setValue(Date .from(LocalDateTime.now().plusMinutes(30).atZone(SPDateTimeUtil.getTimeZoneId(tz)).toInstant())); startAtDateField.setImmediate(true); startAtDateField.setTimeZone(tz); startAtDateField.setLocale(HawkbitCommonUtil.getCurrentLocale()); startAtDateField.setResolution(Resolution.MINUTE); startAtDateField.addStyleName(ValoTheme.DATEFIELD_SMALL); addComponent(startAtDateField); }
From source file:org.eclipse.hawkbit.ui.tenantconfiguration.authentication.CertificateAuthenticationConfigurationItem.java
License:Open Source License
public CertificateAuthenticationConfigurationItem( final TenantConfigurationManagement tenantConfigurationManagement, final VaadinMessageSource i18n) { super(TenantConfigurationKey.AUTHENTICATION_MODE_HEADER_ENABLED, tenantConfigurationManagement, i18n); super.init("label.configuration.auth.header"); configurationEnabled = isConfigEnabled(); detailLayout = new VerticalLayout(); detailLayout.setImmediate(true);//from w w w .ja v a2 s. co m final HorizontalLayout caRootAuthorityLayout = new HorizontalLayout(); caRootAuthorityLayout.setSpacing(true); final Label caRootAuthorityLabel = new LabelBuilder().name("SSL Issuer Hash:").buildLabel(); caRootAuthorityLabel.setDescription( "The SSL Issuer iRules.X509 hash, to validate against the controller request certifcate."); caRootAuthorityLabel.setWidthUndefined(); caRootAuthorityTextField = new TextFieldBuilder(TenantConfiguration.VALUE_MAX_SIZE).buildTextComponent(); caRootAuthorityTextField.setWidth("100%"); caRootAuthorityTextField.addTextChangeListener(event -> caRootAuthorityChanged()); caRootAuthorityLayout.addComponent(caRootAuthorityLabel); caRootAuthorityLayout.setExpandRatio(caRootAuthorityLabel, 0); caRootAuthorityLayout.addComponent(caRootAuthorityTextField); caRootAuthorityLayout.setExpandRatio(caRootAuthorityTextField, 1); caRootAuthorityLayout.setWidth("100%"); detailLayout.addComponent(caRootAuthorityLayout); if (isConfigEnabled()) { caRootAuthorityTextField.setValue(getCaRootAuthorityValue()); setDetailVisible(true); } }
From source file:org.eclipse.skalli.view.component.MultiLinkField.java
License:Open Source License
@SuppressWarnings({ "serial", "deprecation" }) private void render() { layout.removeAllComponents();//from ww w . jav a 2s .c om if (!readOnly) { layout.setColumns(2); } int groupsIdx = 0; int groupsSize = linkGroups.getItems().size(); for (final LinkGroup linkGroup : linkGroups.getItems()) { Label linkGroupLabel = new Label(linkGroup.getCaption()); linkGroupLabel.addStyleName(STYLE_LABEL_GROUP); layout.addComponent(linkGroupLabel); layout.setComponentAlignment(linkGroupLabel, Alignment.TOP_RIGHT); if (!readOnly) { Button btnUpGroup = null; Button btnDownGroup = null; Button btnRemoveGroup = null; // up if (groupsIdx > 0) { btnUpGroup = new Button("up"); btnUpGroup.setStyleName(Button.STYLE_LINK); btnUpGroup.addStyleName(STYLE_BUTTON_GROUPACTION); btnUpGroup.setDescription(String.format("Move up group '%s'", linkGroup.getCaption())); btnUpGroup.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroups.moveUp(linkGroup); renderIfModified(); } }); } // down if (groupsIdx < groupsSize - 1) { btnDownGroup = new Button("down"); btnDownGroup.setStyleName(Button.STYLE_LINK); btnDownGroup.addStyleName(STYLE_BUTTON_GROUPACTION); btnDownGroup.setDescription(String.format("Move down group '%s'", linkGroup.getCaption())); btnDownGroup.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroups.moveDown(linkGroup); renderIfModified(); } }); } // remove btnRemoveGroup = new Button("remove"); btnRemoveGroup.setStyleName(Button.STYLE_LINK); btnRemoveGroup.addStyleName(STYLE_BUTTON_GROUPACTION); btnRemoveGroup.setDescription(String.format("Remove group '%s'", linkGroup.getCaption())); btnRemoveGroup.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroups.remove(linkGroup); renderIfModified(); } }); HorizontalLayout toolbar = getToolbar(btnUpGroup, btnDownGroup, btnRemoveGroup); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.TOP_RIGHT); } layout.newLine(); Collection<Link> links = linkGroup.getItems(); int linksIdx = 0; int linksSize = links.size(); for (final Link link : links) { if (readOnly) { // view Label linkLabel = new Label(link.getLabel()); linkLabel.addStyleName(STYLE_LABEL_LINK); linkLabel.setDescription(StringUtils.abbreviate(link.getUrl(), 50)); layout.addComponent(linkLabel); layout.setComponentAlignment(linkLabel, Alignment.TOP_LEFT); } else { // edit Button btnEditLink = new Button(link.getLabel()); btnEditLink.setStyleName(Button.STYLE_LINK); btnEditLink.addStyleName(STYLE_LABEL_LINK); btnEditLink.setDescription(String.format("Edit link '%s' %s", link.getLabel(), StringUtils.isBlank(link.getUrl()) ? "" : "[" + link.getUrl() + "]")); btnEditLink.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { LinkWindow editLinkWindow = new LinkWindow(MultiLinkField.this, linkGroups.getItems(), linkGroup, link, MultiLinkField.this); editLinkWindow.show(); } }); layout.addComponent(btnEditLink); layout.setComponentAlignment(btnEditLink, Alignment.TOP_LEFT); } if (!readOnly) { Button btnUpLink = null; Button btnDownLink = null; Button btnRemoveLink = null; // up if (linksIdx > 0) { btnUpLink = new Button("up"); btnUpLink.setStyleName(Button.STYLE_LINK); btnUpLink.addStyleName(STYLE_BUTTON_LINKACTION); btnUpLink.setDescription(String.format("Move up link '%s'", link.getLabel())); btnUpLink.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroup.moveUp(link); renderIfModified(); } }); } // down if (linksIdx < linksSize - 1) { btnDownLink = new Button("down"); btnDownLink.setStyleName(Button.STYLE_LINK); btnDownLink.addStyleName(STYLE_BUTTON_LINKACTION); btnDownLink.setDescription(String.format("Move down link '%s'", link.getLabel())); btnDownLink.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroup.moveDown(link); renderIfModified(); } }); } // remove btnRemoveLink = new Button("remove"); btnRemoveLink.setStyleName(Button.STYLE_LINK); btnRemoveLink.addStyleName(STYLE_BUTTON_LINKACTION); btnRemoveLink.setDescription(String.format("Remove link '%s'", link.getLabel())); btnRemoveLink.addListener(new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { modified = linkGroup.remove(link); if (linkGroup.getItems().isEmpty()) { linkGroups.remove(linkGroup); } renderIfModified(); } }); HorizontalLayout toolbar = getToolbar(btnUpLink, btnDownLink, btnRemoveLink); layout.addComponent(toolbar); layout.setComponentAlignment(toolbar, Alignment.TOP_RIGHT); } layout.newLine(); linksIdx++; } groupsIdx++; } if (!readOnly) { Button btnAddLink = new Button(buttonCaption, new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { LinkWindow addLinkWindow = new LinkWindow(MultiLinkField.this, linkGroups.getItems(), MultiLinkField.this); addLinkWindow.show(); } }); btnAddLink.setStyleName(Button.STYLE_LINK); btnAddLink.addStyleName(STYLE_BUTTON_ADD); btnAddLink.setDescription("Add Link"); layout.addComponent(btnAddLink); } }
From source file:org.escidoc.browser.controller.ContentModelView.java
License:Open Source License
private VerticalLayout bindNameToHeader() { VerticalLayout headerLayout = new VerticalLayout(); headerLayout.setMargin(false);// w w w . j ava 2 s .c o m headerLayout.setWidth("100%"); final Label headerContext = new Label("Content Model: " + resourceProxy.getName()); headerContext.setStyleName("h1 fullwidth"); headerContext.setDescription("Content Model"); headerLayout.addComponent(headerContext); return headerLayout; }
From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java
License:Open Source License
public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndLabelData(final String labelTxt, Property dataProperty, boolean required) { Preconditions.checkNotNull(labelTxt, "Label is null"); Preconditions.checkNotNull(dataProperty, "DataSource is null"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeUndefined(); horizontalLayout.setDescription(USER_DESCR_ON_HOR_LAYOUT_TO_EDIT); horizontalLayout.setEnabled(true);//from w ww . j ava 2s.c o m horizontalLayout.setSpacing(true); horizontalLayout.setHeight(HOR_PANEL_HEIGHT); Label label = new Label(); label.setWidth(LABEL_WIDTH); label.setValue(DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END); label.setContentMode(Label.CONTENT_XHTML); label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); Label textLabel = new Label(dataProperty); textLabel.setWidth(TEXT_WIDTH); textLabel.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); textLabel.setStyleName(STYLE_ELABS_TEXT_AS_LABEL); horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL); horizontalLayout.addComponent(label, 0); horizontalLayout.addComponent(textLabel, 1); horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); horizontalLayout.setComponentAlignment(textLabel, Alignment.MIDDLE_RIGHT); return horizontalLayout; }
From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java
License:Open Source License
public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndStaticComboData(final String labelTxt, String value, boolean required) { Preconditions.checkNotNull(labelTxt, "Label is null"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeUndefined(); horizontalLayout.setDescription(USER_DESCR_ON_HOR_LAYOUT_TO_EDIT); horizontalLayout.setEnabled(true);/*from w w w .j a v a 2 s.co m*/ horizontalLayout.setSpacing(true); horizontalLayout.setHeight(HOR_PANEL_HEIGHT); Label label = new Label(); label.setWidth(LABEL_WIDTH); label.setValue(DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END); label.setContentMode(Label.CONTENT_XHTML); label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); Label textLabel = new Label(value); textLabel.setWidth(TEXT_WIDTH); textLabel.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); textLabel.setStyleName(STYLE_ELABS_TEXT_AS_LABEL); horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL); horizontalLayout.addComponent(label, 0); horizontalLayout.addComponent(textLabel, 1); horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); horizontalLayout.setComponentAlignment(textLabel, Alignment.MIDDLE_RIGHT); return horizontalLayout; }
From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java
License:Open Source License
public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndLabelComplexData(final String labelTxt, String dataTxt, boolean required) { Preconditions.checkNotNull(labelTxt, "Label is null"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeUndefined(); horizontalLayout.setDescription(USER_DESCR_ON_HOR_LAYOUT_TO_EDIT); horizontalLayout.setEnabled(true);//from w w w . ja v a 2 s .c o m horizontalLayout.setSpacing(true); horizontalLayout.setHeight(HOR_PANEL_HEIGHT); Label label = new Label(); label.setWidth(LABEL_WIDTH); label.setValue(DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END); label.setContentMode(Label.CONTENT_XHTML); label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); Label textLabel = new Label(dataTxt); textLabel.setWidth(TEXT_WIDTH); textLabel.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); textLabel.setStyleName(STYLE_ELABS_TEXT_AS_LABEL); horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL); horizontalLayout.addComponent(label, 0); horizontalLayout.addComponent(textLabel, 1); horizontalLayout.setComponentAlignment(label, Alignment.MIDDLE_LEFT); horizontalLayout.setComponentAlignment(textLabel, Alignment.MIDDLE_RIGHT); return horizontalLayout; }
From source file:org.escidoc.browser.elabsmodul.views.helpers.LabsLayoutHelper.java
License:Open Source License
public static HorizontalLayout createHorizontalLayoutWithELabsLabelAndRelatedDataForRig(final String labelTxt, Property dataProperty, RigBean rigBean, final IRigAction controller, LabsRigTableHelper helper, boolean required) { synchronized (LOCK_1) { Preconditions.checkNotNull(labelTxt, "Label is null"); Preconditions.checkNotNull(dataProperty, "DataSource is null"); Preconditions.checkNotNull(rigBean, "RigBean is null"); Preconditions.checkNotNull(helper, "Helper is null"); Preconditions.checkNotNull(controller, "Controller is null"); HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeUndefined(); horizontalLayout.setEnabled(true); horizontalLayout.setSpacing(true); horizontalLayout.setStyleName(STYLE_ELABS_HOR_PANEL_FOR_TABLE); Label label = new Label(); label.setWidth(LABEL_WIDTH);/*from w ww.j a v a2 s .c o m*/ label.setValue( DIV_ALIGN_RIGHT + (required ? ELabsViewContants.REQUIRED_SIGN : "") + labelTxt + DIV_END); label.setContentMode(Label.CONTENT_XHTML); label.setDescription(USER_DESCR_ON_LABEL_TO_EDIT); label.setStyleName(STYLE_ELABS_HOR_PANEL); horizontalLayout.addComponent(label, 0); horizontalLayout.addComponent(helper.createTableLayoutForRig(rigBean, controller), 1); horizontalLayout.setComponentAlignment(label, Alignment.TOP_LEFT); return horizontalLayout; } }