View | Details | Raw Unified | Return to bug 199431 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/ui/editor/plugin/PluginGeneralInfoSection.java (-25 lines)
Lines 44-56 Link Here
44
import org.eclipse.ui.forms.events.HyperlinkEvent;
44
import org.eclipse.ui.forms.events.HyperlinkEvent;
45
import org.eclipse.ui.forms.widgets.FormToolkit;
45
import org.eclipse.ui.forms.widgets.FormToolkit;
46
import org.eclipse.ui.forms.widgets.TableWrapData;
46
import org.eclipse.ui.forms.widgets.TableWrapData;
47
import org.osgi.framework.Constants;
48
47
49
public class PluginGeneralInfoSection extends GeneralInfoSection {
48
public class PluginGeneralInfoSection extends GeneralInfoSection {
50
49
51
	private FormEntry fClassEntry;
50
	private FormEntry fClassEntry;
52
	private Button fLazyStart;
51
	private Button fLazyStart;
53
	private Button fSingleton;
54
	private TypeFieldAssistDisposer fTypeFieldAssistDisposer;
52
	private TypeFieldAssistDisposer fTypeFieldAssistDisposer;
55
53
56
	public PluginGeneralInfoSection(PDEFormPage page, Composite parent) {
54
	public PluginGeneralInfoSection(PDEFormPage page, Composite parent) {
Lines 107-127 Link Here
107
		});
105
		});
108
	}
106
	}
109
	
107
	
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
	
125
	private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) {
108
	private void createClassEntry(Composite client, FormToolkit toolkit, IActionBars actionBars) {
126
		boolean isEditable = isEditable();
109
		boolean isEditable = isEditable();
127
		fClassEntry = new FormEntry(
110
		fClassEntry = new FormEntry(
Lines 226-239 Link Here
226
		return ICoreConstants.ECLIPSE_AUTOSTART;
209
		return ICoreConstants.ECLIPSE_AUTOSTART;
227
	}
210
	}
228
211
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
212
238
	
213
	
239
	/* (non-Javadoc)
214
	/* (non-Javadoc)
(-)src/org/eclipse/pde/internal/ui/editor/plugin/FragmentGeneralInfoSection.java (+8 lines)
Lines 21-26 Link Here
21
import org.eclipse.pde.core.plugin.PluginRegistry;
21
import org.eclipse.pde.core.plugin.PluginRegistry;
22
import org.eclipse.pde.internal.core.ibundle.IBundle;
22
import org.eclipse.pde.internal.core.ibundle.IBundle;
23
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
23
import org.eclipse.pde.internal.core.ibundle.IBundleModel;
24
import org.eclipse.pde.internal.core.ibundle.IManifestHeader;
25
import org.eclipse.pde.internal.core.text.bundle.BundleSymbolicNameHeader;
24
import org.eclipse.pde.internal.ui.PDEPlugin;
26
import org.eclipse.pde.internal.ui.PDEPlugin;
25
import org.eclipse.pde.internal.ui.PDEUIMessages;
27
import org.eclipse.pde.internal.ui.PDEUIMessages;
26
import org.eclipse.pde.internal.ui.editor.FormEntryAdapter;
28
import org.eclipse.pde.internal.ui.editor.FormEntryAdapter;
Lines 74-79 Link Here
74
		createPluginVersionEntry(parent, toolkit, actionBars);
76
		createPluginVersionEntry(parent, toolkit, actionBars);
75
		if (!isBundle())
77
		if (!isBundle())
76
			createMatchCombo(parent, toolkit, actionBars);
78
			createMatchCombo(parent, toolkit, actionBars);
79
		createSingleton(parent, toolkit, actionBars);
77
	}
80
	}
78
	
81
	
79
	private void createPluginIdEntry(Composite parent, FormToolkit toolkit, IActionBars actionBars) {
82
	private void createPluginIdEntry(Composite parent, FormToolkit toolkit, IActionBars actionBars) {
Lines 348-353 Link Here
348
		}
351
		}
349
		if (fMatchCombo != null)
352
		if (fMatchCombo != null)
350
			fMatchCombo.select(fragment.getRule());
353
			fMatchCombo.select(fragment.getRule());
354
		if (fSingleton != null) {
355
			IManifestHeader header = getSingletonHeader();
356
			fSingleton.setSelection(header instanceof BundleSymbolicNameHeader 
357
					&& ((BundleSymbolicNameHeader)header).isSingleton());
358
		}
351
		super.refresh();
359
		super.refresh();
352
	}
360
	}
353
	
361
	
(-)src/org/eclipse/pde/internal/ui/editor/plugin/GeneralInfoSection.java (-1 / +37 lines)
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
}

Return to bug 199431