KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > editors > text > IPreferenceConfigurationBlock


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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
12 package org.eclipse.ui.internal.editors.text;
13
14
15 import org.eclipse.swt.widgets.Composite;
16 import org.eclipse.swt.widgets.Control;
17
18
19 /**
20  * Interface for preference configuration blocks which can either be
21  * wrapped by a {@link org.eclipse.ui.internal.editors.text.AbstractConfigurationBlockPreferencePage}
22  * or be included some preference page.
23  * <p>
24  * Clients may implement this interface.
25  * </p>
26  *
27  * @since 3.0
28  */

29 interface IPreferenceConfigurationBlock {
30
31     /**
32      * Creates the preference control.
33      *
34      * @param parent the parent composite to which to add the preferences control
35      * @return the control that was added to <code>parent</code>
36      */

37     Control createControl(Composite parent);
38
39     /**
40      * Called after creating the control. Implementations should load the
41      * preferences values and update the controls accordingly.
42      */

43     void initialize();
44
45     /**
46      * Called when the <code>OK</code> button is pressed on the preference
47      * page. Implementations should commit the configured preference settings
48      * into their form of preference storage.
49      */

50     void performOk();
51
52     /**
53      * Called when the <code>OK</code> button is pressed on the preference
54      * page. Implementations can abort the '<code>OK</code>' operation
55      * by returning <code>false</code>.
56      *
57      * @return <code>true</code> iff the '<code>OK</code>' operation
58      * can be performed
59      * @since 3.1
60      */

61     boolean canPerformOk();
62
63     /**
64      * Called when the <code>Defaults</code> button is pressed on the
65      * preference page. Implementation should reset any preference settings to
66      * their default values and adjust the controls accordingly.
67      */

68     void performDefaults();
69
70     /**
71      * Called when the preference page is being disposed. Implementations should
72      * free any resources they are holding on to.
73      */

74     void dispose();
75 }
76
Popular Tags