<idea-plugin>
    <id>com.huangzj.protoPlugin</id>
    <name>Idea-Plugin</name>
    <vendor email="support@example.com" url="https://example.com">huangzj</vendor>

    <description><![CDATA[
    Parse <code>service</code> / <code>rpc</code> from Protocol Buffers files and generate
    Spring <code>@Cmd</code> command classes (e.g. <code>AbstractTypedPbCommand</code>) similar to comm-framework.
    Also: JPA from MySQL, JSON sample from Java class, JSON to Java POJO, project memo tool window,
    and pre-commit system time vs network time check.
    ]]></description>

    <depends>com.intellij.modules.platform</depends>
    <depends>com.intellij.java</depends>

    <extensions defaultExtensionNs="com.intellij">
        <checkinHandlerFactory implementation="com.huangzj.protoplugin.vcs.CommitTimeCheckinHandlerFactory"/>
        <projectService serviceImplementation="com.huangzj.protoplugin.memo.MemoProjectService"/>
        <!-- id 与 MemoToolWindowFactory.TOOL_WINDOW_ID 保持一致 -->
        <toolWindow id="MyCustomMemo"
                    factoryClass="com.huangzj.protoplugin.memo.MemoToolWindowFactory"
                    anchor="right"
                    secondary="true"
                    canCloseContents="false"/>
        <intentionAction>
            <language>JAVA</language>
            <className>com.huangzj.protoplugin.json.ClassToJsonIntention</className>
            <category>Idea-Plugin</category>
            <descriptionDirectoryName>ClassToJsonIntention</descriptionDirectoryName>
        </intentionAction>
    </extensions>

    <actions>
        <action id="ProtoPlugin.GenerateCmdFromProto"
                class="com.huangzj.protoplugin.ProtoCmdGeneratorAction"
                text="Proto转Java"
                description="解析当前 .proto 中的 service/rpc，生成带 @Cmd 的 Java 命令类">
            <add-to-group group-id="EditorPopupMenu" anchor="last"/>
            <add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
            <add-to-group group-id="ToolsMenu" anchor="last"/>
        </action>
        <action id="ProtoPlugin.GenerateJpaFromMysql"
                class="com.huangzj.protoplugin.MysqlEntityFromFolderAction"
                text="mysql转Jpa"
                description="连接 MySQL，勾选表并生成带 jakarta.persistence 注解的实体类到所选目录">
            <add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
            <add-to-group group-id="ToolsMenu" anchor="last"/>
        </action>
        <action id="ProtoPlugin.JsonToJava"
                class="com.huangzj.protoplugin.json.JsonToJavaAction"
                text="Json转java"
                description="输入 JSON 与类名，在选中目录生成 Java Bean 源文件">
            <add-to-group group-id="ProjectViewPopupMenu" anchor="last"/>
            <add-to-group group-id="ToolsMenu" anchor="last"/>
        </action>
        <action id="ProtoPlugin.GenerateClassJson"
                class="com.huangzj.protoplugin.json.GenerateClassJsonEditorAction"
                text="生成类JSON(默认值)"
                description="根据光标所在类的字段生成带默认值的 JSON（与类名处意图相同）">
            <add-to-group group-id="EditorPopupMenu" anchor="last"/>
        </action>
        <action id="ProtoPlugin.OpenMemo"
                class="com.huangzj.protoplugin.memo.OpenMemoToolWindowAction"
                text="我的自定义备忘录"
                description="打开「我的自定义备忘录」工具窗口（按项目保存）">
            <add-to-group group-id="ToolsMenu" anchor="last"/>
        </action>
    </actions>
</idea-plugin>
