text.setText(dialect.getFactory().getName());
// Spacer
new Label(root, SWT.NONE);
final IConfigurableObject co = (IConfigurableObject) dialect.getAdapter(IConfigurableObject.class);
if (co != null) {
List<IConfigOption<?>> options = co.getAllConfigOptions();
if (!options.isEmpty()) {
final Group group = new Group(root, SWT.NONE);
group.setText(Messages.DialectPropertyPage_label_config);
GridData gridData = new GridData(SWT.FILL, SWT.NONE, true, false);
gridData.horizontalSpan = 2;
group.setLayoutData(gridData);
group.setLayout(new GridLayout(2, false));
for (IConfigOption<?> option : options) {
if (!option.isVisible()) {
// Skip
continue;
}
try {
option.visit(new IConfigOptionVisitor() {
/* (non-Javadoc)
* @see net.sf.logsaw.core.config.IConfigOptionVisitor#visit(net.sf.logsaw.core.config.StringConfigOption, java.lang.String)
*/
@Override
public void visit(StringConfigOption opt, String value)
throws CoreException {
Label label = new Label(group, SWT.NONE);
label.setText(opt.getLabel() + ":"); //$NON-NLS-1$
Text text = new Text(group, SWT.SINGLE);
text.setBackground(group.getDisplay().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
text.setText(co.getConfigValue(opt));
}
}, null);
} catch (CoreException e) {
// Log and show error
UIPlugin.logAndShowError(e, true);