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