use of org.talend.librariesmanager.ui.views.ModulesView in project tdi-studio-se by Talend.
the class SubjobContainerPart method showModules.
private void showModules(Node node) {
ILibrariesService moduleService = CorePlugin.getDefault().getLibrariesService();
if (moduleService == null) {
return;
}
List<Problem> problems = moduleService.getProblems(node, node);
List<Problem> mproblems = new ArrayList<Problem>();
List<String> modulesName = new ArrayList<String>();
String componentName = null;
String moduleStr = "Module_";
for (Problem pro : problems) {
if (pro.getStatus() == ProblemStatus.ERROR && pro.getKey() != null && pro.getKey().startsWith(moduleStr)) {
mproblems.add(pro);
}
}
if (mproblems.isEmpty()) {
return;
}
for (Problem pro : mproblems) {
if (componentName == null) {
componentName = pro.getComponentName();
}
String key = pro.getKey();
if (key.contains(moduleStr)) {
int first = key.indexOf(moduleStr);
String keydes = key.substring(first + moduleStr.length());
modulesName.add(keydes);
}
}
IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final IWorkbenchPage page = window.getActivePage();
if (page == null) {
return;
}
try {
IViewPart view = page.showView("org.talend.designer.codegen.perlmodule.ModulesView");
if (view instanceof ModulesView) {
((ModulesView) view).selectUninstalledItem(componentName, modulesName);
}
} catch (PartInitException e) {
ExceptionHandler.process(e);
}
}
Aggregations