incubator-adffaces-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rogers Reilly <rogers_rei...@s-rod.com>
Subject protected final methods in ADF components/renderers
Date Mon, 15 May 2006 02:01:04 GMT
Hi,

I'm looking into extending <af:table>, and had a question about the use 
of "final" on several protected methods- notably the 
"renderRegularHeaders" method in DesktopTableRenderer.  All I need to do 
is stick javascript onmouseover/onmouseout events (a feature the 
Tomahawk table has in the form of "rowOnMouseover/rowOnMouseout") on the 
TR element, which gets written there, but because the method is marked 
"final," I'm stuck overriding a method way higher up the stack (haven't 
figured out exactly how high yet) and copying a bunch of code verbatim.

I ran into a similar issue adding the defaultSortOrder feature I 
submitted a JIRA issue about earlier; some "final" method of 
ColumnGroupRenderer necessitated my extending XhtmlRenderer directly 
with lots of copied code, rather than extending ColumnGroupRenderer and 
overriding a method or two.  (by the way, will provide working 
defaultSortOrder code when I get a sec)

My question--and this is an honest question, I'm a relatively new and 
self-taught Java developer--is what does marking these methods "final" 
buy you?  If they're marked "protected," it seems like they're designed 
to be overriden.  A lot of the features I'd like to add--little 
Javascript here and there, maybe inline CSS on child table elements, 
etc--is piddly stuff that would be great to be able to implement with 
polymorphism.

Thanks in advance,
Rogers

Mime
View raw message