01: package net.suberic.pooka.gui.filter;
02:
03: import net.suberic.pooka.gui.propedit.FolderSelectorPane;
04: import java.util.Properties;
05:
06: /**
07: * This is a class that lets you choose your filter actions.
08: */
09: public class MoveFilterEditor extends FilterEditor {
10: String originalFolderName;
11:
12: FolderSelectorPane fsp;
13:
14: public static String FILTER_CLASS = "net.suberic.pooka.filter.MoveFilterAction";
15:
16: /**
17: * Configures the given FilterEditor from the given VariableBundle and
18: * property.
19: */
20: public void configureEditor(
21: net.suberic.util.gui.propedit.PropertyEditorManager newManager,
22: String propertyName) {
23: property = propertyName;
24: manager = newManager;
25:
26: fsp = new FolderSelectorPane();
27: fsp.configureEditor(propertyName + ".targetFolder", manager);
28:
29: this .add(fsp);
30: }
31:
32: /**
33: * Gets the values that would be set by this FilterEditor.
34: */
35: public java.util.Properties getValue() {
36: Properties props = fsp.getValue();
37:
38: String oldClassName = manager.getProperty(property + ".class",
39: "");
40: if (!oldClassName.equals(FILTER_CLASS))
41: props.setProperty(property + ".class", FILTER_CLASS);
42:
43: return props;
44: }
45:
46: /**
47: * Sets the values represented by this FilterEditor in the manager.
48: */
49: public void setValue() {
50:
51: fsp.setValue();
52:
53: String oldClassName = manager.getProperty(property + ".class",
54: "");
55: if (!oldClassName.equals(FILTER_CLASS))
56: manager.setProperty(property + ".class", FILTER_CLASS);
57: }
58:
59: /**
60: * Returns the class that will be set for this FilterEditor.
61: */
62: public String getFilterClassValue() {
63: return FILTER_CLASS;
64: }
65:
66: }
|