Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ICommand


    }
   
    ICommand[] cmds = description.getBuildSpec();
    List<ICommand> cmdsList = new LinkedList<ICommand>();
    cmdsList.addAll(Arrays.asList(cmds));
    ICommand removeCmd = null;
    for (ICommand cmd : cmdsList) {
      if(cmd.getBuilderName().equals(BUILDER_ID)) {
        removeCmd = cmd;
      }
    }
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(BBQBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

             break;
          }
       }
       if (!found) {
          //add builder to project
          ICommand command = desc.newCommand();
          command.setBuilderName(BUILDER_ID);
          ICommand[] newCommands = new ICommand[commands.length];

          newCommands[0] = command;
          desc.setBuildSpec(newCommands);
          project.setDescription(desc, null);
View Full Code Here

      return;
    }

    // install builder
    IProjectDescription description = project.getDescription();
    final ICommand buildCommand = description.newCommand();
    buildCommand.setBuilderName(ComposerBuildPathManagementBuilder.ID);

    final List<ICommand> commands = new ArrayList<ICommand>();
    commands.add(buildCommand);
    commands.addAll(Arrays.asList(description.getBuildSpec()));
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(UniversalCppBuilder.BUILDER_ID);
    newCommands[newCommands.length - 1] = command;
    desc.setBuildSpec(newCommands);
    project.setDescription(desc, null);
  }
View Full Code Here

   * with default parameters
   * @throws CoreException
   */
  private void checkAndAddBuilder() throws CoreException{
    ArrayList<ICommand> commandList=new ArrayList<ICommand>();
    ICommand hdlCommand=null;

    IProjectDescription description;
    description = getProject().getDescription();
    for(ICommand command: description.getBuildSpec()){
      //try to find an existing builder in the list of builders
      if(command.getBuilderName().startsWith(SIMULATOR_ID)){
        hdlCommand=command;
      }
      commandList.add(command);
    }       
    //if no hdl command was found
    if(hdlCommand==null){
      //make a new one
      hdlCommand = description.newCommand();
      hdlCommand.setBuilderName(SIMULATOR_ID);
      //add it to the list of builders
      commandList.add(hdlCommand);
      //set the arguments
      Map<String,String> args=BuildConfig.encodeArgs(new BuildConfig[]{new BuildConfig()});
      hdlCommand.setArguments(args);
      //set the builders
      description.setBuildSpec(commandList.toArray(new ICommand[0]));
      getProject().setDescription(description, null);
    }   
   
View Full Code Here

  /**
   * Sets the commands based on the given arguments
   */
  public void setCommands(BuildConfig[] buildConfig){
    ArrayList<ICommand> buildConfigList=new ArrayList<ICommand>();
    ICommand hdlCommand=null;
   
    try
    {
      IProjectDescription description;
      description = getProject().getDescription();
     
      //
      // If the user blew away the builder we may need to add it back in
      checkAndAddBuilder();
           
      for(ICommand command: description.getBuildSpec()){
        //try to find an existing builder in the list of builders
        if(command.getBuilderName().startsWith(SIMULATOR_ID)){
          hdlCommand=command;
        }
        buildConfigList.add(command);
      }       
           
      if(hdlCommand!=null){
        //set the arguments
        Map<String,String> args=BuildConfig.encodeArgs(buildConfig);
        hdlCommand.setArguments(args);
      }       
      //set the builders
      description.setBuildSpec(buildConfigList.toArray(new ICommand[0]));
      getProject().setDescription(description, null);
    }
View Full Code Here

    for(int i=0;i<commands.length;i++){
      if(commands[i].getBuilderName().equals(HTML_BUILDER_ID)){
        return;
      }
    }
    ICommand command = desc.newCommand();
    command.setBuilderName(HTML_BUILDER_ID);
    ICommand[] newCommands = new ICommand[commands.length + 1];
    for(int i=0;i<commands.length;i++){
      newCommands[i] = commands[i];
    }
    newCommands[newCommands.length - 1] = command;
View Full Code Here

    try {
      IProjectDescription desc = this.getUnderlyingProject().getDescription();
      List cmdList = Arrays.asList(desc.getBuildSpec());
      Iterator iter = cmdList.iterator();
      while (iter.hasNext()) {
        ICommand cmd = (ICommand) iter.next();
        if (this.isWOLipsBuilder(cmd.getBuilderName())) {
          result = cmd.getArguments();
          break;
        }
      }
    } catch (Exception up) {
      // if anything went wrong, we simply don't have any args (yet)
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.getUnderlyingProject().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.getUnderlyingProject().setDescription(desc, 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.