}
private void setMenu(NXListAdapter list, boolean local) {
MouseListener popupListener = new PopupListener();
list.addMouseListener(popupListener);
NXMenu m = (NXMenu) list.getMenu();
Object[] menuItems = (Object[]) m.getIndex().values().toArray();
for (int x = 0; x < menuItems.length; x++) {
try {
((JMenuItem) menuItems[x]).addActionListener(new ListPopupListener(list, local));
} catch (Exception e) {
continue;