(int direction, Component c)
| 4488 | |
| 4489 | /// {@inheritDoc} |
| 4490 | @Override |
| 4491 | boolean moveScrollTowards(int direction, Component c) { |
| 4492 | //if the current focus item is in a scrollable Container |
| 4493 | //try and move it first |
| 4494 | Component current = getFocused(); |
| 4495 | if (current != null) { |
| 4496 | Container parent; |
| 4497 | if (current instanceof Container) { |
| 4498 | parent = (Container) current; |
| 4499 | } else { |
| 4500 | parent = current.getParent(); |
| 4501 | } |
| 4502 | while (parent != null) { |
| 4503 | if (parent == this) { //NOPMD CompareObjectsWithEquals |
| 4504 | if (getContentPane().isScrollable()) { |
| 4505 | getContentPane().moveScrollTowards(direction, c); |
| 4506 | } |
| 4507 | |
| 4508 | } else { |
| 4509 | if (parent.isScrollable()) { |
| 4510 | return parent.moveScrollTowards(direction, c); |
| 4511 | } |
| 4512 | } |
| 4513 | parent = parent.getParent(); |
| 4514 | } |
| 4515 | } |
| 4516 | |
| 4517 | return true; |
| 4518 | } |
| 4519 | |
| 4520 | /// Initiates a quick drag event on all containers of this form that have a negative scroll position. |
| 4521 | /// Sometimes, after editing, or on a screen-size change, scroll positions can get caught in a |
no test coverage detected