@Override
    public void update(AnActionEvent event) {
        Presentation p = event.getPresentation();
        boolean hasProject = event.getData(CommonDataKeys.PROJECT) != null;

        p.setVisible(hasProject);
    }
@Override
    public void update(AnActionEvent event)