/** * {@inheritDoc} */ @Override public BasicJavaSerializablePropertyDescriptor clone() { BasicJavaSerializablePropertyDescriptor clonedDescriptor = (BasicJavaSerializablePropertyDescriptor) super.clone(); return clonedDescriptor; }
@Override public String getI18nMessage( ITranslationProvider translationProvider, Locale locale) { StringBuilder boundsSpec = new StringBuilder("l"); if (getMaxLength() != null) { boundsSpec.append(" <= ").append(getMaxLength()); } return translationProvider.getTranslation( "integrity.property.toolong", new Object[] { getI18nName(translationProvider, locale), boundsSpec, component }, locale); }
if (getMaxLength() != null && propertyValueAsByteArray.length > getMaxLength()) { IntegrityException ie = new IntegrityException("[" + getName() + "] value is too long on [" + component + "].") {
@Override public Object interceptSetter(Object component, Object newValue) { Object actualNewValue = newValue; if (newValue instanceof byte[] && ((byte[]) newValue).length > 0) { try { actualNewValue = ImageHelper.scaleImage(actualNewValue, getScaledWidth(), getScaledHeight(), getFormatName()); return actualNewValue; } catch (IOException ioe) { // could not transform the image property view. } } return super.interceptSetter(component, actualNewValue); } }