KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > javaeditor > saveparticipant > ISaveParticipantPreferenceConfiguration


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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.jdt.internal.ui.javaeditor.saveparticipant;
12
13 import org.eclipse.core.runtime.IAdaptable;
14 import org.eclipse.core.runtime.preferences.IScopeContext;
15
16 import org.eclipse.swt.widgets.Composite;
17 import org.eclipse.swt.widgets.Control;
18
19 import org.eclipse.jface.preference.IPreferencePageContainer;
20
21 /**
22  * Preference UI to configure details of a save participant on the the
23  * Java > Editor > Save Participants preference page.
24  * <p>
25  * Clients may implement this interface.
26  * </p>
27  *
28  * @since 3.3
29  */

30 public interface ISaveParticipantPreferenceConfiguration {
31
32     /**
33      * Creates a control that will be displayed on the Java &gt; Editor &gt; Save Participants
34      * preference page to edit the details of a save participant.
35      *
36      * @param parent the parent composite to which to add the preferences control
37      * @param container the container in which this preference configuration is displayed
38      * @return the control that was added to the <code>parent</code>
39      */

40     Control createControl(Composite parent, IPreferencePageContainer container);
41
42     /**
43      * Called after creating the control.
44      * <p>
45      * Implementations should load the preferences values and update the controls accordingly.
46      * </p>
47      * @param context the context from which to load the preference values from
48      * @param element the element to configure, or null if this configures the workspace settings
49      */

50     void initialize(IScopeContext context, IAdaptable element);
51
52     /**
53      * Called when the <code>OK</code> button is pressed on the preference
54      * page.
55      * <p>
56      * Implementations should commit the configured preference settings
57      * into their form of preference storage.</p>
58      */

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

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

75     void dispose();
76     
77     /**
78      * Called when project specific settings have been enabled
79      */

80     void enableProjectSettings();
81     
82     /**
83      * Called when project specific settings have been disabled
84      */

85     void disableProjectSettings();
86     
87     /**
88      * Called when a compilation unit is saved.
89      * <p>
90      * @param context the context in which the compilation unit is saved
91      * @return true if the corresponding {@link IPostSaveListener} needs to be informed
92      */

93     boolean isEnabled(IScopeContext context);
94     
95     /**
96      * Called when the property page is opened to check whether this has enabled settings
97      * in the given context.
98      *
99      * @param context the context to check
100      * @return true if this has settings in context
101      */

102     boolean hasSettingsInScope(IScopeContext context);
103     
104 }
105
Popular Tags