View | Details | Raw Unified | Return to bug 309701 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/launching/launcher/BundleLauncherHelper.java (-19 / +56 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2007, 2010 IBM Corporation and others.
2
 * Copyright (c) 2007, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 32-38 Link Here
32
	 * simple configurator and update configurator, we change the start level as they 
32
	 * simple configurator and update configurator, we change the start level as they 
33
	 * shouldn't be started together.
33
	 * shouldn't be started together.
34
	 */
34
	 */
35
	public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL = "3:true"; //$NON-NLS-1$
35
	public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT = "3"; //$NON-NLS-1$
36
	public static final String DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT = "true"; //$NON-NLS-1$
37
	public static final String DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL = DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT + ":" + DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT; //$NON-NLS-1$
36
38
37
	public static final char VERSION_SEPARATOR = '*';
39
	public static final char VERSION_SEPARATOR = '*';
38
40
Lines 358-363 Link Here
358
		return map;
360
		return map;
359
	}
361
	}
360
362
363
	public static String resolveSystemRunLevelText(IPluginModelBase model) {
364
		BundleDescription description = model.getBundleDescription();
365
		String modelName = description.getSymbolicName();
366
367
		if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) {
368
			return "1"; //$NON-NLS-1$ 
369
		} else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) {
370
			return "1"; //$NON-NLS-1$
371
		} else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) {
372
			return "2"; //$NON-NLS-1$
373
		} else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) {
374
			return "-1"; //$NON-NLS-1$
375
		} else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) {
376
			return DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL_TEXT;
377
		} else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) {
378
			if (TargetPlatformHelper.getTargetVersion() > 3.1) {
379
				return "default"; //$NON-NLS-1$
380
			}
381
			return "2"; //$NON-NLS-1$
382
		} else {
383
			return null;
384
		}
385
	}
386
387
	public static String resolveSystemAutoText(IPluginModelBase model) {
388
		BundleDescription description = model.getBundleDescription();
389
		String modelName = description.getSymbolicName();
390
391
		if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) {
392
			return "true"; //$NON-NLS-1$ 
393
		} else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) {
394
			return "true"; //$NON-NLS-1$
395
		} else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) {
396
			return "true"; //$NON-NLS-1$
397
		} else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) {
398
			return "true"; //$NON-NLS-1$
399
		} else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) {
400
			return DEFAULT_UPDATE_CONFIGURATOR_AUTO_START_TEXT;
401
		} else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) {
402
			if (TargetPlatformHelper.getTargetVersion() > 3.1) {
403
				return "true"; //$NON-NLS-1$
404
			}
405
			return "true"; //$NON-NLS-1$
406
		} else {
407
			return null;
408
		}
409
	}
