use of org.talend.dataprofiler.core.helper.EEcosCategory in project tdq-studio-se by Talend.
the class ImportRemotePatternAction method doImportAfterDownload.
private void doImportAfterDownload(IJobChangeEvent event) {
final List<ReturnCode> information = new ArrayList<ReturnCode>();
setEnabled(true);
if (fExtensionDownloaded > 0) {
// $NON-NLS-1$
String csvFormat = System.getProperty("talend.exchange.csv");
if ("true".equals(csvFormat)) {
// $NON-NLS-1$
for (IEcosComponent componet : fInstalledComponents) {
List<ImportObject> validImportObject = ImportObject.extractImportObject(componet, information);
if (!validImportObject.isEmpty()) {
String categoryName = componet.getCategry().getName();
EEcosCategory ecosCategory = EEcosCategory.getEcosCategory(categoryName);
if (ecosCategory != null) {
EResourceConstant resourceType = ecosCategory.getResource();
for (ImportObject importObject : validImportObject) {
information.addAll(ImportFactory.doImport(resourceType, importObject, componet.getName()));
}
}
}
}
// MOD qiongli 2011-11-28 TDQ-4038,give the message when there is nothing to import.
if (information.isEmpty()) {
information.add(new ReturnCode(DefaultMessagesImpl.getString("ImportRemotePatternAction.NothingImport"), // $NON-NLS-1$
false));
}
ImportInfoDialog.openImportInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), DefaultMessagesImpl.getString("ImportRemotePatternAction.ImportFinish"), // $NON-NLS-1$
information.toArray(new ReturnCode[0]));
CorePlugin.getDefault().refreshDQView();
} else {
Display.getDefault().asyncExec(new Runnable() {
public void run() {
for (IEcosComponent componet : fInstalledComponents) {
try {
ImportFactory.importFromExchange(componet);
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
}
});
}
}
}
Aggregations