01: package org.apache.ojb.tools.mapping.reversedb2.propertyEditors;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: import java.beans.PropertyChangeListener;
19:
20: /**
21: * This interface specifies that the class has editable properties for a
22: * property editor. The typical application for this is a tree where you
23: * can select objects and edit settings in another panel.
24: *
25: * The properties of the target are exposed by getAttribute() and setAttribute().
26: * If you want to monitor a property for changes, you can register a PropertyChangeListener
27: * either for all properties or a specific one.
28: *
29: * @author <a href="mailto:bfl@florianbruckner.com">Florian Bruckner</a>
30: * @version $Id: PropertyEditorTarget.java,v 1.1.2.1 2005/12/21 22:33:27 tomdz Exp $
31: */
32: public interface PropertyEditorTarget {
33: /**
34: * Return the property editor class for this PropertyEditorTarget. Depending
35: * on the GUI implementation this could for example be an extension of
36: * JPanel. The Property editor is responsible for the layout, so the property
37: * editor has to know which properties this target has.
38: */
39: public Class getPropertyEditorClass();
40:
41: /**
42: * Returns a property
43: */
44: public Object getAttribute(String key);
45:
46: /**
47: * Stores a property
48: */
49: public void setAttribute(String key, Object value);
50:
51: public void addPropertyChangeListener(
52: PropertyChangeListener listener);
53:
54: public void addPropertyChangeListener(String propertyName,
55: PropertyChangeListener listener);
56:
57: public void removePropertyChangeListener(
58: PropertyChangeListener listener);
59:
60: public void removePropertyChangeListener(String propertyName,
61: PropertyChangeListener listener);
62: }
|