public static boolean notExists(IProject project) { if ((project == null) || !project.exists()) { return true; } return false; }
@Override protected String decorateText(String input, Object element) { if (element instanceof IProject && !((IProject) element).exists()) return input + NLS.bind( TeamUIMessages.PatchInaccessibleProjectsPage_projectDoesNotExistInWorkspace, ""); //$NON-NLS-1$ return input; } });
public IProject findUniqueProject(IWorkspace workspace, String basename) { IProject project = null; String name; for (int i = 1; project == null || project.exists(); i++) { name = (i < 2)? basename:basename + " ("+ i +")"; project = workspace.getRoot().getProject(name); } return project; }
/** * Returns whether the given project is available. * * @param projectName project name * @return whether the project exists and is open */ private boolean isAvailable(String projectName) { IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); return project.exists() && project.isOpen(); }
private String ensureUniqueProjectName(String projectName) { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); String newName = projectName; int index = 0; IProject proj = root.getProject(newName); while (proj.exists()) { index++; newName = projectName + index; proj = root.getProject(newName); } return newName; }
private void createJavaProject(IProject project) throws CoreException { if (!project.exists()) { BuildPathsBlock.createProject(project, null, new NullProgressMonitor()); BuildPathsBlock.addJavaNature(project, new NullProgressMonitor()); } }
private void createJavaProject(IProject project) throws CoreException { if (!project.exists()) { BuildPathsBlock.createProject(project, null, new NullProgressMonitor()); BuildPathsBlock.addJavaNature(project, new NullProgressMonitor()); } }
private static IJavaProject createPlaceholderProject() { String name= "####internal"; //$NON-NLS-1$ IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); while (true) { IProject project= root.getProject(name); if (!project.exists()) { return JavaCore.create(project); } name += '1'; } }
/** * Returns the File to use for saving and restoring the last built state for the given project. */ private File getSerializationFile(IProject project) { if (!project.exists()) return null; IPath workingLocation = project.getWorkingLocation(JavaCore.PLUGIN_ID); return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$ }
static File getSerializationFile(IProject project) { if (!project.exists()) { return null; } IPath workingLocation = project.getWorkingLocation(API_TOOL_PLUGIN_ID); return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$ }
/** * Returns the File to use for saving and restoring the last built state for the given project. */ private File getSerializationFile(IProject project) { if (!project.exists()) return null; IPath workingLocation = project.getWorkingLocation(JavaCore.PLUGIN_ID); return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$ }
/** * Returns the File to use for saving and restoring the last built state for the given project. */ private File getSerializationFile(IProject project) { if (!project.exists()) return null; IPath workingLocation = project.getWorkingLocation(JavaCore.PLUGIN_ID); return workingLocation.append("state.dat").toFile(); //$NON-NLS-1$ }
public static IRuntime getRuntimeTarget(String projectName) { if( projectName != null && projectName.length() > 0 ){ //$NON-NLS-1$ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName); if( project != null && project.exists() ){ return ServerCore.getProjectProperties(project).getRuntimeTarget(); } } return null; }
public static List<IProject> getVisibleProjects(IPath workspaceRoot) { List<IProject> projects = new ArrayList<>(); for (IProject project : ResourcesPlugin.getWorkspace().getRoot().getProjects()) { if (project.exists() && isVisibleProject(project) && workspaceRoot.isPrefixOf(project.getLocation())) { projects.add(project); } } return projects; }
/** * Return the project being created; checks the workspace for an existing project */ public IProject getProject() { if (project == null) { IProject aProject = getWorkspace().getRoot().getProject(getProjectName()); if (aProject.exists()) project = aProject; } return project; }
@Override public URI getLocationURI() { IProject project = getProject(); if (project != null && !project.exists()) return null; return getLocalManager().locationURIFor(this, false); }
@Override public IPath getLocation() { IProject project = getProject(); if (project != null && !project.exists()) return null; return getLocalManager().locationFor(this, false); }
private IPath getProjectPath() { String projName = (String)getProperty(FACET_PROJECT_NAME); IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName); if (project.exists()){ return project.getLocation(); } IDataModel projModel = (IDataModel)getProperty(MASTER_PROJECT_DM); if (projModel.getBooleanProperty(IProjectCreationPropertiesNew.USE_DEFAULT_LOCATION)){ return new Path(projModel.getStringProperty(IProjectCreationPropertiesNew.PROJECT_LOCATION)).append(projName); } return new Path(projModel.getStringProperty(IProjectCreationPropertiesNew.USER_DEFINED_LOCATION)).append(projName); }
public IProject createExternalFoldersProject(IProgressMonitor monitor) throws CoreException { IProject project = getExternalFoldersProject(); if (!project.isAccessible()) { if (!project.exists()) { createExternalFoldersProject(project, monitor); } openExternalFoldersProject(project, monitor); } return project; }
private void setAllChecked(boolean checked) { int count = checkList.getTable().getItemCount(); for (int i = 0; i < count; i++) { IProject project = (IProject) checkList.getElementAt(i); if (project.exists()) checkList.setChecked(project, checked); } }