301 |
|
|
302 |
private boolean popupVisible() |
private boolean popupVisible() |
303 |
{ |
{ |
304 |
JMenuBar mb = (JMenuBar) ((JMenu)menuItem).getParent(); |
JMenuBar mb = (JMenuBar) ((JMenu) menuItem).getParent(); |
305 |
// check if mb.isSelected because if no menus are selected |
// check if mb.isSelected because if no menus are selected |
306 |
// we don't have to look through the list for popup menus |
// we don't have to look through the list for popup menus |
307 |
if (!mb.isSelected()) |
if (!mb.isSelected()) |
308 |
return false; |
return false; |
309 |
for (int i=0;i<mb.getMenuCount();i++) |
for (int i = 0; i < mb.getMenuCount(); i++) |
310 |
if (((JMenu)mb.getComponent(i)).isPopupMenuVisible()) |
{ |
311 |
|
JMenu m = mb.getMenu(i); |
312 |
|
if (m != null && m.isPopupMenuVisible()) |
313 |
return true; |
return true; |
314 |
|
} |
315 |
return false; |
return false; |
316 |
} |
} |
317 |
|
|