Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 75913 Details for
Bug 199431
Add Singleton checkbox to Fragment Manifest Editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch that adds singleton to plug-in and fragments.
singleton_fragment.txt (text/plain), 7.23 KB, created by
Peter Friese
on 2007-08-11 17:55:37 EDT
(
hide
)
Description:
Patch that adds singleton to plug-in and fragments.
Filename:
MIME Type:
Creator:
Peter Friese
Created:
2007-08-11 17:55:37 EDT
Size:
7.23 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.pde.ui >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.31 >diff -u -r1.31 PluginGeneralInfoSection.java >--- src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java 26 Jul 2007 20:49:56 -0000 1.31 >+++ src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java 11 Aug 2007 21:55:45 -0000 >@@ -44,13 +44,11 @@ > import org.eclipse.ui.forms.events.HyperlinkEvent; > import org.eclipse.ui.forms.widgets.FormToolkit; > import org.eclipse.ui.forms.widgets.TableWrapData; >-import org.osgi.framework.Constants; > > public class PluginGeneralInfoSection extends GeneralInfoSection { > > private FormEntry fClassEntry; > private Button fLazyStart; >- private Button fSingleton; > private TypeFieldAssistDisposer fTypeFieldAssistDisposer; > > public PluginGeneralInfoSection(PDEFormPage page, Composite parent) { >@@ -107,21 +105,6 @@ > }); > } > >- 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( >@@ -226,14 +209,6 @@ > return ICoreConstants.ECLIPSE_AUTOSTART; > } > >- private IManifestHeader getSingletonHeader() { >- IBundle bundle = getBundle(); >- if (bundle instanceof Bundle) { >- IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME); >- return header; >- } >- return null; >- } > > > /* (non-Javadoc) >Index: src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java,v >retrieving revision 1.18 >diff -u -r1.18 FragmentGeneralInfoSection.java >--- src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java 8 Jun 2007 16:47:58 -0000 1.18 >+++ src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java 11 Aug 2007 21:55:43 -0000 >@@ -21,6 +21,8 @@ > import org.eclipse.pde.core.plugin.PluginRegistry; > import org.eclipse.pde.internal.core.ibundle.IBundle; > import org.eclipse.pde.internal.core.ibundle.IBundleModel; >+import org.eclipse.pde.internal.core.ibundle.IManifestHeader; >+import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; > import org.eclipse.pde.internal.ui.PDEPlugin; > import org.eclipse.pde.internal.ui.PDEUIMessages; > import org.eclipse.pde.internal.ui.editor.FormEntryAdapter; >@@ -74,6 +76,7 @@ > createPluginVersionEntry(parent, toolkit, actionBars); > if (!isBundle()) > createMatchCombo(parent, toolkit, actionBars); >+ createSingleton(parent, toolkit, actionBars); > } > > private void createPluginIdEntry(Composite parent, FormToolkit toolkit, IActionBars actionBars) { >@@ -348,6 +351,11 @@ > } > if (fMatchCombo != null) > fMatchCombo.select(fragment.getRule()); >+ if (fSingleton != null) { >+ IManifestHeader header = getSingletonHeader(); >+ fSingleton.setSelection(header instanceof BundleSymbolicNameHeader >+ && ((BundleSymbolicNameHeader)header).isSingleton()); >+ } > super.refresh(); > } > >Index: src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui/src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java,v >retrieving revision 1.33 >diff -u -r1.33 GeneralInfoSection.java >--- src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java 8 Jun 2007 16:47:58 -0000 1.33 >+++ src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java 11 Aug 2007 21:55:44 -0000 >@@ -19,6 +19,8 @@ > import org.eclipse.pde.core.plugin.PluginRegistry; > import org.eclipse.pde.internal.core.ibundle.IBundle; > import org.eclipse.pde.internal.core.ibundle.IBundleModel; >+import org.eclipse.pde.internal.core.ibundle.IManifestHeader; >+import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; > import org.eclipse.pde.internal.ui.PDEPlugin; > import org.eclipse.pde.internal.ui.PDEUIMessages; > import org.eclipse.pde.internal.ui.editor.FormEntryAdapter; >@@ -29,7 +31,11 @@ > import org.eclipse.pde.internal.ui.editor.validation.ControlValidationUtility; > import org.eclipse.pde.internal.ui.editor.validation.TextValidator; > import org.eclipse.pde.internal.ui.parts.FormEntry; >+import org.eclipse.swt.SWT; > import org.eclipse.swt.dnd.Clipboard; >+import org.eclipse.swt.events.SelectionAdapter; >+import org.eclipse.swt.events.SelectionEvent; >+import org.eclipse.swt.widgets.Button; > import org.eclipse.swt.widgets.Composite; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Text; >@@ -37,6 +43,9 @@ > import org.eclipse.ui.forms.widgets.FormToolkit; > import org.eclipse.ui.forms.widgets.Section; > import org.eclipse.ui.forms.widgets.TableWrapData; >+import org.osgi.framework.Constants; >+import org.eclipse.pde.internal.core.text.bundle.Bundle; >+ > > public abstract class GeneralInfoSection extends PDESection { > private static String PLATFORM_FILTER = "Eclipse-PlatformFilter"; //$NON-NLS-1$ >@@ -57,7 +66,9 @@ > > private TextValidator fPlatformEntryValidator; > >- private IPluginModelBase fModel; >+ private IPluginModelBase fModel; >+ >+ protected Button fSingleton; > > > public GeneralInfoSection(PDEFormPage page, Composite parent) { >@@ -385,4 +396,29 @@ > return (d.getFocusControl() instanceof Text); > } > >+ >+ IManifestHeader getSingletonHeader() { >+ IBundle bundle = getBundle(); >+ if (bundle instanceof Bundle) { >+ IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME); >+ return header; >+ } >+ return null; >+ } >+ >+ protected 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()); >+ } >+ }); >+ } >+ > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 199431
: 75913 |
75914
|
77564
|
77565