410
361
	/**
411
	/**
362
	 * Adds the given bundle and start information to the map.  This will override anything set
412
	 * Adds the given bundle and start information to the map.  This will override anything set
363
	 * for system bundles, and set their start level to the appropriate level
413
	 * for system bundles, and set their start level to the appropriate level
Lines 369-391 Link Here
369
		BundleDescription desc = bundle.getBundleDescription();
419
		BundleDescription desc = bundle.getBundleDescription();
370
		boolean defaultsl = (sl == null || sl.equals("default:default")); //$NON-NLS-1$
420
		boolean defaultsl = (sl == null || sl.equals("default:default")); //$NON-NLS-1$
371
		if (desc != null && defaultsl) {
421
		if (desc != null && defaultsl) {
372
			String modelName = desc.getSymbolicName();
422
			String runLevelText = resolveSystemRunLevelText(bundle);
373
			if (IPDEBuildConstants.BUNDLE_DS.equals(modelName)) {
423
			String autoText = resolveSystemAutoText(bundle);
374
				map.put(bundle, "1:true"); //$NON-NLS-1$ 
424
			if (runLevelText != null && autoText != null) {
375
			} else if (IPDEBuildConstants.BUNDLE_SIMPLE_CONFIGURATOR.equals(modelName)) {
425
				map.put(bundle, runLevelText + ":" + autoText); //$NON-NLS-1$
376
				map.put(bundle, "1:true"); //$NON-NLS-1$
377
			} else if (IPDEBuildConstants.BUNDLE_EQUINOX_COMMON.equals(modelName)) {
378
				map.put(bundle, "2:true"); //$NON-NLS-1$
379
			} else if (IPDEBuildConstants.BUNDLE_OSGI.equals(modelName)) {
380
				map.put(bundle, "-1:true"); //$NON-NLS-1$
381
			} else if (IPDEBuildConstants.BUNDLE_UPDATE_CONFIGURATOR.equals(modelName)) {
382
				map.put(bundle, DEFAULT_UPDATE_CONFIGURATOR_START_LEVEL);
383
			} else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(modelName)) {
384
				if (TargetPlatformHelper.getTargetVersion() > 3.1) {
385
					map.put(bundle, "default:true"); //$NON-NLS-1$
386
				} else {
387
					map.put(bundle, "2:true"); //$NON-NLS-1$
388
				}
389
			} else {
426
			} else {
390
				map.put(bundle, sl);
427
				map.put(bundle, sl);
391
			}
428
			}
(-)src/org/eclipse/pde/internal/ui/launcher/AbstractPluginBlock.java (-42 / +68 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
2
 * Copyright (c) 2005, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 13-18 Link Here
13
package org.eclipse.pde.internal.ui.launcher;
13
package org.eclipse.pde.internal.ui.launcher;
14
14
15
import java.util.*;
15
import java.util.*;
16
import java.util.List;
16
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.resources.IProject;
17
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.resources.IResource;
18
import org.eclipse.core.runtime.*;
19
import org.eclipse.core.runtime.*;
Lines 93-98 Link Here
93
94
94
	private PluginStatusDialog fDialog;
95
	private PluginStatusDialog fDialog;
95
96
97
	class PluginModelNameBuffer {
98
		private List nameList;
99
100
		PluginModelNameBuffer() {
101
			super();
102
			nameList = new ArrayList();
103
		}
104
105
		void add(IPluginModelBase model) {
106
			nameList.add(getPluginName(model));
107
		}
108
109
		private String getPluginName(IPluginModelBase model) {
110
			String startLevel = null;
111
			String autoStart = null;
112
			if (fPluginTreeViewer.getChecked(model)) {
113
				startLevel = levelColumnCache.get(model) != null ? levelColumnCache.get(model).toString() : null;
114
				autoStart = autoColumnCache.get(model) != null ? autoColumnCache.get(model).toString() : null;
115
			}
116
			return BundleLauncherHelper.writeBundleEntry(model, startLevel, autoStart);
117
		}
118
119
		public String toString() {
120
			Collections.sort(nameList);
121
			StringBuffer result = new StringBuffer();
122
			for (Iterator iterator = nameList.iterator(); iterator.hasNext();) {
123
				String name = (String) iterator.next();
124
				if (result.length() > 0)
125
					result.append(',');
126
				result.append(name);
127
			}
128
129
			if (result.length() == 0)
130
				return null;
131
132
			return result.toString();
133
		}
134
	}
135
96
	/**
136
	/**
97
	 * Label provider for the tree.
137
	 * Label provider for the tree.
98
	 */
138
	 */
Lines 103-117 Link Here
103
		}
143
		}
