@Override public void setCaption(String caption) { super.setCaption(caption); getContent().setCaption(caption); }
/** * Performs messages localization * @param instance Building instance */ protected void localize(I instance) { if (caption != null) { instance.setCaption(LocalizationContext.translate(caption, true)); } if (description != null) { instance.setDescription(LocalizationContext.translate(description, true)); } }
/** * Performs messages localization * @param instance Building instance */ protected void localize(I instance) { if (caption != null) { instance.setCaption(LocalizationContext.translate(caption, true)); } if (description != null) { instance.setDescription(LocalizationContext.translate(description, true)); } }
@Override public B caption(Localizable caption) { getInstance().setCaption(localizeMessage(caption)); return builder(); }
@Override public B caption(Localizable caption) { getInstance().setCaption(localizeMessage(caption)); return builder(); }
/** * Applies annotation values to {@code component} * * @param component the component to be updated * @param annotationValues the annotation values to apply * @param annotationInfo used primarily to identify the Field, and therefore its name */ private void applyAnnotationValues(AbstractComponent component, AnnotationValues annotationValues, AnnotationInfo annotationInfo) { // set locale first Locale locale = annotationValues.locale.isPresent() ? annotationValues.locale.get() : currentLocale.getLocale(); component.setLocale(locale); // set caption, description & value if available if (annotationValues.captionKey.isPresent()) { component.setCaption(translate.from(annotationValues.captionKey.get(), locale)); } if (annotationValues.descriptionKey.isPresent()) { component.setDescription(translate.from(annotationValues.descriptionKey.get(), locale)); } if (annotationValues.valueKey.isPresent()) { if (component instanceof HasValue) { ((HasValue) component).setValue(translate.from(annotationValues.valueKey.get(), locale)); return; } else { log.warn("Field {} has a value annotation but does not implement HasValue. Annotation ignored", annotationInfo.getField() .getName()); } } }
component.setCaption(translate.from(annotationValues.captionKey.get(), locale));
public void doUpdate(DataConnector data) throws MException { if (data.getTaskName().equals(DataSource.CONNECTOR_TASK_TITLE)) { String arg = data.getString((String)label.getCaption()); if (equals(arg,label.getCaption())) return; label.setCaption(arg); return; } if (data.getTaskName().equals(DataSource.CONNECTOR_TASK_ERROR)) { String msg = data.getString(""); setErrorMessage(msg); return; } }