@Override
protected IView<JComponent> createPropertyView(final IPropertyViewDescriptor propertyViewDescriptor,
final IActionHandler actionHandler, Locale locale) {
final IView<JComponent> propertyView = super.createPropertyView(propertyViewDescriptor, actionHandler, locale);
final JComponent peer = propertyView.getPeer();
if (peer instanceof JLabel) {
configureHorizontalAlignment((JLabel) peer, propertyViewDescriptor.getHorizontalAlignment());
} else if (peer instanceof JTextField) {
configureHorizontalAlignment((JTextField) peer, propertyViewDescriptor.getHorizontalAlignment());
}
if (propertyViewDescriptor.getFocusGainedAction() != null) {
peer.addFocusListener(
new FocusGainedListener(actionHandler, propertyView, propertyViewDescriptor.getFocusGainedAction()));
}
if (propertyViewDescriptor.getFocusLostAction() != null) {
peer.addFocusListener(
new FocusLostListener(actionHandler, propertyView, propertyViewDescriptor.getFocusLostAction()));
}
return propertyView;
}