/**
* Create the style selector control.
* @param controlDetails the controls details.
*/
private void createStyleSelectorControl(ControlDetails controlDetails) {
final StyleSelector selector = new StyleSelector(
controlDetails.attributesComposite, SWT.NONE);
createTextButton(selector, controlDetails);
selector.setData(AttributesComposite.ATTRIBUTE_ACCESSOR_KEY,
new AttributesComposite.AttributeAccessor() {
public String getValue(String attribute) {
return selector.getText().getText();
}
public void setValue(String attribute, String value) {
selector.getText().setText(value);
}
});
// Add a text modify listener on the text control.
TextModifyListener listener =
new TextModifyListener(controlDetails.attributesComposite,
controlDetails.attribute);
selector.getText().addListener(SWT.Modify, listener);
// Store the attribute name in the control's data map (test team request).
selector.setData(ATTRIBUTE_NAME_KEY, controlDetails.attribute);
// Add an accessible listener
addAccessibleListener(selector, controlDetails);
// For this attribute composite, associate the attribute with the control