use of org.talend.designer.core.ui.editor.properties.controllers.AbstractRepositoryController in project tdi-studio-se by Talend.
the class DynamicPropertyGenerator method initController.
/**
* DOC yzhang Comment method "initController".
*/
public void initController(IDynamicProperty dp) {
if (!initialized) {
for (IConfigurationElement element : extensionElements) {
try {
//$NON-NLS-1$
String controllerName = element.getAttribute("mapping");
EParameterFieldType key = EParameterFieldType.getFieldTypeByName(controllerName);
if (!dtpControls.containsKey(key)) {
if (!controllerName.equals(key.toString())) {
throw new RuntimeException(//$NON-NLS-1$
"Mapping attribute " + controllerName + //$NON-NLS-1$
" not included in eumn EParameterFieldType");
}
//$NON-NLS-1$
IControllerGenerator generator = (IControllerGenerator) element.createExecutableExtension("class");
generator.setDynamicProperty(dp);
AbstractElementPropertySectionController controller = generator.generate();
dtpControls.put(key, controller);
if (controller instanceof AbstractRepositoryController) {
ControllerRepositoryValueHander repositoryValueHander = ((AbstractRepositoryController) controller).getRepositoryValueHander();
ControllerRepositoryValueHander.getRepositoryValueHandlerMap().put(key, repositoryValueHander);
}
}
} catch (CoreException e) {
ExceptionHandler.process(e);
}
}
initialized = true;
}
}
Aggregations