1 11 package org.eclipse.jdt.internal.ui.preferences; 12 13 import org.eclipse.swt.SWT; 14 import org.eclipse.swt.widgets.Composite; 15 import org.eclipse.swt.widgets.Control; 16 17 import org.eclipse.ui.forms.widgets.FormToolkit; 18 import org.eclipse.ui.forms.widgets.SharedScrolledComposite; 19 20 import org.eclipse.jdt.internal.ui.JavaPlugin; 21 22 23 public class ScrolledPageContent extends SharedScrolledComposite { 24 25 private FormToolkit fToolkit; 26 27 public ScrolledPageContent(Composite parent) { 28 this(parent, SWT.V_SCROLL | SWT.H_SCROLL); 29 } 30 31 public ScrolledPageContent(Composite parent, int style) { 32 super(parent, style); 33 34 setFont(parent.getFont()); 35 36 fToolkit= JavaPlugin.getDefault().getDialogsFormToolkit(); 37 38 setExpandHorizontal(true); 39 setExpandVertical(true); 40 41 Composite body= new Composite(this, SWT.NONE); 42 body.setFont(parent.getFont()); 43 setContent(body); 44 } 45 46 47 public void adaptChild(Control childControl) { 48 fToolkit.adapt(childControl, true, true); 49 } 50 51 public Composite getBody() { 52 return (Composite) getContent(); 53 } 54 55 } 56 | Popular Tags |