@Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); String content = getValue(); if (content != null) { switch (getContentMode()) { case TEXT: case PREFORMATTED: { // FIXME This attribute is not enough to be able to restore the // content mode in readDesign. The content mode should instead // be written directly in the attribute and restored in // readDesign. See ticket #19435 design.attr(DESIGN_ATTR_PLAIN_TEXT, true); String encodeForTextNode = DesignFormatter .encodeForTextNode(content); if (encodeForTextNode != null) { design.html(encodeForTextNode); } } break; case HTML: design.html(content); break; } } }
@Override public String getRawValue() { return component.getValue(); } }
public String getCaption() { return this.caption.getValue(); }
public String getLabel() { return label.getValue(); }
@Override public String getDescription() { return description.getValue(); }
@Override public String getStatusMessage() { return statusMsgLabel.getValue(); }
/** * Overridden to get the value using our lookup. */ @Override public String getValue() { String value = super.getValue(); String lookup = mLookup.get( value ); if ( lookup != null ) { return lookup; } return value; } }
private static void switchCaption(Label label, MessageSourceAccessor messageSourceAccessor) { String newCaption = getTranslatedCaption((String)label.getValue(),messageSourceAccessor); if (newCaption != null) { label.setValue(newCaption); } } public static String getTranslatedCaption(String caption, MessageSourceAccessor messageSourceAccessor)
private Label getMandatoryLabel(final String key) { final Label mandatoryLabel = getLabel(i18n.getMessage(key)); mandatoryLabel.setContentMode(ContentMode.HTML); mandatoryLabel.setValue(mandatoryLabel.getValue().concat(" <span style='color:#ed473b'>*</span>")); return mandatoryLabel; }
private Label getMandatoryLabel(final String key) { final Label mandatoryLabel = getLabel(i18n.getMessage(key)); mandatoryLabel.setContentMode(ContentMode.HTML); mandatoryLabel.setValue(mandatoryLabel.getValue().concat(" <span style='color:#ed473b'>*</span>")); return mandatoryLabel; }
@Override public void save() { if (configurationEnabledChange) { getTenantConfigurationManagement().addOrUpdateConfiguration( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, configurationEnabled); } if (keyChanged) { getTenantConfigurationManagement().addOrUpdateConfiguration( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, gatewayTokenkeyLabel.getValue()); } }
@Override public void save() { if (configurationEnabledChange) { getTenantConfigurationManagement().addOrUpdateConfiguration( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_ENABLED, configurationEnabled); } if (keyChanged) { getTenantConfigurationManagement().addOrUpdateConfiguration( TenantConfigurationKey.AUTHENTICATION_MODE_GATEWAY_SECURITY_TOKEN_KEY, gatewayTokenkeyLabel.getValue()); } }
/** * Clears the left toolbar buttons.<p> */ public void clearButtonsLeft() { m_itemsLeft.removeAllComponents(); m_leftButtons.removeAllComponents(); // in case the app title is set, make sure to keep the label in the button bar if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_appIndicator.getValue())) { m_itemsLeft.addComponent(m_appIndicator); } updateFoldingThreshhold(); }
private void resetComponents() { queryTextField.clear(); queryTextField.focus(); headerCaption.setVisible(true); breadcrumbName.setValue(headerCaption.getValue()); nameLabel.setValue(""); saveButton.setEnabled(false); titleFilterIconsLayout.removeStyleName(SPUIStyleDefinitions.TARGET_FILTER_CAPTION_LAYOUT); }
private void resetComponents() { queryTextField.clear(); queryTextField.focus(); headerCaption.setVisible(true); breadcrumbName.setValue(headerCaption.getValue()); nameLabel.setValue(""); saveButton.setEnabled(false); titleFilterIconsLayout.removeStyleName(SPUIStyleDefinitions.TARGET_FILTER_CAPTION_LAYOUT); }
private void populateComponents() { filterManagementUIState.getTfQuery().ifPresent(query -> { queryTextField.setValue(query.getQuery()); nameLabel.setValue(query.getName()); oldFilterName = query.getName(); oldFilterQuery = query.getQuery(); }); breadcrumbName.setValue(nameLabel.getValue()); queryTextField.showValidationSuccesIcon(filterManagementUIState.getFilterQueryValue()); titleFilterIconsLayout.addStyleName(SPUIStyleDefinitions.TARGET_FILTER_CAPTION_LAYOUT); headerCaption.setVisible(false); setUpCaptionLayout(false); }
@Test public void displayFileNameWithoutExtension() { // GIVEN ResurfaceBasicUploadField<UploadReceiver> uploadField = new ResurfaceBasicUploadField<UploadReceiver>(null, null, new BasicUploadFieldDefinition(), simpleTranslator); receiver.setFileName("me.jpg"); Property<UploadReceiver> property = new ObjectProperty<UploadReceiver>(receiver); // WHEN uploadField.setPropertyDataSource(property); // THEN Label label = (Label) uploadField.getFileName(); assertEquals("me", label.getValue()); }