Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ICommand


    for (int i = 0; i < coms.length; i++) {
      if (coms[i].getBuilderName().equals(aBuilder) && coms[i].getArguments().equals(args))
        return;
    }
    ICommand[] newIc = null;
    ICommand command = desc.newCommand();
    command.setBuilderName(aBuilder);
    command.setArguments(args);
    newIc = new ICommand[coms.length + 1];
    if (installPos <= 0) {
      System.arraycopy(coms, 0, newIc, 1, coms.length);
      newIc[0] = command;
    } else if (installPos >= coms.length) {
View Full Code Here


   */
  private void installBuilder(String aBuilder) throws CoreException {
    IProjectDescription desc = null;
    ICommand[] coms = null;
    ICommand[] newIc = null;
    ICommand command = null;
    try {
      desc = this.getProject().getDescription();
      coms = desc.getBuildSpec();
      boolean foundJBuilder = false;
      for (int i = 0; i < coms.length; i++) {
        if (coms[i].getBuilderName().equals(aBuilder)) {
          foundJBuilder = true;
        }
      }
      if (!foundJBuilder) {
        command = desc.newCommand();
        command.setBuilderName(aBuilder);
        newIc = new ICommand[coms.length + 1];
        System.arraycopy(coms, 0, newIc, 0, coms.length);
        newIc[coms.length] = command;
        desc.setBuildSpec(newIc);
        this.getProject().setDescription(desc, null);
View Full Code Here

      ICommand[] builders = description.getBuildSpec();
      ICommand[] rearrangedBuilders = new ICommand[builders.length];

      int pos = 1;
      for (int i = 0; i < builders.length; i++) {
        ICommand current = builders[i];
        if (Builder.BUILDER_ID.equals(current.getBuilderName())) {
          rearrangedBuilders[0] = current;
        } else {
          rearrangedBuilders[pos] = current;
          pos++;
        }
View Full Code Here

      }
    }

    ICommand[] newCommands = new ICommand[commands.length + 1];
    System.arraycopy(commands, 0, newCommands, 0, commands.length);
    ICommand command = desc.newCommand();
    command.setBuilderName(Builder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

        }
        // add Drools builder
        ICommand[] newCommands = new ICommand[commands.length + 1];
        System.arraycopy(commands, 0, newCommands, 0, commands.length);

        ICommand droolsCommand = description.newCommand();
        droolsCommand.setBuilderName(DroolsBuilder.BUILDER_ID);
        newCommands[commands.length] = droolsCommand;
       
        description.setBuildSpec(newCommands);
        project.getProject().setDescription(description, monitor);
    }
View Full Code Here

    int javaCommandIndex = getJavaCommandIndex(description.getBuildSpec());

    if (javaCommandIndex == -1) {

      // Add a Java command to the build spec
      ICommand command = description.newCommand();
      command.setBuilderName(builderID);
      setJavaCommand(description, command);
    }
  }
View Full Code Here

    newCommands[newCommands.length - 1] = createBuildCommand(description, builderId);
    description.setBuildSpec(newCommands);
  }

  protected ICommand createBuildCommand(IProjectDescription description, String builderId) {
    ICommand command = description.newCommand();
    command.setBuilderName(builderId);
    return command;
  }
View Full Code Here

  public void configure() throws CoreException {
        IProject project = this.getProject();
        IProjectDescription desc = project.getDescription();
        IProgressMonitor monitor = new NullProgressMonitor();
       
        ICommand builderCommand = getBuilderCommand(desc, Constants.BUILDER_ID);
        if (builderCommand == null) {
       
            // Add a new build spec
            ICommand command = desc.newCommand();
            command.setBuilderName(Constants.BUILDER_ID);
       
            // Commit the spec change into the project
            setBuilderCommand(desc, command, monitor, project);
            project.setDescription(desc, monitor);
        }
View Full Code Here

  }
   
   

    private ICommand getBuilderCommand(IProjectDescription description, String builderId) {
        ICommand command = null;
        ICommand[] commands = description.getBuildSpec();
        for (int i = commands.length - 1; i >= 0; i--) {
            if (commands[i].getBuilderName().equals(builderId)) {
                command = commands[i];
                break;
View Full Code Here

        return command;
    }

    private void setBuilderCommand(IProjectDescription description, ICommand command, IProgressMonitor monitor, IProject project) throws CoreException {
        ICommand[] oldCommands = description.getBuildSpec();
        ICommand oldBuilderCommand = getBuilderCommand(description,
                                                     command.getBuilderName());
        ICommand[] newCommands;

        if (oldBuilderCommand == null) {
View Full Code Here

TOP

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

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.