Lines 19-24
Link Here
|
19 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
19 |
import org.eclipse.pde.core.plugin.PluginRegistry; |
20 |
import org.eclipse.pde.internal.core.ibundle.IBundle; |
20 |
import org.eclipse.pde.internal.core.ibundle.IBundle; |
21 |
import org.eclipse.pde.internal.core.ibundle.IBundleModel; |
21 |
import org.eclipse.pde.internal.core.ibundle.IBundleModel; |
|
|
22 |
import org.eclipse.pde.internal.core.ibundle.IManifestHeader; |
23 |
import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader; |
22 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
24 |
import org.eclipse.pde.internal.ui.PDEPlugin; |
23 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
25 |
import org.eclipse.pde.internal.ui.PDEUIMessages; |
24 |
import org.eclipse.pde.internal.ui.editor.FormEntryAdapter; |
26 |
import org.eclipse.pde.internal.ui.editor.FormEntryAdapter; |
Lines 29-35
Link Here
|
29 |
import org.eclipse.pde.internal.ui.editor.validation.ControlValidationUtility; |
31 |
import org.eclipse.pde.internal.ui.editor.validation.ControlValidationUtility; |
30 |
import org.eclipse.pde.internal.ui.editor.validation.TextValidator; |
32 |
import org.eclipse.pde.internal.ui.editor.validation.TextValidator; |
31 |
import org.eclipse.pde.internal.ui.parts.FormEntry; |
33 |
import org.eclipse.pde.internal.ui.parts.FormEntry; |
|
|
34 |
import org.eclipse.swt.SWT; |
32 |
import org.eclipse.swt.dnd.Clipboard; |
35 |
import org.eclipse.swt.dnd.Clipboard; |
|
|
36 |
import org.eclipse.swt.events.SelectionAdapter; |
37 |
import org.eclipse.swt.events.SelectionEvent; |
38 |
import org.eclipse.swt.widgets.Button; |
33 |
import org.eclipse.swt.widgets.Composite; |
39 |
import org.eclipse.swt.widgets.Composite; |
34 |
import org.eclipse.swt.widgets.Display; |
40 |
import org.eclipse.swt.widgets.Display; |
35 |
import org.eclipse.swt.widgets.Text; |
41 |
import org.eclipse.swt.widgets.Text; |
Lines 37-42
Link Here
|
37 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
43 |
import org.eclipse.ui.forms.widgets.FormToolkit; |
38 |
import org.eclipse.ui.forms.widgets.Section; |
44 |
import org.eclipse.ui.forms.widgets.Section; |
39 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
45 |
import org.eclipse.ui.forms.widgets.TableWrapData; |
|
|
46 |
import org.osgi.framework.Constants; |
47 |
import org.eclipse.pde.internal.core.text.bundle.Bundle; |
48 |
|
40 |
|
49 |
|
41 |
public abstract class GeneralInfoSection extends PDESection { |
50 |
public abstract class GeneralInfoSection extends PDESection { |
42 |
private static String PLATFORM_FILTER = "Eclipse-PlatformFilter"; //$NON-NLS-1$ |
51 |
private static String PLATFORM_FILTER = "Eclipse-PlatformFilter"; //$NON-NLS-1$ |
Lines 57-63
Link Here
|
57 |
|
66 |
|
58 |
private TextValidator fPlatformEntryValidator; |
67 |
private TextValidator fPlatformEntryValidator; |
59 |
|
68 |
|
60 |
private IPluginModelBase fModel; |
69 |
private IPluginModelBase fModel; |
|
|
70 |
|
71 |
protected Button fSingleton; |
61 |
|
72 |
|
62 |
|
73 |
|
63 |
public GeneralInfoSection(PDEFormPage page, Composite parent) { |
74 |
public GeneralInfoSection(PDEFormPage page, Composite parent) { |
Lines 385-388
Link Here
|
385 |
return (d.getFocusControl() instanceof Text); |
396 |
return (d.getFocusControl() instanceof Text); |
386 |
} |
397 |
} |
387 |
|
398 |
|
|
|
399 |
|
400 |
IManifestHeader getSingletonHeader() { |
401 |
IBundle bundle = getBundle(); |
402 |
if (bundle instanceof Bundle) { |
403 |
IManifestHeader header = bundle.getManifestHeader(Constants.BUNDLE_SYMBOLICNAME); |
404 |
return header; |
405 |
} |
406 |
return null; |
407 |
} |
408 |
|
409 |
protected void createSingleton(Composite parent, FormToolkit toolkit, IActionBars actionBars) { |
410 |
fSingleton = toolkit.createButton(parent, PDEUIMessages.PluginGeneralInfoSection_singleton, SWT.CHECK); |
411 |
TableWrapData td = new TableWrapData(); |
412 |
td.colspan = 3; |
413 |
fSingleton.setLayoutData(td); |
414 |
fSingleton.setEnabled(isEditable()); |
415 |
fSingleton.addSelectionListener(new SelectionAdapter() { |
416 |
public void widgetSelected(SelectionEvent e) { |
417 |
IManifestHeader header = getSingletonHeader(); |
418 |
if (header instanceof BundleSymbolicNameHeader) |
419 |
((BundleSymbolicNameHeader)header).setSingleton(fSingleton.getSelection()); |
420 |
} |
421 |
}); |
422 |
} |
423 |
|
388 |
} |
424 |
} |