1 11 package org.eclipse.pde.internal.ui.editor.feature; 12 13 import org.eclipse.pde.internal.ui.IHelpContextIds; 14 import org.eclipse.pde.internal.ui.IPDEUIConstants; 15 import org.eclipse.pde.internal.ui.PDEPlugin; 16 import org.eclipse.pde.internal.ui.PDEPluginImages; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.eclipse.pde.internal.ui.editor.FormLayoutFactory; 19 import org.eclipse.pde.internal.ui.editor.PDEFormEditor; 20 import org.eclipse.pde.internal.ui.editor.PDEFormPage; 21 import org.eclipse.swt.layout.GridData; 22 import org.eclipse.swt.widgets.Composite; 23 import org.eclipse.ui.PlatformUI; 24 import org.eclipse.ui.forms.IManagedForm; 25 import org.eclipse.ui.forms.widgets.FormToolkit; 26 import org.eclipse.ui.forms.widgets.ScrolledForm; 27 28 31 public class FeatureReferencePage extends PDEFormPage { 32 public static final String PAGE_ID = "reference"; 34 private PluginSection fPluginSection; 35 36 private PluginDetailsSection fPluginDetailsSection; 37 38 private PluginPortabilitySection fPluginPortabilitySection; 39 40 45 public FeatureReferencePage(PDEFormEditor editor, String title) { 46 super(editor, PAGE_ID, title); 47 } 48 49 52 protected String getHelpResource() { 53 return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/feature_editor/plugins.htm"; } 55 56 protected void createFormContent(IManagedForm managedForm) { 57 ScrolledForm form = managedForm.getForm(); 58 FormToolkit toolkit = managedForm.getToolkit(); 59 form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(true, 2)); 60 61 form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_PLUGINS_FRAGMENTS)); 63 64 GridData gd; 65 66 Composite left = toolkit.createComposite(form.getBody()); 67 left.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1)); 68 gd = new GridData(GridData.FILL_BOTH); 69 left.setLayoutData(gd); 70 71 Composite right = toolkit.createComposite(form.getBody()); 72 right.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1)); 73 gd = new GridData(GridData.FILL_BOTH); 74 right.setLayoutData(gd); 75 76 fPluginSection = new PluginSection(this, left); 77 78 fPluginDetailsSection = new PluginDetailsSection(this, right); 79 80 alignSectionHeaders(fPluginSection.getSection(), 83 fPluginDetailsSection.getSection()); 84 85 fPluginPortabilitySection = new PluginPortabilitySection(this, right); 86 gd = new GridData(GridData.FILL_HORIZONTAL 87 | GridData.VERTICAL_ALIGN_BEGINNING); 88 fPluginPortabilitySection.getSection().setLayoutData(gd); 89 90 managedForm.addPart(fPluginSection); 91 managedForm.addPart(fPluginDetailsSection); 92 managedForm.addPart(fPluginPortabilitySection); 93 94 form.setText(PDEUIMessages.FeatureEditor_ReferencePage_heading); 95 PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(), IHelpContextIds.MANIFEST_FEATURE_CONTENT); 98 fPluginSection.fireSelection(); 99 super.createFormContent(managedForm); 100 } 101 102 public void setFocus() { 103 fPluginSection.setFocus(); 104 } 105 } 106 | Popular Tags |