KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > preferences > SaveParticipantPreferencePage


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.preferences;
12
13 import org.eclipse.core.runtime.preferences.IScopeContext;
14
15 import org.eclipse.core.resources.IProject;
16 import org.eclipse.core.resources.ProjectScope;
17
18 import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
19 import org.eclipse.jdt.internal.ui.JavaPlugin;
20
21 /**
22  * Configures Java Editor save participant preferences.
23  *
24  * @since 3.3
25  */

26 public final class SaveParticipantPreferencePage extends AbstractConfigurationBlockPreferenceAndPropertyPage {
27     
28     public static final String JavaDoc PROPERTY_PAGE_ID= "org.eclipse.jdt.ui.propertyPages.SaveParticipantPreferencePage"; //$NON-NLS-1$
29
public static final String JavaDoc PREFERENCE_PAGE_ID= "org.eclipse.jdt.ui.preferences.SaveParticipantPreferencePage"; //$NON-NLS-1$
30

31     /**
32      * {@inheritDoc}
33      */

34     protected String JavaDoc getHelpId() {
35         return IJavaHelpContextIds.JAVA_EDITOR_PREFERENCE_PAGE;
36     }
37     
38     /**
39      * {@inheritDoc}
40      */

41     protected IPreferenceAndPropertyConfigurationBlock createConfigurationBlock(IScopeContext context) {
42         return new SaveParticipantConfigurationBlock(context, this);
43     }
44     
45     /**
46      * {@inheritDoc}
47      */

48     protected String JavaDoc getPreferencePageID() {
49         return PREFERENCE_PAGE_ID;
50     }
51     
52     /**
53      * {@inheritDoc}
54      */

55     protected String JavaDoc getPropertyPageID() {
56         return PROPERTY_PAGE_ID;
57     }
58     
59     /**
60      * {@inheritDoc}
61      */

62     protected boolean hasProjectSpecificOptions(IProject project) {
63         return JavaPlugin.getDefault().getSaveParticipantRegistry().hasSettingsInScope(new ProjectScope(project));
64     }
65 }
66
Popular Tags