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 |
*/ |