Search in sources :

Example 1 with ContextManagerHelper

use of org.talend.core.ui.context.ContextManagerHelper in project tdi-studio-se by Talend.

the class UpdateContextParameterCommand method checkNewRepositoryParameters.

/**
     * DOC hcw Comment method "checkAddedParameters".
     * 
     * @param process
     * @param names
     */
private void checkNewRepositoryParameters(IProcess2 process, Set<String> names) {
    // add context in repository
    ContextManagerHelper helper = new ContextManagerHelper(process.getContextManager());
    Set<ContextItem> contextItemList = helper.getContextItems();
    ContextItem item = (ContextItem) result.getParameter();
    // this job contains the repository context group
    if (contextItemList.contains(item)) {
        ContextType contextType = getDefaultContextType(item);
        for (String paramName : names) {
            ContextParameterType contextParameterType = ContextUtils.getContextParameterTypeByName(contextType, paramName);
            // check if there is a parameter with same name
            // IContextParameter paramExisted = helper.getExistedContextParameter(contextParameterType.getName());
            // if (paramExisted == null) {
            helper.addContextParameterType(contextParameterType);
        // }
        }
    }
    ConnectionContextHelper.showContextGroupDialog(process, item, process.getContextManager(), names);
}
Also used : ContextItem(org.talend.core.model.properties.ContextItem) ContextType(org.talend.designer.core.model.utils.emf.talendfile.ContextType) ContextManagerHelper(org.talend.core.ui.context.ContextManagerHelper) ContextParameterType(org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType)

Aggregations

ContextItem (org.talend.core.model.properties.ContextItem)1 ContextManagerHelper (org.talend.core.ui.context.ContextManagerHelper)1 ContextParameterType (org.talend.designer.core.model.utils.emf.talendfile.ContextParameterType)1 ContextType (org.talend.designer.core.model.utils.emf.talendfile.ContextType)1