1. /*
  2. * @(#)DesignMode.java 1.13 03/01/23
  3. *
  4. * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.beans;
  8. /**
  9. * <p>
  10. * This interface is intended to be implemented by, or delegated from, instances
  11. * of java.beans.beancontext.BeanContext, in order to propagate to its nested hierarchy
  12. * of java.beans.beancontext.BeanContextChild instances, the current "designTime" property.
  13. * <p>
  14. * The JavaBeans specification defines the notion of design time as is a
  15. * mode in which JavaBeans instances should function during their composition
  16. * and customization in a interactive design, composition or construction tool,
  17. * as opposed to runtime when the JavaBean is part of an applet, application,
  18. * or other live Java executable abstraction.
  19. *
  20. * @author Laurence P. G. Cable
  21. * @version 1.13, 01/23/03
  22. * @since 1.2
  23. *
  24. * @see java.beans.beancontext.BeanContext
  25. * @see java.beans.beancontext.BeanContextChild
  26. * @see java.beans.beancontext.BeanContextMembershipListener
  27. * @see java.beans.PropertyChangeEvent
  28. */
  29. public interface DesignMode {
  30. /**
  31. * The standard value of the propertyName as fired from a BeanContext or
  32. * other source of PropertyChangeEvents.
  33. */
  34. static String PROPERTYNAME = "designTime";
  35. /**
  36. * Sets the "value" of the "designTime" property.
  37. * <p>
  38. * If the implementing object is an instance of java.beans.beancontext.BeanContext,
  39. * or a subinterface thereof, then that BeanContext should fire a
  40. * PropertyChangeEvent, to its registered BeanContextMembershipListeners, with
  41. * parameters:
  42. * <ul>
  43. * <li><code>propertyName</code> - <code>java.beans.DesignMode.PROPERTYNAME</code>
  44. * <li><code>oldValue</code> - previous value of "designTime"
  45. * <li><code>newValue</code> - current value of "designTime"
  46. * </ul>
  47. * Note it is illegal for a BeanContextChild to invoke this method
  48. * associated with a BeanContext that it is nested within.
  49. *
  50. * @param designTime the current "value" of the "designTime" property
  51. * @see java.beans.beancontext.BeanContext
  52. * @see java.beans.beancontext.BeanContextMembershipListener
  53. * @see java.beans.PropertyChangeEvent
  54. */
  55. void setDesignTime(boolean designTime);
  56. /**
  57. * A value of true denotes that JavaBeans should behave in design time
  58. * mode, a value of false denotes runtime behavior.
  59. *
  60. * @return the current "value" of the "designTime" property.
  61. */
  62. boolean isDesignTime();
  63. }