}
final JCasGenThrower jCasGenThrower = new JCasGenThrower();
try {
final IWorkspace workspace = ResourcesPlugin.getWorkspace();
final Jg jg = new Jg();
final TypeDescription[] types = mergedTypeSystemDescription.getTypes();
final String outputDirectory = getPrimarySourceFolder().getLocation().toOSString();
final String inputFile = file.getLocation().toOSString(); // path to descriptor file
IWorkspaceRunnable runnable = new IWorkspaceRunnable() {
public void run(IProgressMonitor progressMonitor) {
try {
jg.mainForCde(new MergerImpl(), new JCasGenProgressMonitor(progressMonitor),
jCasGenThrower, inputFile, outputDirectory, types, (CASImpl) getCurrentView(),
getProject().getLocationURI().getPath(),
limitJCasGenToProjectScope,
mergedTypesAddingFeatures);
} catch (IOException e) {
Utility.popMessage(Messages.getString("MultiPageEditor.25"), //$NON-NLS-1$
Messages.getString("MultiPageEditor.26") //$NON-NLS-1$
+ getMessagesToRootCause(e), MessageDialog.ERROR);
}
}
};
workspace.run(runnable, monitor);
getPrimarySourceFolder().refreshLocal(IResource.DEPTH_INFINITE, null);
String jcasMsg = jCasGenThrower.getMessage();
if (null != jcasMsg && jcasMsg.length() > 0) {
Utility.popMessage(Messages.getString("MultiPageEditor.JCasGenErrorTitle"), //$NON-NLS-1$