1 11 package org.eclipse.pde.internal.ui.editor; 12 13 import org.eclipse.swt.layout.GridData; 14 import org.eclipse.swt.widgets.Composite; 15 import org.eclipse.ui.forms.DetailsPart; 16 import org.eclipse.ui.forms.IManagedForm; 17 import org.eclipse.ui.forms.MasterDetailsBlock; 18 import org.eclipse.ui.forms.widgets.Section; 19 20 public abstract class PDEMasterDetailsBlock extends MasterDetailsBlock { 21 private PDEFormPage fPage; 22 private PDESection fSection; 23 24 public PDEMasterDetailsBlock(PDEFormPage page) { 25 fPage = page; 26 } 27 28 public PDEFormPage getPage() { 29 return fPage; 30 } 31 32 protected void createMasterPart(final IManagedForm managedForm, 33 Composite parent) { 34 Composite container = managedForm.getToolkit().createComposite(parent); 35 container.setLayout(FormLayoutFactory.createMasterGridLayout(false, 1)); 36 container.setLayoutData(new GridData(GridData.FILL_BOTH)); 37 fSection = createMasterSection(managedForm, container); 38 managedForm.addPart(fSection); 39 Section section = fSection.getSection(); 40 section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1)); 41 section.setLayoutData(new GridData(GridData.FILL_BOTH)); 42 } 43 44 protected void createToolBarActions(IManagedForm managedForm) {} 45 46 protected abstract PDESection createMasterSection(IManagedForm managedForm, Composite parent); 47 48 public void createContent(IManagedForm managedForm) { 49 super.createContent(managedForm); 50 managedForm.getForm().getBody().setLayout(FormLayoutFactory.createFormGridLayout(false, 1)); 51 } 52 53 56 public DetailsPart getDetailsPart() { 57 return detailsPart; 58 } 59 60 } 61 | Popular Tags |