* Create a colour selector control.
* @param controlDetails The details of the control.
*/
private void createColorSelectorControl(final ControlDetails controlDetails) {
final ColorSelector colourSelector = (ColorSelector)
new ColorSelectorFactory().buildValidatedTextControl(
controlDetails.attributesComposite, SWT.NONE);
colourSelector.setData(AttributesComposite.ATTRIBUTE_ACCESSOR_KEY,
new AttributesComposite.AttributeAccessor() {
public String getValue(String attribute) {
return colourSelector.getValue();
}
public void setValue(String attribute, String value) {
colourSelector.setValue(value);
}
});
// Add the modify listener to this control.
TextModifyListener listener =
new TextModifyListener(controlDetails.attributesComposite,
controlDetails.attribute);
colourSelector.addListener(SWT.Modify, listener);
// Store the attribute name in the control's data map (test team request).
colourSelector.setData(ATTRIBUTE_NAME_KEY, controlDetails.attribute);
// Add an accessible listener
addAccessibleListener(colourSelector, controlDetails);
// For this attribute composite, associate the attribute with the control
// so that setting the visibility on or off may be easily achieved.
// See AttributesComposite.setVisible(..)
controlDetails.attributesComposite.setData(controlDetails.attribute,
colourSelector);
associateHandlerWithCombo(controlDetails.handler, colourSelector.getCombo());
}