Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ICommand


  protected void addToBuildSpec(String builderID) throws CoreException {
    IProjectDescription description = project.getDescription();
    ICommand[] commands = description.getBuildSpec();
    int commandIndex = getCommandIndex(commands, builderID);
    if (commandIndex == -1) {
      ICommand command = description.newCommand();
      command.setBuilderName(builderID);
     
      // Add a build command to the build spec
      ICommand[] newCommands = ArrayUtil.prepend(command, commands);
      description.setBuildSpec(newCommands);
      project.setDescription(description, null);
View Full Code Here


    }
    return false;
  }

  private ICommand newBuilderCommand(IProjectDescription desc) {
    ICommand command = desc.newCommand();
    command.setBuilderName(SharpenBuilder.BUILDER_ID);
    return command;
  }
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(MackerBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

    // put the SymfonyBuilder on the first position as we need to
    // parse the xml/yml files before the php sources are being parses
    // so the definitions for ie. services can be resolved.
    System.arraycopy(commands, 0, newCommands, 1, commands.length);
   
    ICommand command = desc.newCommand();
    command.setBuilderName(SymfonyBuilder.BUILDER_ID);
    newCommands[0] = command;
    desc.setBuildSpec(newCommands);
    getProject().setDescription(desc, null);
  }
View Full Code Here

  }

  private void addBuilders(IProjectDescription description) {
    ICommand[] commands = new ICommand[builders.length];
    for (int i = 0; i < commands.length; i++) {
      ICommand cmd = description.newCommand();
      cmd.setBuilderName(builders[i]);
      commands[i] = cmd;
    }
    description.setBuildSpec(commands);
  }
View Full Code Here

      }
    }

    ICommand[] newCommands = new ICommand[commands.length + 1];
    System.arraycopy(commands, 0, newCommands, 1, commands.length);
    ICommand command = desc.newCommand();
    command.setBuilderName(PPUiConstants.MODULEFILE_BUILDER_ID);
    newCommands[0] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
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(ComponentBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

        return new ArrayList<ICommand>(Arrays.asList(desc.getBuildSpec()));
    }

    /** Make a new command (builder). */
    private ICommand newCommand(IProject project, String builderName) throws CoreException {
        ICommand cmd = project.getDescription().newCommand();
        cmd.setBuilderName(builderName);
        return cmd;
    }
View Full Code Here

   * Adds given builder to specified project.
   */
  public static void addProjectBuilder(IProject project, String builderID, IProgressMonitor monitor)
      throws CoreException {
    IProjectDescription desc = project.getDescription();
    ICommand builderCommand = getProjectBuilderCommand(desc, builderID);
    if (builderCommand == null) {

      // Add a new build spec
      ICommand command = desc.newCommand();
      command.setBuilderName(builderID);

      // Commit the spec change into the project
      addProjectBuilderCommand(desc, command);
      project.setDescription(desc, monitor);
    }
View Full Code Here

  /**
   * Adds (or updates) a builder in given project description.
   */
  public static void addProjectBuilderCommand(IProjectDescription description, ICommand command) throws CoreException {
    ICommand[] oldCommands = description.getBuildSpec();
    ICommand oldBuilderCommand = getProjectBuilderCommand(description, command.getBuilderName());
    ICommand[] newCommands;
    if (oldBuilderCommand == null) {

      // Add given builder to the end of the builder list
      newCommands = new ICommand[oldCommands.length + 1];
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.