Refactory.
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.wiki / src / net / sourceforge / phpeclipse / wiki / preferences / WikiProjectPreferences.java
1 package net.sourceforge.phpeclipse.wiki.preferences;
2
3 import net.sourceforge.phpeclipse.wiki.editor.WikiEditorPlugin;
4
5 import org.eclipse.jface.preference.DirectoryFieldEditor;
6 import org.eclipse.jface.preference.FileFieldEditor;
7 import org.eclipse.jface.preference.IPreferenceStore;
8 import org.eclipse.jface.preference.StringFieldEditor;
9 import org.eclipse.swt.widgets.Composite;
10 import org.eclipse.ui.IWorkbench;
11 import org.eclipse.ui.IWorkbenchPreferencePage;
12
13 /**
14  * 
15  * This page will be added to the project's property page dialog when the "Properties..." popup menu item is selected
16  */
17 public class WikiProjectPreferences extends FieldEditorOverlayPage implements IWorkbenchPreferencePage {
18
19   public final static String PREF_ID = "net.sourceforge.phpeclipse.wiki.preferences.WikiProjectPreferences";
20
21   public WikiProjectPreferences() {
22     super(GRID);
23   }
24
25   /*
26    * (non-Javadoc)
27    * 
28    * @see net.sourceforge.phpeclipse.wiki.preferences.FieldEditorOverlayPage#getPageId()
29    */
30   protected String getPageId() {
31     return PREF_ID;
32   }
33
34   protected void createFieldEditors() {
35     Composite composite = getFieldEditorParent();
36
37     addField(new DirectoryFieldEditor(WikiEditorPlugin.HTML_OUTPUT_PATH, Messages.getString("WikiProjectPreferences.StaticWikiFolder"), composite));
38     addField(new DirectoryFieldEditor(WikiEditorPlugin.WIKI_TEXTS_BASE_PATH, Messages.getString("WikiProjectPreferences.WikiTextsFolder"), composite));
39     addField(new FileFieldEditor(WikiEditorPlugin.LOCAL_TEMPLATE_FILE_NAME, Messages.getString("WikiProjectPreferences.LocalTemplateFile"), composite));
40     addField(new StringFieldEditor(WikiEditorPlugin.LOCAL_CSS_URL, Messages.getString("WikiProjectPreferences.LocalCssUrl"), composite));
41     addField(new FileFieldEditor(WikiEditorPlugin.EXPORT_TEMPLATE_FILE_NAME, Messages.getString("WikiProjectPreferences.ExportTemplateFile"), composite));  
42     addField(new StringFieldEditor(WikiEditorPlugin.EXPORT_CSS_URL, Messages.getString("WikiProjectPreferences.ExportCssUrl"), composite));
43     }
44  
45   /*
46    * (non-Javadoc)
47    * 
48    * @see org.eclipse.jface.preference.PreferencePage#doGetPreferenceStore()
49    */
50   protected IPreferenceStore doGetPreferenceStore() {
51     return WikiEditorPlugin.getDefault().getPreferenceStore();
52   }
53
54   /*
55    * (non-Javadoc)
56    * 
57    * @see org.eclipse.ui.IWorkbenchPreferencePage#init(org.eclipse.ui.IWorkbench)
58    */
59   public void init(IWorkbench workbench) {
60     setDescription("Default entries static wiki pages.");
61   }
62 }