Package org.eclipse.core.resources

Examples of org.eclipse.core.resources.ICommand


   
    this.rtcc = new RuntimeConfigurationCreator(this.container, SWT.FILL, "Add optional runtime parameters", this.getHelp(), this.getRegex());
    this.prop = null;
   
    IProject obj = (IProject) this.getElement();
    ICommand command = null;
    try {
      command = XVRUtils.getXVRBuilderCommand(obj);
    } catch (CoreException e) {
      e.printStackTrace();
    }
View Full Code Here


  public static void replaceBuilderProperty(IProject prj, String key, String val) throws Exception{
    IProjectDescription desc = prj.getDescription();

    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();

    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }
    if(!found)
      throw new Exception("XVR builder not found.");

    Map<String, String> arg = builder.getArguments();
    arg.put(key, val);
    builder.setArguments(arg);
    list.add(builder);
    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));
    prj.setDescription(desc,(IProject.KEEP_HISTORY | IProject.AVOID_NATURE_CONFIG), null);
  }
View Full Code Here

    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));
    prj.setDescription(desc,(IProject.KEEP_HISTORY | IProject.AVOID_NATURE_CONFIG), null);
  }

  public static Map<String, String> getBuilderArgs(IProject prj){
    ICommand command = null;
    try {
      command = XVRUtils.getXVRBuilderCommand(prj);
    } catch (CoreException e) {
      e.printStackTrace();
    }
   
    if(command == null){
      XVRUtils.displayError("The project does not contain xvr build command.");
      return null;
    }
   
    return command.getArguments();
  }
View Full Code Here

  public static void replaceBuilderProperties(IProject prj, String compiler, String vm, String includes/*, String cml*/, String fs) throws Exception{
    IProjectDescription desc = prj.getDescription();

    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();

    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }
    if(!found)
      throw new Exception("XVR builder not found.");

    Map<String, String> arg = builder.getArguments();

    if(compiler != null)
      arg.put(XVRProjectSupport.ARG_COMPILER_KEY, compiler);
    if(vm != null)
      arg.put(XVRProjectSupport.ARG_GLUT, vm);
    if(includes != null)
      arg.put(XVRProjectSupport.ARG_INCLUDE_DIRS_PARAM_KEY, includes);
    if(fs != null)
      arg.put(XVRProjectSupport.ARG_FS, fs);

    builder.setArguments(arg);
    list.add(builder);
    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));

    prj.setDescription(desc,IProject.FORCE, null);
    //prj.setDescription(desc,(IProject.KEEP_HISTORY | IProject.AVOID_NATURE_CONFIG), null);
View Full Code Here

    return commands[i];
  }
 
  public static String getBuilderPreferece(String pref_key, IProject prj) throws CoreException {
    ICommand c = getXVRBuilderCommand(prj);
    Map<String, String> args = c.getArguments();
    return args.get(pref_key);
  }
View Full Code Here

      throw new CoreException(new Status(Status.ERROR, XVRPlugin.PLUGIN_ID, "Exception while retrieving project description"));
    }

    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();

    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }

    Assert.assertTrue(found);

    Map<String, String> arg = builder.getArguments();

    IResource res = (IResource)((IAdaptable) element).getAdapter(IResource.class);

    String location = res.getProjectRelativePath().toOSString();
    arg.put(XVRProjectSupport.ARG_MAIN_HTML_KEY, location);
    builder.setArguments(arg);
    list.add(builder);
    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));
    try {
      prj.setDescription(desc,(IProject.KEEP_HISTORY | IProject.AVOID_NATURE_CONFIG), null);
    } catch (CoreException e) {
View Full Code Here

      throw new CoreException(new Status(Status.ERROR, XVRPlugin.PLUGIN_ID, "Exception while retrieving project description"));
    }

    ICommand[] commands = desc.getBuildSpec();
    boolean found = false;
    ICommand builder = null;
    ArrayList<ICommand> list = new ArrayList<ICommand>();

    for (int i = 0; i < commands.length; ++i){
      if ((found = commands[i].getBuilderName().equals(XVRBuilder.BUILDER_ID)))
        builder = commands[i];
      else
        list.add(commands[i]);
    }

    Assert.assertTrue(found);

    Map<String, String> arg = builder.getArguments();
    arg.put(builder_key, builder_val);
    builder.setArguments(arg);
    list.add(builder);
    desc.setBuildSpec(list.toArray(new ICommand[list.size()]));
    try {
      if(!prj.isSynchronized(IProject.DEPTH_INFINITE))
        prj.refreshLocal(IProject.DEPTH_INFINITE, null);
View Full Code Here

      ICommand[] buildSpec = description.getBuildSpec();
      ArrayList<ICommand> arrayList = new ArrayList<ICommand>(Arrays
          .asList(buildSpec));
      for (Iterator<ICommand> iterator = arrayList.iterator(); iterator
          .hasNext();) {
        ICommand iCommand = (ICommand) iterator.next();
        if (iCommand.getBuilderName().equals(BUILDER)) {
          iterator.remove();
        }
      }
      description.setBuildSpec(arrayList.toArray(new ICommand[arrayList
          .size()]));
View Full Code Here

        }
      }

      ArrayList<ICommand> arrayList = new ArrayList<ICommand>(Arrays
          .asList(buildSpec));
      ICommand newCommand = description.newCommand();
      newCommand.setBuilderName(BUILDER);
      arrayList.add(newCommand);
      description.setBuildSpec(arrayList.toArray(new ICommand[arrayList
          .size()]));
      javaGaeProject.getProject().setDescription(description,
          new NullProgressMonitor());
View Full Code Here

      }
    }

    if (!found)
    {
      ICommand newCommand = description.newCommand();
      newCommand.setBuilderName(name);
      if (argumentKey != null && argumentValue != null)
      {
        @SuppressWarnings("rawtypes")
        Map arguments = new HashMap<String, String>();
        arguments.put(argumentKey, argumentValue);
        newCommand.setArguments(arguments);
      }

      buildCommands.add(newCommand);

    }
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.