Not able to perform action for new plugin in MAC
Answered
Hi,
I have created a new plugin project on Mac OS where i am able to see action on main menu, but when clicking on action nothing happened(i.e, its not entering into action performed method) where i am able to do it in windows.
<idea-plugin>
<id>com.dbs.helloworl</id>
<name>Hello World</name>
<version>1.0</version>
<vendor email="support1@yourcompany.com" url="http://www.yourcompany1.com">YourCompany1</vendor>
<description><![CDATA[
Hello World Description
]]></description>
<change-notes><![CDATA[
]]>
</change-notes>
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="173.0"/>
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
on how to target different products -->
<!-- uncomment to enable plugin in all products
<depends>com.intellij.modules.lang</depends>
-->
<extensions defaultExtensionNs="com.intellij">
<!-- Add your extensions here -->
</extensions>
<actions>
<!-- Add your actions here -->
<group id="hello-world.MainMenu" text="Hello World" description="Hello World Desc">
<add-to-group group-id="MainMenu" anchor="last"/>
<action class="com.something.HelloWorld" id="hello-world.Actions.helloWorld"
text="Hello World"/>
</group>
</actions>
</idea-plugin>
package com.something;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.Messages;
public class HelloWorld extends AnAction
{
@Override
public void actionPerformed(AnActionEvent e)
{
// BrowserUtil.browse("https://stackoverflow.com/questions/ask");
System.out.println("Action called");
Messages.showMessageDialog(e.getProject(),"Hello World", "Hey", Messages.getInformationIcon());
}
}
Please sign in to leave a comment.
Please try to re-use existing sample plugin https://github.com/JetBrains/intellij-sdk-code-samples/tree/master/action_basics
Hi yann, Thanks for the response, I have added -Dapple.laf.useScreenMenuBar=false this to the configuration and got resolved.
I am new to this intellij plugin development , I have seen the examples which you have shared Can you suggest from where can i learn all those stuff like
I have started reading this https://www.jetbrains.org/intellij/sdk/docs/basics/action_system.html
But i did not find the classes or interfaces which you are using
Not sure I understand your question, all IntelliJ Platform code can be found in https://github.com/JetBrains/intellij-community