1 package net.sourceforge.phpeclipse.news.pref;
3 import net.sourceforge.phpeclipse.news.Plugin;
5 import org.eclipse.jface.dialogs.InputDialog;
6 import org.eclipse.jface.preference.ListEditor;
7 import org.eclipse.swt.widgets.Composite;
9 public class BanListEditor extends ListEditor {
12 * Constructor for SiteListEditor
14 protected BanListEditor(String name, String labelText, Composite parent) {
15 super(name, labelText, parent);
19 * @see ListEditor#parseString(String)
21 protected String[] parseString(String stringList) {
22 return ListEncoder.decode(stringList);
26 * @see ListEditor#getNewInputObject()
28 protected String getNewInputObject() {
30 dialog = new InputDialog(this.getShell(),"All The News","Enter item title to ban","",null);
32 if("".equals(dialog.getValue()) || dialog.getValue()==null) {
35 return dialog.getValue();
40 * @see ListEditor#createList(String[])
42 protected String createList(String[] items) {
43 return ListEncoder.encode(items);
47 * @see org.eclipse.jface.preference.FieldEditor#doStore()
49 protected void doStore() {
51 Plugin.getDefault().updateBanList();
56 * @see org.eclipse.jface.preference.FieldEditor#doLoadDefault()
58 protected void doLoadDefault() {
59 super.doLoadDefault();
60 Plugin.getDefault().updateBanList();