popup.add(new JMenuItem(new NewDirectoryAction(dir)));
popup.add(new JMenuItem(new NewDocumentAction(dir)));
} else {
BeanDocument file = (BeanDocument) doc;
popup.add(new JMenuItem(new PropertyDocumentAction(file)));
popup.add(new JMenuItem(new ViewDocumentAction(file)));
popup.addSeparator();
popup.add(new JMenuItem(new DeleteDocumentAction(file)));
}
popup.show(tree, e.getX(), e.getY());