KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openide > explorer > propertysheet > PropertyModel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 package org.openide.explorer.propertysheet;
20
21 import java.beans.PropertyChangeListener JavaDoc;
22
23 import java.lang.reflect.InvocationTargetException JavaDoc;
24
25
26 /**
27  * A model defining the behavior of a property. This model is used to allow
28  * components such as PropertyPanel to be used with arbitrary JavaBeans, without
29  * requiring them to be instances of Node.Property.
30  * <p>
31  * <b>Note:</b>While not yet deprecated, this class will soon be deprecated. The
32  * only functionality it offers that is distinct from Node.Property and/or
33  * PropertySupport.Reflection is the ability to listen to the model for
34  * changes, rather than listening to the bean it is a property of.
35  * <p>
36  * Users of PropertyPanel are encouraged instead to use
37  * its Node.Property constructor unless you are absolutely sure that
38  * the property you want to display can be changed by circumstances
39  * beyond your control <strong>while it is on screen</strong> (this is
40  * usually a bug not a feature).
41  *
42  * @see DefaultPropertyModel
43  * @author Jaroslav Tulach, Petr Hamernik
44  */

45 public interface PropertyModel {
46     /** Name of the 'value' property. */
47     public static final String JavaDoc PROP_VALUE = "value"; // NOI18N
48

49     /**
50      * Getter for current value of a property.
51      * @return the value
52      * @throws InvocationTargetException if, for example, the getter method
53      * cannot be accessed
54      */

55     public Object JavaDoc getValue() throws InvocationTargetException JavaDoc;
56
57     /** Setter for a value of a property.
58     * @param v the value
59     * @exception InvocationTargetException if, for example, the setter cannot
60     * be accessed
61     */

62     public void setValue(Object JavaDoc v) throws InvocationTargetException JavaDoc;
63
64     /**
65      * The class of the property.
66      * @return A class object
67      */

68     public Class JavaDoc getPropertyType();
69
70     /**
71      * The class of the property editor or <CODE>null</CODE>
72      * if default property editor should be used.
73      * @return the class of PropertyEditor that should be used to edit this
74      * PropertyModel
75      */

76     public Class JavaDoc getPropertyEditorClass();
77
78     /** Add listener to change of the value.
79     */

80     public void addPropertyChangeListener(PropertyChangeListener JavaDoc l);
81
82     /** Remove listener to change of the value.
83     */

84     public void removePropertyChangeListener(PropertyChangeListener JavaDoc l);
85 }
86
Popular Tags