}
@Override
public void buildComplete(boolean isOk) {
if (isOk){
IWorkspaceRunnable myRunnable =
new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
FileOutputStream fos = null;
ObjectOutputStream out = null;
try {
// use serialization to write the mapping tree to disk
IWorkspace workspace = ResourcesPlugin.getWorkspace();
IProject project = workspace.getRoot().getProject(projectName);
IFolder folder = project.getFolder(outputDirectory);
if (!folder.exists())
folder.create(true, true, monitor);
IFile file = folder.getFile("jbprocess.bin");
fos = new FileOutputStream(file.getRawLocation().toFile());
out = new ObjectOutputStream(fos);
out.writeObject(root);
out.close();
file.refreshLocal(IResource.DEPTH_ONE, monitor);
} catch(Exception e){
System.out.println(e.getMessage());
e.printStackTrace();
} finally {
try { if (out != null) out.close(); } catch (Exception e){}
}
}
};
try {
myRunnable.run(null);
} catch (CoreException e){
System.out.println(e.getMessage());
e.printStackTrace();
}
}