01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 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.ui.dialogs;
11:
12: import org.eclipse.core.runtime.IAdaptable;
13: import org.eclipse.jface.preference.PreferencePage;
14: import org.eclipse.ui.IWorkbenchPropertyPage;
15:
16: /**
17: * Abstract base implementation of a workbench property page (
18: * <code>IWorkbenchPropertyPage</code>). The implementation is a JFace
19: * preference page with an adapatable element.
20: * <p>
21: * Subclasses must implement the <code>createContents</code> framework method
22: * to supply the property page's main control.
23: * </p>
24: * <p>
25: * Subclasses should extend the <code>doComputeSize</code> framework method to
26: * compute the size of the page's control.
27: * </p>
28: * <p>
29: * Subclasses may override the <code>performOk</code>,
30: * <code>performApply</code>,<code>performDefaults</code>,
31: * <code>performCancel</code>, and <code>performHelp</code> framework
32: * methods to react to the standard button events.
33: * </p>
34: * <p>
35: * Subclasses may call the <code>noDefaultAndApplyButton</code> framework
36: * method before the page's control has been created to suppress the standard
37: * Apply and Defaults buttons.
38: * </p>
39: *
40: * @see IWorkbenchPropertyPage
41: */
42: public abstract class PropertyPage extends PreferencePage implements
43: IWorkbenchPropertyPage {
44: /**
45: * The element.
46: */
47: private IAdaptable element;
48:
49: /**
50: * Creates a new property page.
51: */
52: public PropertyPage() {
53: }
54:
55: /*
56: * (non-Javadoc)
57: * @see org.eclipse.ui.IWorkbenchPropertyPage#getElement()
58: */
59: public IAdaptable getElement() {
60: return element;
61: }
62:
63: /**
64: * Sets the element that owns properties shown on this page.
65: *
66: * @param element
67: * the element
68: */
69: public void setElement(IAdaptable element) {
70: this.element = element;
71: }
72: }
|