Java Code Examples for org.eclipse.debug.ui.DebugUITools#getLaunchGroups()

The following examples show how to use org.eclipse.debug.ui.DebugUITools#getLaunchGroups() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebAppProjectCreator.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
protected void createLaunchConfig(IProject project) throws CoreException {
  // If the default SDK is GWT 2.7 or greater, turn on GWT super dev mode by default.
  boolean turnOnGwtSuperDevMode = GwtVersionUtil.isGwtVersionGreaterOrEqualTo27(JavaCore.create(project));

  ILaunchConfigurationWorkingCopy wc = WebAppLaunchUtil.createLaunchConfigWorkingCopy(project.getName(), project,
      WebAppLaunchUtil.determineStartupURL(project, false), false, turnOnGwtSuperDevMode);
  ILaunchGroup[] groups = DebugUITools.getLaunchGroups();

  ArrayList<String> groupsNames = new ArrayList<String>();
  for (ILaunchGroup group : groups) {
    if (IDebugUIConstants.ID_DEBUG_LAUNCH_GROUP.equals(group.getIdentifier())
        || IDebugUIConstants.ID_RUN_LAUNCH_GROUP.equals(group.getIdentifier())) {
      groupsNames.add(group.getIdentifier());
    }
  }

  wc.setAttribute(IDebugUIConstants.ATTR_FAVORITE_GROUPS, groupsNames);
  wc.doSave();
}
 
Example 2
Source File: LaunchConfigSelectionHistory.java    From eclipse-extras with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public synchronized boolean remove( Object element ) {
  boolean removed = false;
  if( contains( element ) ) {
    for( ILaunchGroup launchGroup : DebugUITools.getLaunchGroups() ) {
      LaunchHistory launchHistory = getLaunchHistory( launchGroup );
      if( launchHistory != null ) {
        launchHistory.removeFromHistory( ( ILaunchConfiguration )element );
      }
    }
    removed = true;
    launchConfigHistory = null;
  }
  return removed;
}
 
Example 3
Source File: NewWebAppProjectWizard.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * We initialize these members here so that finishPage can access them without triggering a SWT
 * InvalidThreadAccessException.
 */
@Override
public boolean performFinish() {
  projectName = newProjectWizardPage.getProjectName();
  useGWT = newProjectWizardPage.useGWT();
  gwtSdkContainerPath = newProjectWizardPage.getGWTSdkContainerPath();
  packageName = newProjectWizardPage.getPackage();
  locationURI = newProjectWizardPage.getCreationLocationURI();
  isGenerateEmptyProject = newProjectWizardPage.isGenerateEmptyProject();
  buildAnt = newProjectWizardPage.getBuildAnt();
  buildMaven = newProjectWizardPage.getBuildMaven();

  /**
   * HACK: We need to make sure that the DebugUITools plugin (and the DebugUIPlugin plugin) is loaded via the main
   * thread. before we call super.performFinish(). Otherwise, a race condition in Eclipse 3.5 occurs where
   * LaunchConfigurationManager.loadLaunchGroups() is called from two threads. The first call comes from our query for
   * launch groups in WebAppProjectCreator.createLaunchConfiguration() (which is part of a ModalContext runnable). The
   * second comes about due to the initialization of the DebugUIPlugin plugin (which we cause, by accessing classes in
   * this plugin through the DebugUITools plugin).
   */
  DebugUITools.getLaunchGroups();

  boolean finished = super.performFinish();
  if (finished) {
    // TODO: See JavaProjectWizard to see how to switch to Java perspective
    // and open new element
  }
  return finished;
}