views:

386

answers:

2

Hi, I can't find solution for the following problem. I have custom list field, which overlaps the boundaries of its layout manager. List field consumes navigation events from manager to highlight currently selected row with special color. Layout manager is configured to support scrolling. When I scroll trackwheel down, layout manager invokes scrolling and then passes navigation event to its child, the list field. It results in inproper scrolling, because manager scrolls the whole list down to its bottom hiding list rows on the top including the selected row.

What I want is to ignore scrolling while currently selected list row is still visible and employ it otherwise.

I'm using JDE 4.2.1

+1  A: 
Max Gontar
Thanks a lot for your help, I really appreciate it. Actually, I've already solved my scrolling problems by overriding moveFocus method in a special way. I'll post the solution in a while.
nixau
Youre welcome! That would be great to have your answer!
Max Gontar
A: 

Hi, all here's the solution that helped me. By overriding moveFocus in such specific way I managed to modify default behavior of scrolling in layout manager - it skips first items of list field allowing them to stay on top.

public int moveFocus(int amount, int status, int time) {
 invalidate(getSelectedIndex());

 int unused = super.moveFocus(amount, status, time);
 return Math.abs(unused) + 1;
}
nixau