*/
private void addControlRow(Composite parent, StyleValueType[] types) {
Set valueTypes = createTypeSet(types);
// create the StyleValueComposite object
final StyleValueComposite styleValueComposite =
createStyleValueComposite(parent, valueTypes);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
styleValueComposite.setLayoutData(data);
// new container that the 2 supporting controls will be added to.
GridLayout layout = new GridLayout(2, false);
Composite container = new Composite(parent, SWT.DEFAULT);
container.setLayout(layout);
container.setLayoutData(new GridData(GridData.FILL_BOTH));
// create the drop down that will call the displayElement method
// on the StyleValueComposite whenever an item is selected
createLabel(container, "Display Element Type: ");
final Combo combo = createDiplayElememntSelection(container,
valueTypes);
combo.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
StyleValueType type = StyleValueType.get(combo.getText());
Element element = (Element) elements.get(type);
styleValueComposite.displayElement(element);
}
});
// add the text field that will display the value that the
// StyleValueComposites getValue method returns
createLabel(container, "value: ");
final Text textField = createTextField(container);
styleValueComposite.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent event) {
textField.setText(styleValueComposite.getValue());
}
});
}