365 |
* @return the first ancestor Window of <code>comp</code> or |
* @return the first ancestor Window of <code>comp</code> or |
366 |
* <code>null</code> if <code>comp</code> is not contained in a Window |
* <code>null</code> if <code>comp</code> is not contained in a Window |
367 |
*/ |
*/ |
368 |
public Window getWindowAncestor(Component comp) |
public static Window getWindowAncestor(Component comp) |
369 |
{ |
{ |
370 |
return (Window) getAncestorOfClass(Window.class, comp); |
return (Window) getAncestorOfClass(Window.class, comp); |
371 |
} |
} |
1128 |
component.setActionMap(uiActionMap); |
component.setActionMap(uiActionMap); |
1129 |
else |
else |
1130 |
{ |
{ |
1131 |
while(child.getParent() != null |
ActionMap parent = child.getParent(); |
1132 |
&& !(child.getParent() instanceof ActionMapUIResource)) |
while(parent != null) |
1133 |
child = child.getParent(); |
{ |
1134 |
|
child = parent; |
1135 |
|
parent = child.getParent(); |
1136 |
|
} |
1137 |
|
|
1138 |
if (child != null) |
if (child != null) |
1139 |
child.setParent(uiActionMap); |
child.setParent(uiActionMap); |
1140 |
} |
} |