use of com.intellij.openapi.project.DumbAwareAction in project intellij-plugins by JetBrains.
the class FlexBuildConfigurationsExtension method createAddActions.
public Collection<AnAction> createAddActions(final NullableComputable<MasterDetailsComponent.MyNode> selectedNodeRetriever, final Runnable treeNodeNameUpdater, final Project project, final MasterDetailsComponent.MyNode root) {
final Collection<AnAction> actions = new ArrayList<>(2);
actions.add(new DumbAwareAction(FlexBundle.message("create.bc.action.text"), FlexBundle.message("create.bc.action.description"), FlexIcons.Flash_run_config) {
public void update(final AnActionEvent e) {
e.getPresentation().setVisible(getFlexModuleForNode(selectedNodeRetriever.compute()) != null);
}
public void actionPerformed(final AnActionEvent e) {
final Module module = getFlexModuleForNode(selectedNodeRetriever.compute());
myConfigurator.addConfiguration(module, treeNodeNameUpdater);
}
});
return actions;
}
Aggregations