if (fileName==null) {
//System.out.println("creating empty project");
project = projectFactory.createProject();
} else {
LoadOptions opt=new LoadOptions();
opt.setFileName(fileName);
opt.setLocal(true);
opt.setSync(false);
if (merge) opt.setResourceMapping(new ResourceMappingForm(){
public boolean execute(){
if (getImportedResources().size() == 0) // don't show dialog if no resources were imported
return true;
if (resourceMappingDialog == null) {
resourceMappingDialog = ResourceMappingDialog.getInstance(this);
resourceMappingDialog.pack();
resourceMappingDialog.setModal(true);
} else resourceMappingDialog.setForm(this);
resourceMappingDialog.bind(true);
resourceMappingDialog.setLocationRelativeTo(getCurrentFrame());//to center on screen
resourceMappingDialog.setVisible(true);
return resourceMappingDialog.getDialogResult()==JOptionPane.OK_OPTION;
}
});
if (fileName.endsWith(".pod")){ //$NON-NLS-1$
opt.setImporter(Environment.getStandAlone()?LocalSession.LOCAL_PROJECT_IMPORTER:LocalSession.SERVER_LOCAL_PROJECT_IMPORTER);
}else opt.setImporter(LocalSession.MICROSOFT_PROJECT_IMPORTER);
project=projectFactory.openProject(opt);
}
//showWaitCursor(false);
return project != null;