(Component cmp)
| 2612 | /// |
| 2613 | /// true if this Component contains in this Container |
| 2614 | public boolean contains(Component cmp) { |
| 2615 | if (cmp == null) { |
| 2616 | return false; |
| 2617 | } |
| 2618 | cmp = cmp.getParent(); |
| 2619 | while (cmp != null) { |
| 2620 | if (cmp == this) { //NOPMD CompareObjectsWithEquals |
| 2621 | return true; |
| 2622 | } |
| 2623 | cmp = cmp.getParent(); |
| 2624 | } |
| 2625 | return false; |
| 2626 | } |
| 2627 | |
| 2628 | /// Makes sure the component is visible in the scroll if this container is |
| 2629 | /// scrollable |