Package org.eclipse.debug.core

Examples of org.eclipse.debug.core.ILaunchConfiguration


     * Customize launch configuration for setting grinder.properties attributes.
     */
    @Override
    public ILaunchConfiguration createDefaultLaunchConfiguration(FileOrResource[] resource) {

        ILaunchConfiguration conf = super.createDefaultLaunchConfiguration(resource);

        if (!propertiesShouldBeSetManually) {
            FileOrResource fileOrResource = resource[0];
            if (fileOrResource.resource == null) {
                reportError("The grinder.properties cannot be set for a run. "
                                + "Project cannot be located.", null);
            }
            String projName = fileOrResource.resource.getProject().getName();
            IStringVariableManager varManager = VariablesPlugin.getDefault()
                            .getStringVariableManager();
            String location = varManager.generateVariableExpression(GrinderConstants.WORKSPACE_LOC,
                            projName + File.separator
                                            + GrinderConstants.GRINDER_PROPERTIES_FILE_NAME);
            try {
                ILaunchConfigurationWorkingCopy workingCopy = conf.copy(conf.getName());
                workingCopy.setAttribute(GrinderConstants.ATTR_GRINDER_PROPERTIES_LOCATION,
                                location);
                conf.delete();
                conf = workingCopy.doSave();
            } catch (CoreException e) {
                reportError("The grinder.properties cannot be set for a run.", e);
            }
        }
View Full Code Here


    state.setBehaviorMethod("shouldAddUp");
    ILaunchConfigurationWorkingCopy wc = configType.newInstance(
        null, lm.generateUniqueLaunchConfigurationNameFrom(state.getName()));

    state.setAttributes(wc);
    ILaunchConfiguration config = wc.doSave();
 
    IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager();
    final TextConsole[] console=new TextConsole[1];       
    manager.addConsoleListener(new IConsoleListener(){
      public void consolesAdded(IConsole[] consoles) {
View Full Code Here

      launch(state, mode);
    }
  }
 
  private void launch(ConfigurationState state, String mode) throws LaunchCancelledByUserException {
    ILaunchConfiguration config = findLaunchConfiguration(
      mode,
      state,
      ""//$NON-NLS-1$
      "" //$NON-NLS-1$
    );
View Full Code Here

      return (ILaunchConfiguration) candidateConfigs.get(0);
    } else {
      // Prompt the user to choose a config.  A null result means the user
      // cancelled the dialog, in which case this method returns null,
      // since cancelling the dialog should also cancel launching anything.
      ILaunchConfiguration config= chooseConfiguration(candidateConfigs, mode);
      if (config != null) {
        return config;
      }
    }
    return null;
View Full Code Here

    }
  }
 

  private ILaunchConfiguration createConfiguration(ConfigurationState state) {
    ILaunchConfiguration config= null;
    try {
      ILaunchConfigurationType configType= getJBehaveLaunchConfigType();
      ILaunchConfigurationWorkingCopy wc = configType.newInstance(
          null, DebugPlugin.getDefault().getLaunchManager().generateUniqueLaunchConfigurationNameFrom(state.getName()));
      state.setAttributes(wc);
View Full Code Here

  class FavoritesContentProvider implements IStructuredContentProvider {

    public Object[] getElements(Object inputElement) {
      ILaunchGroup[] groups = DebugUITools.getLaunchGroups();
      List possibleGroups = new ArrayList();
      ILaunchConfiguration configuration = (ILaunchConfiguration) inputElement;
      for (int i = 0; i < groups.length; i++) {
        ILaunchGroup extension = groups[i];
        LaunchHistory history = getLaunchConfigurationManager().getLaunchHistory(
                extension.getIdentifier());
        if (history != null && history.accepts(configuration)) {
View Full Code Here

        return null;
      }
    } catch (CoreException e) {
      return null;
    }
    ILaunchConfiguration lastRun = DebugUITools
            .getLastLaunch("org.eclipse.debug.ui.launchGroup.run");
    String scriptName = LaunchConfigurationUtils.getString(lastRun,
            ScriptLaunchConfigurationConstants.ATTR_MAIN_SCRIPT_NAME, "");
    if (scriptName != null && scriptName.length() != 0 && new Path(scriptName).segmentCount() > 0
            && Path.ROOT.isValidPath(scriptName)) {
View Full Code Here

        copy.setAttribute(RutaLaunchConstants.INPUT_FOLDER, inputDirPath);
        // do not use RutaLaunchConstants.ARG_OUTPUT_FOLDER here
        copy.setAttribute(RutaLaunchConstants.OUTPUT_FOLDER, outputDirPath);
        copy.setAttribute(RutaLaunchConstants.ARG_DESCRIPTOR, descriptorAbsolutePath);
        copy.setAttribute(RutaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
        ILaunchConfiguration lc = copy.doSave();

        String mode = ILaunchManager.RUN_MODE;
        ILaunch launch = new Launch(lc, mode, null);

        ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();

        ILaunch launched = launchConfiguration.launch(ILaunchManager.RUN_MODE, monitor);

        while (!launched.isTerminated()) {
          try {
            Thread.sleep(100);
          } catch (InterruptedException e) {
View Full Code Here

    if(selection instanceof IStructuredSelection){
      Object element = ((IStructuredSelection)selection).getFirstElement();
      if(element != null && element instanceof IFile){
        try {
          IFile file = (IFile)element;
          ILaunchConfiguration config = getLaunchConfiguration(file);
          config.launch("run", new NullProgressMonitor());
        } catch(Exception ex){
          HTMLPlugin.logException(ex);
        }
      }
    }
View Full Code Here

  public void launch(IEditorPart editor, String mode) {
    IEditorInput input = editor.getEditorInput();
    if(input instanceof IFileEditorInput){
      try {
        IFile file = ((IFileEditorInput)input).getFile();
        ILaunchConfiguration config = getLaunchConfiguration(file);
        config.launch("run", new NullProgressMonitor());
      } catch(Exception ex){
        HTMLPlugin.logException(ex);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.debug.core.ILaunchConfiguration

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.