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.pde.internal.ui.editor.plugin.MatchSection; 22 import org.eclipse.swt.layout.GridData; 23 import org.eclipse.swt.widgets.Composite; 24 import org.eclipse.ui.PlatformUI; 25 import org.eclipse.ui.forms.IManagedForm; 26 import org.eclipse.ui.forms.widgets.FormToolkit; 27 import org.eclipse.ui.forms.widgets.ScrolledForm; 28 29 32 public class FeatureDependenciesPage extends PDEFormPage { 33 public static final String PAGE_ID = "dependencies"; 35 private RequiresSection fRequiresSection; 36 37 private MatchSection fMatchSection; 38 39 44 public FeatureDependenciesPage(PDEFormEditor editor, String title) { 45 super(editor, PAGE_ID, title); 46 } 47 48 51 protected String getHelpResource() { 52 return IPDEUIConstants.PLUGIN_DOC_ROOT + "guide/tools/editors/feature_editor/dependencies.htm"; } 54 55 protected void createFormContent(IManagedForm managedForm) { 56 ScrolledForm form = managedForm.getForm(); 57 FormToolkit toolkit = managedForm.getToolkit(); 58 form.getBody().setLayout(FormLayoutFactory.createFormGridLayout(true, 2)); 59 60 form.setImage(PDEPlugin.getDefault().getLabelProvider().get(PDEPluginImages.DESC_REQ_PLUGINS_OBJ)); 62 63 GridData gd; 64 65 Composite left = toolkit.createComposite(form.getBody()); 66 left.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1)); 67 gd = new GridData(GridData.FILL_BOTH); 68 left.setLayoutData(gd); 69 70 Composite right = toolkit.createComposite(form.getBody()); 71 right.setLayout(FormLayoutFactory.createFormPaneGridLayout(false, 1)); 72 gd = new GridData(GridData.FILL_BOTH); 73 right.setLayoutData(gd); 74 75 fRequiresSection = new RequiresSection(this, left); 76 fMatchSection = new MatchSection(this, right, false); 77 gd = new GridData(GridData.FILL_HORIZONTAL); 78 fMatchSection.getSection().setLayoutData(gd); 79 80 alignSectionHeaders(fRequiresSection.getSection(), 83 fMatchSection.getSection()); 84 85 managedForm.addPart(fRequiresSection); 86 managedForm.addPart(fMatchSection); 87 PlatformUI.getWorkbench().getHelpSystem().setHelp(form.getBody(),IHelpContextIds.MANIFEST_FEATURE_DEPENDENCIES); 88 initialize(); 89 fRequiresSection.fireSelection(); 90 super.createFormContent(managedForm); 91 } 92 93 public void initialize() { 94 getManagedForm().getForm().setText( 95 PDEUIMessages.FeatureEditor_DependenciesPage_heading); 96 } 97 } 98 | Popular Tags |