Fundamentals 21 min read

IntelliJ IDEA Plugin Development Guide

This tutorial provides a comprehensive guide to developing plugins for IntelliJ IDEA, covering environment setup, project structure, actions, components, services, persistence mechanisms, dependency management, and GUI creation using the built-in designer for developers.

JD Retail Technology
JD Retail Technology
JD Retail Technology
IntelliJ IDEA Plugin Development Guide

The tutorial begins with setting up the development environment, recommending the Community edition of IntelliJ IDEA for plugin development because its open-source nature allows debugging of the IDE’s source code. It explains how to install the Plugin DevKit, configure the IntelliJ Platform Plugin SDK, and optionally set up source code paths and sandbox instances for isolated plugin debugging.

Next, it describes the standard plugin project structure, highlighting the src directory for implementation classes and the resources/META-INF/plugin.xml file as the plugin’s descriptor. The plugin.xml file is detailed, showing how to define plugin metadata such as name, ID, version, description, vendor, dependencies, extension points, and components (application, project, module level).

The guide then covers actions, which represent menu items or toolbar buttons. It explains how to create an action by extending AnAction and overriding the actionPerformed method, and how to register actions in plugin.xml using the element, including , , and tags to place actions in menus or toolbars.

Components are presented as fundamental building blocks of plugins, with three types: application, project, and module components. The lifecycle methods (constructor, initComponent, disposeComponent, and for project/module components projectOpened/projectClosed and moduleAdded) are explained, along with how components obtain references to other components via constructor injection and how to access them through the appropriate container managers.

Services are introduced as on-demand loaded components accessed via ServiceManager.getService(Class). The tutorial shows how to declare services in plugin.xml using , , or elements, and how to generate service interfaces and implementations using the New | Plugin DevKit wizard.

Persistence mechanisms are discussed for retaining plugin state across IDE restarts. The PropertiesComponent class is described for storing simple key‑value values at application or project level, while PersistentStateComponent is used for persisting complex state, requiring a state bean, getState() and loadState() methods, and the @State annotation to define storage location and format.

Finally, the tutorial addresses plugin dependencies, explaining how to add external or bundled plugin JARs to the IntelliJ Platform SDK classpath and declare them in plugin.xml with tags, and provides an overview of the GUI Designer tool for creating Swing‑based interfaces, including form files, layout editing, and code generation.

JavaPersistenceIntelliJ IDEAComponentsplugin developmentActionsIDE extensibilityServices
JD Retail Technology
Written by

JD Retail Technology

Official platform of JD Retail Technology, delivering insightful R&D news and a deep look into the lives and work of technologists.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.