KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > texteditor > spelling > ISpellingPreferenceBlock


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 package org.eclipse.ui.texteditor.spelling;
12
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
15
16
17 /**
18  * Contributors to the <code>org.eclipse.ui.texteditor.spellingEngine</code>
19  * extension point can specify an implementation of this interface to be
20  * displayed on the spelling preference page, if the corresponding engine is
21  * selected.
22  * <p>
23  * This interface is intended to be implemented by clients.
24  * </p>
25  *
26  * @since 3.1
27  */

28 public interface ISpellingPreferenceBlock {
29
30     /**
31      * Creates the control that will be displayed on the preference page.
32      *
33      * @param parent the parent composite to which to add the preferences control
34      * @return the control that was added to <code>parent</code>
35      */

36     Control createControl(Composite parent);
37
38     /**
39      * Called after creating the control. Implementations should load the
40      * preferences values and update the controls accordingly. A status
41      * monitor is supplied to allow for status reporting to the user.
42      *
43      * @param statusMonitor the status monitor
44      */

45     void initialize(IPreferenceStatusMonitor statusMonitor);
46
47     /**
48      * Sets the enablement of all controls of this preference block.
49      *
50      * @param enabled <code>true</code> iff the controls should be enabled
51      */

52     void setEnabled(boolean enabled);
53
54     /**
55      * Returns <code>true</code> iff {@link #performOk()} may be called. A
56      * preference block may, for example, return <code>false</code> if
57      * some user supplied value is not valid (and validation is an expensive
58      * operation, use {@link IPreferenceStatusMonitor} to report validation
59      * results on-the-fly). A preference block may also request additional
60      * user input and cancel the initiated {@link #performOk()}, based on
61      * that input.
62      * <p>
63      * Note that this method is guaranteed to be called only on an enabled
64      * spelling engine, any spelling engine should be prepared to store its
65      * settings on {@link #performOk()} without a preceding call to this
66      * method.
67      * </p>
68      *
69      * @return <code>true</code> iff <code>performOk()</code> may be
70      * called
71      */

72     boolean canPerformOk();
73
74     /**
75      * Called when the <code>OK</code> button is pressed on the preference
76      * page. Implementations should commit the configured preference
77      * settings into their form of preference storage.
78      */

79     void performOk();
80
81     /**
82      * Called when the <code>Defaults</code> button is pressed on the
83      * preference page. Implementation should reset any preference settings to
84      * their default values and adjust the controls accordingly.
85      */

86     void performDefaults();
87
88     /**
89      * Called when the user decided to dismiss all changes. Implementation
90      * should reset any working copy changes to their previous values and
91      * adjust the controls accordingly.
92      */

93     void performRevert();
94
95     /**
96      * Called when the preference page is being disposed. Implementations should
97      * free any resources they are holding on to.
98      */

99     void dispose();
100
101 }
102
Popular Tags