Action is not triggered from main menu
Answered
Hi, i has been created first plugin for IntelliJ with simple action like on this tutorial.
But when I run plugin this action is not triggered from main menu.
I triggered my action only by hot keys and also from Search Everywhere result list.
What is my problem?
plugin.xml
<actions>
<action id="DummyAction" class="DummyAction" text="Dummy Action" description="Dummy Action">
<add-to-group group-id="WindowMenu" anchor="last"/>
<keyboard-shortcut keymap="$default" first-keystroke="ctrl meta alt D"/>
</action>
</actions>
DummyAction.java
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages;
public class DummyAction extends AnAction {
@Override
public void actionPerformed(AnActionEvent e) {
Messages.showMessageDialog("Hello!\n I am glad to see you.", "Information", Messages.getInformationIcon());
}
}
Please sign in to leave a comment.
Do you mean that you can see 'Dummy Action' menu item in 'Window' menu, but when you click on it nothing happens?
If so please look in idea.log (Help | Show Log) for exceptions.
BTW you shouldn't place classes into the root package in Java, please move the class into some package.
Why I should not place classes into root package? I'm newbie in Java world.
I can see menu item in main menu but when I click on it nothing happens.
I moved classes into package. But problem still exists.
IDEA log
I have MacBook Pro with High Sierra (macOS 10.13.3). When I build IntelliJ community edition from sources and run it, main menu is visible but does not work.
I use key -Dapple.laf.useScreenMenuBar=false to run IntelliJ community edition and my plugin too. And now I have working main menu.
I have same problem. When I click the custom action menu, there are no any response. -Dapple.laf.useScreenMenuBar=false works.
I have the same problem when running a debug IDE to test my plugin. I am going through the tutorial and when I click on Tools -> Simple Action, nothing happens. In fact, many of the standard menu items don't do anything either (ex: Tools -> Save Project As Template...)
I am having the same problem and tiered of it
I'm facing the same issue. Impossible to test plugin, since none of the actions is actionable
If you are experiencing this problem in macOS but not Win, please try this workaround:
Repeat step one of the IntelliJ Build Configuration, but base the IntelliJ IDEA JDK "1.8" on the JetBrains Java runtime (jbr) rather than the Oracle Java 8 JDK.
The jbr is located in ~/Library/Preferences/<PRODUCT><VERSION>/jdks, and will have a folder name something like "jbsdk8u152b1402.1_osx_x64".
Configure a new IntelliJ Platform SDK, using the jbr-based "1.8" JDK.
Choose this new jbr-based IntelliJ Platform SDK as the project SDK for your plugin. Recompile and then run or debug.
I'am facing the similar issue even in Win,could you suggest a solution.
Abhiram654 please share your plugin sources