01 /*
02 * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved.
03 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
04 *
05 * This code is free software; you can redistribute it and/or modify it
06 * under the terms of the GNU General Public License version 2 only, as
07 * published by the Free Software Foundation. Sun designates this
08 * particular file as subject to the "Classpath" exception as provided
09 * by Sun in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
22 * CA 95054 USA or visit www.sun.com if you need additional information or
23 * have any questions.
24 */
25
26 package java.beans;
27
28 /**
29 * <p>
30 * This interface is intended to be implemented by, or delegated from, instances
31 * of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
32 * of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
33 * <p>
34 * The JavaBeans specification defines the notion of design time as is a
35 * mode in which JavaBeans instances should function during their composition
36 * and customization in a interactive design, composition or construction tool,
37 * as opposed to runtime when the JavaBean is part of an applet, application,
38 * or other live Java executable abstraction.
39 *
40 * @author Laurence P. G. Cable
41 * @version 1.21, 05/05/07
42 * @since 1.2
43 *
44 * @see java.beans.beancontext.BeanContext
45 * @see java.beans.beancontext.BeanContextChild
46 * @see java.beans.beancontext.BeanContextMembershipListener
47 * @see java.beans.PropertyChangeEvent
48 */
49
50 public interface DesignMode {
51
52 /**
53 * The standard value of the propertyName as fired from a BeanContext or
54 * other source of PropertyChangeEvents.
55 */
56
57 static String PROPERTYNAME = "designTime";
58
59 /**
60 * Sets the "value" of the "designTime" property.
61 * <p>
62 * If the implementing object is an instance of java.beans.beancontext.BeanContext,
63 * or a subinterface thereof, then that BeanContext should fire a
64 * PropertyChangeEvent, to its registered BeanContextMembershipListeners, with
65 * parameters:
66 * <ul>
67 * <li><code>propertyName</code> - <code>java.beans.DesignMode.PROPERTYNAME</code>
68 * <li><code>oldValue</code> - previous value of "designTime"
69 * <li><code>newValue</code> - current value of "designTime"
70 * </ul>
71 * Note it is illegal for a BeanContextChild to invoke this method
72 * associated with a BeanContext that it is nested within.
73 *
74 * @param designTime the current "value" of the "designTime" property
75 * @see java.beans.beancontext.BeanContext
76 * @see java.beans.beancontext.BeanContextMembershipListener
77 * @see java.beans.PropertyChangeEvent
78 */
79
80 void setDesignTime(boolean designTime);
81
82 /**
83 * A value of true denotes that JavaBeans should behave in design time
84 * mode, a value of false denotes runtime behavior.
85 *
86 * @return the current "value" of the "designTime" property.
87 */
88
89 boolean isDesignTime();
90 }
|