104
144
105
		public String getColumnText(Object obj, int index) {
145
		public String getColumnText(Object obj, int index) {
146
			boolean isChecked = fPluginTreeViewer.getChecked(obj);
106
			switch (index) {
147
			switch (index) {
107
				case 0 :
148
				case 0 :
108
					return super.getColumnText(obj, index);
149
					return super.getColumnText(obj, index);
109
				case 1 :
150
				case 1 :
110
					if (levelColumnCache != null && levelColumnCache.containsKey(obj))
151
					if (isChecked && levelColumnCache != null && levelColumnCache.containsKey(obj))
111
						return (String) levelColumnCache.get(obj);
152
						return (String) levelColumnCache.get(obj);
112
					return ""; //$NON-NLS-1$
153
					return ""; //$NON-NLS-1$
113
				case 2 :
154
				case 2 :
114
					if (autoColumnCache != null && autoColumnCache.containsKey(obj))
155
					if (isChecked && autoColumnCache != null && autoColumnCache.containsKey(obj))
115
						return (String) autoColumnCache.get(obj);
156
						return (String) autoColumnCache.get(obj);
116
					return ""; //$NON-NLS-1$
157
					return ""; //$NON-NLS-1$
117
				default :
158
				default :
Lines 596-630 Link Here
596
	protected void resetText(IPluginModelBase model) {
637
	protected void resetText(IPluginModelBase model) {
597
		String levelText = ""; //$NON-NLS-1$
638
		String levelText = ""; //$NON-NLS-1$
598
		String autoText = ""; //$NON-NLS-1$
639
		String autoText = ""; //$NON-NLS-1$
599
		String systemBundleId = PDECore.getDefault().getModelManager().getSystemBundleId();
640
600
		boolean isSystemBundle = systemBundleId.equals(model.getPluginBase().getId());
601
		if (model.isFragmentModel()) {
602
			autoText = "false"; //$NON-NLS-1$
603
		} else if (IPDEBuildConstants.BUNDLE_CORE_RUNTIME.equals(model.getPluginBase().getId()) || "org.eclipse.equinox.ds".equals(model.getPluginBase().getId())) { //$NON-NLS-1$
604
			autoText = "true"; //$NON-NLS-1$
605
		}
606
		Widget widget = fPluginTreeViewer.testFindItem(model);
641
		Widget widget = fPluginTreeViewer.testFindItem(model);
607
		if (fPluginTreeViewer.getChecked(model)) {
642
		if (fPluginTreeViewer.getChecked(model)) {
608
			if (levelColumnCache.containsKey(model) && !isSystemBundle) {
643
			levelText = (String) levelColumnCache.get(model);
609
				levelText = (String) levelColumnCache.get(model);
644
			levelText = levelText == null || levelText.length() == 0 ? "default" : levelText; //$NON-NLS-1$
610
				levelText = levelText.length() > 0 ? levelText : "default"; //$NON-NLS-1$
645
			autoText = (String) autoColumnCache.get(model);
611
			}
646
			autoText = autoText == null || autoText.length() == 0 ? "default" : autoText; //$NON-NLS-1$
612
			if (autoColumnCache.containsKey(model) && !isSystemBundle) {
647
613
				autoText = (String) autoColumnCache.get(model);
648
			// Replace run levels and auto start values for certain important system bundles
614
				autoText = autoText.length() > 0 ? autoText : "default"; //$NON-NLS-1$
649
			String systemValue = BundleLauncherHelper.resolveSystemRunLevelText(model);
615
			}
650
			levelText = systemValue != null ? systemValue : levelText;
616
		}
651
617
		if (levelText != null) {
652
			systemValue = BundleLauncherHelper.resolveSystemAutoText(model);
653
			autoText = systemValue != null ? systemValue : autoText;
654
655
			// Recache the values in case they changed.  I believe the code to only recache
656
			// if they actually changed takes more time than just setting the value.
618
			levelColumnCache.put(model, levelText);
657
			levelColumnCache.put(model, levelText);
619
			if (widget instanceof TreeItem) {
620
				((TreeItem) widget).setText(1, levelText);
621
			}
622
		}
623
		if (autoText != null) {
624
			autoColumnCache.put(model, autoText);
658
			autoColumnCache.put(model, autoText);
625
			if (widget instanceof TreeItem) {
659
		}
626
				((TreeItem) widget).setText(2, autoText);
660
627
			}
661
		// Set values in UI (although I'm not sure why we don't use the label provider here)
662
		if (widget instanceof TreeItem) {
663
			((TreeItem) widget).setText(1, levelText);
664
		}
665
666
		if (widget instanceof TreeItem) {
667
			((TreeItem) widget).setText(2, autoText);
628
		}
668
		}
629
	}
669
	}
630
670
Lines 989-1008 Link Here
989
		}
1029
		}
990
	}
1030
	}
991
1031
992
	protected void appendToBuffer(StringBuffer buffer, IPluginModelBase model) {
993
		if (buffer.length() > 0)
994
			buffer.append(","); //$NON-NLS-1$ 
995
996
		String startLevel = null;
997
		String autoStart = null;
998
		if (fPluginTreeViewer.getChecked(model)) {
999
			startLevel = levelColumnCache.get(model) != null ? levelColumnCache.get(model).toString() : null;
1000
			autoStart = autoColumnCache.get(model) != null ? autoColumnCache.get(model).toString() : null;
1001
		}
1002
		String value = BundleLauncherHelper.writeBundleEntry(model, startLevel, autoStart);
1003
		buffer.append(value);
1004
	}
