01: /*******************************************************************************
02: * Copyright (c) 2000, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.preferences;
11:
12: import org.eclipse.swt.SWT;
13: import org.eclipse.swt.widgets.Composite;
14: import org.eclipse.swt.widgets.Control;
15:
16: import org.eclipse.ui.forms.widgets.FormToolkit;
17: import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
18:
19: import org.eclipse.jdt.internal.ui.JavaPlugin;
20:
21: public class ScrolledPageContent extends SharedScrolledComposite {
22:
23: private FormToolkit fToolkit;
24:
25: public ScrolledPageContent(Composite parent) {
26: this (parent, SWT.V_SCROLL | SWT.H_SCROLL);
27: }
28:
29: public ScrolledPageContent(Composite parent, int style) {
30: super (parent, style);
31:
32: setFont(parent.getFont());
33:
34: fToolkit = JavaPlugin.getDefault().getDialogsFormToolkit();
35:
36: setExpandHorizontal(true);
37: setExpandVertical(true);
38:
39: Composite body = new Composite(this , SWT.NONE);
40: body.setFont(parent.getFont());
41: setContent(body);
42: }
43:
44: public void adaptChild(Control childControl) {
45: fToolkit.adapt(childControl, true, true);
46: }
47:
48: public Composite getBody() {
49: return (Composite) getContent();
50: }
51:
52: }
|