/** * Invoke nls getter. * * @param proxy * the proxy * @param propertyDescriptor * the property descriptor * @return the translated value */ protected String invokeNlsGetter(Object proxy, IStringPropertyDescriptor propertyDescriptor) { return (String) straightGetProperty(proxy, propertyDescriptor.getName() + IComponentDescriptor.RAW_SUFFIX); }
private String getStringTemplateValue( IStringPropertyDescriptor propertyDescriptor) { return getStringTemplateValue(propertyDescriptor.getMaxLength()); }
/** * Is declared translatable. * * @return the boolean */ protected boolean isDeclaredTranslatable() { Collection<IPropertyDescriptor> propertyDescriptors = getDeclaredPropertyDescriptors(); if (propertyDescriptors != null) { for (IPropertyDescriptor pDesc : propertyDescriptors) { if (pDesc instanceof IStringPropertyDescriptor) { if (((IStringPropertyDescriptor) pDesc).isTranslatable()) { return true; } } } } return false; }
IEntityFactory entityFactory, Locale locale) { if (locale != null) { String actualTranslatedValue = (String) propertyDescriptor.interceptSetter(proxy, translatedValue); propertyDescriptor.preprocessSetter(proxy, translatedValue); String barePropertyName = propertyDescriptor.getName(); if (barePropertyName.endsWith(IComponentDescriptor.NLS_SUFFIX)) { barePropertyName = barePropertyName.substring(0, propertyDescriptor.postprocessSetter(proxy, oldTranslation, actualTranslatedValue);
String regex = propertyValue; if (propertyDescriptor instanceof IStringPropertyDescriptor && ((IStringPropertyDescriptor) propertyDescriptor) .isUpperCase()) { regex = regex.toUpperCase();
/** * Invoke nls setter. * * @param proxy * the proxy * @param propertyDescriptor * the property descriptor * @param translatedValue * the translated value */ protected void invokeNlsSetter(Object proxy, IStringPropertyDescriptor propertyDescriptor, String translatedValue) { straightSetProperty(proxy, propertyDescriptor.getName() + IComponentDescriptor.RAW_SUFFIX, translatedValue); }
private String getStringTemplateValue( IStringPropertyDescriptor propertyDescriptor) { return getStringTemplateValue(propertyDescriptor.getMaxLength()); }
propertyValue = sanitizeStringValue(propertyValue); if (propertyDescriptor instanceof IStringPropertyDescriptor && ((IStringPropertyDescriptor) propertyDescriptor) .isTranslatable()) { String nlsOrRawValue = null; String barePropertyName = property.getKey();
/** * Invoke nls or raw getter. * * @param proxy * the proxy * @param propertyDescriptor * the property descriptor * @return the translated value or raw if non-existent. */ protected String invokeNlsOrRawGetter(Object proxy, IStringPropertyDescriptor propertyDescriptor) { String nlsOrRawValue = invokeNlsGetter(proxy, propertyDescriptor); if (nlsOrRawValue == null) { nlsOrRawValue = (String) straightGetProperty(proxy, propertyDescriptor.getName() + IComponentDescriptor.RAW_SUFFIX); } return nlsOrRawValue; }
private String getStringTemplateValue( IStringPropertyDescriptor propertyDescriptor) { return getStringTemplateValue(propertyDescriptor.getMaxLength()); }
IQueryComponent queryComponent, Map<String, Object> context) { if (propertyDescriptor instanceof IStringPropertyDescriptor && ((IStringPropertyDescriptor) propertyDescriptor) .isTranslatable()) { String nlsOrRawValue = null; String nlsValue = (String) property.getValue();
protected String getNlsPropertyValue(Object proxy, IStringPropertyDescriptor propertyDescriptor, Locale locale) { if (locale != null) { String barePropertyName = propertyDescriptor.getName(); if (barePropertyName.endsWith(IComponentDescriptor.NLS_SUFFIX)) { barePropertyName = barePropertyName.substring(0,
RComponent viewPeer = view.getPeer(); if (viewPeer instanceof RTextComponent) { Integer maxLength = propertyDescriptor.getMaxLength(); if (maxLength != null && maxLength > 0) { ((RTextComponent) viewPeer).setMaxLength(maxLength);
for (IPropertyDescriptor descriptor : tempPropertyBuffer) { if (descriptor instanceof IStringPropertyDescriptor) { if (((IStringPropertyDescriptor) descriptor).isTranslatable()) { String rawSqlName = ((BasicStringPropertyDescriptor) descriptor).getSqlName(); if (rawSqlName == null) { for (IPropertyDescriptor translatablePropertyDescriptor : getPropertyDescriptors()) { if (translatablePropertyDescriptor instanceof IStringPropertyDescriptor && ((IStringPropertyDescriptor) translatablePropertyDescriptor).isTranslatable() && !translatablePropertyDescriptor.getName().endsWith(NLS_SUFFIX)) { completeWithComputedNlsDescriptors(translatablePropertyDescriptor);
/** * Invoke nls or raw setter. * * @param proxy * the proxy * @param propertyDescriptor * the property descriptor * @param translatedValue * the translated value */ protected void invokeNlsOrRawSetter(Object proxy, IStringPropertyDescriptor propertyDescriptor, String translatedValue) { String oldTranslation = invokeNlsOrRawGetter(proxy, propertyDescriptor); invokeNlsSetter(proxy, propertyDescriptor, translatedValue); String propertyName = propertyDescriptor.getName(); storeProperty(propertyName, translatedValue); firePropertyChange(proxy, propertyName, oldTranslation, translatedValue); }
&& ((IStringPropertyDescriptor) propertyDescriptor).isTranslatable())) && (!isEntityRef || IEntity.ID .equals(propertyName))) { String prefixedProperty = PropertyHelper.toJavaBeanPropertyName(propertyName);
if (!isPersistent(proxy)) { try { String rawPropertyName = propertyDescriptor.getName() + IComponentDescriptor.RAW_SUFFIX; getAccessorFactory().createPropertyAccessor(rawPropertyName, getComponentDescriptor().getComponentContract()) .setValue(proxy, translatedValue);
&& ((IStringPropertyDescriptor) propertyDescriptor).isTranslatable())) && (!isEntityRef || IEntity.ID .equals(propertyName))) { String prefixedProperty;
/** * {@inheritDoc} */ @Override protected IView<SComponent> createStringPropertyView( IPropertyViewDescriptor propertyViewDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { IStringPropertyDescriptor propertyDescriptor = (IStringPropertyDescriptor) propertyViewDescriptor .getModelDescriptor(); SComponent viewComponent; IValueConnector connector; if (propertyViewDescriptor.isReadOnly()) { viewComponent = createSLabel(true); connector = new SLabelConnector(propertyDescriptor.getName(), (SLabel) viewComponent); } else { viewComponent = createSTextField(); connector = new STextFieldConnector(propertyDescriptor.getName(), (STextField) viewComponent); adjustSizes(propertyViewDescriptor, viewComponent, null, getStringTemplateValue(propertyDescriptor)); } connector.setExceptionHandler(actionHandler); return constructView(viewComponent, propertyViewDescriptor, connector); }