### Eclipse Workspace Patch 1.0 #P org.eclipse.pde.ui Index: src/org/eclipse/pde/internal/ui/pderesources.properties =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/pderesources.properties,v retrieving revision 1.894 diff -u -r1.894 pderesources.properties --- src/org/eclipse/pde/internal/ui/pderesources.properties 22 Jul 2007 22:31:28 -0000 1.894 +++ src/org/eclipse/pde/internal/ui/pderesources.properties 24 Jul 2007 16:27:42 -0000 @@ -1334,6 +1334,7 @@ PluginWorkingSet_deselectAll_label=Dese&lect All PluginDevelopmentPage_presentation=Plug-in Manifest Editor Presentation PluginGeneralInfoSection_lazyStart=Activate this plug-in when one of its classes is loaded +PluginGeneralInfoSection_singleton=Make this plug-in a singleton PluginWorkingSet_deselectAll_toolTip=Unselect all of these plug-ins for this working set. PluginListPage_initializeFromPlugins=&Initialize from the plug-ins list: PluginWorkingSet_noPluginsChecked=At least one plug-in must be checked Index: src/org/eclipse/pde/internal/ui/PDEUIMessages.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/PDEUIMessages.java,v retrieving revision 1.301 diff -u -r1.301 PDEUIMessages.java --- src/org/eclipse/pde/internal/ui/PDEUIMessages.java 22 Jul 2007 05:30:17 -0000 1.301 +++ src/org/eclipse/pde/internal/ui/PDEUIMessages.java 24 Jul 2007 16:27:22 -0000 @@ -2290,6 +2290,8 @@ public static String PluginGeneralInfoSection_lazyStart; + public static String PluginGeneralInfoSection_singleton; + public static String ClassSearchParticipant_taskMessage; public static String CreateJREBundleHeaderResolution_desc; Index: src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java =================================================================== RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java,v retrieving revision 1.29 diff -u -r1.29 PluginGeneralInfoSection.java --- src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java 8 Jun 2007 16:47:58 -0000 1.29 +++ src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java 24 Jul 2007 16:27:43 -0000 @@ -24,6 +24,7 @@ import org.eclipse.pde.internal.core.ibundle.IBundleModel; import org.eclipse.pde.internal.core.ibundle.IManifestHeader; import org.eclipse.pde.internal.core.text.bundle.Bundle; +import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; import org.eclipse.pde.internal.core.text.bundle.LazyStartHeader; import org.eclipse.pde.internal.ui.PDEPlugin; import org.eclipse.pde.internal.ui.PDEUIMessages; @@ -47,6 +48,7 @@ private FormEntry fClassEntry; private Button fLazyStart; + private Button fSingleton; private TypeFieldAssistDisposer fTypeFieldAssistDisposer; public PluginGeneralInfoSection(PDEFormPage page, Composite parent) { @@ -63,6 +65,7 @@ if (isBundle() && (formEditor instanceof ManifestEditor) && ((ManifestEditor) formEditor).isEquinox()) { createLazyStart(parent, toolkit, actionBars); + createSingleton(parent, toolkit, actionBars); } } @@ -102,6 +105,21 @@ }); } + private void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars) { + fSingleton = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_singleton, SWT.CHECK); + TableWrapData td = new TableWrapData(); + td.colspan = 3; + fSingleton.setLayoutData(td); + fSingleton.setEnabled(isEditable()); + fSingleton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + IManifestHeader header = getSingletonHeader(); + if (header instanceof BundleSymbolicNameHeader) + ((BundleSymbolicNameHeader)header).setSingleton(fSingleton.getSelection()); + } + }); + } + private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { boolean isEditable = isEditable(); fClassEntry = new FormEntry( @@ -180,6 +198,11 @@ fLazyStart.setSelection(header instanceof LazyStartHeader && ((LazyStartHeader)header).isLazyStart()); } + if (fSingleton != null) { + IManifestHeader header = getSingletonHeader(); + fSingleton.setSelection(header instanceof BundleSymbolicNameHeader + && ((BundleSymbolicNameHeader)header).isSingleton()); + } super.refresh(); } @@ -201,6 +224,16 @@ return ICoreConstants.ECLIPSE_AUTOSTART; } + private IManifestHeader getSingletonHeader() { + IBundle bundle = getBundle(); + if (bundle instanceof Bundle) { + IManifestHeader header = bundle.getManifestHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME); + return header; + } + return null; + } + + /* (non-Javadoc) * @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose() */