KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > preferences > ScrolledPageContent


1 /*******************************************************************************
2  * Copyright (c) 2000, 2007 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

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