-
-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
80 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package krasa.mavenhelper.action; | ||
|
||
import com.intellij.openapi.actionSystem.AnActionEvent; | ||
import com.intellij.openapi.actionSystem.Presentation; | ||
import com.intellij.openapi.project.DumbAwareAction; | ||
import com.intellij.openapi.util.NlsActions; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.jetbrains.idea.maven.utils.actions.MavenActionUtil; | ||
|
||
import javax.swing.*; | ||
|
||
public abstract class MyAnAction extends DumbAwareAction { | ||
|
||
public MyAnAction() { | ||
} | ||
|
||
public MyAnAction(@Nullable @NlsActions.ActionText String text, @Nullable @NlsActions.ActionDescription String description, @Nullable Icon icon) { | ||
super(text, description, icon); | ||
} | ||
|
||
|
||
public MyAnAction(@Nullable Icon icon) { | ||
super(icon); | ||
} | ||
|
||
public MyAnAction(@Nullable @NlsActions.ActionText String text) { | ||
super(text); | ||
} | ||
|
||
|
||
@Override | ||
public void update(AnActionEvent e) { | ||
super.update(e); | ||
Presentation p = e.getPresentation(); | ||
p.setEnabled(isEnabled(e)); | ||
p.setVisible(isVisible(e)); | ||
} | ||
|
||
protected boolean isVisible(AnActionEvent e) { | ||
return MavenActionUtil.isMavenizedProject(e.getDataContext()); | ||
} | ||
|
||
protected boolean isEnabled(AnActionEvent e) { | ||
return MavenActionUtil.hasProject(e.getDataContext()) && MavenActionUtil.getMavenProject(e.getDataContext()) != null; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
|
||
<id>MavenRunHelper</id> | ||
<name>Maven Helper</name> | ||
<version>4.21.213.3714.0</version> | ||
<version>4.21.222.2964.0</version> | ||
|
||
<vendor url="https://github.com/krasa/MavenHelper" email="[email protected]">Vojtech Krasa</vendor> | ||
|
||
|
@@ -140,7 +140,7 @@ | |
]]> | ||
</change-notes> | ||
|
||
<idea-version since-build="213.3714.440"/> | ||
<idea-version since-build="222.2964.55"/> | ||
|
||
<application-components> | ||
</application-components> | ||
|