Java Code Examples for org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeAttribute()

The following examples show how to use org.eclipse.debug.core.ILaunchConfigurationWorkingCopy#removeAttribute() . 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: XStartOnFirstThreadArgumentProcessor.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 6 votes vote down vote up
private void updateEclipse43(ILaunchConfigurationWorkingCopy launchConfig,
    IJavaProject javaProject, List<String> programArgs, List<String> vmArgs)
    throws CoreException {

  boolean startOnFirstThread = launchConfig.getAttribute(ATTR_XSTART_ON_FIRST_THREAD, false);

  if (needsStartOnFirstThreadHack(javaProject, launchConfig)) {
    /*
     * If we're on a mac, we might need the -XstartOnFirstThread attribute set to true in order to work
     * around a UI threading issue with the Mac platform.
     */
    if (!startOnFirstThread) {
      launchConfig.setAttribute(ATTR_XSTART_ON_FIRST_THREAD, true);
      launchConfig.doSave();
    }
  } else if (startOnFirstThread) {
    launchConfig.removeAttribute(ATTR_XSTART_ON_FIRST_THREAD);
    launchConfig.doSave();
  }
}
 
Example 2
Source File: Model.java    From tlaplus with MIT License 5 votes vote down vote up
private void copyAttributesFromForeignModelToWorkingCopy(final Model foreignModel,
		final ILaunchConfigurationWorkingCopy copy) throws CoreException {
	final ILaunchConfiguration foreignILC = foreignModel.getLaunchConfiguration();
	final Map<String, Object> workingCopyAttributes = copy.getAttributes();
	final Map<String, Object> foreignAttributes = foreignILC.getAttributes();

	for (final Map.Entry<String, Object> me : foreignAttributes.entrySet()) {
		copy.setAttribute(me.getKey(), me.getValue());
		workingCopyAttributes.remove(me.getKey());
	}
	
	for (final String key : workingCopyAttributes.keySet()) {
		copy.removeAttribute(key);
	}
}
 
Example 3
Source File: SARLAgentMainLaunchConfigurationTab.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy config) {
	final IJavaElement javaElement = getContext();
	if (javaElement != null) {
		initializeJavaProject(javaElement, config);
	} else {
		config.removeAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME);
	}
	initializeAgentName(javaElement, config);
	initializeContextIdentifierType(config);
	initializeLaunchOptions(config);
}
 
Example 4
Source File: LaunchConfigurationConfigurator.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
public void setRuntimeConfiguration(ILaunchConfigurationWorkingCopy configuration, ISREInstall sre,
		Boolean useSystemSre, Boolean useProjectSre, boolean resetJavaMainClass) {
	boolean system = useSystemSre == null ? DEFAULT_USE_SYSTEM_SRE : useSystemSre.booleanValue();
	boolean project = useProjectSre == null ? DEFAULT_USE_PROJECT_SRE : useProjectSre.booleanValue();
	if (system && project) {
		system = true;
		project = false;
	}
	// Save the SRE specific parameters
	if (sre != null) {
		configuration.setAttribute(
				ATTR_SARL_RUNTIME_ENVIRONMENT,
				sre.getId());
		final String mainClass = sre.getMainClass();
		if (resetJavaMainClass) {
			if (Strings.isNullOrEmpty(mainClass)) {
				configuration.removeAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME);
			} else {
				setMainJavaClass(configuration, mainClass);
			}
		}
	} else {
		configuration.removeAttribute(ATTR_SARL_RUNTIME_ENVIRONMENT);
		if (resetJavaMainClass) {
			configuration.removeAttribute(IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME);
		}
	}
	// Save the boolean configuration flags
	configuration.setAttribute(ATTR_USE_SYSTEM_SARL_RUNTIME_ENVIRONMENT, system);
	configuration.setAttribute(ATTR_USE_PROJECT_SARL_RUNTIME_ENVIRONMENT, project);
	// Use the default JRE
	configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, (String) null);
}
 
Example 5
Source File: ChromeExecutableTab.java    From wildwebdeveloper with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void setDefaults(ILaunchConfigurationWorkingCopy configuration) {
	configuration.removeAttribute(ChromeRunDAPDebugDelegate.RUNTIME_EXECUTABLE);
}
 
Example 6
Source File: GWTLaunchConfigurationWorkingCopy.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 4 votes vote down vote up
public static void removeSuperDevModeEnabled(ILaunchConfigurationWorkingCopy configuration) {
  configuration.removeAttribute(GWTLaunchAttributes.SUPERDEVMODE_ENABLED.getQualifiedName());
}