Lines 24-29
Link Here
|
24 |
import org.eclipse.pde.internal.core.ibundle.IBundleModel; |
24 |
import org.eclipse.pde.internal.core.ibundle.IBundleModel; |
25 |
import org.eclipse.pde.internal.core.ibundle.IManifestHeader; |
25 |
import org.eclipse.pde.internal.core.ibundle.IManifestHeader; |
26 |
import org.eclipse.pde.internal.core.text.bundle.Bundle; |
26 |
import org.eclipse.pde.internal.core.text.bundle.Bundle; |
|
|
27 |
import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; |
27 |
import org.eclipse.pde.internal.core.text.bundle.LazyStartHeader; |
28 |
import org.eclipse.pde.internal.core.text.bundle.LazyStartHeader; |
28 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
29 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
29 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
30 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
Lines 47-52
Link Here
|
47 |
|
48 |
|
48 |
private FormEntry fClassEntry; |
49 |
private FormEntry fClassEntry; |
49 |
private Button fLazyStart; |
50 |
private Button fLazyStart; |
|
|
51 |
private Button fSingleton; |
50 |
private TypeFieldAssistDisposer fTypeFieldAssistDisposer; |
52 |
private TypeFieldAssistDisposer fTypeFieldAssistDisposer; |
51 |
|
53 |
|
52 |
public PluginGeneralInfoSection(PDEFormPage page, Composite parent) { |
54 |
public PluginGeneralInfoSection(PDEFormPage page, Composite parent) { |
Lines 63-68
Link Here
|
63 |
if (isBundle() && (formEditor instanceof ManifestEditor) |
65 |
if (isBundle() && (formEditor instanceof ManifestEditor) |
64 |
&& ((ManifestEditor) formEditor).isEquinox()) { |
66 |
&& ((ManifestEditor) formEditor).isEquinox()) { |
65 |
createLazyStart(parent, toolkit, actionBars); |
67 |
createLazyStart(parent, toolkit, actionBars); |
|
|
68 |
createSingleton(parent, toolkit, actionBars); |
66 |
} |
69 |
} |
67 |
} |
70 |
} |
68 |
|
71 |
|
Lines 102-107
Link Here
|
102 |
}); |
105 |
}); |
103 |
} |
106 |
} |
104 |
|
107 |
|
|
|
108 |
private void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars) { |
109 |
fSingleton = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_singleton, SWT.CHECK); |
110 |
TableWrapData td = new TableWrapData(); |
111 |
td.colspan = 3; |
112 |
fSingleton.setLayoutData(td); |
113 |
fSingleton.setEnabled(isEditable()); |
114 |
fSingleton.addSelectionListener(new SelectionAdapter() { |
115 |
public void widgetSelected(SelectionEvent e) { |
116 |
IManifestHeader header = getSingletonHeader(); |
117 |
if (header instanceof BundleSymbolicNameHeader) |
118 |
((BundleSymbolicNameHeader)header).setSingleton(fSingleton.getSelection()); |
119 |
} |
120 |
}); |
121 |
} |
122 |
|
105 |
private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { |
123 |
private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) { |
106 |
boolean isEditable = isEditable(); |
124 |
boolean isEditable = isEditable(); |
107 |
fClassEntry = new FormEntry( |
125 |
fClassEntry = new FormEntry( |
Lines 180-185
Link Here
|
180 |
fLazyStart.setSelection(header instanceof LazyStartHeader |
198 |
fLazyStart.setSelection(header instanceof LazyStartHeader |
181 |
&& ((LazyStartHeader)header).isLazyStart()); |
199 |
&& ((LazyStartHeader)header).isLazyStart()); |
182 |
} |
200 |
} |
|
|
201 |
if (fSingleton != null) { |
202 |
IManifestHeader header = getSingletonHeader(); |
203 |
fSingleton.setSelection(header instanceof BundleSymbolicNameHeader |
204 |
&& ((BundleSymbolicNameHeader)header).isSingleton()); |
205 |
} |
183 |
super.refresh(); |
206 |
super.refresh(); |
184 |
} |
207 |
} |
185 |
|
208 |
|
Lines 201-206
Link Here
|
201 |
return ICoreConstants.ECLIPSE_AUTOSTART; |
224 |
return ICoreConstants.ECLIPSE_AUTOSTART; |
202 |
} |
225 |
} |
203 |
|
226 |
|
|
|
227 |
private IManifestHeader getSingletonHeader() { |
228 |
IBundle bundle = getBundle(); |
229 |
if (bundle instanceof Bundle) { |
230 |
IManifestHeader header = bundle.getManifestHeader(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME); |
231 |
return header; |
232 |
} |
233 |
return null; |
234 |
} |
235 |
|
236 |
|
204 |
/* (non-Javadoc) |
237 |
/* (non-Javadoc) |
205 |
* @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose() |
238 |
* @see org.eclipse.pde.internal.ui.editor.plugin.GeneralInfoSection#dispose() |
206 |
*/ |
239 |
*/ |