KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jface > preference > IPreferencePage


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 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.jface.preference;
12
13 import org.eclipse.jface.dialogs.IDialogPage;
14 import org.eclipse.swt.graphics.Point;
15
16 /**
17  * An interface for a preference page. This interface
18  * is used primarily by the page's container
19  */

20 public interface IPreferencePage extends IDialogPage {
21
22     /**
23      * Computes a size for this page's UI component.
24      *
25      * @return the size of the preference page encoded as
26      * <code>new Point(width,height)</code>, or
27      * <code>(0,0)</code> if the page doesn't currently have any UI component
28      */

29     public Point computeSize();
30
31     /**
32      * Returns whether this dialog page is in a valid state.
33      *
34      * @return <code>true</code> if the page is in a valid state,
35      * and <code>false</code> if invalid
36      */

37     public boolean isValid();
38
39     /**
40      * Checks whether it is alright to leave this page.
41      *
42      * @return <code>false</code> to abort page flipping and the
43      * have the current page remain visible, and <code>true</code>
44      * to allow the page flip
45      */

46     public boolean okToLeave();
47
48     /**
49      * Notifies that the container of this preference page has been canceled.
50      *
51      * @return <code>false</code> to abort the container's cancel
52      * procedure and <code>true</code> to allow the cancel to happen
53      */

54     public boolean performCancel();
55
56     /**
57      * Notifies that the OK button of this page's container has been pressed.
58      *
59      * @return <code>false</code> to abort the container's OK
60      * processing and <code>true</code> to allow the OK to happen
61      */

62     public boolean performOk();
63
64     /**
65      * Sets or clears the container of this page.
66      *
67      * @param preferencePageContainer the preference page container, or <code>null</code>
68      */

69     public void setContainer(IPreferencePageContainer preferencePageContainer);
70
71     /**
72      * Sets the size of this page's UI component.
73      *
74      * @param size the size of the preference page encoded as
75      * <code>new Point(width,height)</code>
76      */

77     public void setSize(Point size);
78 }
79
Popular Tags