This patch (committed) implements some missing methods:

2006-11-16  David Gilbert  <[EMAIL PROTECTED]>

        * java/beans/beancontext/BeanContextSupport.java
        (getChildBeanContextMembershipListener): Implemented,
        (getChildPropertyChangeListener): Implemented,
        (getChildSerializable): Implemented,
        (getChildVetoableChangeListener): Implemented,
        (getChildVisibility): Implemented,
        (setDesignTime): Use same property name as Sun's implementation.

Regards,

Dave
Index: java/beans/beancontext/BeanContextSupport.java
===================================================================
RCS file: /sources/classpath/classpath/java/beans/beancontext/BeanContextSupport.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -r1.16 -r1.17
505,506c505,515
<   protected static final BeanContextMembershipListener getChildBeanContextMembershipListener (Object child)
<     throws NotImplementedException
---
>   /**
>    * Returns <code>child</code> as an instance of 
>    * [EMAIL PROTECTED] BeanContextMembershipListener}, or <code>null</code> if 
>    * <code>child</code> does not implement that interface.
>    * 
>    * @param child  the child (<code>null</code> permitted).
>    * 
>    * @return The child cast to [EMAIL PROTECTED] BeanContextMembershipListener}.
>    */
>   protected static final BeanContextMembershipListener 
>       getChildBeanContextMembershipListener(Object child)
508c517,520
<     throw new Error ("Not implemented");
---
>     if (child instanceof BeanContextMembershipListener) 
>       return (BeanContextMembershipListener) child;
>     else 
>       return null;
511,512c523,533
<   protected static final PropertyChangeListener getChildPropertyChangeListener (Object child)
<     throws NotImplementedException
---
>   /**
>    * Returns <code>child</code> as an instance of 
>    * [EMAIL PROTECTED] PropertyChangeListener}, or <code>null</code> if <code>child</code>
>    * does not implement that interface.
>    * 
>    * @param child  the child (<code>null</code> permitted).
>    * 
>    * @return The child cast to [EMAIL PROTECTED] PropertyChangeListener}.
>    */
>   protected static final PropertyChangeListener getChildPropertyChangeListener(
>       Object child)
514c535,538
<     throw new Error ("Not implemented");
---
>     if (child instanceof PropertyChangeListener) 
>       return (PropertyChangeListener) child;
>     else 
>       return null;
517,518c541,550
<   protected static final Serializable getChildSerializable (Object child)
<     throws NotImplementedException
---
>   /**
>    * Returns <code>child</code> as an instance of [EMAIL PROTECTED] Serializable}, or 
>    * <code>null</code> if <code>child</code> does not implement that 
>    * interface.
>    * 
>    * @param child  the child (<code>null</code> permitted).
>    * 
>    * @return The child cast to [EMAIL PROTECTED] Serializable}.
>    */
>   protected static final Serializable getChildSerializable(Object child)
520c552,555
<     throw new Error ("Not implemented");
---
>     if (child instanceof Serializable) 
>       return (Serializable) child;
>     else 
>       return null;
523,524c558,568
<   protected static final VetoableChangeListener getChildVetoableChangeListener (Object child)
<     throws NotImplementedException
---
>   /**
>    * Returns <code>child</code> as an instance of 
>    * [EMAIL PROTECTED] VetoableChangeListener}, or <code>null</code> if <code>child</code>
>    * does not implement that interface.
>    * 
>    * @param child  the child (<code>null</code> permitted).
>    * 
>    * @return The child cast to [EMAIL PROTECTED] VetoableChangeListener}.
>    */
>   protected static final VetoableChangeListener getChildVetoableChangeListener(
>       Object child)
526c570,573
<     throw new Error ("Not implemented");
---
>     if (child instanceof VetoableChangeListener) 
>       return (VetoableChangeListener) child;
>     else 
>       return null;
529,530c576,584
<   protected static final Visibility getChildVisibility (Object child)
<     throws NotImplementedException
---
>   /**
>    * Returns <code>child</code> as an instance of [EMAIL PROTECTED] Visibility}, or
>    * <code>null</code> if <code>child</code> does not implement that interface.
>    * 
>    * @param child  the child (<code>null</code> permitted).
>    * 
>    * @return The child cast to [EMAIL PROTECTED] Visibility}.
>    */
>   protected static final Visibility getChildVisibility(Object child)
532c586,589
<     throw new Error ("Not implemented");
---
>     if (child instanceof Visibility) 
>       return (Visibility) child;
>     else 
>       return null;
580c637,645
<   public boolean isDesignTime ()
---
>   /**
>    * Returns <code>true</code> if the <code>BeanContext</code> is in 
>    * design time mode, and <code>false</code> if it is in runtime mode.
>    * 
>    * @return A boolean.
>    * 
>    * @see #setDesignTime(boolean)
>    */
>   public boolean isDesignTime()
774c839,851
<   public void setDesignTime (boolean dtime)
---
>   /**
>    * Sets the flag that indicates whether or not the 
>    * <code>BeanContext</code> is in design mode.  If the flag changes
>    * value, a [EMAIL PROTECTED] PropertyChangeEvent} (with the property name 'designMode')
>    * is sent to registered listeners.  Note that the property name used here
>    * does NOT match the specification in the [EMAIL PROTECTED] DesignMode} interface, we
>    * match the reference implementation instead - see bug parade entry 4295174.
>    * 
>    * @param dtime  the new value for the flag.
>    * 
>    * @see #isDesignTime()
>    */
>   public void setDesignTime(boolean dtime)
778c855,857
<     firePropertyChange(DesignMode.PROPERTYNAME, Boolean.valueOf(save),
---
>     // note that we use the same property name as Sun's implementation,
>     // even though this is a known bug: see bug parade entry 4295174
>     firePropertyChange("designMode", Boolean.valueOf(save),

Reply via email to