Examples of ICommand


Examples of org.eclipse.core.resources.ICommand

    Assert.assertNotNull(main_html);
    Assert.assertNotNull(main_s3d);

    //add builder to project
    ICommand command = desc.newCommand();
    command.setBuilderName(XVRBuilder.BUILDER_ID);
    //Here we have to create builder command arguments(compiler and include locations)
    Map<String, String> args = new HashMap<String, String>();
    args.put(ARG_COMPILER_KEY, ARG_COMPILER_VAL);
    args.put(ARG_INCLUDE_KEY, ARG_INCLUDE_VAL);
    args.put(ARG_MAIN_KEY, main_s3d);
    args.put(ARG_MAIN_HTML_KEY, main_html);
    args.put(ARG_GLUT, ARG_GLUT_VAL);
    args.put(ARG_FS, ARG_FS_VAL);
    args.put(ARG_PARAM_FILE_KEY, ARG_PARAM_FILE_VAL);
    args.put(ARG_GLUT_PARAM_KEY, ARG_GLUT_PARAM_VAL);
    args.put(ARG_GLUT_PARAM_ACTIVE_KEY, ARG_GLUT_PARAM_ACTIVE_VAL);
    args.put(ARG_INCLUDE_DIRS_PARAM_KEY, ARG_INCLUDE_DIRS_PARAM_VAL);
   
    command.setArguments(args);
    desc.setBuildSpec(new ICommand[]{command});
    try {
      newProject.create(desc, new NullProgressMonitor());
      if (!newProject.isOpen())
        newProject.open(new NullProgressMonitor());
View Full Code Here

Examples of org.eclipse.core.resources.ICommand

        break;
      }
    }
    if (!found) {
      //add builder to project
      ICommand command = desc.newCommand();
      command.setBuilderName(XVRBuilder.BUILDER_ID);
      //Here we have to create builder command arguments(compiler and include locations)
      Map<String, String> args = new HashMap<String, String>();
      args.put(ARG_COMPILER_KEY, ARG_COMPILER_VAL);
      args.put(ARG_INCLUDE_KEY, ARG_INCLUDE_VAL);
      args.put(ARG_MAIN_KEY, main_location);
      args.put(ARG_MAIN_HTML_KEY, main_html);
      args.put(ARG_GLUT, ARG_GLUT_VAL);
      args.put(ARG_FS, ARG_FS_VAL);
      args.put(ARG_PARAM_FILE_KEY, ARG_PARAM_FILE_VAL);
      args.put(ARG_GLUT_PARAM_KEY, ARG_GLUT_PARAM_VAL);
      args.put(ARG_GLUT_PARAM_ACTIVE_KEY, ARG_GLUT_PARAM_ACTIVE_VAL);
      args.put(ARG_INCLUDE_DIRS_PARAM_KEY, ARG_INCLUDE_DIRS_PARAM_VAL);

      command.setArguments(args);
      ICommand[] newCommands = new ICommand[commands.length + 1];

      // Add it before other builders.
      System.arraycopy(commands, 0, newCommands, 1, commands.length);
      newCommands[0] = command;
View Full Code Here

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

Examples of org.eclipse.core.resources.ICommand

  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

Examples of org.eclipse.core.resources.ICommand

    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

Examples of org.eclipse.core.resources.ICommand

  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

Examples of org.eclipse.core.resources.ICommand

    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

Examples of org.eclipse.core.resources.ICommand

      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

Examples of org.eclipse.core.resources.ICommand

      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

Examples of org.eclipse.core.resources.ICommand

      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
TOP
Copyright © 2018 www.massapi.com. 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.