use of org.talend.repository.generic.ui.DynamicComposite in project tdi-studio-se by Talend.
the class GenericWizardService method creatDynamicComposite.
@Override
public Composite creatDynamicComposite(Composite composite, Element element, EComponentCategory sectionCategory, boolean isCompactView) {
DynamicComposite dynamicComposite = null;
if (element != null && element instanceof INode) {
INode node = (INode) element;
ComponentProperties props = null;
if (node.getComponentProperties() == null) {
props = ComponentsUtils.getComponentProperties(node.getComponent().getName());
} else {
props = node.getComponentProperties();
}
if (props != null) {
Form form = props.getForm(EComponentCategory.ADVANCED.equals(sectionCategory) ? Form.ADVANCED : Form.MAIN);
dynamicComposite = new DynamicComposite(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_FOCUS, sectionCategory, element, isCompactView, composite.getBackground(), form);
List<ElementParameter> elementParameters = (List<ElementParameter>) node.getElementParameters();
for (ElementParameter parameter : elementParameters) {
if (parameter instanceof GenericElementParameter) {
GenericElementParameter genericElementParameter = (GenericElementParameter) parameter;
genericElementParameter.callBeforePresent();
genericElementParameter.removePropertyChangeListener(dynamicComposite);
genericElementParameter.addPropertyChangeListener(dynamicComposite);
}
}
}
}
return dynamicComposite;
}
Aggregations