Composite legend = new Composite(panel, SWT.NONE);
if (layoutData != null)
legend.setLayoutData(layoutData);
RowLayout layout = new RowLayout(SWT.HORIZONTAL);
layout.wrap = true;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginLeft = 0;
layout.marginRight = 0;
layout.spacing = 0;
legend.setLayout(layout);
RowData data;
for (int i = 0; i < blockColors.length; i++) {
int r = config.getIntParameter(keys[i] + ".red", -1);
if (r >= 0) {
int g = config.getIntParameter(keys[i] + ".green");
int b = config.getIntParameter(keys[i] + ".blue");
Color color = ColorCache.getColor(panel.getDisplay(), r, g, b);
blockColors[i] = color;
}
Composite colorSet = new Composite(legend, SWT.NONE);
colorSet.setLayout(new RowLayout(SWT.HORIZONTAL));
final Canvas cColor = new Canvas(colorSet, SWT.BORDER);
cColor.setData("Index", new Integer(i));
// XXX Use paint instead of setBackgrond, because OSX does translucent
// crap