001: package net.suberic.util.gui.propedit;
002:
003: import net.suberic.util.VariableBundle;
004:
005: /**
006: * An interface which defines a way of editing a property.
007: */
008: public interface PropertyEditorUI {
009:
010: /**
011: * This configures an editor for the given propertyName using the
012: * PropertyManager mgr.
013: *
014: * This version usees the template property to definte all things about
015: * the editor for propertyName. This is useful if you want to be able
016: * to edit, for instace, the properties of a particular user:
017: *
018: * UserProfile.userOne.showHeaders
019: * UserProfile.userTwo.showHeaders
020: *
021: * UserProfile.showHeaders.propertyType=boolean
022: *
023: * So you can use this just to call configureEditor(factory,
024: * "UserProfile.userOne.showHeaders", "UserProfile.showHeaders", mgr,
025: * true)
026: *
027: * @param propertyName The property to be edited.
028: * @param template The property that will define the layout of the
029: * editor.
030: * @param manager The PropertyEditorManager that will manage the
031: * changes.
032: * @param isEnabled Whether or not this editor is enabled by default.
033: */
034: public void configureEditor(String propertyName, String template,
035: PropertyEditorManager manager, boolean isEnabled);
036:
037: /**
038: * This configures an editor for the given propertyName in the
039: * PropertyEditorManager mgr.
040: * @param propertyName The property to be edited. This will also be
041: * used for the editor layout.
042: * @param manager The PropertyEditorManager that will manage the
043: * changes.
044: * @param isEnabled Whether or not this editor is enabled by default.
045: */
046: public void configureEditor(String propertyName,
047: PropertyEditorManager mgr, boolean isEnabled);
048:
049: /**
050: * This configures an editor for the given propertyName in the
051: * PropertyEditorManager mgr.
052: *
053: * @param propertyName The property to be edited. This will also be
054: * used for the editor layout.
055: * @param manager The PropertyEditorManager that will manage the
056: * changes.
057: */
058: public void configureEditor(String propertyName,
059: PropertyEditorManager mgr);
060:
061: /**
062: * This writes the currently configured value in the PropertyEditorUI
063: * to the source VariableBundle.
064: */
065: public void setValue() throws PropertyValueVetoException;
066:
067: /**
068: * This resets the editor to the original (or latest set, if setValue()
069: * has been called) value of the edited property.
070: */
071: public void resetDefaultValue() throws PropertyValueVetoException;
072:
073: /**
074: * Returns the current values of the edited properties as a
075: * java.util.Properties object.
076: */
077: public java.util.Properties getValue();
078:
079: /**
080: * Sets the enabled property of the PropertyEditorUI. Disabled
081: * editors should not be able to do setValue() calls.
082: */
083: public void setEnabled(boolean newValue);
084:
085: /**
086: * Returns whether or not this editor is enabled.
087: */
088: public boolean isEnabled();
089:
090: /**
091: * Returns the PropertyEditorManager for this PropertyEditorUI.
092: */
093: public PropertyEditorManager getManager();
094:
095: /**
096: * Adds a PropertyEditorListener to the ListenerList.
097: */
098: public void addPropertyEditorListener(PropertyEditorListener pel);
099:
100: /**
101: * Removes a PropertyEditorListener from the ListenerList.
102: */
103: public void removePropertyEditorListener(PropertyEditorListener pel);
104:
105: }
|