KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > beans > DesignMode


1 /*
2  * @(#)DesignMode.java 1.14 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.beans;
9
10 /**
11  * <p>
12  * This interface is intended to be implemented by, or delegated from, instances
13  * of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
14  * of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
15  * <p>
16  * The JavaBeans specification defines the notion of design time as is a
17  * mode in which JavaBeans instances should function during their composition
18  * and customization in a interactive design, composition or construction tool,
19  * as opposed to runtime when the JavaBean is part of an applet, application,
20  * or other live Java executable abstraction.
21  *
22  * @author Laurence P. G. Cable
23  * @version 1.14, 12/19/03
24  * @since 1.2
25  *
26  * @see java.beans.beancontext.BeanContext
27  * @see java.beans.beancontext.BeanContextChild
28  * @see java.beans.beancontext.BeanContextMembershipListener
29  * @see java.beans.PropertyChangeEvent
30  */

31
32 public interface DesignMode {
33
34     /**
35      * The standard value of the propertyName as fired from a BeanContext or
36      * other source of PropertyChangeEvents.
37      */

38
39     static String JavaDoc PROPERTYNAME = "designTime";
40
41     /**
42      * Sets the "value" of the "designTime" property.
43      * <p>
44      * If the implementing object is an instance of java.beans.beancontext.BeanContext,
45      * or a subinterface thereof, then that BeanContext should fire a
46      * PropertyChangeEvent, to its registered BeanContextMembershipListeners, with
47      * parameters:
48      * <ul>
49      * <li><code>propertyName</code> - <code>java.beans.DesignMode.PROPERTYNAME</code>
50      * <li><code>oldValue</code> - previous value of "designTime"
51      * <li><code>newValue</code> - current value of "designTime"
52      * </ul>
53      * Note it is illegal for a BeanContextChild to invoke this method
54      * associated with a BeanContext that it is nested within.
55      *
56      * @param designTime the current "value" of the "designTime" property
57      * @see java.beans.beancontext.BeanContext
58      * @see java.beans.beancontext.BeanContextMembershipListener
59      * @see java.beans.PropertyChangeEvent
60      */

61
62     void setDesignTime(boolean designTime);
63
64     /**
65      * A value of true denotes that JavaBeans should behave in design time
66      * mode, a value of false denotes runtime behavior.
67      *
68      * @return the current "value" of the "designTime" property.
69      */

70
71     boolean isDesignTime();
72 }
73
Popular Tags