mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
Add Kotlin code sample
This commit is contained in:
parent
11062a0a1b
commit
115bfbfb6c
1
.idea/modules.xml
generated
1
.idea/modules.xml
generated
@ -9,6 +9,7 @@
|
||||
<module fileurl="file://$PROJECT_DIR$/code_samples/gradle_plugin_demo/gradle_plugin_demo.iml" filepath="$PROJECT_DIR$/code_samples/gradle_plugin_demo/gradle_plugin_demo.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/code_samples/inspection/inspection.iml" filepath="$PROJECT_DIR$/code_samples/inspection/inspection.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/intellij-sdk-docs.iml" filepath="$PROJECT_DIR$/.idea/intellij-sdk-docs.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/code_sample/kotlin_demo/kotlin_demo.iml" filepath="$PROJECT_DIR$/code_sample/kotlin_demo/kotlin_demo.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/code_samples/module/module.iml" filepath="$PROJECT_DIR$/code_samples/module/module.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/code_samples/plugin_sample/plugin_sample.iml" filepath="$PROJECT_DIR$/code_samples/plugin_sample/plugin_sample.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/code_samples/project_model/project_model.iml" filepath="$PROJECT_DIR$/code_samples/project_model/project_model.iml" />
|
||||
|
9
.idea/runConfigurations/kotlin_demo.xml
generated
Normal file
9
.idea/runConfigurations/kotlin_demo.xml
generated
Normal file
@ -0,0 +1,9 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="kotlin_demo" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
||||
<module name="kotlin_demo" />
|
||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
|
||||
<option name="PROGRAM_PARAMETERS" value="" />
|
||||
<log_file path="$USER_HOME$/.IntelliJIdea15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
|
||||
<method />
|
||||
</configuration>
|
||||
</component>
|
13
code_sample/kotlin_demo/kotlin_demo.iml
Normal file
13
code_sample/kotlin_demo/kotlin_demo.iml
Normal file
@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PLUGIN_MODULE" version="4">
|
||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/../../code_samples/kotlin_demo/resources/META-INF/plugin.xml" />
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$/../../code_samples/kotlin_demo">
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../code_samples/kotlin_demo/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/../../code_samples/kotlin_demo/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
12
code_samples/kotlin_demo/kotlin_demo.iml
Normal file
12
code_samples/kotlin_demo/kotlin_demo.iml
Normal file
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="PLUGIN_MODULE" version="4">
|
||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/resources" type="java-resource" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
38
code_samples/kotlin_demo/resources/META-INF/plugin.xml
Normal file
38
code_samples/kotlin_demo/resources/META-INF/plugin.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<idea-plugin version="2">
|
||||
<id>org.jetbrains</id>
|
||||
<name>kotlin_demo</name>
|
||||
<version>1.0</version>
|
||||
<vendor email="support@yourcompany.com" url="http://www.yourcompany.com">YourCompany</vendor>
|
||||
|
||||
<description><![CDATA[
|
||||
Enter short description for your plugin here.<br>
|
||||
<em>most HTML tags may be used</em>
|
||||
]]></description>
|
||||
|
||||
<change-notes><![CDATA[
|
||||
Add change notes here.<br>
|
||||
<em>most HTML tags may be used</em>
|
||||
]]>
|
||||
</change-notes>
|
||||
|
||||
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/build_number_ranges.html for description -->
|
||||
<idea-version since-build="141.0"/>
|
||||
|
||||
<!-- please see http://www.jetbrains.org/intellij/sdk/docs/basics/getting_started/plugin_compatibility.html
|
||||
on how to target different products -->
|
||||
<!-- uncomment to enable plugin in all products
|
||||
<depends>com.intellij.modules.lang</depends>
|
||||
-->
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<!-- Add your extensions here -->
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
<group id="MyPlugin.TestMeu" text="Greeting" description="Greeting menu">
|
||||
<add-to-group group-id="MainMenu" anchor="last" />
|
||||
<action id="Myplugin.Textboxes" class="HelloAction" text="Hello" description="Says hello" />
|
||||
</group>
|
||||
</actions>
|
||||
|
||||
</idea-plugin>
|
11
code_samples/kotlin_demo/src/HelloAction.kt
Normal file
11
code_samples/kotlin_demo/src/HelloAction.kt
Normal file
@ -0,0 +1,11 @@
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||
import com.intellij.openapi.ui.Messages
|
||||
|
||||
class HelloAction : AnAction("Hello") {
|
||||
override fun actionPerformed(event: AnActionEvent) {
|
||||
val project = event.getData(PlatformDataKeys.PROJECT)
|
||||
Messages.showMessageDialog(project, "Hello from Kotlin!", "Greeting", Messages.getInformationIcon())
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user