
org.sonar.ide.idea.utils.actions.SonarActionGroup Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of idea-sonar-plugin Show documentation
Show all versions of idea-sonar-plugin Show documentation
An IntelliJ IDEA Plugin for Sonar.
The newest version!
/*
* Copyright (C) 2010 Evgeny Mandrikov
*
* Sonar-IDE is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* Sonar-IDE is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with Sonar-IDE; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.ide.idea.utils.actions;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.DefaultActionGroup;
import com.intellij.openapi.actionSystem.Presentation;
import org.jetbrains.idea.maven.utils.actions.MavenActionUtil;
/**
* @author Evgeny Mandrikov
*/
public class SonarActionGroup extends DefaultActionGroup {
@Override
public void update(AnActionEvent event) {
super.update(event);
boolean available = isAvailable(event);
Presentation p = event.getPresentation();
p.setEnabled(available);
p.setVisible(available);
}
protected boolean isAvailable(AnActionEvent event) {
return MavenActionUtil.getProject(event) != null && !MavenActionUtil.getMavenProjects(event).isEmpty();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy