Extend splitpanel

1 view
Skip to first unread message

Michael Vogt

unread,
Jun 16, 2008, 9:24:04 AM6/16/08
to Google-We...@googlegroups.com
Hi all.

I want to add special behaviour to the HorizontalSplitPanel, to
enforce a minimal size of either side. Generaly I would just extend
the HorizontalSplitPanel. Since it is declared final, this option is
not available.

Any other way to implement this?


Thanks,
Michael Vogt

gregor

unread,
Jun 16, 2008, 10:38:13 AM6/16/08
to Google Web Toolkit
Hi Michael,

I did this about 9 months ago. Not only can you not extend HSP but you
can't just copy the code into your own version either. Can't remember
exactly why, but I think it's because the base class SplitPanel uses
(or used) stuff that was package protected. So I downloaded the system
from SVN and copied the classes (MySplitPanel & MyHoriz.. etc)
building my own version of GWT jars. I made MySplitPanel implement
SourcesChangeEvents fired from splitter drag events and had MyHSP
provide two methods to get the pixes size of both the left and right
panels. Hence I could get the HSP splitter to "jump back" to some
given minimum panel size.

None of this was that difficult, but when I wanted to upgrade to
1.4..61 I looked again at the hassle involved and asked myself
"Exactly why am I doing this?". Came to the conclusion it wasn't worth
it, especially since the result was a bit hit and miss depending on
how fast you dragged the splitter and let it go etc. So I gave up on
the idea and reverted back to standard HSP.

regards
gregor

walden

unread,
Jun 16, 2008, 2:34:09 PM6/16/08
to Google Web Toolkit
You don't really need to build your own version of the gwt jars. You
can create the same com.google.gwt.* packages in your own project and
hack on the google code there. Just make sure your sources appear
first on the compile classpath.

Walden
> > Michael Vogt- Hide quoted text -
>
> - Show quoted text -

Michael Vogt

unread,
Jun 17, 2008, 2:05:06 AM6/17/08
to Google-We...@googlegroups.com
Hello Gregor.

Thanks for your fast answer and your advice.

What you did was about what I was about to do. I asked here because
I hoped there is another way.

I tried to understand, why the HorizontalPanel is declared final, but
don't see the reason for this. So I wonder, in what kind of problems I
will run into when I change this class to non final.

Does anybody know?
(trying it out now)


Thanks,
Michael Vogt

Reply all
Reply to author
Forward
0 new messages