private IView<SComponent> createColorPropertyView( IColorPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { SColorPicker viewComponent = createSColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } SColorPickerConnector connector = new SColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, null, connector); }
/** * {@inheritDoc} */ @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); }
private IView<JComponent> createColorPropertyView( IColorPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { JColorPicker viewComponent = createJColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } JColorPickerConnector connector = new JColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, null, connector); }
/** * {@inheritDoc} */ @Override protected IView<RComponent> createColorPropertyView(IPropertyViewDescriptor propertyViewDescriptor, IActionHandler actionHandler, Locale locale) { IColorPropertyDescriptor propertyDescriptor = (IColorPropertyDescriptor) propertyViewDescriptor .getModelDescriptor(); IValueConnector connector = getConnectorFactory().createValueConnector(propertyDescriptor.getName()); RComponent viewComponent; if (propertyViewDescriptor.isReadOnly()) { if (propertyViewDescriptor.getAction() != null) { viewComponent = createRLink(propertyViewDescriptor, false); } else { viewComponent = createRLabel(propertyViewDescriptor, false); } ((RLabel) viewComponent).setMaxLength(10); } else { viewComponent = createRColorField(propertyViewDescriptor); String defaultColor = (String) propertyDescriptor.getDefaultValue(); ((RColorField) viewComponent).setDefaultColor(defaultColor); if (defaultColor == null && propertyDescriptor.isMandatory()) { ((RColorField) viewComponent).setResetEnabled(false); } } connector.setExceptionHandler(actionHandler); IView<RComponent> view = constructView(viewComponent, propertyViewDescriptor, connector); return view; }
private IView<ULCComponent> createColorPropertyView( IColorPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { ULCColorPicker viewComponent = createULCColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } ULCColorPickerConnector connector = new ULCColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, null, connector); }
/** * {@inheritDoc} */ @Override protected IView<SComponent> createColorPropertyView( IPropertyViewDescriptor propertyViewDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { IColorPropertyDescriptor propertyDescriptor = (IColorPropertyDescriptor) propertyViewDescriptor .getModelDescriptor(); SColorPicker viewComponent = createSColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } SColorPickerConnector connector = new SColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, propertyViewDescriptor, connector); }