文章目录
- 资料
- action_basics (基本的响应操作)
- plugin.xml
- CustomDefaultActionGroup
- PopupDialogAction
- DynamicActionGroup
- comparing_references_inspection (关注代码提示)
- conditional_operator_intention [未成功复现]
- editor_basics (选择文字替换等)
- Caret Position
- Editor Add Caret (EditorHandlerIllustration)
- Editor Replace text (字符串替换)
- MyTypedHandler
- facet_basics (框架信息)
- framework_basics (新建一个框架模板)
- inspection_basics
- kotlin_demo (kotlin插件支持)
- live_templates (应用模板)
- max_opend_project
- module (引导页)
- product_specific (特定语言平台的插件)
- project_model (获取项目环境信息)
- project_view_pane (自定义Project目录)
- project_wizard (引导页)
- psi_demo (类文件的信息)
- run_configuration (新增项)
- settings (设置页面配置)
- simple_laguage_plugin (未)
- theme_basics (未)
- tool_window (工具窗口,左右下)
- tree_structure_provider (控制Project View显示什么)
资料
intellij-sdk-code-samples
action_basics (基本的响应操作)
Creating Actions
Actions
plugin.xml
ToolsMenu上的三个
EditorPopupMenu上的一个
<actions>
<!--
See https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#registering-actions
for information about the elements and attributes used for actions and groups.
This <action> element adds a static menu item in first position of the Tools menu that shows PopupDialogAction.
Note this element has no text or description attributes because translations for them are given
by action-id in the resource-bundle.
An <override-text> element is also used for demonstration purposes to show alternate text and description strings
for this action's entries in the MainMenu. (Which includes the ToolsMenu. Try commenting out the override-text
element and see how the menu text changes.) The alternate text and description attributes do not
appear here because they are defined by action-id in the resource-bundle.
-->
<action id="org.intellij.sdk.action.PopupDialogAction" class="org.intellij.sdk.action.PopupDialogAction"
text="Action Basics Plugin: Pop Dialog Action" description="SDK action example"
icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="ToolsMenu" anchor="first"/>
<override-text place="MainMenu" text="Pop Dialog Action"/>
<keyboard-shortcut first-keystroke="control alt A" second-keystroke="C" keymap="$default"/>
<mouse-shortcut keystroke="control button3 doubleClick" keymap="$default"/>
</action>
<!--
All of the following menu groups add the action PopupDialogAction to menus in different ways.
Note that even though these groups reuse the same action class, in each use the action ids are unique.
GroupedActions demonstrates declaring an action group using the default ActionGroup implementation provided by the
IntelliJ Platform framework. (Note the lack of a group "class" attribute.) GroupedActions gets inserted after
PopupDialogAction in the Tools menu. Because the group's implementation is default, it cannot impose
enable/disable conditions. Instead it must rely on the conditions imposed by the parent menu where it is inserted.
It declares one action in the group.
-->
<group id="org.intellij.sdk.action.GroupedActions"
text="Static Grouped Actions" description="SDK statically grouped action example"
popup="true" icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="ToolsMenu" anchor="after" relative-to-action="org.intellij.sdk.action.PopupDialogAction"/>
<action id="org.intellij.sdk.action.GroupPopDialogAction" class="org.intellij.sdk.action.PopupDialogAction"
text="A Group Action" description="SDK static grouped action example"
icon="SdkIcons.Sdk_default_icon">
</action>
</group>
<!--
CustomDefaultActionGroup demonstrates declaring an action group based on a ActionGroup class supplied by this
plugin. This group is to be inserted atop the Editor Popup Menu. It declares one action in the group.
The group and action implementations are internationalized, so their declarations do not use the text or
description attributes. Instead, the information is defined in the BasicActionsBundle.
-->
<!-- 默认菜单:一级目录 -->
<group id="org.intellij.sdk.action.CustomDefaultActionGroup"
class="org.intellij.sdk.action.CustomDefaultActionGroup"
popup="true">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
<!--二级响应-->
<action id="org.intellij.sdk.action.CustomGroupedAction" class="org.intellij.sdk.action.PopupDialogAction"
icon="SdkIcons.Sdk_default_icon"/>
</group>
<!--
DynamicActionGroup demonstrates declaring an action group without a static action declaration.
An action is added to the group programmatically in the DynamicActionGroup implementation.
-->
<group id="org.intellij.sdk.action.DynamicActionGroup" class="org.intellij.sdk.action.DynamicActionGroup"
popup="true" text="Dynamically Grouped Actions" description="SDK dynamically grouped action example"
icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="ToolsMenu" anchor="after" relative-to-action="org.intellij.sdk.action.GroupedActions"/>
</group>
</actions>
CustomDefaultActionGroup
<!--
CustomDefaultActionGroup demonstrates declaring an action group based on a ActionGroup class supplied by this
plugin. This group is to be inserted atop the Editor Popup Menu. It declares one action in the group.
The group and action implementations are internationalized, so their declarations do not use the text or
description attributes. Instead, the information is defined in the BasicActionsBundle.
-->
<!-- 默认菜单:一级目录 Popup Grouped Actions[en] -->
<group id="org.intellij.sdk.action.CustomDefaultActionGroup"
class="org.intellij.sdk.action.CustomDefaultActionGroup"
popup="true">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
<!--二级响应 A Popup Action[en] -->
<action id="org.intellij.sdk.action.CustomGroupedAction" class="org.intellij.sdk.action.PopupDialogAction"
icon="SdkIcons.Sdk_default_icon"/>
</group>
PopupDialogAction
public class PopupDialogAction extends AnAction
plugin.xml中
<!--
See https://plugins.jetbrains.com/docs/intellij/basic-action-system.html#registering-actions
for information about the elements and attributes used for actions and groups.
This <action> element adds a static menu item in first position of the Tools menu that shows PopupDialogAction.
Note this element has no text or description attributes because translations for them are given
by action-id in the resource-bundle.
An <override-text> element is also used for demonstration purposes to show alternate text and description strings
for this action's entries in the MainMenu. (Which includes the ToolsMenu. Try commenting out the override-text
element and see how the menu text changes.) The alternate text and description attributes do not
appear here because they are defined by action-id in the resource-bundle.
-->
<action id="org.intellij.sdk.action.PopupDialogAction" class="org.intellij.sdk.action.PopupDialogAction"
text="Action Basics Plugin: Pop Dialog Action" description="SDK action example"
icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="ToolsMenu" anchor="first"/>
<override-text place="MainMenu" text="Pop Dialog Action"/>
<keyboard-shortcut first-keystroke="control alt A" second-keystroke="C" keymap="$default"/>
<mouse-shortcut keystroke="control button3 doubleClick" keymap="$default"/>
</action>
DynamicActionGroup
动态加载的,也就是代码加载Action
comparing_references_inspection (关注代码提示)
Code Inspections
监视你感兴趣的字符串, 并给出代码提示
conditional_operator_intention [未成功复现]
Intention actions
Intentions
Extensions
应用
editor_basics (选择文字替换等)
Basics of Working with the Editor
Extensions
Actions
<actions>
<!--替换字符串-->
<action id="EditorBasics.EditorIllustrationAction"
class="org.intellij.sdk.editor.EditorIllustrationAction"
text="Editor Replace Text"
description="Replaces selected text with 'Replacement'."
icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
</action>
<!---->
<action id="EditorBasics.EditorHandlerIllustration"
class="org.intellij.sdk.editor.EditorHandlerIllustration"
text="Editor Add Caret"
description="Adds a second caret below the existing one."
icon="SdkIcons.Sdk_default_icon">
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
</action>
<!-- Place this entry first in the popup menu; it's always enabled if a project and editor are open -->
<action id="EditorBasics.LogicalPositionIllustration"
class="org.intellij.sdk.editor.EditorAreaIllustration"
text="Caret Position"
description="Reports information about the caret position."
icon="SdkIcons.Sdk_default_icon">
<keyboard-shortcut keymap="$default" first-keystroke="control alt G"/>
<add-to-group group-id="EditorPopupMenu" anchor="first"/>
</action>
</actions>
Caret Position
Editor Add Caret (EditorHandlerIllustration)
Editor Replace text (字符串替换)
直接替换文字
MyTypedHandler
监听键盘输入,里面有个操作,给document第0个位置加入字符串
facet_basics (框架信息)
Facet IntelliJ Platform
Facet IDEA
Add frameworks (facets)
工作三年还不懂facet?赶紧学一学IntelliJ IDEA如何管理java项目
Project(项目信息)、Modules(模块信息)、Libraries(依赖信息)、Facets(框架信息)以及Artifacts(构建输出信息)
framework_basics (新建一个框架模板)
Frameworks
inspection_basics
Code Inspections
kotlin_demo (kotlin插件支持)
Configuring Kotlin Support
Kotlin UI DSL Version 2
live_templates (应用模板)
Live Templates
Providing Live Templates
Creating New Functions for Live Templates
max_opend_project
Services
<applicationListeners>
<listener class="org.intellij.sdk.maxOpenProjects.ProjectOpenCloseListener"
topic="com.intellij.openapi.project.ProjectManagerListener"/>
</applicationListeners>
<extensions defaultExtensionNs="com.intellij">
<applicationService serviceImplementation="org.intellij.sdk.maxOpenProjects.ProjectCountingService"/>
</extensions>
module (引导页)
Project Wizard Tutorial
product_specific (特定语言平台的插件)
PyCharm Plugin Development
特定语言平台的插件
project_model (获取项目环境信息)
SDK
Project
Library
How to create library for module with its ModuleDependencyItem.DependencyScope scope?
project_view_pane (自定义Project目录)
Project View
<extensions defaultExtensionNs="com.intellij">
<projectViewPane implementation="org.intellij.sdk.view.pane.ImagesProjectViewPane"/>
</extensions>
project_wizard (引导页)
未复现
Project Wizard Tutorial
psi_demo (类文件的信息)
Program Structure Interface (PSI)
Navigating the PSI
run_configuration (新增项)
Run/debug configurations
Run Configurations
Run Configurations Tutorial
settings (设置页面配置)
Settings Tutorial
Settings Guide
<extensions defaultExtensionNs="com.intellij">
<applicationConfigurable parentId="tools" instance="org.intellij.sdk.settings.AppSettingsConfigurable"
id="org.intellij.sdk.settings.AppSettingsConfigurable"
displayName="SDK: Application Settings Example"/>
<applicationService serviceImplementation="org.intellij.sdk.settings.AppSettingsState"/>
</extensions>
- AppSettingsConfigurable 需要的服务
- AppSettingsComponent 用到的界面
- AppSettingsState 数据持久化
simple_laguage_plugin (未)
theme_basics (未)
tool_window (工具窗口,左右下)
tree_structure_provider (控制Project View显示什么)
Modifying Project View Structure