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); } }
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); } }
@Handler public final void headings(LocaleChangeBusMessage busMessage) { nameCaption.setValue(translate.from(LabelKey.Name)); nameLabel.setDescription(translate.from(DescriptionKey.Name_of_the_source)); descriptionCaption.setValue(translate.from(LabelKey.Description)); descriptionLabel.setDescription(translate.from(DescriptionKey.Description_of_the_source)); connectionUrlCaption.setValue(translate.from(LabelKey.Connection_URL)); connectionUrlLabel.setDescription(translate.from(DescriptionKey.The_connection_string_for_this_source)); volatileCaption.setValue(translate.from(LabelKey.Is_Volatile)); volatileLabel.setDescription(translate.from(DescriptionKey.Data_is_held_in_memory)); optionsButton.setCaption(translate.from(LabelKey.Options)); }
private static Label createUsernameLabel(final String label, final String username) { String loadAndFormatUsername = ""; if (!StringUtils.isEmpty(username)) { loadAndFormatUsername = UserDetailsFormatter.loadAndFormatUsername(username); } final Label nameValueLabel = new Label(getBoldHTMLText(label) + loadAndFormatUsername, ContentMode.HTML); nameValueLabel.setSizeFull(); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("label-style"); nameValueLabel.setDescription(loadAndFormatUsername); return nameValueLabel; }
private static Label createUsernameLabel(final String label, final String username) { String loadAndFormatUsername = ""; if (!StringUtils.isEmpty(username)) { loadAndFormatUsername = UserDetailsFormatter.loadAndFormatUsername(username); } final Label nameValueLabel = new Label(getBoldHTMLText(label) + loadAndFormatUsername, ContentMode.HTML); nameValueLabel.setSizeFull(); nameValueLabel.addStyleName(SPUIDefinitions.TEXT_STYLE); nameValueLabel.addStyleName("label-style"); nameValueLabel.setDescription(loadAndFormatUsername); return nameValueLabel; }
/** * Shows the validation error icon in the textfield * * @param validationMessage * the validation message which should be added to the error-icon * tooltip */ public void showValidationFailureIcon(final String validationMessage) { validationIcon.setValue(FontAwesome.TIMES_CIRCLE.getHtml()); validationIcon.setStyleName(SPUIStyleDefinitions.ERROR_ICON); validationIcon.setDescription(validationMessage); filterManagementUIState.setFilterQueryValue(null); filterManagementUIState.setIsFilterByInvalidFilterQuery(Boolean.TRUE); }
/** * Shows the validation error icon in the textfield * * @param validationMessage * the validation message which should be added to the error-icon * tooltip */ public void showValidationFailureIcon(final String validationMessage) { validationIcon.setValue(FontAwesome.TIMES_CIRCLE.getHtml()); validationIcon.setStyleName(SPUIStyleDefinitions.ERROR_ICON); validationIcon.setDescription(validationMessage); filterManagementUIState.setFilterQueryValue(null); filterManagementUIState.setIsFilterByInvalidFilterQuery(Boolean.TRUE); }
public static HorizontalLayout labelWithIcon(Resource image, String caption, String style, String description) { Embedded img = new Embedded(null, image); img.setDescription(description); Label label = new Label(caption, Label.CONTENT_XHTML); label.setDescription(description); if (style != null) { label.setStyleName(style); } HorizontalLayout hl = VaadinUtility.horizontalLayout(Alignment.MIDDLE_LEFT, img, label); hl.setWidth(-1, Sizeable.UNITS_PIXELS); return hl; }
private Label getTargetPollTime(final Object itemId) { final Label statusLabel = new Label(); statusLabel.addStyleName(ValoTheme.LABEL_SMALL); statusLabel.setHeightUndefined(); 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; }
private Label getTargetPollTime(final Object itemId) { final Label statusLabel = new Label(); statusLabel.addStyleName(ValoTheme.LABEL_SMALL); statusLabel.setHeightUndefined(); 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; }
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()); } return label; }
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()); } return label; }
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) { final VerticalLayout verticalLayout = new VerticalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); 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; }
private static VerticalLayout createSoftwareModuleLayout(final String softwareModuleName) { final VerticalLayout verticalLayout = new VerticalLayout(); final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); 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; }
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType, final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) { final VerticalLayout verticalLayout = new VerticalLayout(); for (final SoftwareModule sw : alreadyAssignedSwModules) { if (swModType.getKey().equals(sw.getType().getKey())) { final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(""); final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class); reassignSoftModule .addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules)); final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(), sw.getVersion()); softwareModule.setValue(softwareModNameVersion); softwareModule.setDescription(softwareModNameVersion); softwareModule.setId(sw.getName() + "-label"); horizontalLayout.addComponent(softwareModule); horizontalLayout.setExpandRatio(softwareModule, 1F); if (isUnassignSoftModAllowed && permissionChecker.hasUpdateRepositoryPermission() && !isTargetAssigned && (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) { horizontalLayout.addComponent(reassignSoftModule); } verticalLayout.addComponent(horizontalLayout); } } return verticalLayout; }
private VerticalLayout createSoftModuleLayout(final SoftwareModuleType swModType, final DistributionSet distributionSet, final Set<SoftwareModule> alreadyAssignedSwModules) { final VerticalLayout verticalLayout = new VerticalLayout(); for (final SoftwareModule sw : alreadyAssignedSwModules) { if (swModType.getKey().equals(sw.getType().getKey())) { final HorizontalLayout horizontalLayout = new HorizontalLayout(); horizontalLayout.setSizeFull(); final Label softwareModule = HawkbitCommonUtil.getFormatedLabel(""); final Button reassignSoftModule = SPUIComponentProvider.getButton(sw.getName(), "", "", "", true, FontAwesome.TIMES, SPUIButtonStyleNoBorder.class); reassignSoftModule .addClickListener(event -> unassignSW(event, distributionSet, alreadyAssignedSwModules)); final String softwareModNameVersion = HawkbitCommonUtil.getFormattedNameVersion(sw.getName(), sw.getVersion()); softwareModule.setValue(softwareModNameVersion); softwareModule.setDescription(softwareModNameVersion); softwareModule.setId(sw.getName() + "-label"); horizontalLayout.addComponent(softwareModule); horizontalLayout.setExpandRatio(softwareModule, 1F); if (isUnassignSoftModAllowed && permissionChecker.hasUpdateRepositoryPermission() && !isTargetAssigned && (isSoftModAvaiableForSoftType(alreadyAssignedSwModules, swModType))) { horizontalLayout.addComponent(reassignSoftModule); } verticalLayout.addComponent(horizontalLayout); } } return verticalLayout; }
@Override public Object generateCell(Table source, Object itemId, Object columnId) { final HorizontalLayout layout = new HorizontalLayout(); final BusinessServiceStateMachine stateMachine = businessServiceManager.getStateMachine(); final BusinessService businessService = getItem(itemId).getBean().getBusinessService(); final Status status = stateMachine.getOperationalStatus(businessService); if (status != null) { final String topologyLink = new TopologyLinkBuilder() .focus(businessService.getId().toString()) .szl(1) .layout(Layout.HIERARCHY) .provider(TopologyProvider.BUSINESS_SERVICE) .getLink(); // Generate the link final Link link = new Link("View in Topology UI", new ExternalResource(topologyLink)); link.setIcon(FontAwesome.EXTERNAL_LINK_SQUARE); // This app is typically access in an iframe, so we open the URL in a new window/tab link.setTargetName("_blank"); layout.addComponent(link); layout.setComponentAlignment(link, Alignment.MIDDLE_CENTER); } else { Label label = new Label("N/A"); label.setDescription("Try reloading the daemon and refreshing the table."); label.setWidth(null); layout.addComponent(label); } return layout; } });
public ConfirmationDialog(String caption, String description) { setCaption(caption); setModal(true); setResizable(false); setClosable(false); setWidth(400, Unit.PIXELS); setHeight(200, Unit.PIXELS); addCloseListener(this); okButton = UIHelper.createButton("ok", null, null, this); okButton.setId("confirmationDialog.button.ok"); cancelButton = UIHelper.createButton("cancel", "cancels the current action.", null, this); cancelButton.setId("confirmationDialog.button.cancel"); label.setDescription(description); final HorizontalLayout buttonLayout = new HorizontalLayout(okButton, cancelButton); buttonLayout.setSpacing(true); layout.setSpacing(true); layout.setMargin(true); layout.setSizeFull(); layout.addComponent(label); layout.addComponent(buttonLayout); layout.setComponentAlignment(buttonLayout, Alignment.BOTTOM_RIGHT); setContent(layout); center(); }
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); 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); } }
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); 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); } }