idea.rb is an IntelliJ plugin which exposes the IntelliJ Plugin API (OpenAPI) into user space so you can define customizations to the IDE from within your project.
- Package the plugin with (this will output the plugin to build/distributions/idea.rb.zip):
$ gradle -Pidea.libraries="<idea.home>/lib" distribution
-
Install the plugin from IntelliJ. "Plugins -> "Install From Disk"
-
Create a idea.rb file in the top level directory in you project with the following content:
require 'java'
module UI
include_package 'com.intellij.openapi.ui'
end
class MyAwesomePlugin
def initialize project
@project = project
end
def project_opened
text = UI::Messages.show_input_dialog(@project, "What is your name?", "Input your name", UI::Messages.question_icon);
UI::Messages.show_message_dialog(@project, "Hello, " + text + "!\n I am glad to see you.", "Information", UI::Messages.information_icon);
end
def project_closed
end
def init_component
end
def destroy_component
end
def component_name
"My Awesome Plugin"
end
end
proc { |project| MyAwesomePlugin.new(project) }
- Reload your project.