List of usage examples for org.eclipse.jdt.core IJavaProject findPackageFragment
IPackageFragment findPackageFragment(IPath path) throws JavaModelException;
null
if none exist. From source file:org.eclipse.wb.tests.designer.core.nls.SourceFieldTest.java
License:Open Source License
public void test_create() throws Exception { ContainerInfo frame = parseContainer("public class Test extends JFrame {", " public Test() {", " setTitle('My JFrame');", " }", "}"); NlsSupport support = NlsSupport.get(frame); IEditableSupport editableSupport = support.getEditable(); // prepare editable source IEditableSource editableSource = NlsTestUtils.createEmptyEditable("test.messages"); // prepare parameters SourceParameters parameters = new SourceParameters(); IJavaProject javaProject = m_lastEditor.getJavaProject(); {/*from w w w. j a v a2 s .c om*/ parameters.m_propertySourceFolder = javaProject.findPackageFragmentRoot(new Path("/TestProject/src")); parameters.m_propertyPackage = javaProject.findPackageFragment(new Path("/TestProject/src/test")); parameters.m_propertyFileName = "messages.properties"; parameters.m_propertyBundleName = "test.messages"; parameters.m_propertyFileExists = false; // parameters.m_fieldName = "m_bundle"; } // add source editableSupport.addSource(editableSource, new SourceDescription(FieldSource.class, FieldSourceNewComposite.class), parameters); // do externalize StringPropertyInfo propertyInfo = editableSupport.getProperties(frame).get(0); editableSupport.externalizeProperty(propertyInfo, editableSource, true); // apply commands support.applyEditable(editableSupport); // checks assertEditor("import java.util.ResourceBundle;", "public class Test extends JFrame {", " private static final ResourceBundle m_bundle = ResourceBundle.getBundle('test.messages'); //$NON-NLS-1$", " public Test() {", " setTitle(m_bundle.getString('Test.this.title')); //$NON-NLS-1$", " }", "}"); { String newProperties = getFileContentSrc("test/messages.properties"); assertTrue(newProperties.contains("#Field ResourceBundle: m_bundle")); assertTrue(newProperties.contains("Test.this.title=My JFrame")); } }
From source file:org.eclipse.xtext.xbase.ui.quickfix.CreateJavaTypeQuickfixes.java
License:Open Source License
protected void setPackageName(NewTypeWizardPage page, URI contextUri, String packageName) { IJavaProject javaProject = getJavaProject(contextUri); String path = contextUri.trimSegments(1).toPlatformString(true); try {/* w ww . j a v a 2s. c o m*/ if (javaProject != null) { IPackageFragment contextPackageFragment = javaProject.findPackageFragment(new Path(path)); IPackageFragmentRoot root = (IPackageFragmentRoot) contextPackageFragment .getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); IPackageFragment packageFragment; if (!isEmpty(packageName)) { packageFragment = root.getPackageFragment(packageName); } else { packageFragment = contextPackageFragment; } page.setPackageFragment(packageFragment, true); page.setPackageFragmentRoot(root, true); } } catch (JavaModelException e) { LOG.error("Could not find package for " + path, e); } }
From source file:org.jboss.tools.batch.internal.core.impl.PreferredPackageManager.java
License:Open Source License
/** * returns suggested package name for the given list of batch artifact types previously saved with method savePreferredPackage * /* ww w. jav a 2 s . co m*/ * @param batchProject * @param types * @return */ public static IPackageFragment getPackageSuggestion(IBatchProject batchProject, List<BatchArtifactType> types) { IProject project = batchProject.getProject(); for (BatchArtifactType type : types) { QualifiedName qualifiedName = new QualifiedName("", QUALIFIED_NAME_PREFIX + type.toString()); try { String packPath = project.getPersistentProperty(qualifiedName); if (packPath != null && packPath.length() > 0) { IJavaProject javaProject = EclipseUtil.getJavaProject(project); if (javaProject != null) { IPackageFragment result = javaProject.findPackageFragment(new Path(packPath)); if (result != null && result.exists() && !result.isReadOnly()) { return result; } } } } catch (CoreException e) { BatchCorePlugin.pluginLog().logError(e); } } return findPackage(batchProject, types); }
From source file:org.jboss.tools.seam.core.SeamUtil.java
License:Open Source License
/** * @param componentXmlFile/* w w w. jav a 2 s. c om*/ * @return name of component class for <ComponentName>.component.xml */ public static String getClassNameForComponentXml(IFile componentXmlFile, IProject rootProject) { String fileName = componentXmlFile.getName(); int firstDot = fileName.indexOf('.'); if (firstDot == -1) { return null; } String className = fileName.substring(0, firstDot); try { IJavaProject jp = EclipseResourceUtil.getJavaProject(rootProject); IPackageFragment packageFragment = jp .findPackageFragment(componentXmlFile.getFullPath().removeLastSegments(1)); if (packageFragment == null) { return null; } return packageFragment.getElementName() + "." + className; //$NON-NLS-1$ } catch (JavaModelException e) { SeamCorePlugin.getDefault().logError(e); return null; } }
From source file:org.jboss.tools.ws.creation.core.utils.JBossWSCreationUtils.java
License:Open Source License
private static void findInPackageFragment(List<ICompilationUnit> units, IPath path, IJavaProject project, String annotation) {//from w w w. j ava 2s . com ICompilationUnit[] javaFiles = null; try { if (project.findPackageFragment(path) != null) { javaFiles = project.findPackageFragment(path).getCompilationUnits(); } if (javaFiles != null && javaFiles.length > 0) { for (ICompilationUnit unit : javaFiles) { if (unit.getTypes().length > 0) { IType type = unit.getTypes()[0]; if (type.getAnnotation(annotation).exists()) { File file = new File(unit.getResource().getLocation().toOSString()); if (file.lastModified() > JBossWSCreationCorePlugin.getDefault().getGenerateTime()) { units.add(unit); } } } } } } catch (JavaModelException e) { JBossWSCreationCorePlugin.getDefault().logError(e); } }
From source file:org.jboss.tools.ws.jaxws.ui.utils.JBossWSCreationUtils.java
License:Open Source License
private static void findInPackageFragment(List<ICompilationUnit> units, IPath path, IJavaProject project, String annotation) {// ww w .j av a 2s .c o m ICompilationUnit[] javaFiles = null; try { if (project.findPackageFragment(path) != null) { javaFiles = project.findPackageFragment(path).getCompilationUnits(); } if (javaFiles != null && javaFiles.length > 0) { for (ICompilationUnit unit : javaFiles) { if (unit.getTypes().length > 0) { IType type = unit.getTypes()[0]; if (type.getAnnotation(annotation).exists()) { File file = new File(unit.getResource().getLocation().toOSString()); if (file.lastModified() > JBossJAXWSUIPlugin.getDefault().getGenerateTime()) { units.add(unit); } } } } } } catch (JavaModelException e) { JBossJAXWSUIPlugin.getDefault().logError(e); } }
From source file:org.jnario.suite.ui.quickfix.SuiteQuickfixProvider.java
License:Open Source License
@Override public void createLinkingIssueResolutions(final Issue issue, final IssueResolutionAcceptor issueResolutionAcceptor) { final IModificationContext modificationContext = getModificationContextFactory() .createModificationContext(issue); final IXtextDocument xtextDocument = modificationContext.getXtextDocument(); if (xtextDocument != null) { xtextDocument.readOnly(new IUnitOfWork.Void<XtextResource>() { @Override//w w w .j a v a 2 s. co m public void process(XtextResource state) throws Exception { EObject target = state.getEObject(issue.getUriToProblem().fragment()); EReference reference = getUnresolvedEReference(issue, target); if (reference == null) return; if (reference == SuitePackage.Literals.SPEC_REFERENCE__SPEC) { String issueString = xtextDocument.get(issue.getOffset(), issue.getLength()); IJavaProject javaProject = projectProvider .getJavaProject(target.eResource().getResourceSet()); String path = target.eResource().getURI().trimSegments(1).toPlatformString(true); IPackageFragment packageFragmentRoot = javaProject.findPackageFragment(new Path(path)); IPackageFragmentRoot root = (IPackageFragmentRoot) packageFragmentRoot .getAncestor(IJavaElement.PACKAGE_FRAGMENT_ROOT); issueString = issueString.substring(1, issueString.length() - 1); issueResolutionAcceptor.accept(issue, "New Spec", "Create a new Jnario Specification '" + issueString + "'", "spec_file.png", doFixMissingSpecification(root, packageFragmentRoot, issueString, newSpecWizardProvider)); issueResolutionAcceptor.accept(issue, "New Feature", "Create a new Jnario Feature '" + issueString + "'", "feature_file.png", doFixMissingSpecification(root, packageFragmentRoot, issueString, newFeatureWizardProvider)); issueResolutionAcceptor.accept(issue, "New Suite", "Create a new Jnario Suite '" + issueString + "'", "suite_file.png", doFixMissingSpecification(root, packageFragmentRoot, issueString, newSuiteWizardProvider)); } } }); super.createLinkingIssueResolutions(issue, issueResolutionAcceptor); } }
From source file:org.key_project.util.test.testcase.JDTUtilTest.java
License:Open Source License
/** * Tests {@link JDTUtil#getPackage(IJavaElement)} *//*ww w . ja v a 2 s .c om*/ @Test public void testGetPackage() throws CoreException, InterruptedException { // Create projects with test content IJavaProject jdt = TestUtilsUtil.createJavaProject("JDTUtilTest_testGetPackage"); IFolder srcFolder = jdt.getProject().getFolder("src"); BundleUtil.extractFromBundleToWorkspace(Activator.PLUGIN_ID, "data/getPackage", srcFolder); // Get java project IJavaElement projectTest = JDTUtil.getPackage(jdt); assertNull(projectTest); // Get java model IJavaElement modelTest = JDTUtil.getPackage(jdt.getJavaModel()); assertNull(modelTest); // Get packageA IJavaElement packageA = jdt.findElement(new Path("packageA")); IJavaElement packageATest = JDTUtil.getPackage(packageA); assertEquals(packageA, packageATest); // Get packageA.ClassA IType classA = jdt.findType("packageA.ClassA"); IJavaElement classATest = JDTUtil.getPackage(classA); assertEquals(packageA, classATest); // Get packageB IJavaElement packageB = jdt.findElement(new Path("packageB")); IJavaElement packageBTest = JDTUtil.getPackage(packageB); assertEquals(packageB, packageBTest); // Get packageB.C IJavaElement packageC = jdt.findElement(new Path("packageB/C")); IJavaElement packageCTest = JDTUtil.getPackage(packageC); assertEquals(packageC, packageCTest); // Get packageB.C.D IJavaElement packageD = jdt.findElement(new Path("packageB/C/D")); IJavaElement packageDTest = JDTUtil.getPackage(packageD); assertEquals(packageD, packageDTest); // Get packageB.C.D.ClassB IType classB = jdt.findType("packageB.C.D.ClassB"); IJavaElement classBTest = JDTUtil.getPackage(classB); assertEquals(packageD, classBTest); // Get <default> IPackageFragment defaultPackage = jdt.findPackageFragment(srcFolder.getFullPath()); IJavaElement defaultPackageTest = JDTUtil.getPackage(defaultPackage); assertEquals(defaultPackage, defaultPackageTest); // Get ClassRoot IType classRoot = jdt.findType("ClassRoot"); IJavaElement classRootTest = JDTUtil.getPackage(classRoot); assertEquals(defaultPackage, classRootTest); }
From source file:potes.cucumberjvm.eclipseplugin.launch.CucumberTestLaunchDelegate.java
License:Apache License
@Override public String getVMArguments(ILaunchConfiguration configuration) throws CoreException { IJavaProject javaProject = getJavaProject(configuration); Set<String> packages = new HashSet<String>( Activator.getLanguage().getCucumberDefinitionPackages(javaProject)); StringBuilder pathsBuilder = new StringBuilder(); List<String> paths = configuration.getAttribute(Activator.LAUNCH_FEATURE_PATH, Collections.EMPTY_LIST); for (String path : paths) { IPath fullPath = javaProject.getProject().getFile(path).getParent().getFullPath(); IPackageFragment packageFragment = javaProject.findPackageFragment(fullPath); if (packageFragment != null) { packages.add(packageFragment.getElementName()); } else {//from w ww.j a va2s. c om for (IPackageFragmentRoot root : javaProject.getPackageFragmentRoots()) { if (root.getResource().getFullPath().isPrefixOf(fullPath)) { packages.add(fullPath.makeRelativeTo(root.getResource().getFullPath()).toString() .replace('/', '.')); break; } } } pathsBuilder.append(" ").append(path); } normalisePackages(packages); StringBuilder builder = new StringBuilder("-ea -Dcucumber.options=\"--strict"); for (String pkg : packages) { builder.append(" --glue ").append(pkg.replace('.', '/')); } builder.append(pathsBuilder).append("\""); String args = builder.toString(); Activator.getDefault().getLog().log(new Status(Status.INFO, Activator.PLUGIN_ID, "VM Args: " + args)); return args; }
From source file:repast.simphony.eclipse.ide.NewProjectCreationWizard.java
License:Open Source License
/** * Creates the java projects and add the Repast Simphony Nature * // w ww. j a v a 2 s.com * @param monitor * @throws InterruptedException * @throws CoreException */ protected void finishPage(IProgressMonitor monitor) throws InterruptedException, CoreException { monitor.beginTask("", 10); //$NON-NLS-1$ javaPage.performFinish(monitor); IJavaProject javaProject = javaPage.getJavaProject(); BasicNewProjectResourceWizard.updatePerspective(configElement); IClasspathEntry list[] = javaProject.getRawClasspath(); IPath srcPath = null; for (IClasspathEntry entry : list) { if (entry.getEntryKind() == IClasspathEntry.CPE_SOURCE) { srcPath = entry.getPath(); } } if (srcPath != null) { // String scenarioDirectory = this.contextPage.getModelPackage() // + ".rs"; // TODO the inputs on the legacy score context page are just replaced // with the project name here. If we want additional customization // for model and package names, new gui elements need to be created. // TODO make sure packagename string is formatted properly (no spaces). String scenarioDirectory = mainPage.getProjectName() + ".rs"; String mainDataSourcePluginDirectory = RepastSimphonyPlugin.getInstance() .getPluginInstallationDirectory(); IFolder srcFolder = javaProject.getProject().getFolder(srcPath.removeFirstSegments(1)); // IFolder packageFolder = srcFolder.getFolder(this.contextPage // .getPackage()); String packageName = mainPage.getProjectName().replace(" ", "_"); packageName = packageName.substring(0, 1).toLowerCase() + packageName.substring(1, packageName.length()); IFolder packageFolder = srcFolder.getFolder(packageName); packageFolder.create(true, true, monitor); String[][] variableMap = { { "%MODEL_NAME%", mainPage.getProjectName() }, { "%PROJECT_NAME%", javaProject.getElementName() }, { "%SCENARIO_DIRECTORY%", scenarioDirectory }, { "%PACKAGE%", packageName }, { "%REPAST_SIMPHONY_INSTALL_BUILDER_PLUGIN_DIRECTORY%", mainDataSourcePluginDirectory } }; IFolder newFolder = srcFolder.getFolder("../docs"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("docs/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("docs/index.html", newFolder, "index.html", variableMap, monitor); // for distributed batch (see SIM-459) newFolder = srcFolder.getFolder("../output"); if (!newFolder.exists()) newFolder.create(true, true, monitor); newFolder = srcFolder.getFolder("../freezedried_data"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("freezedried_data/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); newFolder = srcFolder.getFolder("../icons"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("icons/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("icons/model.png", newFolder, "model.png", variableMap, monitor); Utilities.copyFileFromPluginInstallation("icons/model.bmp", newFolder, "model.bmp", variableMap, monitor); Utilities.createModelInstallerFiles(srcFolder, monitor, variableMap); newFolder = srcFolder.getFolder("../repast-licenses"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/apache-license.txt", newFolder, "apache-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/asm-license.txt", newFolder, "asm-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/axion-license.txt", newFolder, "axion-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/binding-license.txt", newFolder, "binding-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/common-public-license.txt", newFolder, "common-public-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/concurrent-license.pdf", newFolder, "concurrent-license.pdf", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/CPL.txt", newFolder, "CPL.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/forms-license.txt", newFolder, "forms-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/geotools-license.txt", newFolder, "geotools-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/groovy-license.txt", newFolder, "groovy-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/hsqldb-license.txt", newFolder, "hsqldb-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jakarta-commons-collections-license.txt", newFolder, "jakarta-commons-collections-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jaxen-license.txt", newFolder, "jaxen-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jh-license.txt", newFolder, "jh-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jide-oss-license.txt", newFolder, "jide-oss-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jmatlink-license.txt", newFolder, "jmatlink-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jmf-license.txt", newFolder, "jmf-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jmock-license.txt", newFolder, "jmock-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jscience-license.txt", newFolder, "jscience-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jsp-servlet-api-license.txt", newFolder, "jsp-servlet-api-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jts-license.txt", newFolder, "jts-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/jung-license.txt", newFolder, "jung-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/lgpl-2.1.txt", newFolder, "lgpl-2.1.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/LICENSE-jgoodies.txt", newFolder, "LICENSE-jgoodies.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/log4j-license.txt", newFolder, "log4j-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/mitre-relogo-import-wizard-license.txt", newFolder, "mitre-relogo-import-wizard-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/MPL-license.txt", newFolder, "MPL-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/msql-connector-license.txt", newFolder, "msql-connector-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/mx4j-license.txt", newFolder, "mx4j-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/openforecast-license.txt", newFolder, "openforecast-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/piccolo-license.txt", newFolder, "piccolo-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/proactive-license.txt", newFolder, "proactive-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/repast-license.txt", newFolder, "repast-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/saxpath-license.txt", newFolder, "saxpath-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/swingx-license.txt", newFolder, "swingx-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/table-layout-license.txt", newFolder, "table-layout-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/violinstrings-license.txt", newFolder, "violinstrings-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/wizard-license.txt", newFolder, "wizard-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/xpp3-license.txt", newFolder, "xpp3-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/xstream-license.txt", newFolder, "xstream-license.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/license_apache.txt", newFolder, "license_apache.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/license_apache11.txt", newFolder, "license_apache11.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/license_flow4j.txt", newFolder, "license_flow4j.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/license_flow4J-eclipse.txt", newFolder, "license_flow4J-eclipse.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("repast-licenses/license_xstream.txt", newFolder, "license_xstream.txt", variableMap, monitor); newFolder = srcFolder.getFolder("../launchers"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("launchers/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); RSProjectConfigurator configurator = new RSProjectConfigurator(); configurator.createLaunchConfigurations(javaProject, newFolder, scenarioDirectory); newFolder = srcFolder.getFolder("../batch"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("batch/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); Utilities.copyFileFromPluginInstallation("batch/batch_params.xml", newFolder, "batch_params.xml", variableMap, monitor); newFolder = srcFolder.getFolder("../integration"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("integration/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); newFolder = srcFolder.getFolder("../lib"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("lib/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); newFolder = srcFolder.getFolder("../misc"); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("misc/ReadMe.txt", newFolder, "ReadMe.txt", variableMap, monitor); newFolder = srcFolder.getFolder("../" + scenarioDirectory); if (!newFolder.exists()) newFolder.create(true, true, monitor); Utilities.copyFileFromPluginInstallation("package.rs/scenario.xml", newFolder, "scenario.xml", variableMap, monitor); Utilities.copyFileFromPluginInstallation("package.rs/user_path.xml", newFolder, "user_path.xml", variableMap, monitor); Utilities.copyFileFromPluginInstallation("package.rs/context.xml", newFolder, "context.xml", variableMap, monitor); Utilities.copyFileFromPluginInstallation("package.rs/parameters.xml", newFolder, "parameters.xml", variableMap, monitor); newFolder = srcFolder.getFolder("../license.txt"); Utilities.copyFileFromPluginInstallation("license.txt", newFolder, "", variableMap, monitor); newFolder = srcFolder.getFolder("../MessageCenter.log4j.properties"); Utilities.copyFileFromPluginInstallation("MessageCenter.log4j.properties", newFolder, "", variableMap, monitor); newFolder = srcFolder.getFolder("../model_description.txt"); Utilities.copyFileFromPluginInstallation("model_description.txt", newFolder, "", variableMap, monitor); configurator.configureNewProject(javaProject, new SubProgressMonitor(monitor, 1)); try { selectAndReveal( javaProject.findPackageFragment(packageFolder.getFullPath()).getCorrespondingResource(), this.getWorkbench().getActiveWorkbenchWindow()); } catch (Exception e) { } } monitor.done(); }