01: /*******************************************************************************
02: * Copyright (c) 2006, 2007 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.jdt.internal.ui.preferences;
11:
12: import org.eclipse.core.runtime.preferences.IScopeContext;
13:
14: import org.eclipse.core.resources.IProject;
15: import org.eclipse.core.resources.ProjectScope;
16:
17: import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
18: import org.eclipse.jdt.internal.ui.JavaPlugin;
19:
20: /**
21: * Configures Java Editor save participant preferences.
22: *
23: * @since 3.3
24: */
25: public final class SaveParticipantPreferencePage extends
26: AbstractConfigurationBlockPreferenceAndPropertyPage {
27:
28: public static final String PROPERTY_PAGE_ID = "org.eclipse.jdt.ui.propertyPages.SaveParticipantPreferencePage"; //$NON-NLS-1$
29: public static final String PREFERENCE_PAGE_ID = "org.eclipse.jdt.ui.preferences.SaveParticipantPreferencePage"; //$NON-NLS-1$
30:
31: /**
32: * {@inheritDoc}
33: */
34: protected String getHelpId() {
35: return IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE;
36: }
37:
38: /**
39: * {@inheritDoc}
40: */
41: protected IPreferenceAndPropertyConfigurationBlock createConfigurationBlock(
42: IScopeContext context) {
43: return new SaveParticipantConfigurationBlock(context, this );
44: }
45:
46: /**
47: * {@inheritDoc}
48: */
49: protected String getPreferencePageID() {
50: return PREFERENCE_PAGE_ID;
51: }
52:
53: /**
54: * {@inheritDoc}
55: */
56: protected String getPropertyPageID() {
57: return PROPERTY_PAGE_ID;
58: }
59:
60: /**
61: * {@inheritDoc}
62: */
63: protected boolean hasProjectSpecificOptions(IProject project) {
64: return JavaPlugin.getDefault().getSaveParticipantRegistry()
65: .hasSettingsInScope(new ProjectScope(project));
66: }
67: }
|