On 05/25/2012 12:21 PM, Stefan Ram wrote:
> Jeff Higgins<je...@invalid.invalid> writes:
>> Have you looked about Focus Traversal Policy?
>
> In javax.swing.plaf.basic.BasicPopupMenuUI.java, there is
> the method selectParentChild(boolean), and at the end of
> this method, there is a new menu path selected that ends with
> the popup menu.
>
> It seems as if I need to overwrite this and extend the path
> so as to also include the first popup menu entry, but only
> if this selectParentChild(boolean) is called in response to
> an arrow key (not in the case of a mouse action).
>
> »Overwriting« something in a LaF also is not obvious: I want
> my program to use a new LaF that is just a copy of Oracle's
> Windows LaF but with this small change.
>
> After all, I will give up for now. I also tried a web search
> to see if someone has done this before, but to no avail.
>
Yep, I see I flubbed this one.
Being the point and clicky type I hadn't noticed the behavior you
describe in the Swing menu UI. All of the native applications I've since
looked at, both in linux-gtk and windows, implement the behavior you
hope for. I'm surprised.
After a good bit of reading on the subject since your post, I find your
statement: "»Overwriting« something in a LaF also is not obvious"
remarkably mild.
I ran across an article, "Enhancing Swing Applications", located here:
<
http://today.java.net/pub/a/today/2006/10/03/enhancing-swing-applications.html>
that I hope to pursue further after my holiday weekend.
The project described in the article seems to have changed homes, it is
now located here:
<
http://insubstantial.github.com/insubstantial/laf-widget/>
the links to documentation and etc. in the article still point to the
old home.
Kirill Grouchnikov seems to have a very good grasp of the PLAF system
and writes a lot about it, worth a look.