IWorkspace workspace = ResourcesPlugin.getWorkspace(); IWorkspaceRoot root = workspace.getRoot(); String projectName = projectNames[indices[i]]; IProject newProjectHandle = root.getProject(projectName.replace("Examples_", "")); newProjectHandle.create(new NullProgressMonitor()); IProjectDescription description = workspace .newProjectDescription(newProjectHandle.getName()); newProjectHandle = CCorePlugin.getDefault().createCProject(description, newProjectHandle, new NullProgressMonitor(), ManagedBuilderCorePlugin.MANAGED_MAKE_PROJECT_ID); IndexerPreferences.set(newProjectHandle, IndexerPreferences.KEY_INCLUDE_HEURISTICS, "true");
@Override public Collection<IProjectDescription> getNewProjectDescriptions() { Collection<IProjectDescription> result = new ArrayList<IProjectDescription> (); IWorkspace workspace = ResourcesPlugin.getWorkspace(); for (IInstallableUnit iu : getInstallableUnits()) { String name = iu.getId(); IProject project = getProjectHandle(name); IProjectDescription description = workspace.newProjectDescription(project.getName()); result.add(description); } return result; }
public static IContainer findOrCreateContainer (IPath path, boolean forceRefresh, IPath localLocation, IProgressMonitor progressMonitor) throws CoreException { String projectName = path.segment(0); IProjectDescription projectDescription = ResourcesPlugin.getWorkspace().newProjectDescription(projectName); projectDescription.setLocation(localLocation); return findOrCreateContainer(path, forceRefresh, projectDescription, progressMonitor); }
public static IContainer findOrCreateContainer (IPath path, boolean forceRefresh, IPath localLocation, IProgressMonitor progressMonitor) throws CoreException { String projectName = path.segment(0); IProjectDescription projectDescription = ResourcesPlugin.getWorkspace().newProjectDescription(projectName); projectDescription.setLocation(localLocation); return findOrCreateContainer(path, forceRefresh, projectDescription, progressMonitor); }
private IProjectDescription getProjectDescription() { String projectName = (String) getProperty(PROJECT_NAME); IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(projectName); String projectLocation = (String) getProperty(PROJECT_LOCATION); if (projectLocation != null) desc.setLocation(new Path(projectLocation)); else desc.setLocation(null); return desc; }
@Override public Collection<IProjectDescription> getNewProjectDescriptions() { Collection<IProjectDescription> result = new ArrayList<IProjectDescription> (); IWorkspace workspace = ResourcesPlugin.getWorkspace(); IProject project = getProjectHandle(); IPath newPath = useDefaults() ? null : getLocationPath(); IProjectDescription description = workspace.newProjectDescription(project.getName()); description.setLocation(newPath); result.add(description); return result; }
protected IProjectDescription createProjectDescription() { final IProjectDescription projectDescription = workspace.newProjectDescription(projectName); if (location != null && !Platform.getLocation().equals(location.removeLastSegments(1))) { projectDescription.setLocation(location); } if (referencedProjects != null && referencedProjects.size() != 0) { projectDescription .setReferencedProjects(referencedProjects.toArray(new IProject[referencedProjects.size()])); } if (projectNatures != null) projectDescription.setNatureIds(projectNatures.toArray(new String[projectNatures.size()])); if (builderIds != null) setBuilder(projectDescription, builderIds.toArray(new String[builderIds.size()])); return projectDescription; }
private IProjectDescription getProjectDescription() { String projectName = (String) getProperty(PROJECT_NAME); IProjectDescription desc = ResourcesPlugin.getWorkspace().newProjectDescription(projectName); if (getDataModel().isPropertySet(PROJECT_LOCATION)) { String projectLocation = (String) getProperty(IProjectCreationProperties.PROJECT_LOCATION); if (projectLocation != null) desc.setLocation(new Path(projectLocation)); else desc.setLocation(null); } return desc; }
public void createAndOpen(IProgressMonitor monitor) throws CoreException, OperationCanceledException { monitor.beginTask(null, 2); try { IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName()); if (projectLocation != null) { description.setLocation(projectLocation); } project.create(description, new SubProgressMonitor(monitor, 1)); if (monitor.isCanceled()) { throw new OperationCanceledException(); } project.open(new SubProgressMonitor(monitor, 1)); } finally { monitor.done(); } }
private void createProj(IProject newProj, boolean isJavaProject) throws CoreException { newProj.create(null); IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(newProj.getName()); // if (isJavaProject) // description.setNatureIds(new String[]{JavaCore.NATURE_ID}); description.setLocation(null); newProj.open(null); newProj.setDescription(description, null); }
public static IProject openProject(String projectName, IPath dir, IProgressMonitor monitor) throws CoreException { IWorkspace workspace = getWorkspace(); IProject project = getProject(projectName); IProjectDescription desc = workspace.newProjectDescription(project.getName()); desc.setLocation(dir); project.create(desc, monitor); project.open(monitor); return project; }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); project.create(desc, IResource.HIDDEN, monitor); }
public static void createProject(IProject project, IPath location, IProgressMonitor monitor) throws CoreException { if (!Platform.getLocation().equals(location)) { IProjectDescription desc = project.getWorkspace() .newProjectDescription(project.getName()); desc.setLocation(location); project.create(desc, monitor); } else project.create(monitor); }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); project.create(desc, IResource.HIDDEN, monitor); }
public static void createProject(IProject project, IPath location, IProgressMonitor monitor) throws CoreException { if (!Platform.getLocation().equals(location)) { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); desc.setLocation(location); project.create(desc, monitor); } else project.create(monitor); }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); project.create(desc, IResource.HIDDEN, monitor); }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); project.create(desc, IResource.HIDDEN, monitor); }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); try { project.create(desc, IResource.HIDDEN, monitor); } catch (CoreException e) { // If we managed to create the project in the meantime, don't complain if (!project.exists()) { throw e; } } }
private void createExternalFoldersProject(IProject project, IProgressMonitor monitor) throws CoreException { IProjectDescription desc = project.getWorkspace().newProjectDescription(project.getName()); IPath stateLocation = JavaCore.getPlugin().getStateLocation(); desc.setLocation(stateLocation.append(EXTERNAL_PROJECT_NAME)); try { project.create(desc, IResource.HIDDEN, monitor); } catch (CoreException e) { // If we managed to create the project in the meantime, don't complain if (!project.exists()) { throw e; } } }
/** * Create and open the described project, as necessary. * * @param description project description * @exception CoreException on failure */ private void createProject(IBundleProjectDescription description) throws CoreException { IProject project = description.getProject(); if (!project.exists()) { IProjectDescription pd = project.getWorkspace().newProjectDescription(project.getName()); pd.setLocationURI(description.getLocationURI()); project.create(pd, null); } if (!project.isOpen()) { project.open(null); } }