Idea Intellij 插件在 android studio 1.5.1 中不起作用 [英] Idea intellij plugin not working in android studio 1.5.1

查看:41
本文介绍了Idea Intellij 插件在 android studio 1.5.1 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为 android studio 开发一个测试插件,当使用从磁盘安装插件"添加时,我的插件在 Android studio 1.5 中工作(创建的操作是可见的).但是相同的 jar 文件在 Android studio 1.5.1 中不起作用.下面是 plugin.xml 文件.请帮忙.

I'm developing a test plugin for android studio, my plugin works (The actions created are visible ) in Android studio 1.5 when added using "install plugin from disk". But the same jar file is not working in Android studio 1.5.1. Below is the plugin.xml file. Please help.

<idea-plugin version="2">
<id>com.test.android.studio.plugin</id>
<name>test Android Studio Plugin</name>
<version>1.0</version>
<vendor email="test@test.com" url="http://www.test.com">test test Services Pvt. Ltd.</vendor>

<description>
Android Studio plugin to integrate test SDK
</description>

<change-notes>
 Release 0.0.1: Initial release.
</change-notes>

<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
<idea-version since-build="131"/>

<!-- 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="Test" class="org.test.plugin.actions.TestMainActionGroup" text="Test" description="Main Test invocation Action"
           popup="true">
        <add-to-group group-id="MainMenu" anchor="last"/>

        <action id="testMode" class="org.Test.plugin.actions.TestModeAction" text="Test Mode" description="Test mode action">
            <keyboard-shortcut keymap="$default" first-keystroke="ctrl k"/>
        </action>
        <action id="invocationCode" class="org.Test.plugin.actions.InvocationCodeAction" text="Invocation Code"
                description="Test mode action">
        </action>
        <action id="onlineDoc" class="org.Test.plugin.actions.OnlineDocAction" text="Online Documentation"
                description="Test mode action">
        </action>
        <action id="aboutUs" class="org.Test.plugin.actions.AboutUsAction" text="About Us" description="Test mode action">
        </action>
    </group>

</actions>

推荐答案

正如另一个答案已经指出的那样,问题是由对操作组使用自定义组类引起的.

As the other answer already pointed out the problem is caused by using a custom group class for the action group.

何时可能需要自定义操作组?

仅当您有一些自定义逻辑来控制您的操作组的行为时才需要自定义操作组,例如应该在编辑器中的某些选择或鼠标悬停时启用该组,或者如果您想动态添加动作到组等

A Custom action group is needed only if you have some custom logic that controls the behavior of your group of actions, such as the group should be enabled on some selection in the editor,or on mouse hover ,or if you want to add actions dynamically to the group etc.

如果组的目的是将预定义的动作分组并显示在特定位置,则默认动作组就是您所需要的它可以通过以下几行轻松完成

If the purpose of group is to group the predefined actions and display it in a particular location the default action group is all that you need and it can be easily accomplished by following lines

 <group id="Test" text="Test" description="Main Test invocation Action"
       popup="true">
    <add-to-group group-id="MainMenu" anchor="last"/>
    <!--List of predefined actions here  -->
</group>

请注意,group 标签中的 class 属性已被删除.现在 IDE 将其组视为默认操作组.

Note that the class attribute from the group tag is removed. Now the IDE considers its group as Default Action Group.

这篇关于Idea Intellij 插件在 android studio 1.5.1 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