misc changes
[phpeclipse.git] / net.sourceforge.phpeclipse / src / net / sourceforge / phpeclipse / preferences / PHPPreviewProjectPreferences.java
1 package net.sourceforge.phpeclipse.preferences;
2 import net.sourceforge.phpeclipse.IPreferenceConstants;
3 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
4
5 import org.eclipse.jface.preference.BooleanFieldEditor;
6 import org.eclipse.jface.preference.IPreferenceStore;
7 import org.eclipse.swt.widgets.Composite;
8 import org.eclipse.ui.IWorkbench;
9 import org.eclipse.ui.IWorkbenchPreferencePage;
10
11 import net.sourceforge.phpeclipse.overlaypages.FieldEditorOverlayPage;
12 /**
13  * 
14  * This page will be added to the project's property page dialog when the
15  * "Properties..." popup menu item is selected
16  */
17 public class PHPPreviewProjectPreferences extends FieldEditorOverlayPage
18     implements
19       IWorkbenchPreferencePage {
20   public final static String PREF_ID = "net.sourceforge.phpeclipse.preferences.PHPPreviewProjectPreferences";
21   
22   public PHPPreviewProjectPreferences() {
23     super(GRID, true);
24   }
25   /*
26    * (non-Javadoc)
27    * 
28    * @see com.bdaum.overlayPages.FieldEditorOverlayPage#getPageId()
29    */
30   protected String getPageId() {
31     return PREF_ID;
32   }
33   /*
34    * (non-Javadoc)
35    * 
36    * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
37    */
38   protected void createFieldEditors() {
39     Composite composite = getFieldEditorParent();
40     addField(new BooleanFieldEditor(
41         IPreferenceConstants.PHP_AUTO_PREVIEW_DEFAULT, PHPPreferencesMessages
42             .getString("PHPPreviewProjectPreferences.auto_preview"), composite));
43     addField(new BooleanFieldEditor(
44         IPreferenceConstants.PHP_BRING_TO_TOP_PREVIEW_DEFAULT, PHPPreferencesMessages
45             .getString("PHPPreviewProjectPreferences.bring_to_top_preview"), composite));
46     addField(new BooleanFieldEditor(
47         IPreferenceConstants.PHP_SHOW_HTML_FILES_LOCAL, PHPPreferencesMessages
48             .getString("PHPPreviewProjectPreferences.show_html_files_local"), composite));
49     //if (!isPropertyPage)) {
50     //  
51     //}
52   }
53   /*
54    * (non-Javadoc)
55    * 
56    * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
57    */
58   protected IPreferenceStore doGetPreferenceStore() {
59     return PHPeclipsePlugin.getDefault().getPreferenceStore();
60   }
61   /*
62    * (non-Javadoc)
63    * 
64    * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
65    */
66   public void init(IWorkbench workbench) {
67     setDescription("Default entries for Previewer.");
68   }
69 }