@Override public void deconfigure() throws CoreException { removeLiferayNature(_currentProject, _monitor); _currentProject.refreshLocal(IResource.DEPTH_INFINITE, _monitor); }
@Override public void configure() throws CoreException { addLiferayNature(_currentProject, _monitor); _currentProject.refreshLocal(IResource.DEPTH_INFINITE, _monitor); }
@Override public void refreshProject(IProject project, IProgressMonitor monitor) { // validate arguments Preconditions.checkNotNull(project); Preconditions.checkArgument(project.isAccessible(), "Project must be open."); try { project.refreshLocal(IProject.DEPTH_INFINITE, monitor); } catch (CoreException e) { throw new GradlePluginsRuntimeException(e); } }
public void refresh(Project p) throws Exception { IJavaProject jp = getJavaProject(p); if (jp != null) jp.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); }
protected void refreshLocal(IProgressMonitor monitor) throws CoreException { IProject project = fManifestFile.getProject(); project.refreshLocal(IResource.DEPTH_ONE, monitor); IFile file = project.getFile("dev.properties"); //$NON-NLS-1$ if (file.exists()) file.delete(true, false, monitor); project.refreshLocal(IResource.DEPTH_ONE, monitor); }
@Override public void configure(IProject project, Set<IPath> excludedDirectories, IProgressMonitor monitor) { try { project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (CoreException ex) { IDEWorkbenchPlugin.log(ex.getMessage(), ex); } }
public void refresh(Project p) throws Exception { IJavaProject jp = getJavaProject(p); if (jp != null) jp.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); }
protected void refreshProject(IProgressMonitor monitor) throws CoreException { IProject project = CloudFoundryProjectUtil.getProject(appModule); if (project != null && project.isAccessible()) { project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } }
/** Refresh the project file hierarchy. * * @param project the project. * @param monitor the progress monitor. */ @SuppressWarnings("static-method") protected void safeRefresh(IProject project, IProgressMonitor monitor) { try { project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } catch (CoreException exception) { SARLEclipsePlugin.getDefault().log(exception); } }
@Override public void runWithinEclipse() throws CoreException { // add all projects to the workspace IWorkspace workspace = ResourcesPlugin.getWorkspace(); for (File projectFile : host.projects) { Path path = new Path(projectFile.toString()); IProjectDescription description = workspace.loadProjectDescription(path); IProject project = workspace.getRoot().getProject(description.getName()); if (project.isOpen() == false) { project.create(description, null); project.open(null); } else { project.refreshLocal(IResource.DEPTH_INFINITE, null); } } } }
private void setDefaultValues(File dir, String buildFilename) { try { IContainer container = PDEPlugin.getWorkspace().getRoot().getContainerForLocation(new Path(dir.toString())); if (container != null && container.exists()) { IProject project = container.getProject(); if (project != null) { project.refreshLocal(IResource.DEPTH_INFINITE, null); IFile file = container.getFile(new Path(buildFilename)); if (file.exists()) BaseBuildAction.setDefaultValues(file); } } } catch (CoreException e) { } }
public IJavaProject createJavaProjectFromJavacNode(String projectName, Javac javacTask, IProgressMonitor monitor) throws CoreException { try { IJavaProject javaProject = createJavaProject(projectName, monitor); File destDir = javacTask.getDestdir(); String destDirName = destDir == null ? null : destDir.getName(); org.apache.tools.ant.types.Path sourceDirs = javacTask.getSrcdir(); createSourceDirectories(destDir, destDirName, sourceDirs, javaProject, monitor); // add rt.jar addVariableEntry(javaProject, new Path(JavaRuntime.JRELIB_VARIABLE), new Path(JavaRuntime.JRESRC_VARIABLE), new Path(JavaRuntime.JRESRCROOT_VARIABLE), monitor); setClasspath(javacTask, javaProject, monitor); javaProject.getProject().refreshLocal(IResource.DEPTH_INFINITE, monitor); return javaProject; } catch (BuildException be) { IStatus status = new Status(IStatus.ERROR, AntUIPlugin.PI_ANTUI, IStatus.OK, be.getLocalizedMessage(), be); throw new CoreException(status); } }
protected boolean verifyFilesInSync(IProject project) throws CoreException { if (!project.exists()) return true; if (!project.isSynchronized(IResource.DEPTH_INFINITE)) { String message = MessageFormat.format(ClientJARCreationConstants.FILES_OUT_OF_SYNC, new String[]{project.getName()}); if (operationHandler == null || operationHandler.canContinue(message)) ejbProject.refreshLocal(IResource.DEPTH_INFINITE, createSubProgressMonitor(1)); else return false; } return true; }
/** * Execute RefreshProjectTask */ public IStatus execute( IProgressMonitor monitor, IAdaptable adaptable ) { IEnvironment env = getEnvironment(); try { if (project!=null) project.refreshLocal(IProject.DEPTH_INFINITE, new NullProgressMonitor()); } catch (CoreException e) { IStatus status = StatusUtils.errorStatus( AxisConsumptionUIMessages.MSG_ERROR_REFRESH_PROJECT, e); env.getStatusHandler().reportError(status); return status; } return Status.OK_STATUS; }
public static void addLiferayNature(IProject project, IProgressMonitor monitor) throws CoreException { if ((monitor != null) && monitor.isCanceled()) { throw new OperationCanceledException(); } if (!hasNature(project)) { IProjectDescription description = project.getDescription(); String[] prevNatures = description.getNatureIds(); String[] newNatures = new String[prevNatures.length + 1]; System.arraycopy(prevNatures, 0, newNatures, 0, prevNatures.length); newNatures[prevNatures.length] = NATURE_ID; description.setNatureIds(newNatures); project.setDescription(description, monitor); project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } else if (monitor != null) { monitor.worked(1); } }
public static void convertToOSGIFormat(IProject project, String target, Dictionary dictionary, HashMap newProps, IProgressMonitor monitor) throws CoreException { try { File outputFile = new File(project.getLocation().append( "META-INF/MANIFEST.MF").toOSString()); //$NON-NLS-1$ File inputFile = new File(project.getLocation().toOSString()); PluginConverter converter = PluginConverter.getDefault(); converter.convertManifest(inputFile, outputFile, false, target, true, dictionary); if (newProps != null && newProps.size() > 0) converter.writeManifest(outputFile, getProperties(outputFile, newProps), false); project.refreshLocal(IResource.DEPTH_INFINITE, null); } catch (PluginConversionException e) { } finally { monitor.done(); } }
public void run(IProgressMonitor monitor_inner) throws CoreException{ if (shouldUseJ2EEConfig(fv)){ JSFUtils11.createConfigFile(fv.getVersionString(), configPath); } else { JSFUtils12.createConfigFile(fv.getVersionString(), configPath); } project.refreshLocal(IResource.DEPTH_INFINITE, monitor_inner); }
protected void saveFiles() throws SaveFailureException { super.saveFiles(); linkImportedClassesFolderIfNecessary(); try { vComponent.getProject().refreshLocal(IResource.DEPTH_INFINITE, null); } catch (CoreException ex) { Logger.getLogger().logError(ex); } }
private void importRootProject(File rootDir, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor); progress.setWorkRemaining(3); WorkspaceOperations workspaceOperations = CorePlugin.workspaceOperations(); Optional<IProject> projectOrNull = workspaceOperations.findProjectByLocation(rootDir); if (!projectOrNull.isPresent() && this.newProjectHandler.shouldImportNewProjects()) { String projectName = findFreeProjectName(rootDir.getName()); projectOrNull = Optional.of(workspaceOperations.createProject(projectName, rootDir, ImmutableList.<String>of(), progress.newChild(1))); } if (projectOrNull.isPresent()) { IProject project = projectOrNull.get(); project.refreshLocal(IResource.DEPTH_INFINITE, progress.newChild(1)); CorePlugin.workspaceOperations().addNature(project, GradleProjectNature.ID, progress.newChild(1)); this.newProjectHandler.afterProjectImported(project); progress.worked(1); } }
private IJavaProject createJavaProject(String projectName, IProgressMonitor monitor) throws CoreException { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject(projectName); if (!project.exists()) { project.create(monitor); } else { project.refreshLocal(IResource.DEPTH_INFINITE, monitor); } if (!project.isOpen()) { project.open(monitor); } if (!project.hasNature(JavaCore.NATURE_ID)) { addNatureToProject(project, JavaCore.NATURE_ID, monitor); } IJavaProject jproject = JavaCore.create(project); jproject.setRawClasspath(new IClasspathEntry[0], monitor); return jproject; }