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