private IView<SComponent> createReferencePropertyView(
IReferencePropertyDescriptor<?> propertyDescriptor,
IActionHandler actionHandler, Locale locale) {
SActionField viewComponent = createSActionField(true);
SReferenceFieldConnector connector = new SReferenceFieldConnector(
propertyDescriptor.getName(), viewComponent);
connector.setToStringPropertyConnector(new BasicValueConnector(
propertyDescriptor.getComponentDescriptor().getToStringProperty()));
connector.setExceptionHandler(actionHandler);
Action fieldAction = actionFactory.createAction(lovAction, actionHandler,
viewComponent, propertyDescriptor, connector, locale);
fieldAction.putValue(Action.NAME, getTranslationProvider().getTranslation(
"lov.element.name",
new Object[] {propertyDescriptor.getReferencedDescriptor().getI18nName(
translationProvider, locale)}, locale));
fieldAction.putValue(Action.SHORT_DESCRIPTION, getTranslationProvider()
.getTranslation(
"lov.element.description",
new Object[] {propertyDescriptor.getReferencedDescriptor()
.getI18nName(translationProvider, locale)}, locale)
+ TOOLTIP_ELLIPSIS);
if (propertyDescriptor.getReferencedDescriptor().getIconImageURL() != null) {
fieldAction.putValue(Action.SMALL_ICON, iconFactory.getIcon(
propertyDescriptor.getReferencedDescriptor().getIconImageURL(),
IIconFactory.TINY_ICON_SIZE));
}
viewComponent.setActions(Collections.singletonList(fieldAction));
adjustSizes(viewComponent, null, null);
return constructView(viewComponent, null, connector);
}