Path: blob/master/src/java.desktop/share/classes/java/beans/DesignMode.java
41152 views
/*1* Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package java.beans;2627/**28* <p>29* This interface is intended to be implemented by, or delegated from, instances30* of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy31* of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.32* <p>33* The JavaBeans specification defines the notion of design time as is a34* mode in which JavaBeans instances should function during their composition35* and customization in a interactive design, composition or construction tool,36* as opposed to runtime when the JavaBean is part of an applet, application,37* or other live Java executable abstraction.38*39* @author Laurence P. G. Cable40* @since 1.241*42* @see java.beans.beancontext.BeanContext43* @see java.beans.beancontext.BeanContextChild44* @see java.beans.beancontext.BeanContextMembershipListener45* @see java.beans.PropertyChangeEvent46*/4748public interface DesignMode {4950/**51* The standard value of the propertyName as fired from a BeanContext or52* other source of PropertyChangeEvents.53*/5455static String PROPERTYNAME = "designTime";5657/**58* Sets the "value" of the "designTime" property.59* <p>60* If the implementing object is an instance of java.beans.beancontext.BeanContext,61* or a subinterface thereof, then that BeanContext should fire a62* PropertyChangeEvent, to its registered BeanContextMembershipListeners, with63* parameters:64* <ul>65* <li>{@code propertyName} - {@code java.beans.DesignMode.PROPERTYNAME}66* <li>{@code oldValue} - previous value of "designTime"67* <li>{@code newValue} - current value of "designTime"68* </ul>69* Note it is illegal for a BeanContextChild to invoke this method70* associated with a BeanContext that it is nested within.71*72* @param designTime the current "value" of the "designTime" property73* @see java.beans.beancontext.BeanContext74* @see java.beans.beancontext.BeanContextMembershipListener75* @see java.beans.PropertyChangeEvent76*/7778void setDesignTime(boolean designTime);7980/**81* A value of true denotes that JavaBeans should behave in design time82* mode, a value of false denotes runtime behavior.83*84* @return the current "value" of the "designTime" property.85*/8687boolean isDesignTime();88}899091