1 package net.sourceforge.phpeclipse.news.pref;
3 import net.sourceforge.phpeclipse.news.Plugin;
5 import org.eclipse.jface.preference.BooleanFieldEditor;
6 import org.eclipse.jface.preference.FieldEditorPreferencePage;
7 import org.eclipse.jface.preference.FileFieldEditor;
8 import org.eclipse.jface.preference.IntegerFieldEditor;
9 import org.eclipse.ui.IWorkbench;
10 import org.eclipse.ui.IWorkbenchPreferencePage;
12 public class PreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage {
14 protected SiteListEditor siteListFE;
15 protected BanListEditor banListFE;
16 protected FileFieldEditor browserAppFE;
17 protected IntegerFieldEditor refreshFE;
18 protected BooleanFieldEditor forceCacheFE;
20 public PreferencePage() {
21 super("All The News", FieldEditorPreferencePage.GRID);
25 * @see FieldEditorPreferencePage#createFieldEditors()
27 protected void createFieldEditors() {
28 siteListFE = new SiteListEditor(Plugin.BACKENDS_PREFERENCE, "Sites", getFieldEditorParent());
29 banListFE = new BanListEditor(Plugin.BANNED_ITEMS_PREFERENCE, "Banned items", getFieldEditorParent());
30 browserAppFE = new FileFieldEditor(Plugin.BROWSER_PREFERENCE, "External Browser", getFieldEditorParent());
31 refreshFE = new IntegerFieldEditor(Plugin.REFRESH_INTERVAL_PREFERENCE,"Refresh interval (minutes)", getFieldEditorParent());
32 refreshFE.setValidRange(0,10000);
34 forceCacheFE = new BooleanFieldEditor(Plugin.FORCE_CACHE_PREFERENCE,"Force refresh from proxy", getFieldEditorParent());
38 addField(browserAppFE);
40 addField(forceCacheFE);
44 * @see IWorkbenchPreferencePage#init(IWorkbench)
46 public void init(IWorkbench workbench) {
47 setPreferenceStore(Plugin.getDefault().getPreferenceStore());
51 * @see org.eclipse.jface.preference.IPreferencePage#performOk()
53 public boolean performOk() {
54 boolean result = super.performOk();
55 Plugin.getDefault().setTimer();