public void performFinish(List variants) {
super.performFinish(variants);
Iterator it = variants.iterator();
while (it.hasNext()) {
VariantBuilder variant = (VariantBuilder) it.next();
InternalLayoutContentBuilder content = (InternalLayoutContentBuilder)
((InternalPolicyFactory) POLICY_FACTORY).createLayoutContentBuilder();
LayoutType type = null;
Object selected = ((IStructuredSelection) layoutType.
getSelection()).getFirstElement();
if (selected instanceof LayoutType) {
type = (LayoutType) selected;
}
Layout layout = null;
if (type == LayoutType.CANVAS) {
layout = new CanvasLayout();
} else if (type == LayoutType.MONTAGE) {
layout = new MontageLayout(null);
}
if (type == null) {
variant.setContentBuilder(null);
variant.setVariantType(VariantType.NULL);
} else {
content.setLayout(layout);
variant.setContentBuilder(content);
}
}
}