Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.IResourceRuleFactory


    }
  }
 
  protected ISchedulingRule getSchedulingRule() {
    if (this.canChangeResources) {
      IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
      return new MultiRule(new ISchedulingRule[] {
        // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references
        ruleFactory.modifyRule(this.project.getProject()),
       
        // and external project modification rule in case the external folders are modified
        ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject())
      });
    }
    return super.getSchedulingRule();
  }
View Full Code Here


        return Status.OK_STATUS;
      }

    };

    IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace()
        .getRuleFactory();

    ISchedulingRule rule = ruleFactory.buildRule();
    job.setRule(rule);
    job.schedule();
  }
View Full Code Here

        // Found an Ivy container in this project -- notify dependent projects
        // to perform fresh resolve

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the close operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(javaProject.getCorrespondingResource());
        List affectedContainers = getAffectedContainers(javaProject.getPath());
        IvyMultiResolveJob multiResolveJob = new IvyMultiResolveJob(affectedContainers);
        multiResolveJob.setRule(modifyRule);
        multiResolveJob.schedule();
View Full Code Here

            return;
        }

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the open operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(ResourcesPlugin.getWorkspace()
                .getRoot());
        List allContainers = getAllContainersExcludingProjects(projects);
        IvyMultiResolveJob multiResolveJob = new IvyMultiResolveJob(allContainers);
        multiResolveJob.setRule(modifyRule);
        multiResolveJob.schedule();
View Full Code Here

        // Found an Ivy container in this project -- notify dependent projects
        // to perform fresh resolve

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the close operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(javaProject.getCorrespondingResource());
        class IvyClosedProjectJob extends WorkspaceJob {

            public IvyClosedProjectJob() {
                super("IvyClosedProjectJob");
            }
View Full Code Here

            return;
        }

        // Let's try to be nice and use the workspace method to schedule resolves in
        // dependent projects after the open operation has finished.
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule modifyRule = ruleFactory.modifyRule(ResourcesPlugin.getWorkspace()
                .getRoot());
        class IvyOpenProjectJob extends WorkspaceJob {

            public IvyOpenProjectJob() {
                super("IvyOpenProjectJob");
View Full Code Here

        }
    }

    private void run(ReplaceOperation operation, IResource resource) throws InvocationTargetException,
            InterruptedException {
        IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
        ISchedulingRule rule = ruleFactory.modifyRule(resource);

        PlatformUI.getWorkbench().getProgressService().runInUI(this, operation, rule);
    }
View Full Code Here

    return schedulingRule;
  }

  private static ISchedulingRule calcRefreshRule(IResource[] resources) {
    List<ISchedulingRule> rules = new ArrayList<ISchedulingRule>();
    IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace()
        .getRuleFactory();
    for (IResource resource : resources) {
      ISchedulingRule rule = ruleFactory.refreshRule(resource);
      if (rule != null)
        rules.add(rule);
    }
    if (rules.size() == 0)
      return null;
View Full Code Here

   * @param paths
   * @return scheduling rule
   */
  public static ISchedulingRule getRuleForContainers(Collection<IPath> paths) {
    List<ISchedulingRule> rules = new ArrayList<ISchedulingRule>();
    IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace()
        .getRuleFactory();
    for (IPath path : paths) {
      IResource resource = ResourceUtil.getResourceForLocation(path);
      if (resource != null) {
        IContainer container = resource.getParent();
        ISchedulingRule rule = ruleFactory.modifyRule(container);
        if (rule != null)
          rules.add(rule);
      }
    }
    if (rules.size() == 0)
View Full Code Here

    }
  }
 
  protected ISchedulingRule getSchedulingRule() {
    if (this.canChangeResources) {
      IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
      return new MultiRule(new ISchedulingRule[] {
        // use project modification rule as this is needed to create the .classpath file if it doesn't exist yet, or to update project references
        ruleFactory.modifyRule(this.project.getProject()),
       
        // and external project modification rule in case the external folders are modified
        ruleFactory.modifyRule(JavaModelManager.getExternalManager().getExternalFoldersProject())
      });
    }
    return super.getSchedulingRule();
  }
View Full Code Here

TOP

Related Classes of org.eclipse.core.resources.IResourceRuleFactory

Copyright © 2018 www.massapicom. 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.