1. /*
  2. * @(#)DesignMode.java 1.7 01/11/29
  3. *
  4. * Copyright 2002 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, in order to propagate to its nested hierarchy of
  12. * java.beans.BeanContextChild instances, the current "designTime" property.
  13. * </p>
  14. *
  15. * <p>
  16. * The JavaBeans specification defines the notion of design time as is a
  17. * mode in which JavaBeans instances should function during their composition
  18. * and customization in a interactive design, composition or construction tool,
  19. * as opposed to runtime when the JavaBean is part of an applet, application,
  20. * or other live Java executable abstraction.
  21. * </p>
  22. *
  23. * @author Laurence P. G. Cable
  24. * @version 1.7
  25. * @since JDK1.2
  26. *
  27. * @see java.beans.BeanContext
  28. * @see java.beans.BeanContextChild
  29. * @see java.beans.BeanContextListener
  30. * @see java.beans.PropertyChangeEvent
  31. */
  32. public interface DesignMode {
  33. /**
  34. * <p>
  35. * the standard value of the propertyName as fired from a BeanContext or
  36. * other source of PropertyChangeEvents.
  37. * </p>
  38. */
  39. static String PROPERTYNAME = "designTime";
  40. /**
  41. * Sets the "value" of the "designTime" property.
  42. *
  43. * @param designTime sets the current "value" of the "designTime" property.
  44. * <p>
  45. * If the implementing object is an instance of java.beans.BeanContext, or
  46. * a subinterface thereof, then that BeanContext should fire a
  47. * PropertyChangeEvent, to its registered BeanContextListeners, with
  48. * parameters:
  49. *
  50. * @param propertyName java.beans.DesignMode.PROPERTYNAME
  51. * @param oldValue previous value of "designTime"
  52. * @param newValue current value of "designTime"
  53. * </p>
  54. *
  55. * <p>
  56. * Note it is illegal for a BeanContextChild to invoke this method
  57. * associated with a BeanContext that it is nested within.
  58. * </p>
  59. *
  60. * @see java.beans.BeanContext
  61. * @see java.beans.BeanContextListener
  62. * @see java.beans.PropertyChangeEvent
  63. */
  64. void setDesignTime(boolean designTime);
  65. /**
  66. * <p>
  67. * A value of true denotes that JavaBeans should behave in design time
  68. * mode, a value of false denotes runtime behavior.
  69. * </p>
  70. *
  71. * @return the current "value" of the "designTime" property.
  72. */
  73. boolean isDesignTime();
  74. }