you could always put a MyLabel subclass in the "org.apache.tapestry5.corelib.components" package and then derive from that. Java does let classes be in different source directories and still be in the same package...
Its a little ugly ... but a whole lot better than the cut-and-paste that you are doing now... On Tue, Jun 24, 2008 at 8:05 PM, Thiago H. de Paula Figueiredo < [EMAIL PROTECTED]> wrote: > I've faced the same situation more than once trying to build my own > components that extend or slightly changes some existing T5-core component. > For example, subclassing the Label component so it always ignores its body > and generates the label name from the corresponding field id. That could be > (almost) accomplished if I could override its afterRender() method ( > http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Label.java?view=markup). > The only solution I've found yet was copying the original component class > and then changing it. > > Other examples are an ActionLink and a PageLink subclasses that have it's > own activation context logic, having an object as parameter, not the context > value itself. Again, I had to copy code instead of subclassing. > > Question to Howard: instead of having package visibility, could the core > components have methods with protected visibility? And could their fields > hava protected getters, so component subclasses can access superclass' > parameter values? Or the current situation is the best one? > > Thank you very much in advance. > > Thiago > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Patrick Moore Amplafi 650-207-9792 "copy/paste" blog : http://www.sworddance.com/blog