IProgressMonitor progressMonitor = new NullProgressMonitor(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IProject project = root.getProject("DesiredProjectName"); project.create(progressMonitor); project.open(progressMonitor);
@Override public boolean isCanceled() { boolean canceled= super.isCanceled(); if (canceled) { throw new CancellationException(); } return canceled; } }
@Override public void beginTask(String name, int totalWork) { if (name != null && name.length() != 0) { printStream.println(">>> " + name); } super.beginTask(name, totalWork); }
@Override public void beginTask(String name, int totalWork) { if (name != null && name.length() != 0) { printStream.println(">>> " + name); } super.beginTask(name, totalWork); }
IOverwriteQuery overwriteQuery = new IOverwriteQuery() { public String queryOverwrite(String file) { return ALL; } }; String baseDir = // location of files to import ImportOperation importOperation = new ImportOperation(project.getFullPath(), new File(baseDir), FileSystemStructureProvider.INSTANCE, overwriteQuery); importOperation.setCreateContainerStructure(false); importOperation.run(new NullProgressMonitor());
ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor()); ResourcesPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
ICompilationUnit cu = ... // an ICompilationUnit to rename RefactoringContribution contribution = RefactoringCore.getRefactoringContribution(IJavaRefactorings .RENAME_COMPILATION_UNIT); RenameJavaElementDescriptor descriptor = (RenameJavaElementDescriptor) contribution.createDescriptor(); descriptor.setProject(cu.getResource().getProject().getName( )); descriptor.setNewName("NewClass"); // new name for a Class descriptor.setJavaElement(cu); RefactoringStatus status = new RefactoringStatus(); try { Refactoring refactoring = descriptor.createRefactoring(status); IProgressMonitor monitor = new NullProgressMonitor(); refactoring.checkInitialConditions(monitor); refactoring.checkFinalConditions(monitor); Change change = refactoring.createChange(monitor); change.perform(monitor); } catch (CoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }
/** * Creates a progress monitor. * <p> * The default implementation creates a * <code>NullProgressMonitor</code>. * </p> * * @return a progress monitor */ protected IProgressMonitor createProgressMonitor() { return new NullProgressMonitor(); }
/** * Returns the progress monitor. It there is no progress monitor the monitor\ * is set to the <code>NullProgressMonitor</code>. * * @return the progress monitor */ public IProgressMonitor getProgressMonitor() { if (fProgressMonitor == null) fProgressMonitor= new NullProgressMonitor(); return fProgressMonitor; }
/** * Returns the progress monitor. It there is no progress monitor the monitor\ * is set to the <code>NullProgressMonitor</code>. * * @return the progress monitor */ public IProgressMonitor getProgressMonitor() { if (fProgressMonitor == null) fProgressMonitor= new NullProgressMonitor(); return fProgressMonitor; }
public ResponsiveSocketFactory(IProgressMonitor monitor, int timeout) { if (monitor == null) monitor = new NullProgressMonitor(); this.monitor = monitor; this.timeout=timeout; } public InputStream getInputStream(Socket socket) throws IOException {
public static IProgressMonitor monitorFor(IProgressMonitor monitor){ if(monitor==null) return new NullProgressMonitor(); return monitor; }
/** * Returns the progress monitor. It there is no progress monitor the monitor\ * is set to the <code>NullProgressMonitor</code>. * * @return the progress monitor */ public IProgressMonitor getProgressMonitor() { if (fProgressMonitor == null) fProgressMonitor= new NullProgressMonitor(); return fProgressMonitor; }
IMethod methodToRename = <....> RenameMethodProcessor processor = new RenameVirtualMethodProcessor(methodToRename) processor.setUpdateReferences(true); processor.setNewElementName("newMethodName"); RenameRefactoring fRefactoring = new RenameRefactoring(processor); fChange= fRefactoring.createChange(new NullProgressMonitor()); fChange.initializeValidationData(new NullProgressMonitor()); fChange.perform(new NullProgressMonitor())
public static void waitForJobsToComplete() { try { waitForJobsToComplete(new NullProgressMonitor()); } catch(Exception ex) { throw new IllegalStateException(ex); } }
public void run() { try { run(new NullProgressMonitor()); } catch (InterruptedException e) { // should not happen } catch (InvocationTargetException e) { // should not happen } } }
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { if (monitor == null) { monitor= new NullProgressMonitor(); } createType(monitor); } catch (CoreException e) { throw new InvocationTargetException(e); } } };
public boolean visit(IResource resource) throws CoreException { if (resource instanceof IFile) { // progress is covered outside. saveFileIfNeeded((IFile)resource, new NullProgressMonitor()); } return true; } }, IResource.DEPTH_INFINITE, false);
public ClassPathDetector(IProject project, IProgressMonitor monitor) throws CoreException { fSourceFolders= new HashMap(); fJARFiles= new HashSet(10); fClassFiles= new ArrayList(100); fProject= project; fResultClasspath= null; fResultOutputFolder= null; if (monitor == null) { monitor = new NullProgressMonitor(); } detectClasspath(monitor); }
/** * @deprecated */ public void removeDescriptor(IArtifactDescriptor descriptor) { this.removeDescriptor(descriptor, new NullProgressMonitor()); }