1005
1006
	protected void resetGroup(NamedElement group) {
1032
	protected void resetGroup(NamedElement group) {
1007
		Widget widget = fPluginTreeViewer.testFindItem(group);
1033
		Widget widget = fPluginTreeViewer.testFindItem(group);
1008
		if (widget instanceof TreeItem) {
1034
		if (widget instanceof TreeItem) {
(-)src/org/eclipse/pde/internal/ui/launcher/ConfigurationAreaBlock.java (-7 / +16 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
2
 * Copyright (c) 2005, 2011 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 29-35 Link Here
29
	private Button fUseDefaultLocationButton;
29
	private Button fUseDefaultLocationButton;
30
	private Button fClearConfig;
30
	private Button fClearConfig;
31
	private String fLastEnteredConfigArea;
31
	private String fLastEnteredConfigArea;
32
	private String fConfigName;
32
	private String fLastKnownConfigName;
33
	private static String DEFAULT_DIR = "${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/"; //$NON-NLS-1$
33
	private static String DEFAULT_DIR = "${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/"; //$NON-NLS-1$
34
34
35
	public ConfigurationAreaBlock(AbstractLauncherTab tab) {
35
	public ConfigurationAreaBlock(AbstractLauncherTab tab) {
Lines 51-57 Link Here
51
			public void widgetSelected(SelectionEvent e) {
51
			public void widgetSelected(SelectionEvent e) {
52
				boolean useDefaultArea = fUseDefaultLocationButton.getSelection();
52
				boolean useDefaultArea = fUseDefaultLocationButton.getSelection();
53
				if (useDefaultArea)
53
				if (useDefaultArea)
54
					fLocationText.setText(DEFAULT_DIR + fConfigName);
54
					fLocationText.setText(DEFAULT_DIR + fLastKnownConfigName);
55
				else
55
				else
56
					fLocationText.setText(fLastEnteredConfigArea);
56
					fLocationText.setText(fLastEnteredConfigArea);
57
				enableBrowseSection(!useDefaultArea);
57
				enableBrowseSection(!useDefaultArea);
Lines 80-86 Link Here
80
	}
80
	}
81
81
82
	public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
82
	public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
83
		fConfigName = configuration.getName();
83
		fLastKnownConfigName = configuration.getName();
84
		boolean useDefaultArea = configuration.getAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true);
84
		boolean useDefaultArea = configuration.getAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, true);
85
		fUseDefaultLocationButton.setSelection(useDefaultArea);
85
		fUseDefaultLocationButton.setSelection(useDefaultArea);
86
		enableBrowseSection(!useDefaultArea);
86
		enableBrowseSection(!useDefaultArea);
Lines 92-105 Link Here
92
		fLastEnteredConfigArea = configuration.getAttribute(IPDELauncherConstants.CONFIG_LOCATION, ""); //$NON-NLS-1$
92
		fLastEnteredConfigArea = configuration.getAttribute(IPDELauncherConstants.CONFIG_LOCATION, ""); //$NON-NLS-1$
93
93
94
		if (useDefaultArea)
94
		if (useDefaultArea)
95
			fLocationText.setText(DEFAULT_DIR + fConfigName);
95
			fLocationText.setText(DEFAULT_DIR + fLastKnownConfigName);
96
		else
96
		else
97
			fLocationText.setText(fLastEnteredConfigArea);
97
			fLocationText.setText(fLastEnteredConfigArea);
98
	}
98
	}
99
99
100
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
100
	public void performApply(ILaunchConfigurationWorkingCopy configuration) {
101
		configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, fUseDefaultLocationButton.getSelection());
101
		configuration.setAttribute(IPDELauncherConstants.CONFIG_USE_DEFAULT_AREA, fUseDefaultLocationButton.getSelection());
102
		fLastEnteredConfigArea = getLocation();
102
103
		if (!fLastKnownConfigName.equals(configuration.getName())) {
104
			fLastKnownConfigName = configuration.getName();
105
			if (fUseDefaultLocationButton.getSelection()) {
106
				fLastEnteredConfigArea = DEFAULT_DIR + fLastKnownConfigName;
107
				fLocationText.setText(fLastEnteredConfigArea);
108
			} else {
109
				fLastEnteredConfigArea = getLocation();
110
			}
111
		}
112
103
		configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, fLastEnteredConfigArea);
113
		configuration.setAttribute(IPDELauncherConstants.CONFIG_LOCATION, fLastEnteredConfigArea);
104
		configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, fClearConfig.getSelection());
114
		configuration.setAttribute(IPDELauncherConstants.CONFIG_CLEAR_AREA, fClearConfig.getSelection());
105
	}
115
	}
Lines 132-136 Link Here
132
			return null;
142
			return null;
133
		return super.validate();
143
		return super.validate();
134
	}
144
	}
135
136
}
145
}
(-)src/org/eclipse/pde/internal/ui/launcher/OSGiBundleBlock.java (-13 / +14 lines)
Lines 11-25 Link Here
11
 *******************************************************************************/
