use of net.sourceforge.usbdm.cdt.ui.newProjectWizard.CDTProjectManager in project usbdm-eclipse-plugins by podonoghue.
the class KSDKLibraryImportWizard method run.
@Override
public void run(IProgressMonitor progressMonitor) throws InvocationTargetException, InterruptedException {
System.err.println("KSDKLibraryImportWizard.run()");
SubMonitor monitor = SubMonitor.convert(progressMonitor);
monitor.beginTask("Importing KDS Library", 100);
Map<String, String> paramMap = new HashMap<String, String>();
try {
kdsLibraryImportWizardPage.getPageData(paramMap);
Device device = getDevice(paramMap.get(UsbdmConstants.TARGET_DEVICE_KEY));
if (device == null) {
throw new Exception("Failed to obtain device description for " + paramMap.get(UsbdmConstants.TARGET_DEVICE_KEY));
}
// Add device options
ProjectActionList deviceActionList = device.getProjectActionList(paramMap);
// UsbdmOptionsPanel.getPageData(paramMap, deviceActionLists);
listParamMap("KSDKLibraryImportWizard.run() - paramMap =================================", paramMap);
// Create project
System.err.println("KSDKLibraryImportWizard.run() - Creating project");
IProject project = new CDTProjectManager().createUSBDMProject(paramMap, monitor.newChild(30));
// Apply default device project options
System.err.println("KSDKLibraryImportWizard.run() - Applying deviceActionLists");
ProcessProjectActions.process(this, project, device, deviceActionList, paramMap, monitor.newChild(30));
// Apply Library options
System.err.println("KSDKLibraryImportWizard.run() - Getting libraryActionList");
ProjectActionList libraryActionList = kdsLibraryImportWizardPage.getProjectActionList();
System.err.println("KSDKLibraryImportWizard.run() - Applying libraryActionList");
ProcessProjectActions.process(this, project, device, libraryActionList, paramMap, monitor.newChild(30));
updateConfigurations(project, monitor.newChild(10));
} catch (Exception e) {
e.printStackTrace();
throw new InvocationTargetException(e);
} finally {
monitor.done();
}
}
Aggregations