use of easik.ui.tree.popup.DeleteFromOverviewFromTreeAction in project fql by CategoricalData.
the class OverviewInfoTreeUI method buildPopupMenu.
/**
* Creates the popup menu
*/
private void buildPopupMenu() {
_popupMenu.add(_addSketchItem = new JMenuItem(new NewSketchAction(_newPosition, _theFrame.getOverview())));
_popupMenu.add(_addViewItem = new JMenuItem(new NewViewFromTreeAction(_theFrame.getOverview())));
_popupMenu.add(_renameSketchItem = new JMenuItem(new RenameInOverviewFromTreeAction(_theFrame, "Rename Sketch")));
_popupMenu.add(_deleteSketchItem = new JMenuItem(new DeleteFromOverviewFromTreeAction(_theFrame, "Delete Sketch")));
_popupMenu.add(_renameViewItem = new JMenuItem(new RenameInOverviewFromTreeAction(_theFrame, "Rename View")));
_popupMenu.add(_deleteViewItem = new JMenuItem(new DeleteFromOverviewFromTreeAction(_theFrame, "Delete View")));
_infoTree.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(MouseEvent evt) {
if (evt.isPopupTrigger()) {
_infoTree.setSelectionRow(_infoTree.getClosestRowForLocation(evt.getX(), evt.getY()));
_newPosition.setLocation(_theFrame.getOverview().getNewSketchPosition(10));
if (setPopMenuItems()) {
_popupMenu.show(evt.getComponent(), evt.getX(), evt.getY());
}
}
}
@Override
public void mouseReleased(MouseEvent evt) {
mousePressed(evt);
}
});
}
Aggregations