@Override
protected IView<JComponent> createColorPropertyView(IPropertyViewDescriptor propertyViewDescriptor,
IActionHandler actionHandler, Locale locale) {
IColorPropertyDescriptor propertyDescriptor = (IColorPropertyDescriptor) propertyViewDescriptor
.getModelDescriptor();
JColorPicker viewComponent = createJColorPicker(propertyViewDescriptor);
if (propertyDescriptor.getDefaultValue() != null) {
int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor.getDefaultValue());
viewComponent.setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3]));
} else {
if (propertyDescriptor.isMandatory()) {
viewComponent.setResetEnabled(false);
}
}
JColorPickerConnector connector = new JColorPickerConnector(propertyDescriptor.getName(), viewComponent);
connector.setExceptionHandler(actionHandler);
return constructView(viewComponent, propertyViewDescriptor, connector);
}