1 /* java.beans.DesignMode
2 Copyright (C) 1999 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
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)
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.
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
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. */
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.
38 * @see java.beans.beancontext.BeanContextChild
41 public interface DesignMode {
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.
46 public static final String PROPERTYNAME = "designTime";
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).
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.
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.
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.
70 * @see java.util.PropertyChangeEvent
71 * @see java.beans.beancontext.BeanContext
74 public void setDesignTime(boolean designTime);
77 * This method should tell whether it is design time or runtime.
78 * @return <code>true</code> if design time, <code>false</code> if
81 public boolean isDesignTime();