3.x RC1 compatibility
[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     //if (!isPropertyPage)) {
47     //  
48     //}
49   }
50   /*
51    * (non-Javadoc)
52    * 
53    * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
54    */
55   protected IPreferenceStore doGetPreferenceStore() {
56     return PHPeclipsePlugin.getDefault().getPreferenceStore();
57   }
58   /*
59    * (non-Javadoc)
60    * 
61    * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
62    */
63   public void init(IWorkbench workbench) {
64     setDescription("Default entries for Previewer.");
65   }
66 }