This plugin is meant to provide on the fly implementation of various design patterns.
You can download it directly from IntelliJ IDEA or from https://plugins.jetbrains.com/plugin/10856-design-patterns-plugin
- Behavioral
- Strategy
- Creational
- Builder (Inner)
- Factory
- Singleton
- Structural
Assuming you have already installed the plugin, you can use it just by right-clicking inside a .java file while your mouse is inside a code block that defines a class. This will bring up the editor menu and the first option will be Design Patterns, where you can choose which one should be implemented.
In order to avoid some common importing errors (when it comes to intellij plugin development), please follow the steps listed below.
- Open the project using IntelliJ IDEA (Community or Ultimate)
- In
Project Structure
->Project Settings
->Project
->Project SDK
create a newIntellJ Platform Plugin SDK
- When asked for directory, use your IntelliJ IDEA installation directory.
- Note that you will need IntelliJ IDEA Community in order to be able to properly debug the SDK's core code. If no debug is required though, Ultimate will work just fine as well.
- In
Project Language Level
choose8 - Lambdas, type annotations etc
- In
Project compiler output
choose the out folder (for exampleC:\Users\design-patterns\out
- Use
gradlew runIde
to run the plugin
- 2.0.1
- Adds support for IDEA builds from '145.20' to '191.*'
- Fixes bug that was causing 'NullPointerException' when clicking on non .java files
- Code refactoring
- 2.0.0
- Fixes bug that was causing 'ActionDuplicationException' during IDEA launch
- Migrates plugin's build tool from DevKit to Gradle
- Changes Singleton and Builder to use resource templates instead of String literals
- Adds support for IDEA builds from '145.20' to '183.*'
- 1.1.0
- Updated Builder DP, so that it can now handle mandatory fields (if the user wants to)
- Fixed bug in Builder DP, that would produce multiple constructors when ran again
- Fixed bug in Strategy/Factory DP, that would cause error, when running it in a class without package statement
- Fixed bug in Factory DP, that would produce multiple constructors when ran again
- Fixed bug in Factory DP, that would not always find all implementors of an interface
- 1.0.1
- Added Factory Design Pattern
- Fixed bug with package declaration in Strategy Design Pattern
- Fixed bug with modifiers of fields and methods in Singleton Design Pattern
- 1.0.0
- Added Builder Design Pattern
- Added Singleton Design Pattern
- Added Strategy Design Pattern
- Orestes Polyzos - Initial work - OrPolyzos