1 /*******************************************************************************
2 * Copyright (c) 2006, 2008 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
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
11 package org.eclipse.jdt.internal.ui.javaeditor.saveparticipant;
13 import org.eclipse.swt.widgets.Composite;
14 import org.eclipse.swt.widgets.Control;
16 import org.eclipse.core.runtime.IAdaptable;
17 import org.eclipse.core.runtime.preferences.IScopeContext;
19 import org.eclipse.jface.preference.IPreferencePageContainer;
22 * Preference UI to configure details of a save participant on the the
23 * Java > Editor > Save Participants preference page.
25 * Clients may implement this interface.
30 public interface ISaveParticipantPreferenceConfiguration {
33 * Creates a control that will be displayed on the Java > Editor > Save Participants
34 * preference page to edit the details of a save participant.
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>
40 Control createControl(Composite parent, IPreferencePageContainer container);
43 * Called after creating the control.
45 * Implementations should load the preferences values and update the controls accordingly.
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
50 void initialize(IScopeContext context, IAdaptable element);
53 * Called when the <code>OK</code> button is pressed on the preference
56 * Implementations should commit the configured preference settings
57 * into their form of preference storage.</p>
62 * Called when the <code>Defaults</code> button is pressed on the
65 * Implementation should reset any preference settings to
66 * their default values and adjust the controls accordingly.</p>
68 void performDefaults();
71 * Called when the preference page is being disposed.
73 * Implementations should free any resources they are holding on to.</p>
78 * Called when project specific settings have been enabled
80 void enableProjectSettings();
83 * Called when project specific settings have been disabled
85 void disableProjectSettings();
88 * Called when a compilation unit is saved.
90 * @param context the context in which the compilation unit is saved
91 * @return true if the corresponding {@link IPostSaveListener} needs to be informed
93 boolean isEnabled(IScopeContext context);
96 * Called when the property page is opened to check whether this has enabled settings
97 * in the given context.
99 * @param context the context to check
100 * @return true if this has settings in context
102 boolean hasSettingsInScope(IScopeContext context);