[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.albireo] Re: Context Help in SwingControl

Johannes Utzig wrote:

I tried I few things and my current 'solution' is the following:
The outer JScrollPane is set to focusable=true and registers a focus listener to itself that calls requestFocus on the inner diagram editor.
I did that, because I noticed in the code that SwingControl behaves differently if the direct child is focusable and that seems to solve the main issue at least (i.e. it didn't work at all after another workbench part was activated).

I've been thinking about this general case a bit. We shouldn't be checking just the direct child for focusability. I've committed a change to CVS that loosens the focusability check to look for *any* child with focusable == true.


I can't tell for sure, but I hope this change would remove the need for your focus listener. It depends on how your Swing component's focus policy is defined.