OSDN Git Service

Jumbo patch:
[pf3gnuchains/gcc-fork.git] / libjava / java / beans / DesignMode.java
1 /* java.beans.DesignMode
2    Copyright (C) 1999 Free Software Foundation, Inc.
3
4 This file is part of GNU Classpath.
5
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10  
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING.  If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
20
21 As a special exception, if you link this library with other files to
22 produce an executable, this library does not by itself cause the
23 resulting executable to be covered by the GNU General Public License.
24 This exception does not however invalidate any other reasons why the
25 executable file might be covered by the GNU General Public License. */
26
27
28 package java.beans;
29
30 /**
31  * <code>BeanContextChild</code> implementors implement this to get information about whether they are in a design time or runtime environment.
32  * The reason this is restricted to <code>BeanContextChild</code>ren is that
33  * only things in the <code>BeanContext</code> hierarchy are given this
34  * information in the first place.
35  *
36  * @author John Keiser
37  * @since JDK1.2
38  * @see java.beans.beancontext.BeanContextChild
39  */
40
41 public interface DesignMode {
42         /**
43          * Use this name when firing <code>PropertyChangeEvent</code>s from your Bean.  
44          * @fixme Check whether PROPERTYNAME is set to same value as Sun.
45          */
46         public static final String PROPERTYNAME = "designTime";
47
48         /**
49          * The environment will call this method on your
50          * <code>BeanContextChild</code> when it is registered in a parent
51          * <code>BeanContext</code> or when behavior needs to switch from
52          * design time to runtime behavior (or vice versa).
53          * <P>
54          *
55          * <code>BeanContext</code>s are required to fire
56          * <code>PropertyChangeEvent</code>s when properties change.
57          * <code>designTime</code> is a property, and therefore when you
58          * implement <code>setDesignTime()</code>, you need to fire a
59          * <code>PropertyChangeEvent</code> with the old value, the new
60          * value and using <code>PROPERTYNAME</code> as the property name.
61          *
62          * @param designTime the new value of design time,
63          *        <code>true</code> if it is design time,
64          *        <code>false</code> if it is runtime.
65          *
66          * @fixme I'm frankly not really sure whether it's the case that
67          *        the BeanContext can <em>change</em> the status of the Bean from
68          *        design time to runtime.  But it appears that it may be so.
69          *
70          * @see java.util.PropertyChangeEvent
71          * @see java.beans.beancontext.BeanContext
72          * @see #PROPERTYNAME
73          */
74         public void setDesignTime(boolean designTime);
75
76         /**
77          * This method should tell whether it is design time or runtime.
78          * @return <code>true</code> if design time, <code>false</code> if
79          *         runtime.
80          */
81         public boolean isDesignTime();
82 }