KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > suberic > pooka > gui > filter > DeleteFilterEditor


1 package net.suberic.pooka.gui.filter;
2 import java.util.Properties JavaDoc;
3
4 /**
5  * This is a class that lets you choose your filter actions.
6  */

7 public class DeleteFilterEditor extends FilterEditor {
8   String JavaDoc originalFolderName;
9   
10   public static String JavaDoc FILTER_CLASS = "net.suberic.pooka.filter.DeleteFilterAction";
11   
12   /**
13    * Configures the given FilterEditor from the given VariableBundle and
14    * property.
15    */

16   public void configureEditor(net.suberic.util.gui.propedit.PropertyEditorManager newManager, String JavaDoc propertyName) {
17     manager = newManager;
18     property = propertyName;
19     // there really isn't anything to do here, is there?
20

21   }
22   
23   /**
24    * Gets the values that would be set by this FilterEditor.
25    */

26   public java.util.Properties JavaDoc getValue() {
27     Properties JavaDoc props = new Properties JavaDoc();
28     
29     String JavaDoc oldClassName = manager.getProperty(property + ".class", "");
30     if (!oldClassName.equals(FILTER_CLASS))
31       props.setProperty(property + ".class", FILTER_CLASS);
32     
33     return props;
34   }
35   
36   /**
37    * Sets the values represented by this FilterEditor in the manager.
38    */

39   public void setValue() {
40     String JavaDoc oldClassName = manager.getProperty(property + ".class", "");
41     if (!oldClassName.equals(FILTER_CLASS))
42       manager.setProperty(property + ".class", FILTER_CLASS);
43   }
44   
45   /**
46    * Returns the class that will be set for this FilterEditor.
47    */

48   public String JavaDoc getFilterClassValue() {
49     return FILTER_CLASS;
50   }
51 }
52
Popular Tags