Source:
public EObject generateAdaptorInterface(EObject self) { final String PROPERTIES_FILE_NAME = "generator.properties"; final String GENERATION_PATH_PROPERTY = "generationPath"; DialogInputServices dialogInputServices = new DialogInputServices(); String folderPath = getFolderPath(self); String propertiesFilePath = folderPath + "\\" + PROPERTIES_FILE_NAME; String generationPath = null; try { Properties props = new Properties(); File propertiesFile = new File(propertiesFilePath); if(propertiesFile.exists() && !propertiesFile.isDirectory()) { props.load(new FileInputStream(propertiesFile)); generationPath = props.getProperty(GENERATION_PATH_PROPERTY); } } catch (IOException e) { IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); Activator.getDefault().getLog().log(status); dialogInputServices.showMessage(self, "Exception!", "an Exception occurred reading the properties file:\"" + propertiesFilePath + "\". Please see the error log."); return self; } if (generationPath == null || generationPath.length() == 0) { generationPath = dialogInputServices.promptForFolder(self, "Enter Generation Base Folder", "Select the base folder for your generation." + "\n" + "NOTE: To provide a default path, set a \"" + GENERATION_PATH_PROPERTY + "\" property in a \"" + PROPERTIES_FILE_NAME + "\" file, in the same location as your toolchain model.", folderPath); } if (generationPath == null || generationPath.length() == 0) { return self; } File generationPathFile = new File(generationPath); if(!generationPathFile.exists() || !generationPathFile.isDirectory()) { dialogInputServices.showMessage(self, "Exception!", "The chosen generationPath " + generationPath + " does not exists."); return self; } if (generateAdaptorInterface(self, generationPath)) { dialogInputServices.showMessage(self, "Generation Success", "Generation completed on \"" + generationPath + "\"."); } return self; }

Target:
public EObject generateAdaptorInterface(EObject self) { final String PROPERTIES_FILE_NAME = "generator.properties"; final String GENERATION_PATH_PROPERTY = "generationPath"; DialogInputServices dialogInputServices = new DialogInputServices(); String folderPath = getFolderPath(self); String propertiesFilePath = folderPath + File.separator + PROPERTIES_FILE_NAME; String generationPath = null; try { Properties props = new Properties(); File propertiesFile = new File(propertiesFilePath); if(propertiesFile.exists() && !propertiesFile.isDirectory()) { props.load(new FileInputStream(propertiesFile)); generationPath = props.getProperty(GENERATION_PATH_PROPERTY); } } catch (IOException e) { IStatus status = new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); logger.log(status); dialogInputServices.showMessage(self, "Exception!", "an Exception occurred reading the properties file:\"" + propertiesFilePath + "\". Please see the error log."); return self; } if (generationPath == null || generationPath.length() == 0) { generationPath = dialogInputServices.promptForFolder(self, "Enter Generation Base Folder", "Select the base folder for your generation." + "\n" + "NOTE: To provide a default path, set a \"" + GENERATION_PATH_PROPERTY + "\" property in a \"" + PROPERTIES_FILE_NAME + "\" file, in the same location as your toolchain model.", folderPath); } if (generationPath == null || generationPath.length() == 0) { return self; } File generationPathFile = new File(generationPath); if(!generationPathFile.exists() || !generationPathFile.isDirectory()) { dialogInputServices.showMessage(self, "Exception!", "Generation path " + generationPath + " must be an existing directory."); return self; } if (generateAdaptorInterface(self, generationPath)) { dialogInputServices.showMessage(self, "Generation Success", "Generation completed on \"" + generationPath + "\"."); } return self; }