Package org.eclipse.core.runtime

Examples of org.eclipse.core.runtime.SubMonitor.beginTask()


    this.projectRoot = projectRoot;
  }

  public void createJavaProject(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 8);
    sub.beginTask("Creating Java Project.", 8);

    if (theJavaProject == null) {
      createProject(sub.newChild(1));
      convertToJavaProject(sub.newChild(1));
     
View Full Code Here


    }
  }
 
  public void addNatureToProject(String natureId, IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 5);
    sub.beginTask("Adding " + natureId + " nature to project.", 5);
   
    IProjectDescription description = theProject.getDescription();
    String[] natures = description.getNatureIds();
    sub.worked(1);
   
View Full Code Here

    theProject.setDescription(description, sub.newChild(2));
  }

  public void deleteProject(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 1);
    sub.beginTask("Deleting project.", 1);
 
    if (theProject != null && theProject.exists()) {
      theProject.delete(true, true, sub.newChild(1));
 
      theProject = null;
View Full Code Here

    return theJavaProject;
  }

  private void createProject(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 3);
    sub.beginTask("Creating Project.", 3);
 
    IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
    theProject = root.getProject(projectRoot.getName());
 
    if (theProject.exists()) {
View Full Code Here

    theProject.open(sub.newChild(1));
  }

  private void convertToJavaProject(SubMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 1);
    sub.beginTask("Converting project to Java project.", 1);
   
    setJavaNature(sub.newChild(1));
    theJavaProject = JavaCore.create(theProject);
  }
View Full Code Here

    theJavaProject = JavaCore.create(theProject);
  }

  private void setJavaNature(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 4);
    sub.beginTask("Adding Java nature.", 4);
   
    IProjectDescription description = theProject.getDescription();
    sub.worked(1);
   
    description.setNatureIds(new String[] { JavaCore.NATURE_ID });
View Full Code Here

    theProject.setDescription(description, sub.newChild(2));
  }

  private void addSystemLibraries(IProgressMonitor monitor) throws JavaModelException {
    SubMonitor sub = SubMonitor.convert(monitor, 1);
    sub.beginTask("Adding default class path entries.", 1);
   
    // discard existing raw class path (=the project's root).
    theJavaProject.setRawClasspath(new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() }, sub.newChild(1));
  }
View Full Code Here

    theJavaProject.setRawClasspath(new IClasspathEntry[] { JavaRuntime.getDefaultJREContainerEntry() }, sub.newChild(1));
  }

  private void addOutputFolder(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 2);
    sub.beginTask("Adding default output folder.", 2);
   
    IFolder binFolder = createFolder("bin", sub.newChild(1));
    theJavaProject.setOutputLocation(binFolder.getFullPath(), sub.newChild(1));
  }
View Full Code Here

    theJavaProject.setOutputLocation(binFolder.getFullPath(), sub.newChild(1));
  }

  private void addSourceFolder(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 2);
    sub.beginTask("Adding default src folder.", 2);
       
    sourceFolder = theJavaProject.getPackageFragmentRoot(createFolder("src", sub.newChild(1)));
   
    addClassPathEntry(JavaCore.newSourceEntry(sourceFolder.getPath()), sub.newChild(1));
  }
View Full Code Here

    addClassPathEntry(JavaCore.newSourceEntry(sourceFolder.getPath()), sub.newChild(1));
  }

  private void addLibFolder(IProgressMonitor monitor) throws CoreException {
    SubMonitor sub = SubMonitor.convert(monitor, 1);
    sub.beginTask("Creating lib folder.", 1);
   
    createFolder("lib", monitor);   
  }

  private void addSourceFiles() throws JavaModelException {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.