That is exactly what i am doing right now. And i have no problem if it has to stay that way. However I thought i might be helpful for everyone extending CompoundPropertyModel, and given the fact that none of the methods in AttachedCompoundPropertyModel are final or otherwise protected against overriding i though it was an oversight. And like you said there is not much going on in that class so why not make it extendable.
just my 2 cents, Maurice On 6/17/07, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
Can't you just create your own version of AttachedCompoundPropertyModel (you are after all thinking about extending it, and there isn't so much going on in that class) and overriding wrapOnInheritance and return an instance of your class? Eelco On 6/17/07, Maurice Marrink <[EMAIL PROTECTED]> wrote: > Hi, I am in the process of extending CompoundPropertyModel and its > inner class AttachedCompoundPropertyModel. However since the last is a > private inner class i am forced to copy the class definition in to my > own creating some code duplication. In order to prevent this > duplication it would be helpful if this inner class was made protected > instead of private and provided a method to access the owning > component. These proposed changes are already applied to the attached > patch. So if everybody agrees the change can be made very quickly. > > Index: . > =================================================================== > --- . (revision 548032) > +++ . (working copy) > @@ -149,7 +149,7 @@ > * > * @author ivaynberg > */ > - private class AttachedCompoundPropertyModel extends AbstractPropertyModel > + protected class AttachedCompoundPropertyModel extends AbstractPropertyModel > implements IWrapModel > { > private static final long serialVersionUID = 1L; > @@ -167,7 +167,14 @@ > super(CompoundPropertyModel.this); > this.owner = owner; > } > - > + /** > + * The owning component of this model. > + * @return the component owning this model. > + */ > + protected final Component getOwner() > + { > + return owner; > + } > /** > * @see org.apache.wicket.model.AbstractPropertyModel#propertyExpression() > */ > > > What do you think? > > Maurice >