entries.getReadWriteLock().writeLock().lock();
glTable.repaint();
}
public void insertNodes(JMenu menu, GroupTreeNode node) {
final AbstractAction action = getAction(node);
if (node.getChildCount() == 0) {
menu.add(action);
if (action.isEnabled())
menu.setEnabled(true);
return;
}
JMenu submenu = null;
if (node.getGroup() instanceof AllEntriesGroup) {
for (int i = 0; i < node.getChildCount(); ++i) {
insertNodes(menu, (GroupTreeNode) node.getChildAt(i));
}
} else {
submenu = new JMenu("[" + node.getGroup().getName() + "]");
// setEnabled(true) is done above/below if at least one menu
// entry (item or submenu) is enabled
submenu.setEnabled(action.isEnabled());
submenu.add(action);
submenu.add(new JPopupMenu.Separator());
for (int i = 0; i < node.getChildCount(); ++i)
insertNodes(submenu, (GroupTreeNode) node.getChildAt(i));
menu.add(submenu);