Intellij IDEA插件开发入门
现今的IDE尽管有如“洪水猛兽”般强大,但要知道再强大的IDE也没法提供给使用者想要的一切功能,
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
package com.cdai.plugin.rapidg;import com.intellij.openapi.components.ApplicationComponent;import com.intellij.openapi.ui.Messages;import org.jetbrains.annotations.NotNull;/** * My Component * User: cdai * Date: 13-11-4 * Time: 上午10:08 */public class MyComponent implements ApplicationComponent { public MyComponent() { } public void initComponent() { // TODO: insert component initialization logic here } public void disposeComponent() { // TODO: insert component disposal logic here } @NotNull public String getComponentName() { return "MyComponent"; } public void sayHello() { // Show dialog with message Messages.showMessageDialog( "Hello World!", "Sample", Messages.getInformationIcon() ); }} |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
package com.cdai.plugin.rapidg;import com.intellij.openapi.actionSystem.AnAction;import com.intellij.openapi.actionSystem.AnActionEvent;import com.intellij.openapi.application.Application;import com.intellij.openapi.application.ApplicationManager;/** * Say Hello Action * User: cdai * Date: 13-11-4 * Time: 上午10:16 */public class SayHelloAction extends AnAction { @Override public void actionPerformed(AnActionEvent e) { Application application = ApplicationManager.getApplication(); MyComponent myComponent = application.getComponent(MyComponent.class); myComponent.sayHello(); }} |
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
<idea-plugin version="2"> <id>com.cdai.plugin.rapidg</id> <name>CDai's Rapid Generator Plugin</name> <version>1.0</version> <description><![CDATA[ Enter short description for your plugin here.<br> <small>most HTML tags may be used</small> ]]></description> <change-notes><![CDATA[ Add change notes here.<br> <small>most HTML tags may be used</small> ]]> </change-notes> <!-- please see http://confluence.jetbrains.net/display/IDEADEV/Build+Number+Ranges for description --> <idea-version since-build="107.105"/> <!-- please see http://confluence.jetbrains.net/display/IDEADEV/Plugin+Compatibility+with+IntelliJ+Platform+Products on how to target different products --> <!-- uncomment to enable plugin in all products <depends>com.intellij.modules.lang</depends> --> <application-components> <!-- Add your application components here --> <component> <implementation-class>com.cdai.plugin.rapidg.MyComponent</implementation-class> </component> </application-components> <project-components> <!-- Add your project components here --> </project-components> <actions> <!-- Add your actions here --> <action id="SayHello" class="com.cdai.plugin.rapidg.SayHelloAction" text="Say Hello!"> <add-to-group group-id="WindowMenu" anchor="first"/> </action> </actions> <extensions defaultExtensionNs="com.intellij"> <!-- Add your extensions here --> </extensions></idea-plugin> |
Plugin for IntelliJ IDEA. This demo explains the basics of plugin writing and publishing.
More experienced plugin developers can find answers in these two articles:
1. The
Basics of Plugin Development for IntelliJ IDEA by Alexey Efimov (for beginners)
2. Developing
Custom Language Plugins for IntelliJ IDEA 5.0 by Dmitry Jemerov (for more advanced developers)
Also IntelliJ IDEA tries to ease the plugin development by providing specific code generation, completion, etc. Just look what was done for 5.0
and 5.1 releases for Open
API & Plugins.
Intellij IDEA插件开发入门的更多相关文章
- Chrome插件开发入门(二)——消息传递机制
Chrome插件开发入门(二)——消息传递机制 由于插件的js运行环境有区别,所以消息传递机制是一个重要内容.阅读了很多博文,大家已经说得很清楚了,直接转一篇@姬小光 的博文,总结的挺好.后面附一 ...
- IntelliJ IDEA 插件开发视频教程
IntelliJ IDEA 插件开发视频教程 学习了:http://wiki.jikexueyuan.com/project/intellij-idea-tutorial/plugins-develo ...
- Intellij IDEA 插件开发秘籍
来这里找志同道合的小伙伴! 这里总结一下 Intellij IDEA 插件开发的知识,供大家参考,本篇文章包含以下内容: 开发环境搭建 Component 介绍 Extension Point And ...
- Vue插件开发入门
相对组件来说,Vue 的插件开发受到的关注要少一点.但是插件的功能是十分强大的,能够完成许多 Vue 框架本身不具备的功能. 大家一般习惯直接调用现成的插件,比如官方推荐的 vue-router.vu ...
- discuzX3后台管理插件开发入门
discuz官方有完整的插件开发文档,详见: http://open.discuz.net/?ac=document&page=dev_plugin 关于discuz前台插件入门可以见这篇文: ...
- jQuery插件开发入门
扩展jQuery插件和方法的作用是非常强大的,它可以节省大量开发时间.这篇文章将概述jQuery插件开发的基本知识,最佳做法和常见的陷阱. 入门 编写一个jQuery插件开始于给jQuery.fn加入 ...
- intellij idea 插件开发--快速定位到mybatis mapper文件中的sql
intellij idea 提供了openApi,通过openApi我们可以自己开发插件,提高工作效率.这边直接贴个链接,可以搭个入门的demo:http://www.jianshu.com/p/24 ...
- Maven3.x 插件开发入门
Maven工具有很多插件,各种各样的插件,让我们开发调试过程中非常方便,但是终究是有你想要的但是现目前插件不能满足的(可能性非常非常低),这个时候就需要使用其他的替代工具,或者是自己来开发一个Mave ...
- openfire插件开发入门1
.案例插件的功能 这个插件很简单,就是在openfire Server启动时,和关闭时,在控制台打印出消息. 3.插件开发的目录结构设计 先来看一下当前openfire在eclipse中的目录结构: ...
随机推荐
- bzoj 3174: [Tjoi2013]拯救小矮人
Description 一群小矮人掉进了一个很深的陷阱里,由于太矮爬不上来,于是他们决定搭一个人梯.即:一个小矮人站在另一小矮人的 肩膀上,知道最顶端的小矮人伸直胳膊可以碰到陷阱口.对于每一个小矮人, ...
- 例10-3 uva10375(唯一分解定理)
题意:已知C(m,n) = m!/(n!(m-n)!),已知p,q,r,s,求C(p,q)/C(r,s) 思路: 全部分解成质因子,相乘则加,除则减 #include <iostream> ...
- centos下 apache+mysql+php的安装
一.安装 MySQL 首先来进行 MySQL 的安装.打开超级终端,输入: [root@localhost ~]# yum install mysql mysql-server 安装完毕,让 MySQ ...
- SpringCloud学习之eureka集群配置
一.集群方案及部署思路: 如果是单节点的注册中心,是无法保证系统稳定性的,当然现在项目部署架构不可能是单节点的. 集群节点的部署思路:通过运行多个实例并请求他们相互注册,来完成注册中心的高可用性(结伴 ...
- xml 制作 RSS 订阅源
首先制作一个 RSS 模板,模板的文件名是 feed.xml,代码如下: <?xml version="1.0" encoding="utf-8"?> ...
- mooc- 基本程序设计方法week1,week2
学习了第一单元我们几本可以写出10行左右的代码. week1:python编程之基本方法 1.从计算机到程序设计语言: 理解计算机:计算机是能够根据一组指令操作数据的机器. 功能性:可以进行数据计算 ...
- CRM客户关系管理系统(一)
第一章.CRM介绍和开发流程 1.1.CRM简介 客户关系管理(CRM) 客户关系管理(customer relationship management)的定义是:企业为提高核心竞争力,利用相应的信息 ...
- 利用mybatis-generator自动生成数据持久化的代码
MyBatis生成器简介 MyBatis Generator(MBG)是MyBatis MyBatis 和iBATIS的代码生成器.它将生成所有版本的MyBatis的代码,以及版本2.2.0之后的iB ...
- ECC公钥格式详解
本文首先介绍公钥格式相关的若干概念/技术,随后以示例的方式剖析DER格式的ECC公钥,最后介绍如何使用Java生成.解析和使用ECC公钥. ASN.1 Abstract Syntax Notation ...
- python序列化pickle/cPickle
一.pickle/Cpickle简介 Python序列化的概念很简单.内存里面有一个数据结构,你希望将它保存下来,重用,或者发送给其他人.你会怎么做?这取决于你想要怎么保存,怎么重用,发送给谁.很多游 ...