Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IProject.create()


  private IProject createIProject(String name, java.net.URI hdfsURI) throws CoreException {
    final IWorkspace workspace = ResourcesPlugin.getWorkspace();
    IProject project = workspace.getRoot().getProject(name);
    IProjectDescription pd = workspace.newProjectDescription(name);
    pd.setLocationURI(hdfsURI);
    project.create(pd, new NullProgressMonitor());
    project.open(new NullProgressMonitor());
    RepositoryProvider.map(project, HDFSTeamRepositoryProvider.ID);
    return project;
  }
View Full Code Here


        IPath location = operation.getLocation();
        IContainer container = workspace.getRoot().getContainerForLocation(location);
        if (container == null) {
            IProjectDescription projDesc = workspace.loadProjectDescription(location.append(IProjectDescription.DESCRIPTION_FILE_NAME));
            IProject project = workspace.getRoot().getProject(Workspace.CNFDIR);
            project.create(projDesc, monitor);
            project.open(monitor);
        } else if (container.getType() == IResource.PROJECT) {
            IProject project = (IProject) container;
            if (project.exists()) {
                project.open(monitor);
View Full Code Here

        } else if (container.getType() == IResource.PROJECT) {
            IProject project = (IProject) container;
            if (project.exists()) {
                project.open(monitor);
            } else {
                project.create(monitor);
            }
        } else {
            throw new CoreException(new Status(IStatus.ERROR, Plugin.PLUGIN_ID, 0, "Incorrect path (not a project): " + location, null));
        }
    }
View Full Code Here

        final IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
       
        WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
            protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
                monitor.beginTask("", 2500);
                project.create(description, monitor);
                project.open(monitor);
               
                IPluginModelBase model = new BundlePluginModelBase(){
                    private static final long serialVersionUID = 1L;
View Full Code Here

        final IProjectDescription description = ResourcesPlugin.getWorkspace().newProjectDescription(project.getName());
       
        WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
            protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
                monitor.beginTask("", 2500);
                project.create(description, monitor);
                project.open(monitor);
               
                IPluginModelBase model = new BundlePluginModelBase(){
                    private static final long serialVersionUID = 1L;
View Full Code Here

            protected void execute(IProgressMonitor monitor)
                throws CoreException,
                     InvocationTargetException,
                     InterruptedException {
                monitor.beginTask("", 2500);
                project.create(description, monitor);
                project.open(monitor);
               
                IPluginModelBase model = new BundlePluginModelBase(){
                    private static final long serialVersionUID = 1L;
View Full Code Here

      throws CoreException {
    IProject project = EclipseUtils.getWorkspaceRoot().getProject(name);
    if(overwrite && project.exists()) {
      project.delete(true, pm);
    }
    project.create(pm);
    project.open(pm);
    return project;
  }
 
  public static void deleteProject_unchecked(String projectName) {
View Full Code Here

                .newProjectDescription(_projectName);
            String natures[] = { "org.eclipse.jdt.core.javanature" };
            pid.setNatureIds(natures);
            pid.setLocation(null);

            proj.create(pid, monitor);
            final IJavaProject javaProj = JavaCore.create(proj);
            if (!proj.isOpen()) {
                proj.open(monitor);
            }
View Full Code Here

        WorkspaceModifyOperation op = new WorkspaceModifyOperation() {
            @Override
            protected void execute(IProgressMonitor monitor) throws CoreException {
                try {
                    monitor.beginTask("", 3000);
                    newProject.create(description, new SubProgressMonitor(monitor, 1000));
                    if (monitor.isCanceled()) {
                        throw new OperationCanceledException();
                    }
                    newProject.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 1000));
                    newProject.refreshLocal(IResource.DEPTH_INFINITE, new SubProgressMonitor(monitor, 1000));
View Full Code Here

      @Override
      public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
        monitor.beginTask("Creating Project", 100);
        try {
          pd.setLocationURI(hdfsURI);
          project.create(pd, new SubProgressMonitor(monitor, 70));
          project.open(IResource.BACKGROUND_REFRESH, new SubProgressMonitor(monitor, 30));
          RepositoryProvider.map(project, HDFSTeamRepositoryProvider.ID);
          return Status.OK_STATUS;
        } catch (final CoreException e) {
          logger.error("error found in creating HDFS site", e);
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.