final Map<String, AttributeEditorInfo> editorInfos = Maps.newHashMap();
int maxColumns = 1;
for (String key : sortedKeys)
{
final AttributeDescriptor descriptor = attributeDescriptors.get(key);
IAttributeEditor editor = null;
try
{
editor = EditorFactory.getEditorFor(this.componentClazz, descriptor);
final AttributeEditorInfo info = editor.init(bindable, descriptor,
globalEventsProvider, currentValues);
editorInfos.put(key, info);
maxColumns = Math.max(maxColumns, info.columns);
}
catch (EditorNotFoundException ex)
{
Utils.logError("No editor for attribute: "
+ descriptor.key + " (class: " + descriptor.type + ")", false);
/*
* Skip editor.
*/
editor = null;
}
editors.put(key, editor);
}
/*
* Prepare the layout for this editor.
*/
final GridLayout layout = GUIFactory.zeroMarginGridLayout();
layout.makeColumnsEqualWidth = false;
layout.numColumns = maxColumns;
this.setLayout(layout);
/*
* Create visual components for editors.
*/
final GridDataFactory labelFactory = GridDataFactory.fillDefaults().span(
maxColumns, 1);
boolean firstEditor = true;
for (String key : sortedKeys)
{
final AttributeDescriptor descriptor = attributeDescriptors.get(key);
final IAttributeEditor editor = editors.get(key);
final AttributeEditorInfo editorInfo = editorInfos.get(key);
if (editor == null)
{