HintsPanel.java 文件源码

java
阅读 27 收藏 0 点赞 0 评论 0

项目:incubator-netbeans 作者:
private void handleClick(MouseEvent e) {
    if (e.isPopupTrigger()) {
        Point p = e.getPoint();
        TreePath path = errorTree.getPathForLocation(e.getPoint().x, e.getPoint().y);
        if (path != null) {
            DefaultMutableTreeNode o = (DefaultMutableTreeNode) path.getLastPathComponent();
            if (o.getUserObject() instanceof HintMetadata) {
                HintMetadata hint = (HintMetadata) o.getUserObject();
                if (hint.category.equals(Utilities.CUSTOM_CATEGORY)) {
                    JPopupMenu popup = new JPopupMenu();
                    popup.add(new JMenuItem(new RenameHint(o, hint, path)));
                    popup.add(new JMenuItem(new RemoveHint(o, hint)));
                    popup.show(errorTree, e.getX(), e.getY());
                }
            }
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号