@Override public void initializeFrom(ILaunchConfiguration config) { try { if (config.hasAttribute(DEFAULTS_SET) == false) { ILaunchConfigurationWorkingCopy wc; wc = config.getWorkingCopy(); setDefaults(wc); wc.doSave(); } } catch (CoreException e) { } super.initializeFrom(config); }
/* * When the launch configuration is created for Run mode, this Debugger tab * is not created because it is not used for Run mode but only for Debug * mode. When we then open the same configuration in Debug mode, the launch * configuration already exists and initializeFrom() is called instead of * setDefaults(). We therefore call setDefaults() ourselves and update the * configuration. If we don't then the user will be required to press Apply * to get the default settings saved. Bug 281970 */ @Override public void setDefaults(ILaunchConfigurationWorkingCopy config) { config.setAttribute(DEFAULTS_SET, true); super.setDefaults(config); }