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

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+2 lines)
Lines 2290-2295 Link Here
2290
2290
2291
	public static String PluginGeneralInfoSection_lazyStart;
2291
	public static String PluginGeneralInfoSection_lazyStart;
2292
2292
2293
	public static String PluginGeneralInfoSection_singleton;
2294
2293
	public static String ClassSearchParticipant_taskMessage;
2295
	public static String ClassSearchParticipant_taskMessage;
2294
2296
2295
	public static String CreateJREBundleHeaderResolution_desc;
2297
	public static String CreateJREBundleHeaderResolution_desc;
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (+1 lines)
Lines 1334-1339 Link Here
1334
PluginWorkingSet_deselectAll_label=Dese&lect All
1334
PluginWorkingSet_deselectAll_label=Dese&lect All
1335
PluginDevelopmentPage_presentation=Plug-in Manifest Editor Presentation
1335
PluginDevelopmentPage_presentation=Plug-in Manifest Editor Presentation
1336
PluginGeneralInfoSection_lazyStart=Activate this plug-in when one of its classes is loaded
1336
PluginGeneralInfoSection_lazyStart=Activate this plug-in when one of its classes is loaded
1337
PluginGeneralInfoSection_singleton=This plug-in a singleton
1337
PluginWorkingSet_deselectAll_toolTip=Unselect all of these plug-ins for this working set.
1338
PluginWorkingSet_deselectAll_toolTip=Unselect all of these plug-ins for this working set.
1338
PluginListPage_initializeFromPlugins=&Initialize from the plug-ins list:
1339
PluginListPage_initializeFromPlugins=&Initialize from the plug-ins list:
1339
PluginWorkingSet_noPluginsChecked=At least one plug-in must be checked
1340
PluginWorkingSet_noPluginsChecked=At least one plug-in must be checked
(-)src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java (+35 lines)
Lines 7-12 Link Here
7
 *
7
 *
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Peter Friese <peter.friese@openarchitectureware.org> - bug 191769
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.eclipse.pde.internal.ui.editor.plugin;
12
package org.eclipse.pde.internal.ui.editor.plugin;
12
13
Lines 24-29 Link Here
24
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
25
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
25
import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
26
import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
26
import org.eclipse.pde.internal.core.text.bundle.Bundle;
27
import org.eclipse.pde.internal.core.text.bundle.Bundle;
28
import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader;
27
import org.eclipse.pde.internal.core.text.bundle.LazyStartHeader;
29
import org.eclipse.pde.internal.core.text.bundle.LazyStartHeader;
28
import org.eclipse.pde.internal.ui.PDEPlugin;
30
import org.eclipse.pde.internal.ui.PDEPlugin;
29
import org.eclipse.pde.internal.ui.PDEUIMessages;
31
import org.eclipse.pde.internal.ui.PDEUIMessages;
Lines 42-52 Link Here
42
import org.eclipse.ui.forms.events.HyperlinkEvent;
44
import org.eclipse.ui.forms.events.HyperlinkEvent;
43
import org.eclipse.ui.forms.widgets.FormToolkit;
45
import org.eclipse.ui.forms.widgets.FormToolkit;
44
import org.eclipse.ui.forms.widgets.TableWrapData;
46
import org.eclipse.ui.forms.widgets.TableWrapData;
47
import org.osgi.framework.Constants;
45
48
46
public class PluginGeneralInfoSection extends GeneralInfoSection {
49
public class PluginGeneralInfoSection extends GeneralInfoSection {
47
50
48
	private FormEntry fClassEntry;
51
	private FormEntry fClassEntry;
49
	private Button fLazyStart;
52
	private Button fLazyStart;
53
	private Button fSingleton;
50
	private TypeFieldAssistDisposer fTypeFieldAssistDisposer;
54
	private TypeFieldAssistDisposer fTypeFieldAssistDisposer;
51
55
52
	public PluginGeneralInfoSection(PDEFormPage page, Composite parent) {
56
	public PluginGeneralInfoSection(PDEFormPage page, Composite parent) {
Lines 63-68 Link Here
63
		if (isBundle() && (formEditor instanceof ManifestEditor)
67
		if (isBundle() && (formEditor instanceof ManifestEditor)
64
				&& ((ManifestEditor) formEditor).isEquinox()) {
68
				&& ((ManifestEditor) formEditor).isEquinox()) {
65
			createLazyStart(parent, toolkit, actionBars);
69
			createLazyStart(parent, toolkit, actionBars);
70
			createSingleton(parent, toolkit, actionBars);
66
		}
71
		}
67
	}
72
	}
68
73
Lines 102-107 Link Here
102
		});
107
		});
103
	}
108
	}
104
	
109
	
110
	private void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars) {
111
		fSingleton = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_singleton, SWT.CHECK);
112
		TableWrapData td = new TableWrapData();
113
		td.colspan = 3;
114
		fSingleton.setLayoutData(td);
115
		fSingleton.setEnabled(isEditable());
116
		fSingleton.addSelectionListener(new SelectionAdapter() {
117
			public void widgetSelected(SelectionEvent e) {
118
				IManifestHeader header = getSingletonHeader();
119
				if (header instanceof BundleSymbolicNameHeader)
120
					((BundleSymbolicNameHeader)header).setSingleton(fSingleton.getSelection());
121
			}
122
		});
123
	}
124
	
105
	private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) {
125
	private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) {
106
		boolean isEditable = isEditable();
126
		boolean isEditable = isEditable();
107
		fClassEntry = new FormEntry(
127
		fClassEntry = new FormEntry(
Lines 180-185 Link Here
180
			fLazyStart.setSelection(header instanceof LazyStartHeader 
200
			fLazyStart.setSelection(header instanceof LazyStartHeader 
181
					&& ((LazyStartHeader)header).isLazyStart());
201
					&& ((LazyStartHeader)header).isLazyStart());
182
		}
202
		}
203
		if (fSingleton != null) {
204
			IManifestHeader header = getSingletonHeader();
205
			fSingleton.setSelection(header instanceof BundleSymbolicNameHeader 
206
					&& ((BundleSymbolicNameHeader)header).isSingleton());
207
		}
183
		super.refresh();
208
		super.refresh();
184
	}
209
	}
185
	
210
	
Lines 201-206 Link Here
201
		return ICoreConstants.ECLIPSE_AUTOSTART;
226
		return ICoreConstants.ECLIPSE_AUTOSTART;
202
	}
227
	}
203
228
229
	private IManifestHeader getSingletonHeader() {
230
		IBundle bundle = getBundle();
231
		if (bundle instanceof Bundle) {
232
			IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME);
233
			return header;
234
		}
235
		return null;
236
	}
237
238
	
204
	/* (non-Javadoc)
239
	/* (non-Javadoc)
205
	 * @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose()
240
	 * @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose()
206
	 */
241
	 */

Return to bug 191769