11
 *******************************************************************************/
12
package org.eclipse.pde.internal.ui.launcher;
12
package org.eclipse.pde.internal.ui.launcher;
13
13
14
import org.eclipse.pde.launching.IPDELauncherConstants;
15
16
import org.eclipse.pde.internal.launching.launcher.*;
17
18
import java.util.*;
14
import java.util.*;
19
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.core.runtime.CoreException;
20
import org.eclipse.debug.core.ILaunchConfiguration;
16
import org.eclipse.debug.core.ILaunchConfiguration;
21
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
17
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
22
import org.eclipse.pde.core.plugin.IPluginModelBase;
18
import org.eclipse.pde.core.plugin.IPluginModelBase;
19
import org.eclipse.pde.internal.launching.launcher.*;
20
import org.eclipse.pde.launching.IPDELauncherConstants;
23
import org.eclipse.pde.ui.launcher.BundlesTab;
21
import org.eclipse.pde.ui.launcher.BundlesTab;
24
22
25
public class OSGiBundleBlock extends AbstractPluginBlock {
23
public class OSGiBundleBlock extends AbstractPluginBlock {
Lines 32-62 Link Here
32
30
33
	protected void savePluginState(ILaunchConfigurationWorkingCopy config) {
31
	protected void savePluginState(ILaunchConfigurationWorkingCopy config) {
34
		Object[] selected = fPluginTreeViewer.getCheckedElements();
32
		Object[] selected = fPluginTreeViewer.getCheckedElements();
35
		StringBuffer wBuffer = new StringBuffer();
33
36
		StringBuffer tBuffer = new StringBuffer();
34
		PluginModelNameBuffer wBuffer = new PluginModelNameBuffer();
35
		PluginModelNameBuffer tBuffer = new PluginModelNameBuffer();
36
37
		for (int i = 0; i < selected.length; i++) {
37
		for (int i = 0; i < selected.length; i++) {
38
			if (selected[i] instanceof IPluginModelBase) {
38
			if (selected[i] instanceof IPluginModelBase) {
39
				IPluginModelBase model = (IPluginModelBase) selected[i];
39
				IPluginModelBase model = (IPluginModelBase) selected[i];
40
				if (model.getUnderlyingResource() == null) {
40
				if (model.getUnderlyingResource() == null) {
41
					appendToBuffer(tBuffer, model);
41
					tBuffer.add(model);
42
				} else {
42
				} else {
43
					appendToBuffer(wBuffer, model);
43
					wBuffer.add(model);
44
				}
44
				}
45
			}
45
			}
46
		}
46
		}
47
		config.setAttribute(IPDELauncherConstants.WORKSPACE_BUNDLES, wBuffer.length() == 0 ? (String) null : wBuffer.toString());
48
		config.setAttribute(IPDELauncherConstants.TARGET_BUNDLES, tBuffer.length() == 0 ? (String) null : tBuffer.toString());
49
47
50
		StringBuffer buffer = new StringBuffer();
48
		config.setAttribute(IPDELauncherConstants.WORKSPACE_BUNDLES, wBuffer.toString());
49
		config.setAttribute(IPDELauncherConstants.TARGET_BUNDLES, tBuffer.toString());
50
51
		PluginModelNameBuffer buffer = new PluginModelNameBuffer();
51
		if (fAddWorkspaceButton.getSelection()) {
52
		if (fAddWorkspaceButton.getSelection()) {
52
			IPluginModelBase[] workspaceModels = getWorkspaceModels();
53
			IPluginModelBase[] workspaceModels = getWorkspaceModels();
53
			for (int i = 0; i < workspaceModels.length; i++) {
54
			for (int i = 0; i < workspaceModels.length; i++) {
54
				if (!fPluginTreeViewer.getChecked(workspaceModels[i])) {
55
				if (!fPluginTreeViewer.getChecked(workspaceModels[i])) {
55
					appendToBuffer(buffer, workspaceModels[i]);
56
					buffer.add(workspaceModels[i]);
56
				}
57
				}
57
			}
58
			}
58
		}
59
		}
59
		config.setAttribute(IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, buffer.length() > 0 ? buffer.toString() : (String) null);
60
		config.setAttribute(IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, buffer.toString());
60
	}
61
	}
61
62
62
	public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
63
	public void initializeFrom(ILaunchConfiguration configuration) throws CoreException {
(-)src/org/eclipse/pde/internal/ui/launcher/PluginBlock.java (-11 / +11 lines)
Lines 143-150 Link Here
143
	protected void savePluginState(ILaunchConfigurationWorkingCopy config) {
143
	protected void savePluginState(ILaunchConfigurationWorkingCopy config) {
144
		// If the table is populated, store what is checked.  If we are lazy loading and need to init, store the default checkstate
144
		// If the table is populated, store what is checked.  If we are lazy loading and need to init, store the default checkstate
145
		if (isEnabled() || fInitDefaultCheckState) {
145
		if (isEnabled() || fInitDefaultCheckState) {
146
			StringBuffer wBuffer = new StringBuffer();
146
			PluginModelNameBuffer wBuffer = new PluginModelNameBuffer();
147
			StringBuffer tBuffer = new StringBuffer();
147
			PluginModelNameBuffer tBuffer = new PluginModelNameBuffer();
148
148
149
			// If this is the first time the table is enabled, default the checkstate to all workspace plug-ins
149
			// If this is the first time the table is enabled, default the checkstate to all workspace plug-ins
150
			if (fInitDefaultCheckState) {
150
			if (fInitDefaultCheckState) {
Lines 162-170 Link Here
162
					IPluginModelBase model = externalModels[i];
162
					IPluginModelBase model = externalModels[i];
163
					boolean masked = checkedWorkspace.contains(model.getPluginBase().getId());
163
					boolean masked = checkedWorkspace.contains(model.getPluginBase().getId());
164
					if (masked) {
164
					if (masked) {
165
						appendToBuffer(wBuffer, model);
165
						wBuffer.add(model);
166
					} else if (model.isEnabled()) {
166
					} else if (model.isEnabled()) {
167
						appendToBuffer(tBuffer, model);
167
						tBuffer.add(model);
168
					}
168
					}
169
				}
169
				}
170
				fInitDefaultCheckState = false;
170
				fInitDefaultCheckState = false;
Lines 175-201 Link Here
175
					if (selected[i] instanceof IPluginModelBase) {
175
					if (selected[i] instanceof IPluginModelBase) {
176
						IPluginModelBase model = (IPluginModelBase) selected[i];
176
						IPluginModelBase model = (IPluginModelBase) selected[i];
177
						if (model.getUnderlyingResource() == null) {
177
						if (model.getUnderlyingResource() == null) {
178
							appendToBuffer(tBuffer, model);
178
							tBuffer.add(model);
179
						} else {
179
						} else {
180
							appendToBuffer(wBuffer, model);
180
							wBuffer.add(model);
181
						}
181
						}
182
					}
182
					}
183
				}
183
				}
184
184
185
			}
185
			}
186
			config.setAttribute(IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS, wBuffer.length() == 0 ? (String) null : wBuffer.toString());
186
			config.setAttribute(IPDELauncherConstants.SELECTED_WORKSPACE_PLUGINS, wBuffer.toString());
187
			config.setAttribute(IPDELauncherConstants.SELECTED_TARGET_PLUGINS, tBuffer.length() == 0 ? (String) null : tBuffer.toString());
187
			config.setAttribute(IPDELauncherConstants.SELECTED_TARGET_PLUGINS, tBuffer.toString());
188
188
189
			StringBuffer buffer = new StringBuffer();
189
			PluginModelNameBuffer buffer = new PluginModelNameBuffer();
190
			if (fAddWorkspaceButton.getSelection()) {
190
			if (fAddWorkspaceButton.getSelection()) {
191
				IPluginModelBase[] workspaceModels = getWorkspaceModels();
191
				IPluginModelBase[] workspaceModels = getWorkspaceModels();
192
				for (int i = 0; i < workspaceModels.length; i++) {
192
				for (int i = 0; i < workspaceModels.length; i++) {
193
					if (!fPluginTreeViewer.getChecked(workspaceModels[i])) {
193
					if (!fPluginTreeViewer.getChecked(workspaceModels[i])) {
194
						appendToBuffer(buffer, workspaceModels[i]);
194
						buffer.add(workspaceModels[i]);
195
					}
195
					}
196
				}
196
				}
197
			}
197
			}
198
			config.setAttribute(IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, buffer.length() > 0 ? buffer.toString() : (String) null);
198
			config.setAttribute(IPDELauncherConstants.DESELECTED_WORKSPACE_PLUGINS, buffer.toString());
199
		}
199
		}
200
	}
200
	}
201
201

Return to bug 309701