use of org.jetbrains.plugins.gradle.codeInsight.actions.AddGradleDslPluginAction in project android by JetBrains.
the class GradleDslMethodNotFoundErrorHandler method getApplyGradlePluginHyperlink.
@NotNull
private static NotificationHyperlink getApplyGradlePluginHyperlink(@NotNull final VirtualFile virtualFile, @NotNull final NotificationData notification) {
return new NotificationHyperlink("apply.gradle.plugin", "Apply Gradle plugin") {
@Override
protected void execute(@NotNull Project project) {
openFile(virtualFile, notification, project);
ActionManager actionManager = ActionManager.getInstance();
String actionId = AddGradleDslPluginAction.ID;
AnAction action = actionManager.getAction(actionId);
assert action instanceof AddGradleDslPluginAction;
AddGradleDslPluginAction addPluginAction = (AddGradleDslPluginAction) action;
actionManager.tryToExecute(addPluginAction, ActionCommand.getInputEvent(actionId), null, ActionPlaces.UNKNOWN, true);
}
};
}
use of org.jetbrains.plugins.gradle.codeInsight.actions.AddGradleDslPluginAction in project intellij-community by JetBrains.
the class ApplyGradlePluginCallback method hyperlinkActivated.
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
new GotoSourceNotificationCallback(myNotificationData, myProject).hyperlinkActivated(notification, event);
final AnAction action = ActionManager.getInstance().getAction(AddGradleDslPluginAction.ID);
assert action instanceof AddGradleDslPluginAction;
final AddGradleDslPluginAction addGradleDslPluginAction = (AddGradleDslPluginAction) action;
ActionManager.getInstance().tryToExecute(addGradleDslPluginAction, ActionCommand.getInputEvent(AddGradleDslPluginAction.ID), null, ActionPlaces.UNKNOWN, true);
}
Aggregations