Add links to example Kotlin projects for the IntelliJ Platform

This commit is contained in:
breandan 2016-01-28 06:52:50 -08:00
commit 78ce4fede8
404 changed files with 11877 additions and 27873 deletions

44
.gitignore vendored Normal file
View File

@ -0,0 +1,44 @@
### Jekyll template
_site/
.sass-cache/
.jekyll-metadata
_includes
.bundle/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio
# *.iml
## Directory-based project format:
# .idea/
# if you remove the above rule, at least ignore the following:
# User-specific stuff:
.idea/workspace.xml
.idea/tasks.xml
.idea/dictionaries
.idea/libraries/Gradle__*.xml
# Sensitive or high-churn files:
.idea/dataSources.ids
.idea/dataSources.xml
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/uiDesigner.xml
## File-based project format:
*.ipr
*.iws
### Gradle template
.gradle
build/
# Ignore Gradle GUI config
gradle-app.setting
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "sdkdocs-template"]
path = sdkdocs-template
url = https://github.com/JetBrains/sdkdocs-template.git

22
.idea/compiler.xml generated Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
<entry name="!?*.flex" />
<entry name="!?*.kt" />
<entry name="!?*.clj" />
<entry name="!?*.aj" />
</wildcardResourcePatterns>
<annotationProcessing>
<profile default="true" name="Default" enabled="false">
<processorPath useClasspath="true" />
</profile>
</annotationProcessing>
</component>
</project>

3
.idea/copyright/profiles_settings.xml generated Normal file
View File

@ -0,0 +1,3 @@
<component name="CopyrightManager">
<settings default="" />
</component>

6
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="PROJECT" charset="UTF-8" />
</component>
</project>

10
.idea/externalDependencies.xml generated Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ExternalDependencies">
<plugin id="DevKit" />
<plugin id="Docker" />
<plugin id="org.jetbrains.idea.grammar" />
<plugin id="org.jetbrains.kotlin" />
<plugin id="org.jetbrains.plugins.gradle" />
</component>
</project>

23
.idea/gradle.xml generated Normal file
View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$/code_samples/gradle_plugin_demo" />
<option name="gradleHome" value="C:/Program Files (x86)/Gradle/gradle-2.9" />
<option name="gradleJvm" value="#JAVA_HOME" />
<option name="modules">
<set>
<option value="$PROJECT_DIR$/code_samples/gradle_plugin_demo" />
</set>
</option>
<option name="myModules">
<set>
<option value="$PROJECT_DIR$/code_samples/gradle_plugin_demo" />
</set>
</option>
</GradleProjectSettings>
</option>
</component>
</project>

View File

@ -0,0 +1,11 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<option name="myLocal" value="true" />
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
</inspection_tool>
<inspection_tool class="SSBasedInspection" enabled="true" level="WARNING" enabled_by_default="true" />
</profile>
</component>

View File

@ -0,0 +1,7 @@
<component name="InspectionProjectProfileManager">
<settings>
<option name="PROJECT_PROFILE" value="Project Default" />
<option name="USE_PROJECT_PROFILE" value="true" />
<version value="1.0" />
</settings>
</component>

8
.idea/intellij-sdk-docs.iml generated Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>

12
.idea/libraries/KotlinJavaRuntime.xml generated Normal file
View File

@ -0,0 +1,12 @@
<component name="libraryTable">
<library name="KotlinJavaRuntime">
<CLASSES>
<root url="jar://$PROJECT_DIR$/lib/kotlin-runtime.jar!/" />
<root url="jar://$PROJECT_DIR$/lib/kotlin-reflect.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$PROJECT_DIR$/lib/kotlin-runtime-sources.jar!/" />
</SOURCES>
</library>
</component>

9
.idea/misc.xml generated Normal file
View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<entry_points version="2.0" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="false" assert-keyword="true" jdk-15="true" project-jdk-name="IntelliJ IDEA Community Edition IC-143.382.35" project-jdk-type="IDEA JDK">
<output url="file://$PROJECT_DIR$/build" />
</component>
</project>

28
.idea/modules.xml generated Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/code_samples/comparing_references_inspection/comparing_references_inspection.iml" filepath="$PROJECT_DIR$/code_samples/comparing_references_inspection/comparing_references_inspection.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/conditional_operator_intention/conditional_operator_intention.iml" filepath="$PROJECT_DIR$/code_samples/conditional_operator_intention/conditional_operator_intention.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/editor_basics/editor_basics.iml" filepath="$PROJECT_DIR$/code_samples/editor_basics/editor_basics.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/facet_basics/facet_basics.iml" filepath="$PROJECT_DIR$/code_samples/facet_basics/facet_basics.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/framework/framework.iml" filepath="$PROJECT_DIR$/code_samples/framework/framework.iml" />
<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_samples/kotlin_demo/kotlin_demo.iml" filepath="$PROJECT_DIR$/code_samples/kotlin_demo/kotlin_demo.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/live_templates/live_templates.iml" filepath="$PROJECT_DIR$/code_samples/live_templates/live_templates.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/max_opened_projects/max_opened_projects.iml" filepath="$PROJECT_DIR$/code_samples/max_opened_projects/max_opened_projects.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" />
<module fileurl="file://$PROJECT_DIR$/code_samples/project_view_pane/project_view_pane.iml" filepath="$PROJECT_DIR$/code_samples/project_view_pane/project_view_pane.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/project_wizard/project_wizard.iml" filepath="$PROJECT_DIR$/code_samples/project_wizard/project_wizard.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/register_actions/register_actions.iml" filepath="$PROJECT_DIR$/code_samples/register_actions/register_actions.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/run_configuration/run_configuration.iml" filepath="$PROJECT_DIR$/code_samples/run_configuration/run_configuration.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/simple_language_plugin/simple_language_plugin.iml" filepath="$PROJECT_DIR$/code_samples/simple_language_plugin/simple_language_plugin.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/tool_window/tool_window.iml" filepath="$PROJECT_DIR$/code_samples/tool_window/tool_window.iml" />
<module fileurl="file://$PROJECT_DIR$/code_samples/tree_structure_provider/tree_structure_provider.iml" filepath="$PROJECT_DIR$/code_samples/tree_structure_provider/tree_structure_provider.iml" />
</modules>
</component>
</project>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="comparing_references_inspection" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="comparing_references_inspection" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="conditional_operator_intention" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="conditional_operator_intention" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="editor_basics" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="editor_basics" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="facet_basics" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="facet_basics" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

8
.idea/runConfigurations/framework.xml generated Normal file
View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="framework" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="framework" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

9
.idea/runConfigurations/inspection.xml generated Normal file
View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="inspection" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="inspection" />
<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>

View File

@ -0,0 +1,26 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="intellij-sdk-docs" type="docker-deploy" factoryName="Docker Deployment" server-name="Docker">
<deployment type="dockerfile" path="$PROJECT_DIR$/Dockerfile">
<settings>
<option name="JSONFilePath" value="$PROJECT_DIR$/container_settings.json" />
<option name="command" value="" />
<option name="containerName" value="" />
<option name="entrypoint" value="" />
<option name="envVarsExpanded" value="true" />
<option name="imageTag" value="intellij-sdk-docs" />
<option name="startBrowserSettings">
<browser start="true" />
</option>
<option name="volumeBindings">
<list>
<DockerVolumeBindingImpl>
<option name="containerPath" value="/usr/src/app" />
<option name="hostPath" value="C:\Users\breandan\WebstormProjects\intellij-sdk-docs" />
</DockerVolumeBindingImpl>
</list>
</option>
</settings>
</deployment>
<method />
</configuration>
</component>

8
.idea/runConfigurations/kotlin_demo.xml generated Normal file
View File

@ -0,0 +1,8 @@
<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="" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="live_templates" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="live_templates" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
<method />
</configuration>
</component>

9
.idea/runConfigurations/module.xml generated Normal file
View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="module" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="module" />
<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>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="plugin_sample" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="plugin_sample" />
<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>

View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="project_model" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="project_model" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="project_view_pane" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="project_view_pane" />
<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>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="project_wizard" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="project_wizard" />
<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>

View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="register_actions" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="register_actions" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

20
.idea/runConfigurations/runIdea.xml generated Normal file
View File

@ -0,0 +1,20 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="runIdea" type="GradleRunConfiguration" factoryName="Gradle">
<ExternalSystemSettings>
<option name="executionName" />
<option name="externalProjectPath" value="$PROJECT_DIR$/code_samples/gradle_plugin_demo/build.gradle" />
<option name="externalSystemIdString" value="GRADLE" />
<option name="scriptParameters" value="--stacktrace" />
<option name="taskDescriptions">
<list />
</option>
<option name="taskNames">
<list>
<option value="runIdea" />
</list>
</option>
<option name="vmOptions" value="" />
</ExternalSystemSettings>
<method />
</configuration>
</component>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="run_configuration" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="run_configuration" />
<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>

View File

@ -0,0 +1,8 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="simple_language_plugin" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="simple_language_plugin" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<method />
</configuration>
</component>

View File

@ -0,0 +1,24 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="simple_language_plugin_tests" type="JUnit" factoryName="JUnit">
<extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" />
<module name="simple_language_plugin" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" />
<option name="PACKAGE_NAME" />
<option name="MAIN_CLASS_NAME" value="" />
<option name="METHOD_NAME" value="" />
<option name="TEST_OBJECT" value="directory" />
<option name="VM_PARAMETERS" value="-ea -Xbootclasspath/p:../out/classes/production/boot -XX:+HeapDumpOnOutOfMemoryError -Xmx512m -XX:MaxPermSize=320m -Didea.system.path=../test-system -Didea.home.path=. -Didea.config.path=../test-config -Didea.test.group=ALL_EXCLUDE_DEFINED" />
<option name="PARAMETERS" value="" />
<option name="WORKING_DIRECTORY" value="" />
<option name="ENV_VARIABLES" />
<option name="PASS_PARENT_ENVS" value="true" />
<option name="TEST_SEARCH_SCOPE">
<value defaultName="singleModule" />
</option>
<envs />
<dir value="$PROJECT_DIR$/code_samples/simple_language_plugin/tests" />
<patterns />
<method />
</configuration>
</component>

9
.idea/runConfigurations/tool_window.xml generated Normal file
View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tool_window" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="tool_window" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -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>

View File

@ -0,0 +1,9 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="tree_structure_provider" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
<module name="tree_structure_provider" />
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" />
<option name="PROGRAM_PARAMETERS" value="" />
<log_file path="$USER_HOME$/.IdeaIC15/system/plugins-sandbox/system/log/idea.log" checked="false" skipped="true" show_all="false" alias="IDEA LOG" />
<method />
</configuration>
</component>

124
.idea/uiDesigner.xml generated Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.png" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.png" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.png" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.png" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

17
.idea/vcs.xml generated Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="IssueNavigationConfiguration">
<option name="links">
<list>
<IssueNavigationLink>
<option name="issueRegexp" value="[A-Z]+\-\d+" />
<option name="linkRegexp" value="https://youtrack.jetbrains.com/issue/$0" />
</IssueNavigationLink>
</list>
</option>
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/sdkdocs-template" vcs="Git" />
</component>
</project>

View File

View File

@ -1,443 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title> / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="CONTRIBUTING">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<a name="contributing" class="elem-anchor"></a>
<h1>Contributing<a href="#contributing" class="anchor-link"><span></span></a></h1>
<p>Thanks for contributing! Here are few useful things to know before submitting your Pull Request.</p>
<ul>
<li>Licensing - see <a href="LICENSE.txt"><span>LICENSE.txt</span></a></li>
<li><a href="#contributing-to-the-intellij-platform"><span>Contributing to the IntelliJ Platform</span></a></li>
<li><a href="#setting-up-your-environment"><span>Setting up your environment</span></a>
<ul>
<li><a href="#developing-with-docker"><span>Developing with Docker</span></a></li>
<li><a href="#developing-locally"><span>Developing locally</span></a></li>
</ul>
</li>
<li><a href="#markup"><span>Markup</span></a>
<ul>
<li><a href="#summarymd"><span>_SUMMARY.md</span></a></li>
<li><a href="#redirects"><span>Redirects</span></a></li>
<li><a href="#table-of-contents"><span>Table of contents</span></a></li>
<li><a href="#liquid-tags-and-filters"><span>Liquid tags and filters</span></a></li>
<li><a href="#syntax-highlighting"><span>Syntax highlighting</span></a></li>
<li><a href="#tables"><span>Tables</span></a></li>
<li><a href="#links"><span>Links</span></a></li>
<li><a href="#notes-and-callouts"><span>Callouts</span></a></li>
<li><a href="#images"><span>Images</span></a></li>
</ul>
</li>
<li>Style guide</li>
<li><a href="#a-word-on-submodules"><span>A word on submodules</span></a></li>
</ul>
<a name="contributing-to-the-intellij-platform" class="elem-anchor"></a>
<h2>Contributing to the IntelliJ Platform<a href="#contributing-to-the-intellij-platform" class="anchor-link"><span></span></a></h2>
<p>This document describes our contribution guidelines for the IntelliJ SDK Docs. For information about contributing to the IntelliJ Platform, please visit <a href="/intellij-sdk-docs/basics/platform_contributions.html"><span>Contributing to the IntelliJ Platform</span></a>.</p>
<a name="setting-up-your-environment" class="elem-anchor"></a>
<h2>Setting up your environment<a href="#setting-up-your-environment" class="anchor-link"><span></span></a></h2>
<p>This site runs via <a href="http://jekyllrb.com" data-bypass="yes" target="_blank"><span>Jekyll</span></a>, which is a popular static site generator, written in Ruby. It can be hosted locally to ensure that any changes are correct. Once set up, running the site is as easy as calling <code class="code highlight language-text">rake preview</code>.</p>
<p>Alternatively, the site can also be hosted in a <a href="https://www.docker.com" data-bypass="yes" target="_blank"><span>Docker container</span></a>. On Mac and Windows, this means the site is hosted in a virtual machine. Docker maintains this container, building it based on the instructions in the <a href="Dockerfile"><span><code class="code highlight language-text">Dockerfile</code></span></a>. All dependencies (Ruby, etc.) are automatically installed when building the image, which reduces the manual configuration steps. The Docker image is also used to build the <a href="http://www.jetbrains.org/intellij/sdk/docs/index.html" data-bypass="yes" target="_blank"><span>published site</span></a>, so it is a known working environment.</p>
<a name="developing-with-docker" class="elem-anchor"></a>
<h3>Developing with Docker<a href="#developing-with-docker" class="anchor-link"><span></span></a></h3>
<p>Follow these steps to work with Docker:</p>
<ul>
<li>Firstly, install Docker, using the <a href="https://www.docker.com/docker-toolbox" data-bypass="yes" target="_blank"><span>Docker Toolbox</span></a>.</li>
<li>On Windows and Mac, start the Docker host virtual machine (start the “Docker Quickstart terminal” or run “Kitematic”. See the Getting Started guides on <a href="https://www.docker.com" data-bypass="yes" target="_blank"><span>docker.com</span></a> for more details).</li>
<li>Clone the <a href="https://github.com/JetBrains/intellij-sdk-docs" data-bypass="yes" target="_blank"><span><code class="code highlight language-text">intellij-sdk-docs</code></span></a> repo to the local machine, and <a href="#a-word-on-submodules"><span>initialise the <code class="code highlight language-text">sdkdocs-template</code> submodule</span></a>.</li>
<li>Change the current directory to the parent directory of the git repo.</li>
<li>Run <code class="code highlight language-text">docker build -t intellij-sdk-docs .</code>. This will build the docker image from the current folder, and give it the tag <code class="code highlight language-text">intellij-sdk-docs</code>.
<ul>
<li>Note that this must be run from a command prompt that has the various <code class="code highlight language-text">DOCKER_*</code> environment variables set up, such as the Docker Quickstart Terminal.</li>
</ul>
</li>
<li>Run <code class="code highlight language-text">docker run -p 4000:4000 -v $PWD:/usr/src/app intellij-sdk-docs</code>. This command will:
<ul>
<li>Start the docker container called <code class="code highlight language-text">intellij-sdk-docs</code>.</li>
<li>Forward port 4000 from the docker container to port 4000 on the docker client.</li>
</ul>
<aside class="note">
<p> For Windows and Mac, this means port 4000 of the docker container is forwarded to port 4000 of the docker virtual machine, not <code class="code highlight language-text">localhost</code>. For Linux, the docker client is the host machine, so <code class="code highlight language-text">localhost:4000</code> is forwarded to port 4000 on the docker container.</p>
<p>In order to hit the containers port 4000 from Windows or the Mac, it is necessary to hit the IP address of the docker client (virtual machine). Use <code class="code highlight language-text">docker-machine ip default</code> to get the IP address of the docker client. Use <code class="code highlight language-text">X.X.X.X:4000</code> to hit the client in the virtual machine, which is in turn mapped to the containers port 4000.</p>
<p>Alternatively, modify the virtual machines settings to automatically forward port 4000 to <code class="code highlight language-text">localhost</code>. See this <a href="http://acaird.github.io/computers/2014/11/16/docker-virtualbox-host-networking/" data-bypass="yes" target="_blank"><span>blog post</span></a> for more details.</p>
</aside>
<ul>
<li>Mount the current directory (<code class="code highlight language-text">$PWD</code> is a Unix style environment variable. You can use <code class="code highlight language-text">%CD%</code> on Windows, or specify the full path) as <code class="code highlight language-text">/usr/src/app</code> inside the docker container. This means the docker image will see the <code class="code highlight language-text">intellij-sdk-docs</code> repo as the folder <code class="code highlight language-text">/usr/src/app</code>.</li>
</ul>
<aside class="note">
<p> If running on Windows in an msys bash script (e.g. the “Docker Quickstart terminal”), the path to the local folder needs to be properly escaped, or the msys environment will translate the paths to standard Windows path, and you will see an error such as <code class="code highlight language-text">invalid value "C:\\Users\\...;C:\\Program Files\\Git\\usr\\src\\app" for flag -v</code>. To fix this, prefix the full path with double slashes, e.g. <code class="code highlight language-text">-v //c/Users/...</code>, or <code class="code highlight language-text">docker run -p 4000:4000 -v /$PWD:/usr/src/app intellij-sdk-docs</code> (note the leading slash before <code class="code highlight language-text">$PWD</code>).</p>
</aside>
<ul>
<li>Run the commands specific in the Dockerfiles <code class="code highlight language-text">CMD</code> instruction, which runs both <code class="code highlight language-text">rake bootstrap</code>, which ensures all of the prerequisites are installed, and <code class="code highlight language-text">rake preview</code>, which builds the site and starts to host it.</li>
</ul>
</li>
<li>Finally, you can access the newly created site by visiting <a href="http://localhost:4000/intellij/sdk/docs/" data-bypass="yes" target="_blank"><span>http://localhost:4000/intellij/sdk/docs/</span></a>, or by using the IP address of the docker client virtual machine (see note above).</li>
</ul>
<a name="developing-locally" class="elem-anchor"></a>
<h3>Developing locally<a href="#developing-locally" class="anchor-link"><span></span></a></h3>
<p>In order to build the documentation site, you will need:</p>
<ul>
<li>Ruby 2 - Jekyll is a Ruby application.</li>
<li>Ruby 2 DevKit (for Windows) - Some of Jekylls dependencies need to be compiled, and require the DevKit to be installed.</li>
<li><code class="code highlight language-text">gem install bundler</code> - the site uses <a href="http://bundler.io" data-bypass="yes" target="_blank"><span>Bundler</span></a> to manage gem dependencies within the repo, rather than globally installing to the local operating system. Run this command to install the Bundler toolset globally.</li>
</ul>
<p><strong>OS X</strong></p>
<p>OS X comes with Ruby already installed. The only steps required are:</p>
<ul>
<li><code class="code highlight language-text">gem install bundler</code></li>
</ul>
<p><strong>Windows</strong></p>
<ul>
<li>Install <a href="http://rubyinstaller.org" data-bypass="yes" target="_blank"><span>Ruby 2</span></a> and the <a href="http://rubyinstaller.org/downloads/" data-bypass="yes" target="_blank"><span>Ruby 2 DevKit</span></a> (one of the gems needs to build a native component)
<ul>
<li>After installing the DevKit, make sure to edit the <code class="code highlight language-text">config.yml</code> file to point to the Ruby installation</li>
</ul>
</li>
</ul>
<p>This is made easier if you use <a href="https://chocolatey.org" data-bypass="yes" target="_blank"><span>Chocolatey</span></a>, a package manager for Windows:</p>
<ul>
<li><code class="code highlight language-text">choco install ruby</code></li>
<li><code class="code highlight language-text">choco install ruby2.devkit</code>
<ul>
<li>After installing the DevKit, make sure to edit the <code class="code highlight language-text">config.yml</code> file to point to the Ruby installation.</li>
<li>By default, this is <code class="code highlight language-text">C:\tools\DevKit\config.yml</code></li>
<li>Add the line <code class="code highlight language-text">- C:\tools\ruby21</code> (including the leading minus sign)</li>
</ul>
</li>
</ul>
<aside class="note">
<p> Before running the <code class="code highlight language-text">rake bootstrap</code> step listed below, please run the <code class="code highlight language-text">devkitvars.bat</code> file from the DevKit. E.g. <code class="code highlight language-text">C:\tools\DevKit\devkitvars.bat</code></p>
</aside>
<a name="bootstrapping-the-environment" class="elem-anchor"></a>
<h3>Bootstrapping the environment<a href="#bootstrapping-the-environment" class="anchor-link"><span></span></a></h3>
<ol>
<li>Ensure Bundler is installed - <code class="code highlight language-text">gem install bundler</code></li>
<li>On Windows, ensure the <code class="code highlight language-text">devkitvars.bat</code> file has been run in the current command prompt (e.g. <code class="code highlight language-text">c:\tools\DevKit\devkitvars.bat</code>).</li>
<li>Clone the documentation site.</li>
<li>Initialise and update the <code class="code highlight language-text">sdkdocs-template</code> submodule - <code class="code highlight language-text">git submodule init</code> and <code class="code highlight language-text">git submodule update</code></li>
<li><code class="code highlight language-text">rake bootstrap</code> - this uses Bundler to download all required gems.</li>
<li><code class="code highlight language-text">rake preview</code> - this will build the site, and host it in a local webserver.</li>
</ol>
<a name="building-and-previewing-the-site" class="elem-anchor"></a>
<h3>Building and previewing the site<a href="#building-and-previewing-the-site" class="anchor-link"><span></span></a></h3>
<p>To build and test the site, simply run <code class="code highlight language-text">rake preview</code>. This will build the site and host it, using the config provided. The URL of the hosted site is displayed on the screen, and depends on the <code class="code highlight language-text">baseurl</code> field defined in <code class="code highlight language-text">_config.yml</code>.</p>
<a name="markup" class="elem-anchor"></a>
<h2>Markup<a href="#markup" class="anchor-link"><span></span></a></h2>
<p>By default, when building the site, all files are copied to the destination <code class="code highlight language-text">_site</code> folder. Some files are excluded in the <code class="code highlight language-text">_config.yml</code> and <code class="code highlight language-text">sdkdocs-template/jekyll/_config-defaults.yml</code> files. The documentation files themselves are <a href="http://daringfireball.net/projects/markdown/" data-bypass="yes" target="_blank"><span>Markdown</span></a> files (<code class="code highlight language-text">.md</code>) that get automatically converted to HTML when the site is built.</p>
<p>However, only markdown files beginning with a <a href="http://yaml.org" data-bypass="yes" target="_blank"><span>YAML</span></a> header are converted. If the markdown file doesnt contain a header, it wont be converted. In other words, to convert a <code class="code highlight language-text">.md</code> file to HTML, it should look like this:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="nn">---</span>
<span class="nn">---</span>
<span class="gh"># Introduction</span>
Lorem ipsum...
</code></pre>
<p>The two lines at the top of the file are the markers of the YAML “front matter”. Fields can be added in between these markers, and are used when generating the HTML. Typically, this header will be empty, although it is required by Jekyll (if omitted, the file isnt converted).</p>
<p>The YAML header can contain data that is used when generating the site. For example, the page title can be specified as a simple piece of markdown - <code class="code highlight language-text"># Title</code>, or it can be specified in the YAML, and the page template will display it appropriately:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="nn">---</span>
<span class="s">title</span><span class="pi">:</span> <span class="s">The Title Of The Page</span>
<span class="nn">---</span>
Lorem ipsum...
</code></pre>
<p>The YAML header can also include <a href="#redirects"><span>redirect</span></a> information.</p>
<a name="summarymd" class="elem-anchor"></a>
<h3>_SUMMARY.md<a href="#summarymd" class="anchor-link"><span></span></a></h3>
<p>The table of contents for the site is displayed in the tree view on the left hand side of the site, and it is generated from the <code class="code highlight language-text">_SUMMARY.md</code> file. It is a simple markdown list, with each item in the list being a link to another markdown page, either in the root folder, or sub-folders. The list can have nested items, which will be displayed as child items in the table of contents.</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="gh"># Summary</span>
<span class="p">
*</span> <span class="p">[</span><span class="nv">Introduction</span><span class="p">](</span><span class="sx">README.md</span><span class="p">)</span>
<span class="p">*</span> <span class="p">[</span><span class="nv">About This Guide</span><span class="p">](</span><span class="sx">Intro/About.md</span><span class="p">)</span>
<span class="p"> *</span> <span class="p">[</span><span class="nv">Key Topics</span><span class="p">](</span><span class="sx">Intro/KeyTopics.md</span><span class="p">)</span>
</code></pre>
<p>The contents can be split into “parts” by separating the list into several lists, each new list starting with a level 2 heading (<code class="code highlight language-text">##</code>).</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="gh"># Summary</span>
<span class="p">
*</span> <span class="p">[</span><span class="nv">Introduction</span><span class="p">](</span><span class="sx">README.md</span><span class="p">)</span>
<span class="p">*</span> <span class="p">[</span><span class="nv">About This Guide</span><span class="p">](</span><span class="sx">Intro/About.md</span><span class="p">)</span>
<span class="p"> *</span> <span class="p">[</span><span class="nv">Key Topics</span><span class="p">](</span><span class="sx">Intro/KeyTopics.md</span><span class="p">)</span>
<span class="gu">## Part I - Extending the Platform</span>
<span class="p">*</span> <span class="p">[</span><span class="nv">Getting Started</span><span class="p">](</span><span class="sx">Docs/GettingStarted.md</span><span class="p">)</span>
<span class="p">*</span> ...
</code></pre>
<p>If a node doesnt have a link, but is just plain text, it will still appear in the table of contents, but will be greyed out and not clickable. It acts like a placeholder for a documentation item. This is useful to keep track of what should be documented, but hasnt yet, and can be useful to show readers that the topic exists, but isnt yet documented (Pull Requests always welcome!).</p>
<a name="redirects" class="elem-anchor"></a>
<h3>Redirects<a href="#redirects" class="anchor-link"><span></span></a></h3>
<p>The documentation site is set up to include the <a href="https://github.com/jekyll/jekyll-redirect-from" data-bypass="yes" target="_blank"><span>jekyll-redirect-from</span></a> plugin, which will generate “dummy” pages that automatically redirect to a given page. For example, to specify that the <code class="code highlight language-text">index.html</code> page will be generated to redirect to <code class="code highlight language-text">README.md</code>, the <code class="code highlight language-text">README.md</code> file should include the following in the YAML header:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="nn">---</span>
<span class="s">redirect_from</span><span class="pi">:</span>
<span class="pi">-</span> <span class="s">/index.html</span>
<span class="nn">---</span>
<span class="gh"># Introduction</span>
Lorem ipsum...
</code></pre>
<p>This will create an <code class="code highlight language-text">index.html</code> file that will automatically redirect to the generated <code class="code highlight language-text">README.html</code> file. This is very useful to allow the site URL to automatically show the <code class="code highlight language-text">README.html</code> file - <code class="code highlight language-text">http://localhost:4001/foo-test/</code> will try to load <code class="code highlight language-text">index.html</code>, which will automatically redirect to <code class="code highlight language-text">README.html</code>.</p>
<p>It is also useful to redirect when renaming or moving files. Multiple redirects can be added to the YAML header.</p>
<a name="table-of-contents" class="elem-anchor"></a>
<h3>Table of contents<a href="#table-of-contents" class="anchor-link"><span></span></a></h3>
<p>The site is configured to use the <a href="http://kramdown.gettalong.org" data-bypass="yes" target="_blank"><span>Kramdown Markdown converter</span></a>, which adds some extra features over traditional markdown, such as “attribute lists”, which can apply attributes to the generated elements.</p>
<p>One useful attribute is <code class="code highlight language-text">{:toc}</code>, which can be applied to a list item, which will get replaced with a list of links to header items. E.g. the following list item will be replaced by links to all of the header items in the page:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_md"><span class="p">*</span> Dummy list item
{:toc}
</code></pre>
<p>Further Kramdown features are described on the <a href="http://kramdown.gettalong.org/converter/html.html" data-bypass="yes" target="_blank"><span>converter page</span></a>, and attribute lists are described on the <a href="http://kramdown.gettalong.org/syntax.html" data-bypass="yes" target="_blank"><span>syntax page</span></a>. Note that source code formatting is configured to use <a href="https://help.github.com/articles/github-flavored-markdown/" data-bypass="yes" target="_blank"><span>GitHub Flavoured Mardown</span></a> and “code fences”, see below.</p>
<a name="liquid-tags-and-filters" class="elem-anchor"></a>
<h3>Liquid tags and filters<a href="#liquid-tags-and-filters" class="anchor-link"><span></span></a></h3>
<p>Jekyll uses the <a href="http://liquidmarkup.org" data-bypass="yes" target="_blank"><span>Liquid</span></a> templating language to process files. This means standard Liquid tags and filters are available. There should be little need to use them however, as the Markdown format is already quite rich. See the <a href="http://jekyllrb.com/docs/templates/" data-bypass="yes" target="_blank"><span>Jekyll site</span></a> for more details.</p>
<a name="syntax-highlighting" class="elem-anchor"></a>
<h3>Syntax highlighting<a href="#syntax-highlighting" class="anchor-link"><span></span></a></h3>
<p>Source code can be represented by using <a href="https://help.github.com/articles/github-flavored-markdown/" data-bypass="yes" target="_blank"><span>GitHub Flavoured Markdown</span></a> code fences, which are three back ticks:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">```
// Source code goes here...
```
</code></pre>
<p>Syntax highlighting can be applied by specifying the language after the first set of ticks:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">```csharp
// Some C# code
```
```java
// Some Java code
```
</code></pre>
<p>Here is the list of <a href="https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers" data-bypass="yes" target="_blank"><span>supported languages</span></a> (and also <a href="https://kotlinlang.org" data-bypass="yes" target="_blank"><span>Kotlin</span></a>, of course).</p>
<!-- Not currently supported by rouge, or by the site's CSS
The site is also configured to highlight a range of files in the source code, by specifying `{start-end}` which is the start and end line of the highlighting:
```java{2-3}
// Not highlighted
// Highlighted
// Highlighted
// Not highlighted
```
-->
<a name="tables" class="elem-anchor"></a>
<h3>Tables<a href="#tables" class="anchor-link"><span></span></a></h3>
<p>The Kramdown parser also supports tables. The syntax is to use the pipe (<code class="code highlight language-text">|</code>) and minus symbols:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">```md
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Blah | Blah | Blah |
```
</code></pre>
<a name="links" class="elem-anchor"></a>
<h3>Links<a href="#links" class="anchor-link"><span></span></a></h3>
<p>Links are handled as normal markdown links, and can be links to external sites, pages within the sites, or headings in the sites. When a Markdown header is converted to an HTML header, it is assigned an ID, so it can be linked, e.g. <code class="code highlight language-text">## Introduction</code> will get the ID of <code class="code highlight language-text">introduction</code>, and can be linked either in the same page <code class="code highlight language-text">[click here](#introduction)</code> or cross page <code class="code highlight language-text">[click here](page.html#introduction)</code>. The anchor name will be all lower case, and spaces are replaced with <code class="code highlight language-text">-</code>, e.g. <code class="code highlight language-text">## Page setup</code> becomes <code class="code highlight language-text">#page-setup</code>.</p>
<ul>
<li><code class="code highlight language-text">[External site](http://example.org)</code> will link to an external site</li>
<li><code class="code highlight language-text">[Other page in current directory](Page2.md)</code> will link to a page in the same directory as the current page. Note that the extension is <code class="code highlight language-text">.md</code>, NOT <code class="code highlight language-text">.html</code>.</li>
<li><code class="code highlight language-text">[Page in another folder](/Folder2/Page2.md)</code> will link to a page in another folder. Note that the URL is navigating from root - this works even if the site is hosted in a sub-folder (e.g. this link will work for <code class="code highlight language-text">http://localhost:4000/devguide/Folder2/Page2.html</code>). Relative links will also work (<code class="code highlight language-text">../Folder2/Page2.md</code>).</li>
<li><code class="code highlight language-text">[Link to section on another page](Page2.md#another-section)</code> will link to a heading on another page. The ID of the heading is generated by making the text lowercase and replacing spaces with <code class="code highlight language-text">-</code>.</li>
<li><code class="code highlight language-text">[Link to section on current page](#another-section)</code> will link to a heading on the current page.</li>
</ul>
<a name="notes-and-callouts" class="elem-anchor"></a>
<h3>Notes and callouts<a href="#notes-and-callouts" class="anchor-link"><span></span></a></h3>
<p>Notes and callouts can be specified using the blockquote syntax. The converter will look at the first following word to see if it is bold. If so, it will apply that as a callout style. For example:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">&gt; **NOTE** This is a note
</code></pre>
<p>Will be displayed as a callout, styled as a “note”. The other styles available for callouts are “note”, “warning”, “tip” and “todo”.</p>
<a name="images" class="elem-anchor"></a>
<h3>Images<a href="#images" class="anchor-link"><span></span></a></h3>
<p>Images can be included by adding the file directly to the repository and adding a link to the image like so:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">```md
![Alt text](path-to-img.png)
```
</code></pre>
<p>Please downscale screenshots made at high resolution.</p>
<a name="a-word-on-submodules" class="elem-anchor"></a>
<h2>A word on submodules<a href="#a-word-on-submodules" class="anchor-link"><span></span></a></h2>
<p>The <code class="code highlight language-text">sdkdocs-template</code> repo is added as a submodule, and it also contains a submodule to the private <code class="code highlight language-text">webhelp-template</code> repo. The <code class="code highlight language-text">sdkdocs-template</code> repo contains build time scripts and compiled and minified JS and CSS that allow the site to run. The private <code class="code highlight language-text">webhelp-template</code> repo contains the code to build the JS and CSS. It is currently closed source, but the plan is to make it open source at some point, in which case, it is likely the two repos will be merged.</p>
<p>After cloning, a submodule needs to be initialised and updated:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">```
git submodule init
git submodule update
```
</code></pre>
<p>This will create a <code class="code highlight language-text">.gitmodules</code> file, register a submodule in the <code class="code highlight language-text">sdkdocs-template</code> folder, and check out the files. (Note that when a repo is added as a submodule, it doesnt get a <code class="code highlight language-text">.git</code> folder, but instead gets a <code class="code highlight language-text">.git</code> file that points to the location of the <code class="code highlight language-text">.git</code> folder.</p>
<p>A submodule can be updated using normal git commands such as <code class="code highlight language-text">git pull</code>. It can be switched to a different branch using <code class="code highlight language-text">git checkout</code>, and any changes to the currently checked out revision need to be committed back into the main repo, as normal git commands. It is initially cloned at a specific revision, and not as part of a branch.update</p>
<p>If changes are made to the submodule, they should be made on a branch to a clone, and a Pull Request sent. Changes can be made and committed, and the hosting repo will need to commit a pointer to the current version of the submodule.</p>
<p>If there are any problems with the <code class="code highlight language-text">sdkdocs-template</code>, please <a href="https://github.com/JetBrains/sdkdocs-template/issues" data-bypass="yes" target="_blank"><span>raise an issue</span></a>.</p>
<div class="last-modified">
Last modified: 6 January 2016
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

285
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,285 @@
---
---
# Contributing
Thanks for contributing! Here are few useful things to know before submitting your Pull Request.
* Licensing - see [LICENSE.txt](LICENSE.txt)
* [Contributing to the IntelliJ Platform](#contributing-to-the-intellij-platform)
* [Setting up your environment](#setting-up-your-environment)
* [Developing with Docker](#developing-with-docker)
* [Developing locally](#developing-locally)
* [Markup](#markup)
* [_SUMMARY.md](#summarymd)
* [Redirects](#redirects)
* [Table of contents](#table-of-contents)
* [Liquid tags and filters](#liquid-tags-and-filters)
* [Syntax highlighting](#syntax-highlighting)
* [Tables](#tables)
* [Links](#links)
* [Callouts](#notes-and-callouts)
* [Images](#images)
* Style guide
* [A word on submodules](#a-word-on-submodules)
## Contributing to the IntelliJ Platform
This document describes our contribution guidelines for the IntelliJ SDK Docs. For information about contributing to the IntelliJ Platform, please visit [Contributing to the IntelliJ Platform](/basics/platform_contributions.md).
## Setting up your environment
This site runs via [Jekyll](http://jekyllrb.com), which is a popular static site generator, written in Ruby. It can be hosted locally to ensure that any changes are correct. Once set up, running the site is as easy as calling `rake preview`.
Alternatively, the site can also be hosted in a [Docker container](https://www.docker.com). On Mac and Windows, this means the site is hosted in a virtual machine. Docker maintains this container, building it based on the instructions in the [`Dockerfile`](Dockerfile). All dependencies (Ruby, etc.) are automatically installed when building the image, which reduces the manual configuration steps. The Docker image is also used to build the [published site](http://www.jetbrains.org/intellij/sdk/docs/index.html), so it is a known working environment.
### Developing with Docker
Follow these steps to work with Docker:
* Firstly, install Docker, using the [Docker Toolbox](https://www.docker.com/docker-toolbox).
* On Windows and Mac, start the Docker host virtual machine (start the "Docker Quickstart terminal" or run "Kitematic". See the Getting Started guides on [docker.com](https://www.docker.com) for more details).
* Clone the [`intellij-sdk-docs`](https://github.com/JetBrains/intellij-sdk-docs) repo to the local machine, and [initialise the `sdkdocs-template` submodule](#a-word-on-submodules).
* Change the current directory to the parent directory of the git repo.
* Run `docker build -t intellij-sdk-docs .`. This will build the docker image from the current folder, and give it the tag `intellij-sdk-docs`.
* Note that this must be run from a command prompt that has the various `DOCKER_*` environment variables set up, such as the Docker Quickstart Terminal.
* Run `docker run -p 4000:4000 -v $PWD:/usr/src/app intellij-sdk-docs`. This command will:
* Start the docker container called `intellij-sdk-docs`.
* Forward port 4000 from the docker container to port 4000 on the docker client.
> **NOTE** For Windows and Mac, this means port 4000 of the docker container is forwarded to port 4000 of the docker virtual machine, not `localhost`. For Linux, the docker client is the host machine, so `localhost:4000` is forwarded to port 4000 on the docker container.
>
> In order to hit the container's port 4000 from Windows or the Mac, it is necessary to hit the IP address of the docker client (virtual machine). Use `docker-machine ip default` to get the IP address of the docker client. Use `X.X.X.X:4000` to hit the client in the virtual machine, which is in turn mapped to the container's port 4000.
>
> Alternatively, modify the virtual machine's settings to automatically forward port 4000 to `localhost`. See this [blog post](http://acaird.github.io/computers/2014/11/16/docker-virtualbox-host-networking/) for more details.
* Mount the current directory (`$PWD` is a Unix style environment variable. You can use `%CD%` on Windows, or specify the full path) as `/usr/src/app` inside the docker container. This means the docker image will see the `intellij-sdk-docs` repo as the folder `/usr/src/app`.
> **NOTE** If running on Windows in an msys bash script (e.g. the "Docker Quickstart terminal"), the path to the local folder needs to be properly escaped, or the msys environment will translate the paths to standard Windows path, and you will see an error such as `invalid value "C:\\Users\\...;C:\\Program Files\\Git\\usr\\src\\app" for flag -v`. To fix this, prefix the full path with double slashes, e.g. `-v //c/Users/...`, or `docker run -p 4000:4000 -v /$PWD:/usr/src/app intellij-sdk-docs` (note the leading slash before `$PWD`).
* Run the commands specific in the Dockerfile's `CMD` instruction, which runs both `rake bootstrap`, which ensures all of the prerequisites are installed, and `rake preview`, which builds the site and starts to host it.
* Finally, you can access the newly created site by visiting [http://localhost:4000/intellij/sdk/docs/](http://localhost:4000/intellij/sdk/docs/), or by using the IP address of the docker client virtual machine (see note above).
### Developing locally
In order to build the documentation site, you will need:
* Ruby 2 - Jekyll is a Ruby application.
* Ruby 2 DevKit (for Windows) - Some of Jekyll's dependencies need to be compiled, and require the DevKit to be installed.
* `gem install bundler` - the site uses [Bundler](http://bundler.io) to manage gem dependencies within the repo, rather than globally installing to the local operating system. Run this command to install the Bundler toolset globally.
**OS X**
OS X comes with Ruby already installed. The only steps required are:
* `gem install bundler`
**Windows**
* Install [Ruby 2](http://rubyinstaller.org) and the [Ruby 2 DevKit](http://rubyinstaller.org/downloads/) (one of the gems needs to build a native component)
* After installing the DevKit, make sure to edit the `config.yml` file to point to the Ruby installation
This is made easier if you use [Chocolatey](https://chocolatey.org), a package manager for Windows:
* `choco install ruby`
* `choco install ruby2.devkit`
* After installing the DevKit, make sure to edit the `config.yml` file to point to the Ruby installation.
* By default, this is `C:\tools\DevKit\config.yml`
* Add the line `- C:\tools\ruby21` (including the leading minus sign)
> **NOTE** Before running the `rake bootstrap` step listed below, please run the `devkitvars.bat` file from the DevKit. E.g. `C:\tools\DevKit\devkitvars.bat`
### Bootstrapping the environment
1. Ensure Bundler is installed - `gem install bundler`
2. On Windows, ensure the `devkitvars.bat` file has been run in the current command prompt (e.g. `c:\tools\DevKit\devkitvars.bat`).
3. Clone the documentation site.
4. Initialise and update the `sdkdocs-template` submodule - `git submodule init` and `git submodule update`
5. `rake bootstrap` - this uses Bundler to download all required gems.
6. `rake preview` - this will build the site, and host it in a local webserver.
### Building and previewing the site
To build and test the site, simply run `rake preview`. This will build the site and host it, using the config provided. The URL of the hosted site is displayed on the screen, and depends on the `baseurl` field defined in `_config.yml`.
## Markup
By default, when building the site, all files are copied to the destination `_site` folder. Some files are excluded in the `_config.yml` and `sdkdocs-template/jekyll/_config-defaults.yml` files. The documentation files themselves are [Markdown](http://daringfireball.net/projects/markdown/) files (`.md`) that get automatically converted to HTML when the site is built.
However, only markdown files beginning with a [YAML](http://yaml.org) header are converted. If the markdown file doesn't contain a header, it won't be converted. In other words, to convert a `.md` file to HTML, it should look like this:
```md
---
---
# Introduction
Lorem ipsum...
```
The two lines at the top of the file are the markers of the YAML "front matter". Fields can be added in between these markers, and are used when generating the HTML. Typically, this header will be empty, although it is required by Jekyll (if omitted, the file isn't converted).
The YAML header can contain data that is used when generating the site. For example, the page title can be specified as a simple piece of markdown - `# Title`, or it can be specified in the YAML, and the page template will display it appropriately:
```md
---
title: The Title Of The Page
---
Lorem ipsum...
```
The YAML header can also include [redirect](#redirects) information.
### _SUMMARY.md
The table of contents for the site is displayed in the tree view on the left hand side of the site, and it is generated from the `_SUMMARY.md` file. It is a simple markdown list, with each item in the list being a link to another markdown page, either in the root folder, or sub-folders. The list can have nested items, which will be displayed as child items in the table of contents.
```md
# Summary
* [Introduction](README.md)
* [About This Guide](Intro/About.md)
* [Key Topics](Intro/KeyTopics.md)
```
The contents can be split into "parts" by separating the list into several lists, each new list starting with a level 2 heading (`##`).
```md
# Summary
* [Introduction](README.md)
* [About This Guide](Intro/About.md)
* [Key Topics](Intro/KeyTopics.md)
## Part I - Extending the Platform
* [Getting Started](Docs/GettingStarted.md)
* ...
```
If a node doesn't have a link, but is just plain text, it will still appear in the table of contents, but will be greyed out and not clickable. It acts like a placeholder for a documentation item. This is useful to keep track of what should be documented, but hasn't yet, and can be useful to show readers that the topic exists, but isn't yet documented (Pull Requests always welcome!).
### Redirects
The documentation site is set up to include the [jekyll-redirect-from](https://github.com/jekyll/jekyll-redirect-from) plugin, which will generate "dummy" pages that automatically redirect to a given page. For example, to specify that the `index.html` page will be generated to redirect to `README.md`, the `README.md` file should include the following in the YAML header:
```md
---
redirect_from:
- /index.html
---
# Introduction
Lorem ipsum...
```
This will create an `index.html` file that will automatically redirect to the generated `README.html` file. This is very useful to allow the site URL to automatically show the `README.html` file - `http://localhost:4001/foo-test/` will try to load `index.html`, which will automatically redirect to `README.html`.
It is also useful to redirect when renaming or moving files. Multiple redirects can be added to the YAML header.
### Table of contents
The site is configured to use the [Kramdown Markdown converter](http://kramdown.gettalong.org), which adds some extra features over traditional markdown, such as "attribute lists", which can apply attributes to the generated elements.
One useful attribute is `{:toc}`, which can be applied to a list item, which will get replaced with a list of links to header items. E.g. the following list item will be replaced by links to all of the header items in the page:
```md
* Dummy list item
{:toc}
```
Further Kramdown features are described on the [converter page](http://kramdown.gettalong.org/converter/html.html), and attribute lists are described on the [syntax page](http://kramdown.gettalong.org/syntax.html). Note that source code formatting is configured to use [GitHub Flavoured Mardown](https://help.github.com/articles/github-flavored-markdown/) and "code fences", see below.
### Liquid tags and filters
Jekyll uses the [Liquid](http://liquidmarkup.org) templating language to process files. This means standard Liquid tags and filters are available. There should be little need to use them however, as the Markdown format is already quite rich. See the [Jekyll site](http://jekyllrb.com/docs/templates/) for more details.
### Syntax highlighting
Source code can be represented by using [GitHub Flavoured Markdown](https://help.github.com/articles/github-flavored-markdown/) code fences, which are three back ticks:
```
// Source code goes here...
```
Syntax highlighting can be applied by specifying the language after the first set of ticks:
```csharp
// Some C# code
```
```java
// Some Java code
```
Here is the list of [supported languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers) (and also [Kotlin](https://kotlinlang.org), of course).
<!-- Not currently supported by rouge, or by the site's CSS
The site is also configured to highlight a range of files in the source code, by specifying `{start-end}` which is the start and end line of the highlighting:
```java{2-3}
// Not highlighted
// Highlighted
// Highlighted
// Not highlighted
```
-->
### Tables
The Kramdown parser also supports tables. The syntax is to use the pipe (`|`) and minus symbols:
```md
| Column 1 | Column 2 | Column 3 |
|----------|----------|----------|
| Blah | Blah | Blah |
```
### Links
Links are handled as normal markdown links, and can be links to external sites, pages within the sites, or headings in the sites. When a Markdown header is converted to an HTML header, it is assigned an ID, so it can be linked, e.g. `## Introduction` will get the ID of `introduction`, and can be linked either in the same page `[click here](#introduction)` or cross page `[click here](page.html#introduction)`. The anchor name will be all lower case, and spaces are replaced with `-`, e.g. `## Page setup` becomes `#page-setup`.
* `[External site](http://example.org)` will link to an external site
* `[Other page in current directory](Page2.md)` will link to a page in the same directory as the current page. Note that the extension is `.md`, NOT `.html`.
* `[Page in another folder](/Folder2/Page2.md)` will link to a page in another folder. Note that the URL is navigating from root - this works even if the site is hosted in a sub-folder (e.g. this link will work for `http://localhost:4000/devguide/Folder2/Page2.html`). Relative links will also work (`../Folder2/Page2.md`).
* `[Link to section on another page](Page2.md#another-section)` will link to a heading on another page. The ID of the heading is generated by making the text lowercase and replacing spaces with `-`.
* `[Link to section on current page](#another-section)` will link to a heading on the current page.
### Notes and callouts
Notes and callouts can be specified using the blockquote syntax. The converter will look at the first following word to see if it is bold. If so, it will apply that as a callout style. For example:
> **NOTE** This is a note
Will be displayed as a callout, styled as a "note". The other styles available for callouts are "note", "warning", "tip" and "todo".
### Images
Images can be included by adding the file directly to the repository and adding a link to the image like so:
```md
![Alt text](path-to-img.png)
```
Please downscale screenshots made at high resolution.
## A word on submodules
The `sdkdocs-template` repo is added as a submodule, and it also contains a submodule to the private `webhelp-template` repo. The `sdkdocs-template` repo contains build time scripts and compiled and minified JS and CSS that allow the site to run. The private `webhelp-template` repo contains the code to build the JS and CSS. It is currently closed source, but the plan is to make it open source at some point, in which case, it is likely the two repos will be merged.
After cloning, a submodule needs to be initialised and updated:
```
git submodule init
git submodule update
```
This will create a `.gitmodules` file, register a submodule in the `sdkdocs-template` folder, and check out the files. (Note that when a repo is added as a submodule, it doesn't get a `.git` folder, but instead gets a `.git` file that points to the location of the `.git` folder.
A submodule can be updated using normal git commands such as `git pull`. It can be switched to a different branch using `git checkout`, and any changes to the currently checked out revision need to be committed back into the main repo, as normal git commands. It is initially cloned at a specific revision, and not as part of a branch.update
If changes are made to the submodule, they should be made on a branch to a clone, and a Pull Request sent. Changes can be made and committed, and the hosting repo will need to commit a pointer to the current version of the submodule.
If there are any problems with the `sdkdocs-template`, please [raise an issue](https://github.com/JetBrains/sdkdocs-template/issues).

1
Gemfile Normal file
View File

@ -0,0 +1 @@
eval File.read('sdkdocs-template/bundler/Gemfile.defaults')

64
Gemfile.lock Normal file
View File

@ -0,0 +1,64 @@
GIT
remote: https://github.com/JetBrains/jekyll-git_metadata.git
revision: 5f5e3a02d0cc414d984d85835235b782aac04b4d
branch: fix_windows
specs:
jekyll-git_metadata (0.0.3)
jekyll (~> 3.0)
GIT
remote: https://github.com/JetBrains/rouge
revision: 1c6c57410e5b7ffd3112ae99770f7a7e4d6c064a
branch: multiple_fixes
specs:
rouge (1.10.1)
GEM
remote: https://rubygems.org/
specs:
colorator (0.1)
ffi (1.9.10)
ffi (1.9.10-x64-mingw32)
jekyll (3.0.1)
colorator (~> 0.1)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 3.0)
mercenary (~> 0.3.3)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-redirect-from (0.9.1)
jekyll (>= 2.0)
jekyll-sass-converter (1.4.0)
sass (~> 3.4)
jekyll-watch (1.3.0)
listen (~> 3.0)
kramdown (1.9.0)
liquid (3.0.6)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
mercenary (0.3.5)
rake (10.4.2)
rb-fsevent (0.9.6)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
safe_yaml (1.0.4)
sass (3.4.20)
wdm (0.1.1)
PLATFORMS
ruby
x64-mingw32
DEPENDENCIES
jekyll (~> 3.0)
jekyll-git_metadata!
jekyll-redirect-from
rake
rouge!
wdm (>= 0.1.0)
BUNDLED WITH
1.10.6

File diff suppressed because one or more lines are too long

17
Rakefile Normal file
View File

@ -0,0 +1,17 @@
Rake.add_rakelib 'sdkdocs-template/rakelib'
begin
FileUtils.mkdir_p %w( _includes/code_samples )
FileUtils.cp_r 'code_samples', '_includes', :verbose => true, :remove_destination => true
rescue
`yes | cp -rf code_samples _includes`
end
CONFIG = {
:source_dir => __dir__,
:tmp_dir => "#{__dir__}/_tmp",
:build_destination => "_site",
:preview_host => "0.0.0.0",
:preview_port => 4000,
:default_env => 'dev'
}

156
_SUMMARY.md Normal file
View File

@ -0,0 +1,156 @@
* [IntelliJ Platform SDK](index.md)
* [Quick Start Guide](basics.md)
* [Main Types of Plugins](basics/types_of_plugins.md)
* [Creating Your First Plugin](basics/getting_started.md)
* [Setting Up a Development Environment](basics/getting_started/setting_up_environment.md)
* [Creating a Plugin Project](basics/getting_started/creating_plugin_project.md)
* [Build Number Ranges](basics/getting_started/build_number_ranges.md)
* [Creating an Action](basics/getting_started/creating_an_action.md)
* [Running and Debugging a Plugin](basics/getting_started/running_and_debugging_a_plugin.md)
* [Deploying a Plugin](basics/getting_started/deploying_plugin.md)
* [Publishing a Plugin](basics/getting_started/publishing_plugin.md)
* [Plugin Compatibility with IntelliJ Platform Products](basics/getting_started/plugin_compatibility.md)
* [Plugin Structure](basics/plugin_structure.md)
* [Plugin Content](basics/plugin_structure/plugin_content.md)
* [Plugin Class Loaders](basics/plugin_structure/plugin_class_loaders.md)
* [Plugin Components](basics/plugin_structure/plugin_components.md)
* [Plugin Extensions and Extension Points](basics/plugin_structure/plugin_extensions_and_extension_points.md)
* [Plugin Actions](basics/plugin_structure/plugin_actions.md)
* [Plugin Services](basics/plugin_structure/plugin_services.md)
* [Plugin Configuration File](basics/plugin_structure/plugin_configuration_file.md)
* [Plugin Dependencies](basics/plugin_structure/plugin_dependencies.md)
* [Architectural Overview](basics/architectural_overview.md)
* [General Threading Rules](basics/architectural_overview/general_threading_rules.md)
* [Virtual Files](basics/architectural_overview/virtual_file.md)
* [Documents](basics/architectural_overview/documents.md)
* [PSI Files](basics/architectural_overview/psi_files.md)
* [File View Providers](basics/architectural_overview/file_view_providers.md)
* [PSI Elements](basics/architectural_overview/psi_elements.md)
* [Project Structure](basics/project_structure.md)
* [Action System](basics/action_system.md)
* [Persisting State of Components](basics/persisting_state_of_components.md)
* [PSI Cookbook](basics/psi_cookbook.md)
* [Virtual File System](basics/virtual_file_system.md)
* [Check Out And Build Community Edition](basics/checkout_and_build_community.md)
* [IDE Settings, Caches, Logs, and Plugins](basics/settings_caches_logs.md)
* [Indexing and PSI Stubs](basics/indexing_and_psi_stubs.md)
* [File-based indexes](basics/indexing_and_psi_stubs/file_based_indexes.md)
* [Stub indexes](basics/indexing_and_psi_stubs/stub_indexes.md)
* [Run Configurations](basics/run_configurations.md)
* [Run Configuration Management](basics/run_configurations/run_configuration_management.md)
* [Execution](basics/run_configurations/run_configuration_execution.md)
* [Testing Plugins](basics/testing_plugins.md)
* [Tests and Fixtures](basics/testing_plugins/tests_and_fixtures.md)
* [Light and Heavy Tests](basics/testing_plugins/light_and_heavy_tests.md)
* [Test Project and Testdata Directories](basics/testing_plugins/test_project_and_testdata_directories.md)
* [Writing Tests](basics/testing_plugins/writing_tests.md)
* [Testing Highlighting](basics/testing_plugins/testing_highlighting.md)
* [Contributing to the IntelliJ Platform](basics/platform_contributions.md)
* [IntelliJ Coding Guidelines](basics/intellij_coding_guidelines.md)
* [Architecture Reference Guide](reference_guide.md)
* [Project Model](reference_guide/project_model.md)
* [Project](reference_guide/project_model/project.md)
* [Module](reference_guide/project_model/module.md)
* [SDK](reference_guide/project_model/sdk.md)
* [Library](reference_guide/project_model/library.md)
* [Facet](reference_guide/project_model/facet.md)
* [Project Wizard](reference_guide/project_wizard.md)
* [Custom Language Support](reference_guide/custom_language_support.md)
* [Registering File Type](reference_guide/custom_language_support/registering_file_type.md)
* [Implementing Lexer](reference_guide/custom_language_support/implementing_lexer.md)
* [Implementing Parser and PSI](reference_guide/custom_language_support/implementing_parser_and_psi.md)
* [Syntax Highlighting and Error Highlighting](reference_guide/custom_language_support/syntax_highlighting_and_error_highlighting.md)
* [References and Resolve](reference_guide/custom_language_support/references_and_resolve.md)
* [Code Completion](reference_guide/custom_language_support/code_completion.md)
* [Find Usages](reference_guide/custom_language_support/find_usages.md)
* [Rename Refactoring](reference_guide/custom_language_support/rename_refactoring.md)
* [Safe Delete Refactoring](reference_guide/custom_language_support/safe_delete_refactoring.md)
* [Code Formatter](reference_guide/custom_language_support/code_formatting.md)
* [Code Inspections and Intentions](reference_guide/custom_language_support/code_inspections_and_intentions.md)
* [Structure View](reference_guide/custom_language_support/structure_view.md)
* [Surround With](reference_guide/custom_language_support/surround_with.md)
* [Go to Class and Go to Symbol](reference_guide/custom_language_support/go_to_class_and_go_to_symbol.md)
* [Documentation](reference_guide/custom_language_support/documentation.md)
* [Additional Minor Features](reference_guide/custom_language_support/additional_minor_features.md)
* [Frameworks and External APIs](reference_guide/frameworks_and_external_apis.md)
* [XML DOM API](reference_guide/frameworks_and_external_apis/xml_dom_api.md)
* [Spring API](reference_guide/frameworks_and_external_apis/spring_api.md)
* [External Builder API and Plugins](reference_guide/frameworks_and_external_apis/external_builder_api.md)
* [External system integration](reference_guide/frameworks_and_external_apis/external_system_integration.md)
* [VCS Integration Plugins](reference_guide/vcs_integration_for_plugins.md)
* [Localization Guide](reference_guide/localization_guide.md)
* [Messaging Infrastructure](reference_guide/messaging_infrastructure.md)
* [Multiple Carets](reference_guide/multiple_carets.md)
* [Color Scheme Management](reference_guide/color_scheme_management.md)
* [Work with Icons and Images](reference_guide/work_with_icons_and_images.md)
* [Tomcat Integration](reference_guide/tomcat_integration.md)
* [User Interface Components](user_interface_components/user_interface_components.md)
* [Tool Windows](user_interface_components/tool_windows.md)
* [Dialogs](user_interface_components/dialog_wrapper.md)
* [Popups](user_interface_components/popups.md)
* [Notifications](user_interface_components/notifications.md)
* [File and Class Choosers](user_interface_components/file_and_class_choosers.md)
* [Editor Components](user_interface_components/editor_components.md)
* [List and Tree Controls](user_interface_components/lists_and_trees.md)
* [Miscellaneous Swing Components](user_interface_components/misc_swing_components.md)
* [PhpStorm](phpstorm/phpstorm.md)
* [Setting-up the Environment](phpstorm/setting_up_environment.md)
* [PHP Open API](phpstorm/php_open_api.md)
* [Existing Third Party Plugins](phpstorm/existing_plugins.md)
* [Tutorials](tutorials.md)
* [Build System Support](tutorials/build_system.md)
* [1. Prerequisites](tutorials/build_system/prerequisites.md)
* [2. Deployment](tutorials/build_system/deployment.md)
* [Custom Language Support](tutorials/custom_language_support_tutorial.md)
* [1. Prerequisites](tutorials/custom_language_support/prerequisites.md)
* [2. Language and File Type](tutorials/custom_language_support/language_and_filetype.md)
* [3. Grammar and Parser](tutorials/custom_language_support/grammar_and_parser.md)
* [4. Lexer and Parser Definition](tutorials/custom_language_support/lexer_and_parser_definition.md)
* [5. Syntax Highlighter and Color Settings Page](tutorials/custom_language_support/syntax_highlighter_and_color_settings_page.md)
* [6. PSI Helpers and Utilities](tutorials/custom_language_support/psi_helper_and_utilities.md)
* [7. Annotator](tutorials/custom_language_support/annotator.md)
* [8. Line Marker Provider](tutorials/custom_language_support/line_marker_provider.md)
* [9. Completion Contributor](tutorials/custom_language_support/completion_contributor.md)
* [10. Reference Contributor](tutorials/custom_language_support/reference_contributor.md)
* [11. Find Usages Provider](tutorials/custom_language_support/find_usages_provider.md)
* [12. Folding Builder](tutorials/custom_language_support/folding_builder.md)
* [13. Go To Symbol Contributor](tutorials/custom_language_support/go_to_symbol_contributor.md)
* [14. Structure View Factory](tutorials/custom_language_support/structure_view_factory.md)
* [15. Formatter](tutorials/custom_language_support/formatter.md)
* [16. Code Style Settings](tutorials/custom_language_support/code_style_settings.md)
* [17. Commenter](tutorials/custom_language_support/commenter.md)
* [18. Quick Fix](tutorials/custom_language_support/quick_fix.md)
* [Writing Tests For Plugins](tutorials/writing_tests_for_plugins.md)
* [1. Tests Prerequisites](tutorials/writing_tests_for_plugins/tests_prerequisites.md)
* [2. Parsing Test](tutorials/writing_tests_for_plugins/parsing_test.md)
* [3. Completion Test](tutorials/writing_tests_for_plugins/completion_test.md)
* [4. Annotator Test](tutorials/writing_tests_for_plugins/annotator_test.md)
* [5. Formatter Test](tutorials/writing_tests_for_plugins/formatter_test.md)
* [6. Rename Test](tutorials/writing_tests_for_plugins/rename_test.md)
* [7. Folding Test](tutorials/writing_tests_for_plugins/folding_test.md)
* [8. Find Usages Test](tutorials/writing_tests_for_plugins/find_usages_test.md)
* [9. Commenter Test](tutorials/writing_tests_for_plugins/commenter_test.md)
* [10. Reference Test](tutorials/writing_tests_for_plugins/reference_test.md)
* [Action System](tutorials/action_system.md)
* [1. Working With Custom Actions](tutorials/action_system/working_with_custom_actions.md)
* [2. Grouping Actions](tutorials/action_system/grouping_action.md)
* [Editor Basics](tutorials/editor_basics.md)
* [1. Working With Text](tutorials/editor_basics/working_with_text.md)
* [2. Editor Coordinates System. Positions And Offsets](tutorials/editor_basics/coordinates_system.md)
* [3. Handling Editor Events](tutorials/editor_basics/editor_events.md)
* [Project Wizard](tutorials/project_wizard.md)
* [Adding New Steps to Project Wizard](tutorials/project_wizard/adding_new_steps.md)
* [Supporting Module Types](tutorials/project_wizard/module_types.md)
* [Code Inspections](tutorials/code_inspections.md)
* [Code Intentions](tutorials/code_intentions.md)
* [Live Templates](tutorials/live_templates.md)
* [1. Adding Live Template Support](tutorials/live_templates/template_support.md)\
* [Run Configurations](tutorials/run_configurations.md)
* [Supporting Frameworks](tutorials/framework.md)
* [Tree Structure View](tutorials/tree_structure_view.md)
* [Kotlin for Plugin Developers](tutorials/kotlin.md)
* [Plugin Development FAQ](faq.md)
* [Contribution Guidelines](CONTRIBUTING.md)

14
_config.yml Normal file
View File

@ -0,0 +1,14 @@
---
product_name: IntelliJ Platform SDK
product_version:
product_type: DevGuide
baseurl: /intellij/sdk/docs/
# This is tag 143.381.42
upsource:
server: upsource.jetbrains.com
repo: idea-ce
# This is the SHA for the 143.381.42 release, but it's not indexed on Upsource
# commit: db70c2b4bdc79eb5f551632aade418c0de50e840
commit: 1731d054af4ca27aa827c03929e27eeb0e6a8366

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,8 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100%" height="100%" viewBox="0 0 14 14" xml:space="preserve">
<path fill="#BFBFBF" d="M7,0C3.134,0,0,3.134,0,7c0,3.866,3.134,7,7,7s7-3.134,7-7C14,3.134,10.866,0,7,0z M10.185,9.059
c0.312,0.312,0.312,0.816,0,1.128c-0.312,0.311-0.816,0.311-1.128,0L6.978,8.108l-2.079,2.079c-0.312,0.311-0.816,0.311-1.128,0
c-0.312-0.312-0.312-0.816,0-1.128L5.85,6.98L3.795,4.926c-0.311-0.312-0.311-0.816,0-1.128c0.312-0.312,0.816-0.312,1.128,0
l2.054,2.054l2.085-2.085c0.312-0.312,0.816-0.312,1.128,0c0.311,0.312,0.311,0.816,0,1.128L8.105,6.98L10.185,9.059z"/>
</svg>

Before

Width:  |  Height:  |  Size: 713 B

View File

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100%" height="100%" viewBox="0 0 17 16.969" enable-background="new 0 0 17 16.969" xml:space="preserve">
<g>
<rect x="0.5" y="0.5" fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" width="16" height="3.969"/>
<path fill="#999999" d="M16,1v2.969H1V1H16 M17,0H0v4.969h17V0L17,0z"/>
</g>
<g>
<rect x="0.5" y="6.5" fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" width="16" height="3.969"/>
<path fill="#999999" d="M16,7v2.969H1V7H16 M17,6H0v4.969h17V6L17,6z"/>
</g>
<g>
<rect x="0.5" y="12.5" fill-rule="evenodd" clip-rule="evenodd" fill="#FFFFFF" width="16" height="3.969"/>
<path fill="#999999" d="M16,13v2.969H1V13H16 M17,12H0v4.969h17V12L17,12z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 852 B

View File

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.4, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100%" height="100%" viewBox="0 0 38 47" enable-background="new 0 0 38 47" xml:space="preserve">
<g>
<path fill="#B2B3B3" d="M28.583,4L34,9.415V43H7V4H28.583 M28.997,3H6v41h29V9L28.997,3L28.997,3z"/>
</g>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#BFBFBF" d="M28.021,3h1v7h-1V3z"/>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#BFBFBF" d="M29.021,10V9h6v1H29.021z"/>
<path opacity="0.2" fill-rule="evenodd" clip-rule="evenodd" fill="#454545" d="M27.348,28.749h-1.304v-1.978h0.965v-1.009H13.992
v1.009h0.965v1.978h-1.304c-0.36,0-0.652-0.282-0.652-0.629V22.01c0-0.608,2.609-1.259,7.174-1.259c0.242,0,0.456,0,0.652,0
c4.524,0,7.174,0.636,7.174,1.259v6.109C28,28.467,27.708,28.749,27.348,28.749z M25.499,22.296c-0.54,0-0.978,0.423-0.978,0.944
s0.438,0.944,0.978,0.944s0.979-0.423,0.979-0.944S26.039,22.296,25.499,22.296z M16.015,16.411c0-0.348,0.292-0.629,0.652-0.629
h7.666c0.36,0,0.652,0.282,0.652,0.629v3.336h-8.97V16.411z M24.985,32.152c0,0.348-0.292,0.629-0.652,0.629h-7.666
c-0.36,0-0.652-0.282-0.652-0.629v-5.386h8.97V32.152z M23.993,27.333h-6.986v0.63h6.986V27.333z M23.993,28.593h-6.986v0.629h6.986
V28.593z M23.993,29.852h-6.986v0.629h6.986V29.852z M23.993,31.111h-6.986v0.629h6.986V31.111z"/>
<path fill-rule="evenodd" clip-rule="evenodd" fill="#F26F71" d="M0,9h17v9H0V9z"/>
<g>
<path fill="#FFFFFF" d="M6.149,12.752c0,0.178-0.027,0.349-0.081,0.513S5.927,13.574,5.804,13.7s-0.286,0.227-0.488,0.302
s-0.452,0.113-0.749,0.113H4.128v1.667H3.583v-4.283h1.061c0.262,0,0.487,0.028,0.677,0.083s0.346,0.137,0.469,0.243
s0.214,0.238,0.272,0.394S6.149,12.553,6.149,12.752z M4.128,13.651h0.378c0.182,0,0.34-0.016,0.476-0.047s0.248-0.082,0.337-0.151
s0.156-0.159,0.201-0.27s0.067-0.245,0.067-0.403c0-0.277-0.08-0.483-0.24-0.617s-0.41-0.201-0.75-0.201H4.128V13.651z"/>
<path fill="#FFFFFF" d="M10.195,13.599c0,0.361-0.047,0.678-0.141,0.951s-0.229,0.5-0.407,0.683s-0.396,0.32-0.655,0.412
s-0.552,0.138-0.88,0.138H7.04v-4.283h1.192c0.299,0,0.569,0.045,0.812,0.135s0.448,0.223,0.618,0.4s0.301,0.396,0.394,0.658
S10.195,13.255,10.195,13.599z M9.618,13.616c0-0.285-0.032-0.532-0.097-0.74s-0.158-0.379-0.281-0.514s-0.274-0.235-0.454-0.3
s-0.384-0.098-0.612-0.098H7.585v3.349H8.06c0.516,0,0.904-0.143,1.166-0.428S9.618,14.177,9.618,13.616z"/>
<path fill="#FFFFFF" d="M11.689,15.781h-0.545v-4.283h2.224v0.48h-1.679v1.512h1.567v0.48h-1.567V15.781z"/>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 2.7 KiB

View File

@ -1,11 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="100%" height="100%" viewBox="0 0 13.001 13.993" enable-background="new 0 0 13.001 13.993" xml:space="preserve">
<path fill="#848990" d="M12.74,13.385l-0.316,0.333c-0.349,0.367-0.915,0.367-1.264,0
l-2.528-2.659c-0.293-0.308-0.325-0.77-0.126-1.13L7.125,8.474c-0.743,0.58-1.66,0.927-2.657,0.927C2,9.402,0,7.297,0,4.701
C0,2.105,2,0,4.468,0c2.468,0,4.468,2.105,4.468,4.701c0,1.208-0.437,2.307-1.15,3.14l1.352,1.422
c0.342-0.209,0.781-0.175,1.074,0.133l2.527,2.659C13.088,12.422,13.088,13.018,12.74,13.385z M7.81,4.682
c0-1.947-1.5-3.526-3.351-3.526c-0.515,0-0.998,0.133-1.434,0.352c0.233,0.252-0.019,0,0,0c-0.363,0-0.948,0.879-0.948,1.29
c0-0.02-0.378,0.602-0.626,0.358C1.238,3.619,1.108,4.132,1.108,4.682c0,1.947,1.5,3.525,3.351,3.525
C6.31,8.207,7.81,6.629,7.81,4.682z"/>
</svg>

Before

Width:  |  Height:  |  Size: 957 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 128.366 119.076"><path d="M75.307 16.07l27.916 41.763c.021-1.302-.018-2.606-.112-3.91l-24.237-36.257c-1.168-.585-2.357-1.118-3.567-1.596zM45.646 15.024c-.681.216-1.358.447-2.031.698l47.801 71.511c.489-.526.964-1.062 1.424-1.607l-47.194-70.602zM50.997 13.68c-.731.135-1.459.294-2.186.466l46.055 68.899c.438-.606.858-1.224 1.264-1.849l-45.133-67.516zM42.508 19.68l-1.728 1.155 46.818 70.041c.537-.453 1.062-.916 1.571-1.391l-46.661-69.805zM38.786 23.872l-1.727 1.155 46.188 69.095.349-.221c.464-.311.912-.636 1.36-.96l-46.17-69.069zM91.456 27.137c-1.917-2.076-4-3.934-6.22-5.567l16.725 25.02c-.654-2.662-1.568-5.285-2.741-7.838l-7.764-11.615zM63.15 13.164c-.867-.082-1.737-.138-2.609-.168l39.877 59.654c.305-.815.59-1.638.846-2.469l-38.114-57.017zM34.469 26.763l-1.727 1.154 45.987 68.795c.62-.31 1.235-.635 1.846-.977l-46.106-68.972zM70.24 14.413c-.978-.256-1.961-.485-2.953-.673l35.019 52.388c.204-.987.373-1.981.511-2.981l-32.577-48.734zM56.801 13.009c-.793.04-1.587.096-2.379.179l43.469 65.03c.378-.699.74-1.406 1.08-2.123l-42.17-63.086zM14.953 53.987c-.085 1.184-.126 2.372-.117 3.562l26.931 40.289c1.096.464 2.209.88 3.336 1.254l-30.15-45.105zM18.222 40.175c-.326.784-.63 1.576-.909 2.376l39.26 58.734c.847.048 1.695.069 2.544.068l-40.895-61.178zM28.835 27.688l-1.728 1.156 46.761 69.952c.666-.237 1.33-.491 1.989-.764l-47.022-70.344zM31.375 91.644c1.499 1.202 3.069 2.292 4.692 3.277l-20.714-30.987c.29 1.876.696 3.742 1.234 5.587l14.788 22.123zM24.03 30.161c-.452.586-.889 1.183-1.309 1.788l45.718 68.392c.72-.156 1.438-.332 2.152-.525l-46.561-69.655zM16.151 46.429c-.234.939-.428 1.887-.601 2.839l34.143 51.078c.946.204 1.896.388 2.854.53l-36.396-54.447zM20.884 34.812c-.395.675-.767 1.361-1.125 2.053l43.005 64.333c.776-.065 1.551-.147 2.326-.254l-44.206-66.132z"/><path fill="#fff" stroke="#000" stroke-width="3" stroke-miterlimit="10" d="M97.905 52.154c0 23.125-18.747 41.873-41.874 41.873-23.126 0-41.874-18.747-41.874-41.873 0-23.126 18.748-41.873 41.874-41.873 23.127 0 41.874 18.747 41.874 41.873"/><path stroke="#000" stroke-width="4" stroke-miterlimit="10" fill="none" d="M44.002 52.914h24M56.002 64.913v-23.999"/></svg>

Before

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 86.75 86.75"><path stroke-miterlimit="10" d="M85.248 43.377c0-23.125-18.747-41.873-41.874-41.873-23.126 0-41.874 18.747-41.874 41.873 0 23.126 18.748 41.873 41.874 41.873 23.127 0 41.874-18.747 41.874-41.873" stroke="#000" stroke-width="3"/><path stroke-miterlimit="10" d="M25.31 43.376h36.128m-18.064-18.063v36.128" fill="#fff" stroke="#fff" stroke-width="4"/><path stroke-miterlimit="10" d="M78.089 43.377c0-19.171-15.542-34.714-34.715-34.714-19.172 0-34.715 15.542-34.715 34.714 0 19.172 15.543 34.714 34.715 34.714 19.173 0 34.715-15.542 34.715-34.714" stroke="#fff" stroke-width="4" fill="none"/></svg>

Before

Width:  |  Height:  |  Size: 687 B

File diff suppressed because one or more lines are too long

View File

@ -1,36 +0,0 @@
/*
RequireJS 2.1.14 Copyright (c) 2010-2014, The Dojo Foundation All Rights Reserved.
Available via the MIT or new BSD license.
see: http://github.com/jrburke/requirejs for details
*/
var requirejs,require,define;
(function(ba){function G(b){return"[object Function]"===K.call(b)}function H(b){return"[object Array]"===K.call(b)}function v(b,c){if(b){var d;for(d=0;d<b.length&&(!b[d]||!c(b[d],d,b));d+=1);}}function T(b,c){if(b){var d;for(d=b.length-1;-1<d&&(!b[d]||!c(b[d],d,b));d-=1);}}function t(b,c){return fa.call(b,c)}function m(b,c){return t(b,c)&&b[c]}function B(b,c){for(var d in b)if(t(b,d)&&c(b[d],d))break}function U(b,c,d,e){c&&B(c,function(c,g){if(d||!t(b,g))e&&"object"===typeof c&&c&&!H(c)&&!G(c)&&!(c instanceof
RegExp)?(b[g]||(b[g]={}),U(b[g],c,d,e)):b[g]=c});return b}function u(b,c){return function(){return c.apply(b,arguments)}}function ca(b){throw b;}function da(b){if(!b)return b;var c=ba;v(b.split("."),function(b){c=c[b]});return c}function C(b,c,d,e){c=Error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requireType=b;c.requireModules=e;d&&(c.originalError=d);return c}function ga(b){function c(a,k,b){var f,l,c,d,e,g,i,p,k=k&&k.split("/"),h=j.map,n=h&&h["*"];if(a){a=a.split("/");l=a.length-1;j.nodeIdCompat&&
Q.test(a[l])&&(a[l]=a[l].replace(Q,""));"."===a[0].charAt(0)&&k&&(l=k.slice(0,k.length-1),a=l.concat(a));l=a;for(c=0;c<l.length;c++)if(d=l[c],"."===d)l.splice(c,1),c-=1;else if(".."===d&&!(0===c||1==c&&".."===l[2]||".."===l[c-1])&&0<c)l.splice(c-1,2),c-=2;a=a.join("/")}if(b&&h&&(k||n)){l=a.split("/");c=l.length;a:for(;0<c;c-=1){e=l.slice(0,c).join("/");if(k)for(d=k.length;0<d;d-=1)if(b=m(h,k.slice(0,d).join("/")))if(b=m(b,e)){f=b;g=c;break a}!i&&(n&&m(n,e))&&(i=m(n,e),p=c)}!f&&i&&(f=i,g=p);f&&(l.splice(0,
g,f),a=l.join("/"))}return(f=m(j.pkgs,a))?f:a}function d(a){z&&v(document.getElementsByTagName("script"),function(k){if(k.getAttribute("data-requiremodule")===a&&k.getAttribute("data-requirecontext")===i.contextName)return k.parentNode.removeChild(k),!0})}function e(a){var k=m(j.paths,a);if(k&&H(k)&&1<k.length)return k.shift(),i.require.undef(a),i.makeRequire(null,{skipMap:!0})([a]),!0}function n(a){var k,c=a?a.indexOf("!"):-1;-1<c&&(k=a.substring(0,c),a=a.substring(c+1,a.length));return[k,a]}function p(a,
k,b,f){var l,d,e=null,g=k?k.name:null,j=a,p=!0,h="";a||(p=!1,a="_@r"+(K+=1));a=n(a);e=a[0];a=a[1];e&&(e=c(e,g,f),d=m(r,e));a&&(e?h=d&&d.normalize?d.normalize(a,function(a){return c(a,g,f)}):-1===a.indexOf("!")?c(a,g,f):a:(h=c(a,g,f),a=n(h),e=a[0],h=a[1],b=!0,l=i.nameToUrl(h)));b=e&&!d&&!b?"_unnormalized"+(O+=1):"";return{prefix:e,name:h,parentMap:k,unnormalized:!!b,url:l,originalName:j,isDefine:p,id:(e?e+"!"+h:h)+b}}function s(a){var k=a.id,b=m(h,k);b||(b=h[k]=new i.Module(a));return b}function q(a,
k,b){var f=a.id,c=m(h,f);if(t(r,f)&&(!c||c.defineEmitComplete))"defined"===k&&b(r[f]);else if(c=s(a),c.error&&"error"===k)b(c.error);else c.on(k,b)}function w(a,b){var c=a.requireModules,f=!1;if(b)b(a);else if(v(c,function(b){if(b=m(h,b))b.error=a,b.events.error&&(f=!0,b.emit("error",a))}),!f)g.onError(a)}function x(){R.length&&(ha.apply(A,[A.length,0].concat(R)),R=[])}function y(a){delete h[a];delete V[a]}function F(a,b,c){var f=a.map.id;a.error?a.emit("error",a.error):(b[f]=!0,v(a.depMaps,function(f,
d){var e=f.id,g=m(h,e);g&&(!a.depMatched[d]&&!c[e])&&(m(b,e)?(a.defineDep(d,r[e]),a.check()):F(g,b,c))}),c[f]=!0)}function D(){var a,b,c=(a=1E3*j.waitSeconds)&&i.startTime+a<(new Date).getTime(),f=[],l=[],g=!1,h=!0;if(!W){W=!0;B(V,function(a){var i=a.map,j=i.id;if(a.enabled&&(i.isDefine||l.push(a),!a.error))if(!a.inited&&c)e(j)?g=b=!0:(f.push(j),d(j));else if(!a.inited&&(a.fetched&&i.isDefine)&&(g=!0,!i.prefix))return h=!1});if(c&&f.length)return a=C("timeout","Load timeout for modules: "+f,null,
f),a.contextName=i.contextName,w(a);h&&v(l,function(a){F(a,{},{})});if((!c||b)&&g)if((z||ea)&&!X)X=setTimeout(function(){X=0;D()},50);W=!1}}function E(a){t(r,a[0])||s(p(a[0],null,!0)).init(a[1],a[2])}function I(a){var a=a.currentTarget||a.srcElement,b=i.onScriptLoad;a.detachEvent&&!Y?a.detachEvent("onreadystatechange",b):a.removeEventListener("load",b,!1);b=i.onScriptError;(!a.detachEvent||Y)&&a.removeEventListener("error",b,!1);return{node:a,id:a&&a.getAttribute("data-requiremodule")}}function J(){var a;
for(x();A.length;){a=A.shift();if(null===a[0])return w(C("mismatch","Mismatched anonymous define() module: "+a[a.length-1]));E(a)}}var W,Z,i,L,X,j={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},h={},V={},$={},A=[],r={},S={},aa={},K=1,O=1;L={require:function(a){return a.require?a.require:a.require=i.makeRequire(a.map)},exports:function(a){a.usingExports=!0;if(a.map.isDefine)return a.exports?r[a.map.id]=a.exports:a.exports=r[a.map.id]={}},module:function(a){return a.module?
a.module:a.module={id:a.map.id,uri:a.map.url,config:function(){return m(j.config,a.map.id)||{}},exports:a.exports||(a.exports={})}}};Z=function(a){this.events=m($,a.id)||{};this.map=a;this.shim=m(j.shim,a.id);this.depExports=[];this.depMaps=[];this.depMatched=[];this.pluginMaps={};this.depCount=0};Z.prototype={init:function(a,b,c,f){f=f||{};if(!this.inited){this.factory=b;if(c)this.on("error",c);else this.events.error&&(c=u(this,function(a){this.emit("error",a)}));this.depMaps=a&&a.slice(0);this.errback=
c;this.inited=!0;this.ignore=f.ignore;f.enabled||this.enabled?this.enable():this.check()}},defineDep:function(a,b){this.depMatched[a]||(this.depMatched[a]=!0,this.depCount-=1,this.depExports[a]=b)},fetch:function(){if(!this.fetched){this.fetched=!0;i.startTime=(new Date).getTime();var a=this.map;if(this.shim)i.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],u(this,function(){return a.prefix?this.callPlugin():this.load()}));else return a.prefix?this.callPlugin():this.load()}},load:function(){var a=
this.map.url;S[a]||(S[a]=!0,i.load(this.map.id,a))},check:function(){if(this.enabled&&!this.enabling){var a,b,c=this.map.id;b=this.depExports;var f=this.exports,l=this.factory;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(1>this.depCount&&!this.defined){if(G(l)){if(this.events.error&&this.map.isDefine||g.onError!==ca)try{f=i.execCb(c,l,b,f)}catch(d){a=d}else f=i.execCb(c,l,b,f);this.map.isDefine&&void 0===f&&((b=this.module)?f=b.exports:this.usingExports&&
(f=this.exports));if(a)return a.requireMap=this.map,a.requireModules=this.map.isDefine?[this.map.id]:null,a.requireType=this.map.isDefine?"define":"require",w(this.error=a)}else f=l;this.exports=f;if(this.map.isDefine&&!this.ignore&&(r[c]=f,g.onResourceLoad))g.onResourceLoad(i,this.map,this.depMaps);y(c);this.defined=!0}this.defining=!1;this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else this.fetch()}},callPlugin:function(){var a=
this.map,b=a.id,d=p(a.prefix);this.depMaps.push(d);q(d,"defined",u(this,function(f){var l,d;d=m(aa,this.map.id);var e=this.map.name,P=this.map.parentMap?this.map.parentMap.name:null,n=i.makeRequire(a.parentMap,{enableBuildCallback:!0});if(this.map.unnormalized){if(f.normalize&&(e=f.normalize(e,function(a){return c(a,P,!0)})||""),f=p(a.prefix+"!"+e,this.map.parentMap),q(f,"defined",u(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),d=m(h,f.id)){this.depMaps.push(f);
if(this.events.error)d.on("error",u(this,function(a){this.emit("error",a)}));d.enable()}}else d?(this.map.url=i.nameToUrl(d),this.load()):(l=u(this,function(a){this.init([],function(){return a},null,{enabled:!0})}),l.error=u(this,function(a){this.inited=!0;this.error=a;a.requireModules=[b];B(h,function(a){0===a.map.id.indexOf(b+"_unnormalized")&&y(a.map.id)});w(a)}),l.fromText=u(this,function(f,c){var d=a.name,e=p(d),P=M;c&&(f=c);P&&(M=!1);s(e);t(j.config,b)&&(j.config[d]=j.config[b]);try{g.exec(f)}catch(h){return w(C("fromtexteval",
"fromText eval for "+b+" failed: "+h,h,[b]))}P&&(M=!0);this.depMaps.push(e);i.completeLoad(d);n([d],l)}),f.load(a.name,n,l,j))}));i.enable(d,this);this.pluginMaps[d.id]=d},enable:function(){V[this.map.id]=this;this.enabling=this.enabled=!0;v(this.depMaps,u(this,function(a,b){var c,f;if("string"===typeof a){a=p(a,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap);this.depMaps[b]=a;if(c=m(L,a.id)){this.depExports[b]=c(this);return}this.depCount+=1;q(a,"defined",u(this,function(a){this.defineDep(b,
a);this.check()}));this.errback&&q(a,"error",u(this,this.errback))}c=a.id;f=h[c];!t(L,c)&&(f&&!f.enabled)&&i.enable(a,this)}));B(this.pluginMaps,u(this,function(a){var b=m(h,a.id);b&&!b.enabled&&i.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){v(this.events[a],function(a){a(b)});"error"===a&&delete this.events[a]}};i={config:j,contextName:b,registry:h,defined:r,urlFetched:S,defQueue:A,Module:Z,makeModuleMap:p,
nextTick:g.nextTick,onError:w,configure:function(a){a.baseUrl&&"/"!==a.baseUrl.charAt(a.baseUrl.length-1)&&(a.baseUrl+="/");var b=j.shim,c={paths:!0,bundles:!0,config:!0,map:!0};B(a,function(a,b){c[b]?(j[b]||(j[b]={}),U(j[b],a,!0,!0)):j[b]=a});a.bundles&&B(a.bundles,function(a,b){v(a,function(a){a!==b&&(aa[a]=b)})});a.shim&&(B(a.shim,function(a,c){H(a)&&(a={deps:a});if((a.exports||a.init)&&!a.exportsFn)a.exportsFn=i.makeShimExports(a);b[c]=a}),j.shim=b);a.packages&&v(a.packages,function(a){var b,
a="string"===typeof a?{name:a}:a;b=a.name;a.location&&(j.paths[b]=a.location);j.pkgs[b]=a.name+"/"+(a.main||"main").replace(ia,"").replace(Q,"")});B(h,function(a,b){!a.inited&&!a.map.unnormalized&&(a.map=p(b))});if(a.deps||a.callback)i.require(a.deps||[],a.callback)},makeShimExports:function(a){return function(){var b;a.init&&(b=a.init.apply(ba,arguments));return b||a.exports&&da(a.exports)}},makeRequire:function(a,e){function j(c,d,m){var n,q;e.enableBuildCallback&&(d&&G(d))&&(d.__requireJsBuild=
!0);if("string"===typeof c){if(G(d))return w(C("requireargs","Invalid require call"),m);if(a&&t(L,c))return L[c](h[a.id]);if(g.get)return g.get(i,c,a,j);n=p(c,a,!1,!0);n=n.id;return!t(r,n)?w(C("notloaded",'Module name "'+n+'" has not been loaded yet for context: '+b+(a?"":". Use require([])"))):r[n]}J();i.nextTick(function(){J();q=s(p(null,a));q.skipMap=e.skipMap;q.init(c,d,m,{enabled:!0});D()});return j}e=e||{};U(j,{isBrowser:z,toUrl:function(b){var d,e=b.lastIndexOf("."),k=b.split("/")[0];if(-1!==
e&&(!("."===k||".."===k)||1<e))d=b.substring(e,b.length),b=b.substring(0,e);return i.nameToUrl(c(b,a&&a.id,!0),d,!0)},defined:function(b){return t(r,p(b,a,!1,!0).id)},specified:function(b){b=p(b,a,!1,!0).id;return t(r,b)||t(h,b)}});a||(j.undef=function(b){x();var c=p(b,a,!0),e=m(h,b);d(b);delete r[b];delete S[c.url];delete $[b];T(A,function(a,c){a[0]===b&&A.splice(c,1)});e&&(e.events.defined&&($[b]=e.events),y(b))});return j},enable:function(a){m(h,a.id)&&s(a).enable()},completeLoad:function(a){var b,
c,d=m(j.shim,a)||{},g=d.exports;for(x();A.length;){c=A.shift();if(null===c[0]){c[0]=a;if(b)break;b=!0}else c[0]===a&&(b=!0);E(c)}c=m(h,a);if(!b&&!t(r,a)&&c&&!c.inited){if(j.enforceDefine&&(!g||!da(g)))return e(a)?void 0:w(C("nodefine","No define call for "+a,null,[a]));E([a,d.deps||[],d.exportsFn])}D()},nameToUrl:function(a,b,c){var d,e,h;(d=m(j.pkgs,a))&&(a=d);if(d=m(aa,a))return i.nameToUrl(d,b,c);if(g.jsExtRegExp.test(a))d=a+(b||"");else{d=j.paths;a=a.split("/");for(e=a.length;0<e;e-=1)if(h=a.slice(0,
e).join("/"),h=m(d,h)){H(h)&&(h=h[0]);a.splice(0,e,h);break}d=a.join("/");d+=b||(/^data\:|\?/.test(d)||c?"":".js");d=("/"===d.charAt(0)||d.match(/^[\w\+\.\-]+:/)?"":j.baseUrl)+d}return j.urlArgs?d+((-1===d.indexOf("?")?"?":"&")+j.urlArgs):d},load:function(a,b){g.load(i,a,b)},execCb:function(a,b,c,d){return b.apply(d,c)},onScriptLoad:function(a){if("load"===a.type||ja.test((a.currentTarget||a.srcElement).readyState))N=null,a=I(a),i.completeLoad(a.id)},onScriptError:function(a){var b=I(a);if(!e(b.id))return w(C("scripterror",
"Script error for: "+b.id,a,[b.id]))}};i.require=i.makeRequire();return i}var g,x,y,D,I,E,N,J,s,O,ka=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,la=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,Q=/\.js$/,ia=/^\.\//;x=Object.prototype;var K=x.toString,fa=x.hasOwnProperty,ha=Array.prototype.splice,z=!!("undefined"!==typeof window&&"undefined"!==typeof navigator&&window.document),ea=!z&&"undefined"!==typeof importScripts,ja=z&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,
Y="undefined"!==typeof opera&&"[object Opera]"===opera.toString(),F={},q={},R=[],M=!1;if("undefined"===typeof define){if("undefined"!==typeof requirejs){if(G(requirejs))return;q=requirejs;requirejs=void 0}"undefined"!==typeof require&&!G(require)&&(q=require,require=void 0);g=requirejs=function(b,c,d,e){var n,p="_";!H(b)&&"string"!==typeof b&&(n=b,H(c)?(b=c,c=d,d=e):b=[]);n&&n.context&&(p=n.context);(e=m(F,p))||(e=F[p]=g.s.newContext(p));n&&e.configure(n);return e.require(b,c,d)};g.config=function(b){return g(b)};
g.nextTick="undefined"!==typeof setTimeout?function(b){setTimeout(b,4)}:function(b){b()};require||(require=g);g.version="2.1.14";g.jsExtRegExp=/^\/|:|\?|\.js$/;g.isBrowser=z;x=g.s={contexts:F,newContext:ga};g({});v(["toUrl","undef","defined","specified"],function(b){g[b]=function(){var c=F._;return c.require[b].apply(c,arguments)}});if(z&&(y=x.head=document.getElementsByTagName("head")[0],D=document.getElementsByTagName("base")[0]))y=x.head=D.parentNode;g.onError=ca;g.createNode=function(b){var c=
b.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");c.type=b.scriptType||"text/javascript";c.charset="utf-8";c.async=!0;return c};g.load=function(b,c,d){var e=b&&b.config||{};if(z)return e=g.createNode(e,c,d),e.setAttribute("data-requirecontext",b.contextName),e.setAttribute("data-requiremodule",c),e.attachEvent&&!(e.attachEvent.toString&&0>e.attachEvent.toString().indexOf("[native code"))&&!Y?(M=!0,e.attachEvent("onreadystatechange",b.onScriptLoad)):
(e.addEventListener("load",b.onScriptLoad,!1),e.addEventListener("error",b.onScriptError,!1)),e.src=d,J=e,D?y.insertBefore(e,D):y.appendChild(e),J=null,e;if(ea)try{importScripts(d),b.completeLoad(c)}catch(m){b.onError(C("importscripts","importScripts failed for "+c+" at "+d,m,[c]))}};z&&!q.skipDataMain&&T(document.getElementsByTagName("script"),function(b){y||(y=b.parentNode);if(I=b.getAttribute("data-main"))return s=I,q.baseUrl||(E=s.split("/"),s=E.pop(),O=E.length?E.join("/")+"/":"./",q.baseUrl=
O),s=s.replace(Q,""),g.jsExtRegExp.test(s)&&(s=I),q.deps=q.deps?q.deps.concat(s):[s],!0});define=function(b,c,d){var e,g;"string"!==typeof b&&(d=c,c=b,b=null);H(c)||(d=c,c=null);!c&&G(d)&&(c=[],d.length&&(d.toString().replace(ka,"").replace(la,function(b,d){c.push(d)}),c=(1===d.length?["require"]:["require","exports","module"]).concat(c)));if(M){if(!(e=J))N&&"interactive"===N.readyState||T(document.getElementsByTagName("script"),function(b){if("interactive"===b.readyState)return N=b}),e=N;e&&(b||
(b=e.getAttribute("data-requiremodule")),g=F[e.getAttribute("data-requirecontext")])}(g?g.defQueue:R).push([b,c,d])};define.amd={jQuery:!0};g.exec=function(b){return eval(b)};g(q)}})(this);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

@ -1,112 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Quick Start Guide / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Quick Start Guide</h1>
<p>This section covers the basics of working with <em>IntelliJ Platform</em>.
It will familiarize you with the working environment, project structure, and frequently used API components.</p>
<ul>
<li><a href="basics/types_of_plugins.html"><span>Main Types of IntelliJ Platform Plugins</span></a></li>
<li><a href="basics/getting_started.html"><span>Getting Started</span></a></li>
<li><a href="basics/architectural_overview.html"><span>Architectural Overview</span></a></li>
<li><a href="basics/project_structure.html"><span>Project Structure</span></a></li>
<li><a href="basics/checkout_and_build_community.html"><span>Check Out And Build Community Edition</span></a></li>
<li><a href="basics/settings_caches_logs.html"><span>IDE Settings, Caches, Logs, and Plugins</span></a></li>
<li><a href="basics/indexing_and_psi_stubs.html"><span>Indexing and PSI Stubs</span></a></li>
<li><a href="basics/run_configurations.html"><span>Run Configurations</span></a></li>
<li><a href="basics/testing_plugins.html"><span>Testing Plugins</span></a></li>
</ul>
<div class="last-modified">
Last modified: 30 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

16
basics.md Normal file
View File

@ -0,0 +1,16 @@
---
title: Quick Start Guide
---
This section covers the basics of working with *IntelliJ Platform*.
It will familiarize you with the working environment, project structure, and frequently used API components.
* [Main Types of IntelliJ Platform Plugins](basics/types_of_plugins.md)
* [Getting Started](basics/getting_started.md)
* [Architectural Overview](basics/architectural_overview.md)
* [Project Structure](basics/project_structure.md)
* [Check Out And Build Community Edition](basics/checkout_and_build_community.md)
* [IDE Settings, Caches, Logs, and Plugins](basics/settings_caches_logs.md)
* [Indexing and PSI Stubs](basics/indexing_and_psi_stubs.md)
* [Run Configurations](basics/run_configurations.md)
* [Testing Plugins](basics/testing_plugins.md)

View File

@ -1,279 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Action System / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/action_system">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Action System</h1>
<a name="executing-and-updating-actions" class="elem-anchor"></a>
<h2>Executing and updating actions<a href="#executing-and-updating-actions" class="anchor-link"><span></span></a></h2>
<p>The system of actions allows plugins to add their own items to IDEA menus and toolbars. An action is a class, derived from the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java" data-bypass="yes" target="_blank"><span><code class="code highlight language-text">AnAction</code></span></a> class, whose <code class="code highlight language-text">actionPerformed</code> method is called when the menu item or toolbar button is selected.
For example, one of the action classes is responsible for the <strong>File | Open File…</strong> menu item and for the <strong>Open File</strong> toolbar button.</p>
<p>Actions are organized into groups, which, in turn, can contain other groups. A group of actions can form a toolbar or a menu.
Subgroups of the group can form submenus of the menu.</p>
<p>Every action and action group has an unique identifier. Identifiers of many of the standard IDEA actions are defined in the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java" data-bypass="yes" target="_blank"><span>IdeActions</span></a> class.</p>
<p>Every action can be included in multiple groups, and thus appear in multiple places within the IDEA user interface. Different places where actions can appear are defined by constants in the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java" data-bypass="yes" target="_blank"><span><code class="code highlight language-text">ActionPlaces</code></span></a> interface. For every place where the action appears, a new <code class="code highlight language-text">Presentation</code> is created. Thus, the same action can have different text or icons when it appears in different places of the user interface. Different presentations for the action are created by copying the presentation returned by the <code class="code highlight language-text">AnAction.getTemplatePresentation()</code> method.</p>
<p>To update the state of the action, the method <code class="code highlight language-text">AnAction.update()</code> is periodically called by IDEA. The <code class="code highlight language-text">AnActionEvent</code> object passed to this method carries the information about the current context for the action, and in particular, the specific presentation which needs to be updated.</p>
<p>To retrieve the information about the current state of the IDE, including the active project, the selected file, the selection in the editor and so on, the method <code class="code highlight language-text">AnActionEvent.getData()</code> can be used. Different data keys that can be passed to that method are defined in the <code class="code highlight language-text">DataKeys</code> class.</p>
<p>The <code class="code highlight language-text">AnActionEvent</code> instance is also passed to the <code class="code highlight language-text">actionPerformed</code> method.</p>
<a name="registering-actions" class="elem-anchor"></a>
<h2>Registering Actions<a href="#registering-actions" class="anchor-link"><span></span></a></h2>
<p>There are two main ways to register an action: either by listing it in the <code class="code highlight language-text">&lt;actions&gt;</code> section of the <code class="code highlight language-text">plugin.xml</code> file, or through Java code.</p>
<a name="registering-actions-in-pluginxml" class="elem-anchor"></a>
<h3>Registering Actions in plugin.xml<a href="#registering-actions-in-pluginxml" class="anchor-link"><span></span></a></h3>
<p>Registering actions in <code class="code highlight language-text">plugin.xml</code> is demonstrated in the following example. The example section of <code class="code highlight language-text">plugin.xml</code> demonstrates all elements which can be used in the <code class="code highlight language-text">&lt;actions&gt;</code> section, and describes the meaning of each element.</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="c">&lt;!-- Actions --&gt;</span>
<span class="nt">&lt;actions&gt;</span>
<span class="c">&lt;!-- The &lt;action&gt; element defines an action to register.
The mandatory "id" attribute specifies an unique
identifier for the action.
The mandatory "class" attribute specifies the
full-qualified name of the class implementing the action.
The mandatory "text" attribute specifies the text of the
action (tooltip for toolbar button or text for menu item).
The optional "use-shortcut-of" attribute specifies the ID
of the action whose keyboard shortcut this action will use.
The optional "description" attribute specifies the text
which is displayed in the status bar when the action is focused.
The optional "icon" attribute specifies the icon which is
displayed on the toolbar button or next to the menu item. --&gt;</span>
<span class="nt">&lt;action</span> <span class="na">id=</span><span class="s">"VssIntegration.GarbageCollection"</span> <span class="na">class=</span><span class="s">"com.foo.impl.CollectGarbage"</span> <span class="na">text=</span><span class="s">"Collect _Garbage"</span> <span class="na">description=</span><span class="s">"Run garbage collector"</span> <span class="na">icon=</span><span class="s">"icons/garbage.png"</span><span class="nt">&gt;</span>
<span class="c">&lt;!-- The &lt;add-to-group&gt; node specifies that the action should be added
to an existing group. An action can be added to several groups.
The mandatory "group-id" attribute specifies the ID of the group
to which the action is added.
The group must be implemented by an instance of the DefaultActionGroup class.
The mandatory "anchor" attribute specifies the position of the
action in the group relative to other actions. It can have the values
"first", "last", "before" and "after".
The "relative-to-action" attribute is mandatory if the anchor
is set to "before" and "after", and specifies the action before or after which
the current action is inserted. --&gt;</span>
<span class="nt">&lt;add-to-group</span> <span class="na">group-id=</span><span class="s">"ToolsMenu"</span> <span class="na">relative-to-action=</span><span class="s">"GenerateJavadoc"</span> <span class="na">anchor=</span><span class="s">"after"</span><span class="nt">/&gt;</span>
<span class="c">&lt;!-- The &lt;keyboard-shortcut&gt; node specifies the keyboard shortcut
for the action. An action can have several keyboard shortcuts.
The mandatory "first-keystroke" attribute specifies the first
keystroke of the action. The key strokes are specified according
to the regular Swing rules.
The optional "second-keystroke" attribute specifies the second
keystroke of the action.
The mandatory "keymap" attribute specifies the keymap for which
the action is active. IDs of the standard keymaps are defined as
constants in the com.intellij.openapi.keymap.KeymapManager class. --&gt;</span>
<span class="nt">&lt;keyboard-shortcut</span> <span class="na">first-keystroke=</span><span class="s">"control alt G"</span> <span class="na">second-keystroke=</span><span class="s">"C"</span> <span class="na">keymap=</span><span class="s">"$default"</span><span class="nt">/&gt;</span>
<span class="c">&lt;!-- The &lt;mouse-shortcut&gt; node specifies the mouse shortcut for the
action. An action can have several mouse shortcuts.
The mandatory "keystroke" attribute specifies the clicks and
modifiers for the action. It is defined as a sequence of words
separated by spaces:
"button1", "button2", "button3" for the mouse buttons;
"shift", "control", "meta", "alt", "altGraph" for the modifier keys;
"doubleClick" if the action is activated by a double-click of the button.
The mandatory "keymap" attribute specifies the keymap for which
the action is active. IDs of the standard keymaps are defined as
constants in the com.intellij.openapi.keymap.KeymapManager class. --&gt;</span>
<span class="nt">&lt;mouse-shortcut</span> <span class="na">keystroke=</span><span class="s">"control button3 doubleClick"</span> <span class="na">keymap=</span><span class="s">"$default"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/action&gt;</span>
<span class="c">&lt;!-- The &lt;group&gt; element defines an action group. &lt;action&gt;, &lt;group&gt; and
&lt;separator&gt; elements defined within it are automatically included in the group.
The mandatory "id" attribute specifies an unique identifier for the action.
The optional "class" attribute specifies the full-qualified name of
the class implementing the group. If not specified,
com.intellij.openapi.actionSystem.DefaultActionGroup is used.
The optional "text" attribute specifies the text of the group (text
for the menu item showing the submenu).
The optional "description" attribute specifies the text which is displayed
in the status bar when the group is focused.
The optional "icon" attribute specifies the icon which is displayed on
the toolbar button or next to the group.
The optional "popup" attribute specifies how the group is presented in
the menu. If a group has popup="true", actions in it are placed in a
submenu; for popup="false", actions are displayed as a section of the
same menu delimited by separators. --&gt;</span>
<span class="nt">&lt;group</span> <span class="na">class=</span><span class="s">"com.foo.impl.MyActionGroup"</span> <span class="na">id=</span><span class="s">"TestActionGroup"</span> <span class="na">text=</span><span class="s">"Test Group"</span> <span class="na">description=</span><span class="s">"Group with test actions"</span> <span class="na">icon=</span><span class="s">"icons/testgroup.png"</span> <span class="na">popup=</span><span class="s">"true"</span><span class="nt">&gt;</span>
<span class="nt">&lt;action</span> <span class="na">id=</span><span class="s">"VssIntegration.TestAction"</span> <span class="na">class=</span><span class="s">"com.foo.impl.TestAction"</span> <span class="na">text=</span><span class="s">"My Test Action"</span> <span class="na">description=</span><span class="s">"My test action"</span><span class="nt">/&gt;</span>
<span class="c">&lt;!-- The &lt;separator&gt; element defines a separator between actions.
It can also have an &lt;add-to-group&gt; child element. --&gt;</span>
<span class="nt">&lt;separator/&gt;</span>
<span class="nt">&lt;group</span> <span class="na">id=</span><span class="s">"TestActionSubGroup"</span><span class="nt">/&gt;</span>
<span class="c">&lt;!-- The &lt;reference&gt; element allows to add an existing action to the group.
The mandatory "ref" attribute specifies the ID of the action to add. --&gt;</span>
<span class="nt">&lt;reference</span> <span class="na">ref=</span><span class="s">"EditorCopy"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;add-to-group</span> <span class="na">group-id=</span><span class="s">"MainMenu"</span> <span class="na">relative-to-action=</span><span class="s">"HelpMenu"</span> <span class="na">anchor=</span><span class="s">"before"</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/group&gt;</span>
<span class="nt">&lt;/actions&gt;</span>
</code></pre>
<a name="registering-actions-from-code" class="elem-anchor"></a>
<h2>Registering Actions from Code<a href="#registering-actions-from-code" class="anchor-link"><span></span></a></h2>
<p>To register an action from code, two steps are required.</p>
<ul>
<li>First, an instance of the class derived from <code class="code highlight language-text">AnAction</code> must be passed to the <code class="code highlight language-text">registerAction</code> method of the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java" data-bypass="yes" target="_blank"><span>ActionManager</span></a> class, to associate the action with an ID.</li>
<li>Second, the action needs to be added to one or more groups. To get an instance of an action group by ID, it is necessary to call <code class="code highlight language-text">ActionManager.getAction()</code> and cast the returned value to the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/openapi/actionSystem/DefaultActionGroup.java" data-bypass="yes" target="_blank"><span>DefaultActionGroup</span></a> class.</li>
</ul>
<p>You can create a plugin that registers actions on IDEA startup using the following procedure.</p>
<p><strong>To register an action on IDEA startup</strong></p>
<ul>
<li>Create a new class that implements the <code class="code highlight language-text">ApplicationComponent</code> interface.</li>
<li>In this class, override the <code class="code highlight language-text">getComponentName</code>, <code class="code highlight language-text">initComponent</code>, and <code class="code highlight language-text">disposeComponent</code> methods.</li>
<li>Register this class in the <code class="code highlight language-text">&lt;application-components&gt;</code> section of the plugin.xml file.</li>
</ul>
<p>To clarify the above procedure, consider the following sample Java class <code class="code highlight language-text">MyPluginRegistration</code> that registers an action defined in a custom <code class="code highlight language-text">TextBoxes</code> class and adds a new menu command to the <em>Window</em> menu group on the main menu:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">MyPluginRegistration</span> <span class="kd">implements</span> <span class="n">ApplicationComponent</span> <span class="o">{</span>
<span class="c1">// Returns the component name (any unique string value).</span>
<span class="nd">@NotNull</span> <span class="kd">public</span> <span class="n">String</span> <span class="nf">getComponentName</span><span class="o">()</span> <span class="o">{</span>
<span class="k">return</span> <span class="s">"MyPlugin"</span><span class="o">;</span>
<span class="o">}</span>
<span class="c1">// If you register the MyPluginRegistration class in the &lt;application-components&gt; section of</span>
<span class="c1">// the plugin.xml file, this method is called on IDEA start-up.</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">initComponent</span><span class="o">()</span> <span class="o">{</span>
<span class="n">ActionManager</span> <span class="n">am</span> <span class="o">=</span> <span class="n">ActionManager</span><span class="o">.</span><span class="na">getInstance</span><span class="o">();</span>
<span class="n">TextBoxes</span> <span class="n">action</span> <span class="o">=</span> <span class="k">new</span> <span class="n">TextBoxes</span><span class="o">();</span>
<span class="c1">// Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class.</span>
<span class="n">am</span><span class="o">.</span><span class="na">registerAction</span><span class="o">(</span><span class="s">"MyPluginAction"</span><span class="o">,</span> <span class="n">action</span><span class="o">);</span>
<span class="c1">// Gets an instance of the WindowMenu action group.</span>
<span class="n">DefaultActionGroup</span> <span class="n">windowM</span> <span class="o">=</span> <span class="o">(</span><span class="n">DefaultActionGroup</span><span class="o">)</span> <span class="n">am</span><span class="o">.</span><span class="na">getAction</span><span class="o">(</span><span class="s">"WindowMenu"</span><span class="o">);</span>
<span class="c1">// Adds a separator and a new menu command to the WindowMenu group on the main menu.</span>
<span class="n">windowM</span><span class="o">.</span><span class="na">addSeparator</span><span class="o">();</span>
<span class="n">windowM</span><span class="o">.</span><span class="na">add</span><span class="o">(</span><span class="n">action</span><span class="o">);</span>
<span class="o">}</span>
<span class="c1">// Disposes system resources.</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">disposeComponent</span><span class="o">()</span> <span class="o">{</span>
<span class="o">}</span>
<span class="o">}</span>
</code></pre>
<p>Note, that the sample <code class="code highlight language-text">TextBoxes</code> class is described in <a href="/intellij-sdk-docs/basics/getting_started.html"><span>Getting Started with Plugin Development</span></a>.</p>
<p>To ensure that your plugin is initialized on IDEA start-up, make the following changes to the <code class="code highlight language-text">&lt;application-components&gt;</code> section of the <code class="code highlight language-text">plugin.xml</code> file:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="nt">&lt;application-components&gt;</span>
<span class="c">&lt;!-- Add your application components here --&gt;</span>
<span class="nt">&lt;component&gt;</span>
<span class="nt">&lt;implementation-class&gt;</span>MypackageName.MyPluginRegistration<span class="nt">&lt;/implementation-class&gt;</span>
<span class="nt">&lt;/component&gt;</span>
<span class="nt">&lt;/application-components&gt;</span>
</code></pre>
<a name="building-ui-from-actions" class="elem-anchor"></a>
<h2>Building UI from Actions<a href="#building-ui-from-actions" class="anchor-link"><span></span></a></h2>
<p>If a plugin needs to include a toolbar or popup menu built from a group of actions in its own user interface, that can be accomplished through the <code class="code highlight language-text">ActionPopupMenu</code> and <code class="code highlight language-text">ActionToolbar</code> classes. These objects can be created through calls to <code class="code highlight language-text">ActionManager.createActionPopupMenu</code> and <code class="code highlight language-text">ActionManager.createActionToolbar</code>. To get a Swing component from such an object, simply call the getComponent() method.</p>
<p>If your action toolbar is attached to a specific component (for example, a panel in a toolwindow), you usually need to call <code class="code highlight language-text">ActionToolbar.setTargetComponent()</code> and pass the instance of the related component as a parameter. This ensures that the state of the toolbar buttons depends on the state of the related component, and not on the current focus location within the IDE frame.</p>
<div class="last-modified">
Last modified: 26 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

179
basics/action_system.md Normal file
View File

@ -0,0 +1,179 @@
---
title: Action System
---
## Executing and updating actions
The system of actions allows plugins to add their own items to IDEA menus and toolbars. An action is a class, derived from the [`AnAction`](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java) class, whose `actionPerformed` method is called when the menu item or toolbar button is selected.
For example, one of the action classes is responsible for the **File \| Open File...** menu item and for the **Open File** toolbar button.
Actions are organized into groups, which, in turn, can contain other groups. A group of actions can form a toolbar or a menu.
Subgroups of the group can form submenus of the menu.
Every action and action group has an unique identifier. Identifiers of many of the standard IDEA actions are defined in the [IdeActions](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/IdeActions.java) class.
Every action can be included in multiple groups, and thus appear in multiple places within the IDEA user interface. Different places where actions can appear are defined by constants in the [`ActionPlaces`](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/ActionPlaces.java) interface. For every place where the action appears, a new `Presentation` is created. Thus, the same action can have different text or icons when it appears in different places of the user interface. Different presentations for the action are created by copying the presentation returned by the `AnAction.getTemplatePresentation()` method.
To update the state of the action, the method `AnAction.update()` is periodically called by IDEA. The `AnActionEvent` object passed to this method carries the information about the current context for the action, and in particular, the specific presentation which needs to be updated.
To retrieve the information about the current state of the IDE, including the active project, the selected file, the selection in the editor and so on, the method `AnActionEvent.getData()` can be used. Different data keys that can be passed to that method are defined in the `DataKeys` class.
The `AnActionEvent` instance is also passed to the `actionPerformed` method.
## Registering Actions
There are two main ways to register an action: either by listing it in the `<actions>` section of the `plugin.xml` file, or through Java code.
### Registering Actions in plugin.xml
Registering actions in `plugin.xml` is demonstrated in the following example. The example section of `plugin.xml` demonstrates all elements which can be used in the `<actions>` section, and describes the meaning of each element.
```xml
<!-- Actions -->
<actions>
<!-- The <action> element defines an action to register.
The mandatory "id" attribute specifies an unique
identifier for the action.
The mandatory "class" attribute specifies the
full-qualified name of the class implementing the action.
The mandatory "text" attribute specifies the text of the
action (tooltip for toolbar button or text for menu item).
The optional "use-shortcut-of" attribute specifies the ID
of the action whose keyboard shortcut this action will use.
The optional "description" attribute specifies the text
which is displayed in the status bar when the action is focused.
The optional "icon" attribute specifies the icon which is
displayed on the toolbar button or next to the menu item. -->
<action id="VssIntegration.GarbageCollection" class="com.foo.impl.CollectGarbage" text="Collect _Garbage" description="Run garbage collector" icon="icons/garbage.png">
<!-- The <add-to-group> node specifies that the action should be added
to an existing group. An action can be added to several groups.
The mandatory "group-id" attribute specifies the ID of the group
to which the action is added.
The group must be implemented by an instance of the DefaultActionGroup class.
The mandatory "anchor" attribute specifies the position of the
action in the group relative to other actions. It can have the values
"first", "last", "before" and "after".
The "relative-to-action" attribute is mandatory if the anchor
is set to "before" and "after", and specifies the action before or after which
the current action is inserted. -->
<add-to-group group-id="ToolsMenu" relative-to-action="GenerateJavadoc" anchor="after"/>
<!-- The <keyboard-shortcut> node specifies the keyboard shortcut
for the action. An action can have several keyboard shortcuts.
The mandatory "first-keystroke" attribute specifies the first
keystroke of the action. The key strokes are specified according
to the regular Swing rules.
The optional "second-keystroke" attribute specifies the second
keystroke of the action.
The mandatory "keymap" attribute specifies the keymap for which
the action is active. IDs of the standard keymaps are defined as
constants in the com.intellij.openapi.keymap.KeymapManager class. -->
<keyboard-shortcut first-keystroke="control alt G" second-keystroke="C" keymap="$default"/>
<!-- The <mouse-shortcut> node specifies the mouse shortcut for the
action. An action can have several mouse shortcuts.
The mandatory "keystroke" attribute specifies the clicks and
modifiers for the action. It is defined as a sequence of words
separated by spaces:
"button1", "button2", "button3" for the mouse buttons;
"shift", "control", "meta", "alt", "altGraph" for the modifier keys;
"doubleClick" if the action is activated by a double-click of the button.
The mandatory "keymap" attribute specifies the keymap for which
the action is active. IDs of the standard keymaps are defined as
constants in the com.intellij.openapi.keymap.KeymapManager class. -->
<mouse-shortcut keystroke="control button3 doubleClick" keymap="$default"/>
</action>
<!-- The <group> element defines an action group. <action>, <group> and
<separator> elements defined within it are automatically included in the group.
The mandatory "id" attribute specifies an unique identifier for the action.
The optional "class" attribute specifies the full-qualified name of
the class implementing the group. If not specified,
com.intellij.openapi.actionSystem.DefaultActionGroup is used.
The optional "text" attribute specifies the text of the group (text
for the menu item showing the submenu).
The optional "description" attribute specifies the text which is displayed
in the status bar when the group is focused.
The optional "icon" attribute specifies the icon which is displayed on
the toolbar button or next to the group.
The optional "popup" attribute specifies how the group is presented in
the menu. If a group has popup="true", actions in it are placed in a
submenu; for popup="false", actions are displayed as a section of the
same menu delimited by separators. -->
<group class="com.foo.impl.MyActionGroup" id="TestActionGroup" text="Test Group" description="Group with test actions" icon="icons/testgroup.png" popup="true">
<action id="VssIntegration.TestAction" class="com.foo.impl.TestAction" text="My Test Action" description="My test action"/>
<!-- The <separator> element defines a separator between actions.
It can also have an <add-to-group> child element. -->
<separator/>
<group id="TestActionSubGroup"/>
<!-- The <reference> element allows to add an existing action to the group.
The mandatory "ref" attribute specifies the ID of the action to add. -->
<reference ref="EditorCopy"/>
<add-to-group group-id="MainMenu" relative-to-action="HelpMenu" anchor="before"/>
</group>
</actions>
```
## Registering Actions from Code
To register an action from code, two steps are required.
* First, an instance of the class derived from `AnAction` must be passed to the `registerAction` method of the [ActionManager](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/ActionManager.java) class, to associate the action with an ID.
* Second, the action needs to be added to one or more groups. To get an instance of an action group by ID, it is necessary to call `ActionManager.getAction()` and cast the returned value to the [DefaultActionGroup](upsource:///platform/platform-api/src/com/intellij/openapi/actionSystem/DefaultActionGroup.java) class.
You can create a plugin that registers actions on IDEA startup using the following procedure.
**To register an action on IDEA startup**
* Create a new class that implements the `ApplicationComponent` interface.
* In this class, override the `getComponentName`, `initComponent`, and `disposeComponent` methods.
* Register this class in the `<application-components>` section of the plugin.xml file.
To clarify the above procedure, consider the following sample Java class `MyPluginRegistration` that registers an action defined in a custom `TextBoxes` class and adds a new menu command to the *Window* menu group on the main menu:
```java
public class MyPluginRegistration implements ApplicationComponent {
// Returns the component name (any unique string value).
@NotNull public String getComponentName() {
return "MyPlugin";
}
// If you register the MyPluginRegistration class in the <application-components> section of
// the plugin.xml file, this method is called on IDEA start-up.
public void initComponent() {
ActionManager am = ActionManager.getInstance();
TextBoxes action = new TextBoxes();
// Passes an instance of your custom TextBoxes class to the registerAction method of the ActionManager class.
am.registerAction("MyPluginAction", action);
// Gets an instance of the WindowMenu action group.
DefaultActionGroup windowM = (DefaultActionGroup) am.getAction("WindowMenu");
// Adds a separator and a new menu command to the WindowMenu group on the main menu.
windowM.addSeparator();
windowM.add(action);
}
// Disposes system resources.
public void disposeComponent() {
}
}
```
Note, that the sample `TextBoxes` class is described in [Getting Started with Plugin Development](/basics/getting_started.md).
To ensure that your plugin is initialized on IDEA start-up, make the following changes to the `<application-components>` section of the `plugin.xml` file:
```xml
<application-components>
<!-- Add your application components here -->
<component>
<implementation-class>MypackageName.MyPluginRegistration</implementation-class>
</component>
</application-components>
```
## Building UI from Actions
If a plugin needs to include a toolbar or popup menu built from a group of actions in its own user interface, that can be accomplished through the `ActionPopupMenu` and `ActionToolbar` classes. These objects can be created through calls to `ActionManager.createActionPopupMenu` and `ActionManager.createActionToolbar`. To get a Swing component from such an object, simply call the getComponent() method.
If your action toolbar is attached to a specific component (for example, a panel in a toolwindow), you usually need to call `ActionToolbar.setTargetComponent()` and pass the instance of the related component as a parameter. This ensures that the state of the toolbar buttons depends on the state of the related component, and not on the current focus location within the IDE frame.

View File

@ -1,112 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Architectural Overview / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Architectural Overview</h1>
<p>This topic describes the architecture of the <em>IntelliJ Platform</em> from a plugin developers point of view. It is organized in a task-based manner to answer specific questions like “what can I do with this object?”, “how do I get to this object?” and so on.</p>
<p>Before proceeding please make sure youre familiar with the basic concepts of IntelliJ Platform plugin development. If not, consider starting with the live demo and tutorials at <a href="http://www.jetbrains.com/idea/plugins/" data-bypass="yes" target="_blank"><span>www.jetbrains.com/idea/plugins/</span></a> and then returning to this document.</p>
<p>The following subjects are covered:</p>
<ul>
<li><a href="architectural_overview/general_threading_rules.html"><span>General threading rules</span></a></li>
<li><a href="architectural_overview/virtual_file.html"><span>Virtual files</span></a></li>
<li><a href="architectural_overview/documents.html"><span>Documents</span></a></li>
<li><a href="architectural_overview/psi_files.html"><span>PSI files</span></a></li>
<li><a href="architectural_overview/file_view_providers.html"><span>File view providers</span></a></li>
<li><a href="architectural_overview/psi_elements.html"><span>Psi elements</span></a></li>
</ul>
<div class="last-modified">
Last modified: 23 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,16 @@
---
title: Architectural Overview
---
This topic describes the architecture of the *IntelliJ Platform* from a plugin developer's point of view. It is organized in a task-based manner to answer specific questions like "what can I do with this object?", "how do I get to this object?" and so on.
Before proceeding please make sure you're familiar with the basic concepts of IntelliJ Platform plugin development. If not, consider starting with the live demo and tutorials at [www.jetbrains.com/idea/plugins/](http://www.jetbrains.com/idea/plugins/) and then returning to this document.
The following subjects are covered:
* [General threading rules](architectural_overview/general_threading_rules.md)
* [Virtual files](architectural_overview/virtual_file.md)
* [Documents](architectural_overview/documents.md)
* [PSI files](architectural_overview/psi_files.md)
* [File view providers](architectural_overview/file_view_providers.md)
* [Psi elements](architectural_overview/psi_elements.md)

View File

@ -1,146 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Documents / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/documents">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Documents</h1>
<p>A document is an editable sequence of Unicode characters, which typically corresponds to the text contents of a virtual file. Line breaks in a document are <em>always</em> normalized to <code class="code highlight language-text">\n</code>. The <em>IntelliJ Platform</em> handles encoding and line break conversions when loading and saving documents transparently.</p>
<a name="how-do-i-get-a-document" class="elem-anchor"></a>
<h2>How do I get a document?<a href="#how-do-i-get-a-document" class="anchor-link"><span></span></a></h2>
<ul>
<li>From an action: <code class="code highlight language-text">e.getData(PlatformDataKeys.EDITOR).getDocument()</code></li>
<li>From a virtual file: <code class="code highlight language-text">FileDocumentManager.getDocument()</code>. This call forces the document content to be loaded from disk if it wasnt loaded previously; if youre only interested in open documents or documents which may have been modified, use <code class="code highlight language-text">FileDocumentManager.getCachedDocument()</code> instead.</li>
<li>From a PSI file: <code class="code highlight language-text">PsiDocumentManager.getInstance().getDocument()</code> or <code class="code highlight language-text">PsiDocumentManager.getInstance().getCachedDocument()</code></li>
</ul>
<a name="what-can-i-do-with-a-document" class="elem-anchor"></a>
<h2>What can I do with a Document?<a href="#what-can-i-do-with-a-document" class="anchor-link"><span></span></a></h2>
<p>You may perform any operations that access or modify the file contents on “plain text” level (as a sequence of characters, not as a tree of Java elements).</p>
<a name="where-does-a-document-come-from" class="elem-anchor"></a>
<h2>Where does a Document come from?<a href="#where-does-a-document-come-from" class="anchor-link"><span></span></a></h2>
<p>Document instances are created when some operation needs to access the text contents of a file (in particular, this is needed to build the PSI for a file). Also, document instances not linked to any virtual files can be created temporarily, for example, to represent the contents of a text editor field in a dialog.</p>
<a name="how-long-does-a-document-persist" class="elem-anchor"></a>
<h2>How long does a Document persist?<a href="#how-long-does-a-document-persist" class="anchor-link"><span></span></a></h2>
<p>Document instances are weakly referenced from <code class="code highlight language-text">VirtualFile</code> instances. Thus, an unmodified <code class="code highlight language-text">Document</code> instance can be garbage-collected if it isnt referenced by anyone, and a new instance will be created if the document contents is accessed again later. Storing <code class="code highlight language-text">Document</code> references in long-term data structures of your plugin will cause memory leaks.</p>
<a name="how-do-i-create-a-document" class="elem-anchor"></a>
<h2>How do I create a Document?<a href="#how-do-i-create-a-document" class="anchor-link"><span></span></a></h2>
<p>If you need to create a new file on disk, you dont create a <code class="code highlight language-text">Document</code>: you create a PSI file and then get its <code class="code highlight language-text">Document</code>. If you need to create a <code class="code highlight language-text">Document</code> instance which isnt bound to anything, you can use <code class="code highlight language-text">EditorFactory.createDocument</code>.</p>
<a name="how-do-i-get-notified-when-documents-change" class="elem-anchor"></a>
<h2>How do I get notified when Documents change?<a href="#how-do-i-get-notified-when-documents-change" class="anchor-link"><span></span></a></h2>
<ul>
<li><code class="code highlight language-text">Document.addDocumentListener</code> allows you to receive notifications about changes in a particular <code class="code highlight language-text">Document</code> instance.</li>
<li><code class="code highlight language-text">EditorFactory.getEventMulticaster().addDocumentListener</code> allows you to receive notifications about changes in all open documents.</li>
<li><code class="code highlight language-text">FileDocumentManager.addFileDocumentManagerListener</code> allows you to receive notifications when any <code class="code highlight language-text">Document</code> is saved or reloaded from disk.</li>
</ul>
<a name="what-are-the-rules-of-working-with-documents" class="elem-anchor"></a>
<h2>What are the rules of working with Documents?<a href="#what-are-the-rules-of-working-with-documents" class="anchor-link"><span></span></a></h2>
<p>The general read/write action rules are in effect. In addition to that, any operations which modify the contents of the document must be wrapped in a command (<code class="code highlight language-text">CommandProcessor.getInstance().executeCommand()</code>). <code class="code highlight language-text">executeCommand()</code> calls can be nested, and the outermost <code class="code highlight language-text">executeCommand</code> call is added to the undo stack. If multiple documents are modified within a command, undoing this command will by default show a confirmation dialog to the user.</p>
<p>If the file corresponding to a <code class="code highlight language-text">Document</code> is read-only (for example, not checked out from the version control system), document modifications will fail. Thus, before modifying the <code class="code highlight language-text">Document</code>, it is necessary to call <code class="code highlight language-text">ReadonlyStatusHandler.getInstance(project).ensureFilesWritable()</code> to check out the file if necessary.</p>
<p>All text strings passed to <code class="code highlight language-text">Document</code> modification methods (<code class="code highlight language-text">setText</code>, <code class="code highlight language-text">insertString</code>, <code class="code highlight language-text">replaceString</code>) must use only \n as line separators.</p>
<div class="last-modified">
Last modified: 23 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,41 @@
---
title: Documents
---
A document is an editable sequence of Unicode characters, which typically corresponds to the text contents of a virtual file. Line breaks in a document are _always_ normalized to `\n`. The *IntelliJ Platform* handles encoding and line break conversions when loading and saving documents transparently.
## How do I get a document?
* From an action: `e.getData(PlatformDataKeys.EDITOR).getDocument()`
* From a virtual file: `FileDocumentManager.getDocument()`. This call forces the document content to be loaded from disk if it wasn't loaded previously; if you're only interested in open documents or documents which may have been modified, use `FileDocumentManager.getCachedDocument()` instead.
* From a PSI file: `PsiDocumentManager.getInstance().getDocument()` or `PsiDocumentManager.getInstance().getCachedDocument()`
## What can I do with a Document?
You may perform any operations that access or modify the file contents on "plain text" level (as a sequence of characters, not as a tree of Java elements).
## Where does a Document come from?
Document instances are created when some operation needs to access the text contents of a file (in particular, this is needed to build the PSI for a file). Also, document instances not linked to any virtual files can be created temporarily, for example, to represent the contents of a text editor field in a dialog.
## How long does a Document persist?
Document instances are weakly referenced from `VirtualFile` instances. Thus, an unmodified `Document` instance can be garbage-collected if it isn't referenced by anyone, and a new instance will be created if the document contents is accessed again later. Storing `Document` references in long-term data structures of your plugin will cause memory leaks.
## How do I create a Document?
If you need to create a new file on disk, you don't create a `Document`: you create a PSI file and then get its `Document`. If you need to create a `Document` instance which isn't bound to anything, you can use `EditorFactory.createDocument`.
## How do I get notified when Documents change?
* `Document.addDocumentListener` allows you to receive notifications about changes in a particular `Document` instance.
* `EditorFactory.getEventMulticaster().addDocumentListener` allows you to receive notifications about changes in all open documents.
* `FileDocumentManager.addFileDocumentManagerListener` allows you to receive notifications when any `Document` is saved or reloaded from disk.
## What are the rules of working with Documents?
The general read/write action rules are in effect. In addition to that, any operations which modify the contents of the document must be wrapped in a command (`CommandProcessor.getInstance().executeCommand()`). `executeCommand()` calls can be nested, and the outermost `executeCommand` call is added to the undo stack. If multiple documents are modified within a command, undoing this command will by default show a confirmation dialog to the user.
If the file corresponding to a `Document` is read-only (for example, not checked out from the version control system), document modifications will fail. Thus, before modifying the `Document`, it is necessary to call `ReadonlyStatusHandler.getInstance(project).ensureFilesWritable()` to check out the file if necessary.
All text strings passed to `Document` modification methods (`setText`, `insertString`, `replaceString`) must use only \n as line separators.

View File

@ -1,141 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>File View Providers / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/file_view_providers">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>File View Providers</h1>
<p>A file view provider (see the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/FileViewProvider.java" data-bypass="yes" target="_blank"><span>FileViewProvider</span></a> class) was introduced in <em>IntelliJ IDEA</em> 6.0. Its main purpose is to manage access to multiple PSI trees within a single file.</p>
<p>For example, a JSPX page has a separate PSI tree for the Java code in it (<code class="code highlight language-text">PsiJavaFile</code>), a separate tree for the XML code (<code class="code highlight language-text">XmlFile</code>), and a separate tree for JSP as a whole <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/java/jsp-openapi/src/com/intellij/psi/jsp/JspFile.java" data-bypass="yes" target="_blank"><span>JspFile</span></a>).</p>
<p>Each of the PSI trees covers the entire contents of the file, and contains special “outer language elements” in the places where contents in a different language can be found.</p>
<p>A <code class="code highlight language-text">FileViewProvider</code> instance corresponds to a single <code class="code highlight language-text">VirtualFile</code>, a single <code class="code highlight language-text">Document</code>, and can be used to retrieve multiple <code class="code highlight language-text">PsiFile</code> instances.</p>
<a name="how-do-i-get-an-fvp" class="elem-anchor"></a>
<h2>How do I get an FVP?<a href="#how-do-i-get-an-fvp" class="anchor-link"><span></span></a></h2>
<ul>
<li>From a VirtualFile: <code class="code highlight language-text">PsiManager.getInstance(project).findViewProvider()</code></li>
<li>From a PSI file: <code class="code highlight language-text">psiFile.getViewProvider()</code></li>
</ul>
<a name="what-can-i-do-with-an-fvp" class="elem-anchor"></a>
<h2>What can I do with an FVP?<a href="#what-can-i-do-with-an-fvp" class="anchor-link"><span></span></a></h2>
<ul>
<li>To get the list of all languages for which PSI trees exist in a file: <code class="code highlight language-text">fileViewProvider.getLanguages()</code></li>
<li>To get the PSI tree for a particular language: <code class="code highlight language-text">fileViewProvider.getPsi(language)</code>, where the <code class="code highlight language-text">language</code> parameter can take values of the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/lang/Language.java" data-bypass="yes" target="_blank"><span>Language</span></a> type defined in <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/lang/StdLanguages.java" data-bypass="yes" target="_blank"><span>StdLanguages</span></a> class. For example, to get the PSI tree for XML, use <code class="code highlight language-text">fileViewProvider.getPsi(StdLanguages.XML)</code>.</li>
<li>To find an element of a particular language at the specified offset in the file: <code class="code highlight language-text">fileViewProvider.findElementAt(offset,language)</code></li>
</ul>
<a name="how-do-i-extend-the-fileviewprovider" class="elem-anchor"></a>
<h2>How do I extend the FileViewProvider?<a href="#how-do-i-extend-the-fileviewprovider" class="anchor-link"><span></span></a></h2>
<p>To create a file type that has multiple interspersing trees for different languages, your plugin must contain an extension to the <code class="code highlight language-text">fileType.fileViewProviderFactory</code> <a href="/intellij-sdk-docs/basics/plugin_structure/plugin_extensions_and_extension_points.html"><span>extension point</span></a> available in the <em>IntelliJ Platform</em> core.</p>
<p>This extension point is declared using the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/fileTypes/FileTypeExtensionPoint.java" data-bypass="yes" target="_blank"><span>FileTypeExtensionPoint</span></a>
bean class.</p>
<p>To access this extension point, create a Java class that implements the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/FileViewProviderFactory.java" data-bypass="yes" target="_blank"><span>FileViewProviderFactory</span></a> interface, and in this class, override the <code class="code highlight language-text">createFileViewProvider</code> method.</p>
<p>To declare the extension to the <code class="code highlight language-text">fileType.fileViewProviderFactory</code> extension point, to the <code class="code highlight language-text">&lt;extensions&gt;</code> section of the plugin.xml file, add the following syntax:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="nt">&lt;extensions&gt;</span>
<span class="nt">&lt;fileType.fileViewProviderFactory</span> <span class="na">filetype=</span><span class="s">"%file_type%"</span> <span class="na">implementationClass=</span><span class="s">"%class_name%"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/extensions&gt;</span>
</code></pre>
<p>Where <code class="code highlight language-text">%file_type%</code> refers to the type of the file being created (for example, “JFS”), and the <code class="code highlight language-text">%class_name%</code> refers to the name of your Java class that implements the <code class="code highlight language-text">FileViewProviderFactory</code> interface.</p>
<div class="last-modified">
Last modified: 13 December 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,41 @@
---
title: File View Providers
---
A file view provider (see the [FileViewProvider](upsource:///platform/core-api/src/com/intellij/psi/FileViewProvider.java) class) was introduced in *IntelliJ IDEA* 6.0. Its main purpose is to manage access to multiple PSI trees within a single file.
For example, a JSPX page has a separate PSI tree for the Java code in it (`PsiJavaFile`), a separate tree for the XML code (`XmlFile`), and a separate tree for JSP as a whole [JspFile](upsource:///java/jsp-openapi/src/com/intellij/psi/jsp/JspFile.java)).
Each of the PSI trees covers the entire contents of the file, and contains special "outer language elements" in the places where contents in a different language can be found.
A `FileViewProvider` instance corresponds to a single `VirtualFile`, a single `Document`, and can be used to retrieve multiple `PsiFile` instances.
## How do I get an FVP?
* From a VirtualFile: `PsiManager.getInstance(project).findViewProvider()`
* From a PSI file: `psiFile.getViewProvider()`
## What can I do with an FVP?
* To get the list of all languages for which PSI trees exist in a file: `fileViewProvider.getLanguages()`
* To get the PSI tree for a particular language: `fileViewProvider.getPsi(language)`, where the `language` parameter can take values of the [Language](upsource:///platform/core-api/src/com/intellij/lang/Language.java) type defined in [StdLanguages](upsource:///platform/platform-api/src/com/intellij/lang/StdLanguages.java) class. For example, to get the PSI tree for XML, use `fileViewProvider.getPsi(StdLanguages.XML)`.
* To find an element of a particular language at the specified offset in the file: `fileViewProvider.findElementAt(offset,language)`
## How do I extend the FileViewProvider?
To create a file type that has multiple interspersing trees for different languages, your plugin must contain an extension to the `fileType.fileViewProviderFactory` [extension point](/basics/plugin_structure/plugin_extensions_and_extension_points.md) available in the *IntelliJ Platform* core.
This extension point is declared using the [FileTypeExtensionPoint](upsource:///platform/core-api/src/com/intellij/openapi/fileTypes/FileTypeExtensionPoint.java)
bean class.
To access this extension point, create a Java class that implements the [FileViewProviderFactory](upsource:///platform/core-api/src/com/intellij/psi/FileViewProviderFactory.java) interface, and in this class, override the `createFileViewProvider` method.
To declare the extension to the `fileType.fileViewProviderFactory` extension point, to the `<extensions>` section of the plugin.xml file, add the following syntax:
```xml
<extensions>
<fileType.fileViewProviderFactory filetype="%file_type%" implementationClass="%class_name%" />
</extensions>
```
Where `%file_type%` refers to the type of the file being created (for example, "JFS"), and the `%class_name%` refers to the name of your Java class that implements the `FileViewProviderFactory` interface.

View File

@ -1,105 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>General Threading Rules / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/general_threading_rules">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>General Threading Rules</h1>
<p>In general, data structures in the <em>IntelliJ Platform</em> are covered by a single reader/writer lock.</p>
<p>Reading data is allowed from any thread. Reading data from the UI thread does not require any special effort. However, read operations performed from any other thread need to be wrapped in a read action by using <code class="code highlight language-text">ApplicationManager.getApplication().runReadAction()</code>.</p>
<p>Writing data is only allowed from the UI thread, and write operations always need to be wrapped in a write action with <code class="code highlight language-text">ApplicationManager.getApplication().runWriteAction()</code>.</p>
<p>To pass control from a background thread to the event dispatch thread, instead of the standard <code class="code highlight language-text">SwingUtilities.invokeLater()</code>, plugins should use <code class="code highlight language-text">ApplicationManager.getApplication().invokeLater()</code>. The latter API allows specifying the <em>modality state</em> for the call, i.e. the stack of modal dialogs under which the call is allowed to execute. Passing <code class="code highlight language-text">ModalityState.NON_MODAL</code> means that the operation will be executed after all modal dialogs are closed. Passing <code class="code highlight language-text">ModalityState.stateForComponent()</code> means that the operation may be executed while the specified component (part of a dialog) is still visible.</p>
<div class="last-modified">
Last modified: 23 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,11 @@
---
title: General Threading Rules
---
In general, data structures in the *IntelliJ Platform* are covered by a single reader/writer lock.
Reading data is allowed from any thread. Reading data from the UI thread does not require any special effort. However, read operations performed from any other thread need to be wrapped in a read action by using `ApplicationManager.getApplication().runReadAction()`.
Writing data is only allowed from the UI thread, and write operations always need to be wrapped in a write action with `ApplicationManager.getApplication().runWriteAction()`.
To pass control from a background thread to the event dispatch thread, instead of the standard `SwingUtilities.invokeLater()`, plugins should use `ApplicationManager.getApplication().invokeLater()`. The latter API allows specifying the _modality state_ for the call, i.e. the stack of modal dialogs under which the call is allowed to execute. Passing `ModalityState.NON_MODAL` means that the operation will be executed after all modal dialogs are closed. Passing `ModalityState.stateForComponent()` means that the operation may be executed while the specified component (part of a dialog) is still visible.

View File

@ -1,119 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>PSI Elements / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/psi_elements">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>PSI Elements</h1>
<p>A PSI (Program Structure Interface) file represents a hierarchy of PSI elements (so-called <em>PSI trees</em>). A single PSI file may include several PSI trees in a particular programming language. A PSI element, in its turn, can have child PSI elements.</p>
<p>PSI elements and operations on the level of individual PSI elements are used to explore the internal structure of source code as it is interpreted by the <strong>IntelliJ Platform</strong>. For example, you can use PSI elements to perform code analysis, such as <a href="http://www.jetbrains.com/idea/help/code-inspection.html" data-bypass="yes" target="_blank"><span>code inspections</span></a> or <a href="http://www.jetbrains.com/idea/help/intention-actions.html" data-bypass="yes" target="_blank"><span>intention actions</span></a>.</p>
<p>The <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/PsiElement.java" data-bypass="yes" target="_blank"><span>PsiElement</span></a> class is the common base class for PSI elements.</p>
<a name="how-do-i-get-a-psi-element" class="elem-anchor"></a>
<h2>How do I get a PSI element?<a href="#how-do-i-get-a-psi-element" class="anchor-link"><span></span></a></h2>
<ul>
<li>From an action: <code class="code highlight language-text">e.getData(LangDataKeys.PSI_ELEMENT)</code>. Note: if an editor is currently open and the element under caret is a reference, this will return the result of resolving the reference. This may or may not be what you need.</li>
<li>From a file by offset: <code class="code highlight language-text">PsiFile.findElementAt()</code>. Note: this returns the lowest level element at the specified offset, which is normally a lexer token.
Most likely you should use <code class="code highlight language-text">PsiTreeUtil.getParentOfType()</code> to find the element you really need.</li>
<li>By iterating through a PSI file: using a <code class="code highlight language-text">PsiRecursiveElementWalkingVisitor</code>.</li>
<li>By resolving a reference: <code class="code highlight language-text">PsiReference.resolve()</code></li>
</ul>
<a name="what-can-i-do-with-psi-elements" class="elem-anchor"></a>
<h2>What can I do with PSI elements?<a href="#what-can-i-do-with-psi-elements" class="anchor-link"><span></span></a></h2>
<p>See <a href="/intellij-sdk-docs/basics/psi_cookbook.html"><span>PSI Cook Book</span></a></p>
<div class="last-modified">
Last modified: 30 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,21 @@
---
title: PSI Elements
---
A PSI (Program Structure Interface) file represents a hierarchy of PSI elements (so-called _PSI trees_). A single PSI file may include several PSI trees in a particular programming language. A PSI element, in its turn, can have child PSI elements.
PSI elements and operations on the level of individual PSI elements are used to explore the internal structure of source code as it is interpreted by the **IntelliJ Platform**. For example, you can use PSI elements to perform code analysis, such as [code inspections](http://www.jetbrains.com/idea/help/code-inspection.html) or [intention actions](http://www.jetbrains.com/idea/help/intention-actions.html).
The [PsiElement](upsource:///platform/core-api/src/com/intellij/psi/PsiElement.java) class is the common base class for PSI elements.
## How do I get a PSI element?
* From an action: `e.getData(LangDataKeys.PSI_ELEMENT)`. Note: if an editor is currently open and the element under caret is a reference, this will return the result of resolving the reference. This may or may not be what you need.
* From a file by offset: `PsiFile.findElementAt()`. Note: this returns the lowest level element at the specified offset, which is normally a lexer token.
Most likely you should use `PsiTreeUtil.getParentOfType()` to find the element you really need.
* By iterating through a PSI file: using a `PsiRecursiveElementWalkingVisitor`.
* By resolving a reference: `PsiReference.resolve()`
## What can I do with PSI elements?
See [PSI Cook Book](/basics/psi_cookbook.md)

View File

@ -1,155 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>PSI Files / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/psi_files">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>PSI Files</h1>
<p>A PSI (Program Structure Interface) file is the root of a structure representing the contents of a file as a hierarchy of elements in a particular programming language.</p>
<p>The <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/PsiFile.java" data-bypass="yes" target="_blank"><span>PsiFile</span></a> class is the common base class for all PSI files, while files in a specific language are usually represented by its subclasses. For example, the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/java/java-psi-api/src/com/intellij/psi/PsiJavaFile.java" data-bypass="yes" target="_blank"><span>PsiJavaFile</span></a> class represents a Java file, and the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/xml/xml-psi-api/src/com/intellij/psi/xml/XmlFile.java" data-bypass="yes" target="_blank"><span>XmlFile</span></a> class represents an XML file.</p>
<p>Unlike <code class="code highlight language-text">VirtualFile</code> and <code class="code highlight language-text">Document</code>, which have application scope (even if multiple projects are open, each file is represented by the same <code class="code highlight language-text">VirtualFile</code> instance), PSI has project scope (the same file is represented by multiple <code class="code highlight language-text">PsiFile</code> instances if the file belongs to multiple projects open at the same time).</p>
<a name="how-do-i-get-a-psi-file" class="elem-anchor"></a>
<h2>How do I get a PSI file?<a href="#how-do-i-get-a-psi-file" class="anchor-link"><span></span></a></h2>
<ul>
<li>From an action: <code class="code highlight language-text">e.getData(LangDataKeys.PSI_FILE)</code>.</li>
<li>From a VirtualFile: <code class="code highlight language-text">PsiManager.getInstance(project).findFile()</code></li>
<li>From a Document: <code class="code highlight language-text">PsiDocumentManager.getInstance(project).getPsiFile()</code></li>
<li>From an element inside the file: <code class="code highlight language-text">psiElement.getContainingFile()</code></li>
<li>To find files with a specific name anywhere in the project, use <code class="code highlight language-text">FilenameIndex.getFilesByName(project, name, scope)</code></li>
</ul>
<a name="what-can-i-do-with-a-psi-file" class="elem-anchor"></a>
<h2>What can I do with a PSI file?<a href="#what-can-i-do-with-a-psi-file" class="anchor-link"><span></span></a></h2>
<p>Most interesting modification operations are performed on the level of individual PSI elements, not files as a whole.</p>
<p>To iterate over the elements in a file, use <code class="code highlight language-text">psiFile.accept(new PsiRecursiveElementWalkingVisitor()...);</code></p>
<a name="where-does-it-a-psi-file-come-from" class="elem-anchor"></a>
<h2>Where does it a PSI file come from?<a href="#where-does-it-a-psi-file-come-from" class="anchor-link"><span></span></a></h2>
<p>As PSI is language-dependent, PSI files are created through the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/lang/Language.java" data-bypass="yes" target="_blank"><span>Language</span></a> object, by using the <code class="code highlight language-text">LanguageParserDefinitions.INSTANCE.forLanguage(language).createFile(fileViewProvider)</code> method.</p>
<p>Like documents, PSI files are created on demand when the PSI is accessed for a particular file.</p>
<a name="how-long-do-psi-files-persist" class="elem-anchor"></a>
<h2>How long do PSI files persist?<a href="#how-long-do-psi-files-persist" class="anchor-link"><span></span></a></h2>
<p>Like documents, PSI files are weakly referenced from the corresponding <code class="code highlight language-text">VirtualFile</code> instances and can be garbage-collected if not referenced by anyone.</p>
<a name="how-do-i-create-a-psi-file" class="elem-anchor"></a>
<h2>How do I create a PSI file?<a href="#how-do-i-create-a-psi-file" class="anchor-link"><span></span></a></h2>
<p>The <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/PsiFileFactory.java" data-bypass="yes" target="_blank"><span><code class="code highlight language-text">PsiFileFactory</code></span></a><code class="code highlight language-text">.getInstance(project).createFileFromText()</code> method creates an in-memory PSI file with the specified contents.</p>
<p>To save the PSI file to disk, use the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/psi/PsiDirectory.java" data-bypass="yes" target="_blank"><span><code class="code highlight language-text">PsiDirectory</code></span></a><code class="code highlight language-text">.add()</code> method.</p>
<a name="how-do-i-get-notified-when-psi-files-change" class="elem-anchor"></a>
<h2>How do I get notified when PSI files change?<a href="#how-do-i-get-notified-when-psi-files-change" class="anchor-link"><span></span></a></h2>
<p><code class="code highlight language-text">PsiManager.getInstance(project).addPsiTreeChangeListener()</code> allows you to receive notifications about all changes to the PSI tree of a project.</p>
<a name="how-do-i-extend-psi" class="elem-anchor"></a>
<h2>How do I extend PSI?<a href="#how-do-i-extend-psi" class="anchor-link"><span></span></a></h2>
<p>PSI can be extended to support additional languages through custom language plugins. For more details on developing custom language plugins, see the <a href="/intellij-sdk-docs/reference_guide/custom_language_support.html"><span>Custom Language Support</span></a> reference guide.</p>
<a name="what-are-the-rules-for-working-with-psi" class="elem-anchor"></a>
<h2>What are the rules for working with PSI?<a href="#what-are-the-rules-for-working-with-psi" class="anchor-link"><span></span></a></h2>
<p>Any changes done to the content of PSI files are reflected in documents, so all rules for working with documents (read/write actions, commands, read-only status handling) are in effect.</p>
<div class="last-modified">
Last modified: 26 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,51 @@
---
title: PSI Files
---
A PSI (Program Structure Interface) file is the root of a structure representing the contents of a file as a hierarchy of elements in a particular programming language.
The [PsiFile](upsource:///platform/core-api/src/com/intellij/psi/PsiFile.java) class is the common base class for all PSI files, while files in a specific language are usually represented by its subclasses. For example, the [PsiJavaFile](upsource:///java/java-psi-api/src/com/intellij/psi/PsiJavaFile.java) class represents a Java file, and the [XmlFile](upsource:///xml/xml-psi-api/src/com/intellij/psi/xml/XmlFile.java) class represents an XML file.
Unlike `VirtualFile` and `Document`, which have application scope (even if multiple projects are open, each file is represented by the same `VirtualFile` instance), PSI has project scope (the same file is represented by multiple `PsiFile` instances if the file belongs to multiple projects open at the same time).
## How do I get a PSI file?
* From an action: `e.getData(LangDataKeys.PSI_FILE)`.
* From a VirtualFile: `PsiManager.getInstance(project).findFile()`
* From a Document: `PsiDocumentManager.getInstance(project).getPsiFile()`
* From an element inside the file: `psiElement.getContainingFile()`
* To find files with a specific name anywhere in the project, use `FilenameIndex.getFilesByName(project, name, scope)`
## What can I do with a PSI file?
Most interesting modification operations are performed on the level of individual PSI elements, not files as a whole.
To iterate over the elements in a file, use `psiFile.accept(new PsiRecursiveElementWalkingVisitor()...);`
## Where does it a PSI file come from?
As PSI is language-dependent, PSI files are created through the [Language](upsource:///platform/core-api/src/com/intellij/lang/Language.java) object, by using the `LanguageParserDefinitions.INSTANCE.forLanguage(language).createFile(fileViewProvider)` method.
Like documents, PSI files are created on demand when the PSI is accessed for a particular file.
## How long do PSI files persist?
Like documents, PSI files are weakly referenced from the corresponding `VirtualFile` instances and can be garbage-collected if not referenced by anyone.
## How do I create a PSI file?
The [`PsiFileFactory`](upsource:///platform/core-api/src/com/intellij/psi/PsiFileFactory.java)`.getInstance(project).createFileFromText()` method creates an in-memory PSI file with the specified contents.
To save the PSI file to disk, use the [`PsiDirectory`](upsource:///platform/core-api/src/com/intellij/psi/PsiDirectory.java)`.add()` method.
## How do I get notified when PSI files change?
`PsiManager.getInstance(project).addPsiTreeChangeListener()` allows you to receive notifications about all changes to the PSI tree of a project.
## How do I extend PSI?
PSI can be extended to support additional languages through custom language plugins. For more details on developing custom language plugins, see the [Custom Language Support](/reference_guide/custom_language_support.md) reference guide.
## What are the rules for working with PSI?
Any changes done to the content of PSI files are reflected in documents, so all rules for working with documents (read/write actions, commands, read-only status handling) are in effect.

View File

@ -1,152 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Virtual Files / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/architectural_overview/virtual_file">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Virtual Files</h1>
<p>A virtual file <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java" data-bypass="yes" target="_blank"><span>com.intellij.openapi.vfs.VirtualFile</span></a> is the <em>IntelliJ Platforms</em> representation of a file in a file system (VFS). Most commonly, a virtual file is a file in your local file system. However, the <em>IntelliJ Platform</em> supports multiple pluggable file system implementations, so virtual files can also represent classes in a JAR file, old revisions of files loaded from a version control repository, and so on.</p>
<p>The VFS level deals only with binary content. You can get or set the contents of a <code class="code highlight language-text">VirtualFile</code> as a stream of bytes, but concepts like encodings and line separators are handled on higher system levels.</p>
<a name="how-do-i-get-a-virtual-file" class="elem-anchor"></a>
<h2>How do I get a virtual file?<a href="#how-do-i-get-a-virtual-file" class="anchor-link"><span></span></a></h2>
<ul>
<li>From an action: <code class="code highlight language-text">e.getData(PlatformDataKeys.VIRTUAL_FILE)</code>. If you are interested in multiple selection, you can also use <code class="code highlight language-text">e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)</code>.</li>
<li>From a path in the local file system: <code class="code highlight language-text">LocalFileSystem.getInstance().findFileByIoFile()</code></li>
<li>From a PSI file: <code class="code highlight language-text">psiFile.getVirtualFile()</code> (may return null if the PSI file exists only in memory)</li>
<li>From a document: <code class="code highlight language-text">FileDocumentManager.getInstance().getFile()</code></li>
</ul>
<a name="what-can-i-do-with-it" class="elem-anchor"></a>
<h2>What can I do with it?<a href="#what-can-i-do-with-it" class="anchor-link"><span></span></a></h2>
<p>Typical file operations are available, such as traverse the file system, get file contents, rename, move, or delete. Recursive iteration should be performed using <code class="code highlight language-text">VfsUtilCore.iterateChildrenRecursively</code> to prevent endless loops caused by recursive symlinks.</p>
<a name="where-does-it-come-from" class="elem-anchor"></a>
<h2>Where does it come from?<a href="#where-does-it-come-from" class="anchor-link"><span></span></a></h2>
<p>The VFS is built incrementally, by scanning the file system up and down starting from the project root. New files appearing in the file system are detected by VFS <em>refreshes</em>. A refresh operation can be initiated programmatically using (<code class="code highlight language-text">VirtualFileManager.getInstance().refresh()</code> or <code class="code highlight language-text">VirtualFile.refresh()</code>). VFS refreshes are also triggered whenever file system watchers receive file system change notifications (available on the Windows and Mac operating systems).</p>
<p>As a plugin developer, you may want to invoke a VFS refresh if you need to access a file that has just been created by an external tool through the IntelliJ Platform APIs.</p>
<a name="how-long-does-a-virtual-file-persist" class="elem-anchor"></a>
<h2>How long does a virtual file persist?<a href="#how-long-does-a-virtual-file-persist" class="anchor-link"><span></span></a></h2>
<p>A particular file on disk is represented by equal <code class="code highlight language-text">VirtualFile</code> instances for the entire lifetime of the IDEA process. There may be several instances corresponding to the same file, and they can be garbage-collected. The file is a <code class="code highlight language-text">UserDataHolder</code>, and the user data is shared between those equal instances. If a file is deleted, its corresponding VirtualFile instance becomes invalid (the <code class="code highlight language-text">isValid()</code> method returns <code class="code highlight language-text">false</code> and operations cause exceptions).</p>
<a name="how-do-i-create-a-virtual-file" class="elem-anchor"></a>
<h2>How do I create a virtual file?<a href="#how-do-i-create-a-virtual-file" class="anchor-link"><span></span></a></h2>
<p>Usually you dont. As a rule, files are created either through the PSI API or through the regular java.io.File API.</p>
<p>If you do need to create a file through VFS, you can use the <code class="code highlight language-text">VirtualFile.createChildData()</code> method to create a <code class="code highlight language-text">VirtualFile</code> instance and the <code class="code highlight language-text">VirtualFile.setBinaryContent()</code> method to write some data to the file.</p>
<a name="how-do-i-get-notified-when-vfs-changes" class="elem-anchor"></a>
<h2>How do I get notified when VFS changes?<a href="#how-do-i-get-notified-when-vfs-changes" class="anchor-link"><span></span></a></h2>
<p>The <code class="code highlight language-text">VirtualFileManager.addVirtualFileListener()</code> method allows you to receive notifications about all changes in the VFS.</p>
<a name="how-do-i-extend-vfs" class="elem-anchor"></a>
<h2>How do I extend VFS?<a href="#how-do-i-extend-vfs" class="anchor-link"><span></span></a></h2>
<p>To provide an alternative file system implementation (for example, an FTP file system), implement the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java" data-bypass="yes" target="_blank"><span>VirtualFileSystem</span></a> class (most likely youll also need to implement <code class="code highlight language-text">VirtualFile</code>), and register your implementation as an <a href="/intellij-sdk-docs/basics/plugin_structure/plugin_components.html"><span>application component</span></a>.</p>
<p>To hook into operations performed in the local file system (for example, if you are developing a version control system integration that needs custom rename/move handling), implement the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/platform-api/src/com/intellij/openapi/vfs/LocalFileOperationsHandler.java" data-bypass="yes" target="_blank"><span>LocalFileOperationsHandler</span></a> interface and register it through the<code class="code highlight language-text">LocalFileSystem.registerAuxiliaryFileOperationsHandler</code> method.</p>
<a name="what-are-the-rules-for-working-with-vfs" class="elem-anchor"></a>
<h2>What are the rules for working with VFS?<a href="#what-are-the-rules-for-working-with-vfs" class="anchor-link"><span></span></a></h2>
<p>See <a href="/intellij-sdk-docs/basics/virtual_file_system.html"><span>IntelliJ Platform Virtual File System</span></a> for a detailed description of the VFS architecture and usage guidelines.</p>
<div class="last-modified">
Last modified: 30 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,48 @@
---
title: Virtual Files
---
A virtual file [com.intellij.openapi.vfs.VirtualFile](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFile.java) is the *IntelliJ Platform's* representation of a file in a file system (VFS). Most commonly, a virtual file is a file in your local file system. However, the *IntelliJ Platform* supports multiple pluggable file system implementations, so virtual files can also represent classes in a JAR file, old revisions of files loaded from a version control repository, and so on.
The VFS level deals only with binary content. You can get or set the contents of a `VirtualFile` as a stream of bytes, but concepts like encodings and line separators are handled on higher system levels.
## How do I get a virtual file?
* From an action: `e.getData(PlatformDataKeys.VIRTUAL_FILE)`. If you are interested in multiple selection, you can also use `e.getData(PlatformDataKeys.VIRTUAL_FILE_ARRAY)`.
* From a path in the local file system: `LocalFileSystem.getInstance().findFileByIoFile()`
* From a PSI file: `psiFile.getVirtualFile()` (may return null if the PSI file exists only in memory)
* From a document: `FileDocumentManager.getInstance().getFile()`
## What can I do with it?
Typical file operations are available, such as traverse the file system, get file contents, rename, move, or delete. Recursive iteration should be performed using `VfsUtilCore.iterateChildrenRecursively` to prevent endless loops caused by recursive symlinks.
## Where does it come from?
The VFS is built incrementally, by scanning the file system up and down starting from the project root. New files appearing in the file system are detected by VFS _refreshes_. A refresh operation can be initiated programmatically using (`VirtualFileManager.getInstance().refresh()` or `VirtualFile.refresh()`). VFS refreshes are also triggered whenever file system watchers receive file system change notifications (available on the Windows and Mac operating systems).
As a plugin developer, you may want to invoke a VFS refresh if you need to access a file that has just been created by an external tool through the IntelliJ Platform APIs.
## How long does a virtual file persist?
A particular file on disk is represented by equal `VirtualFile` instances for the entire lifetime of the IDEA process. There may be several instances corresponding to the same file, and they can be garbage-collected. The file is a `UserDataHolder`, and the user data is shared between those equal instances. If a file is deleted, its corresponding VirtualFile instance becomes invalid (the `isValid()` method returns `false` and operations cause exceptions).
## How do I create a virtual file?
Usually you don't. As a rule, files are created either through the PSI API or through the regular java.io.File API.
If you do need to create a file through VFS, you can use the `VirtualFile.createChildData()` method to create a `VirtualFile` instance and the `VirtualFile.setBinaryContent()` method to write some data to the file.
## How do I get notified when VFS changes?
The `VirtualFileManager.addVirtualFileListener()` method allows you to receive notifications about all changes in the VFS.
## How do I extend VFS?
To provide an alternative file system implementation (for example, an FTP file system), implement the [VirtualFileSystem](upsource:///platform/core-api/src/com/intellij/openapi/vfs/VirtualFileSystem.java) class (most likely you'll also need to implement `VirtualFile`), and register your implementation as an [application component](/basics/plugin_structure/plugin_components.md).
To hook into operations performed in the local file system (for example, if you are developing a version control system integration that needs custom rename/move handling), implement the [LocalFileOperationsHandler](upsource:///platform/platform-api/src/com/intellij/openapi/vfs/LocalFileOperationsHandler.java) interface and register it through the`LocalFileSystem.registerAuxiliaryFileOperationsHandler` method.
## What are the rules for working with VFS?
See [IntelliJ Platform Virtual File System](/basics/virtual_file_system.md) for a detailed description of the VFS architecture and usage guidelines.

View File

@ -1,251 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Check Out And Build Community Edition / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/checkout_and_build_community">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Check Out And Build Community Edition</h1>
<a name="installing-git" class="elem-anchor"></a>
<h2>Installing Git<a href="#installing-git" class="anchor-link"><span></span></a></h2>
<p>The source code of IntelliJ IDEA Community Edition is stored in a Git repository. Therefore, in order to check out the sources, you need to have Git installed. We recommend using the <a href="https://msysgit.github.io" data-bypass="yes" target="_blank"><span>msys git</span></a> distribution on Windows and <a href="http://code.google.com/p/git-osx-installer/" data-bypass="yes" target="_blank"><span>git-osx-installer</span></a> on Mac.</p>
<a name="checking-out-the-code" class="elem-anchor"></a>
<h2>Checking Out the Code<a href="#checking-out-the-code" class="anchor-link"><span></span></a></h2>
<p>You can check out the code either by using IntelliJ IDEA or from the command line.</p>
<p><strong>Checking out from IntelliJ IDEA:</strong></p>
<ul>
<li>Select <strong>VCS | Checkout from Version Control | Git</strong> from the main menu</li>
<li>In the <strong>Git Repository URL</strong> field, enter <code class="code highlight language-text">git://git.jetbrains.org/idea/community.git</code></li>
</ul>
<p><img src="img/check_out_community.png" alt="Check Out Community" /></p>
<p><strong>Checking out from the command line:</strong></p>
<p>Please execute the following command:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">git clone --depth 1 git://git.jetbrains.org/idea/community.git idea
</code></pre>
<p>The <a href="https://github.com/JetBrains/intellij-community/tree/master" data-bypass="yes" target="_blank"><span>master</span></a> branch currently contains the code for the most recent development version of IntelliJ IDEA. Source code of older releases of IntelliJ IDEA can be found in the following branches:</p>
<table>
<thead>
<tr>
<th>IntelliJ Product version</th>
<th>Branch name/number</th>
</tr>
</thead>
<tbody>
<tr>
<td>15.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/143" data-bypass="yes" target="_blank"><span>143</span></a></td>
</tr>
<tr>
<td>14.1.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/141" data-bypass="yes" target="_blank"><span>141</span></a></td>
</tr>
<tr>
<td>14.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/139" data-bypass="yes" target="_blank"><span>139</span></a></td>
</tr>
<tr>
<td>13.1.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/135" data-bypass="yes" target="_blank"><span>135</span></a></td>
</tr>
<tr>
<td>13.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/133" data-bypass="yes" target="_blank"><span>133</span></a></td>
</tr>
<tr>
<td>12.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/123" data-bypass="yes" target="_blank"><span>123</span></a></td>
</tr>
<tr>
<td>11.1.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/117" data-bypass="yes" target="_blank"><span>117</span></a></td>
</tr>
<tr>
<td>11.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/nika" data-bypass="yes" target="_blank"><span>nika</span></a></td>
</tr>
<tr>
<td>10.5.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/xena" data-bypass="yes" target="_blank"><span>xena</span></a></td>
</tr>
<tr>
<td>10.0.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/x0x" data-bypass="yes" target="_blank"><span>x0x</span></a></td>
</tr>
<tr>
<td>9.x</td>
<td><a href="https://github.com/JetBrains/intellij-community/tree/maia" data-bypass="yes" target="_blank"><span>maia</span></a></td>
</tr>
</tbody>
</table>
<p>The source code of stable releases of IntelliJ IDEA Community Edition is also available as a tarball:</p>
<ul>
<li><a href="http://download.jetbrains.com/idea/ideaIC-15.0.1-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 15.0.1</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-14.1.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 14.1.4</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-13.1.6-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 13.1.6</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-13.0.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 13.0.4</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-12.1.6-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 12.1.6</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-12.0.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 12.0.4</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-11.1.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 11.1.4</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-11.0.2-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 11.0.2</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-10.5.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 10.5.4</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-10.0.3-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 10.0.3</span></a></li>
<li><a href="http://download.jetbrains.com/idea/ideaIC-9.0.4-src.tar.bz2" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition 9.0.4</span></a></li>
</ul>
<a name="forking-on-github" class="elem-anchor"></a>
<h2>Forking on GitHub<a href="#forking-on-github" class="anchor-link"><span></span></a></h2>
<p>As an alternative to checking out the official repository, you can fork the GitHub mirror of the IntelliJ Platform source code, make changes in your own fork, and send us a pull request.</p>
<p>The GitHub mirror can be found at <a href="https://github.com/JetBrains/intellij-community" data-bypass="yes" target="_blank"><span>https://github.com/JetBrains/intellij-community</span></a>.</p>
<a name="building-and-running-from-the-ide" class="elem-anchor"></a>
<h2>Building and Running from the IDE<a href="#building-and-running-from-the-ide" class="anchor-link"><span></span></a></h2>
<p>To develop plugins and applications on the IntelliJ Platform, you can use either <a href="https://www.jetbrains.com/idea/download/" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition</span></a> or <a href="https://www.jetbrains.com/idea/download/" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Ultimate</span></a>.</p>
<p><strong>Building and running the code</strong></p>
<ul>
<li>
<p>Make sure you have the <a href="https://plugins.jetbrains.com/plugin/1524" data-bypass="yes" target="_blank"><span>Groovy plugin</span></a> enabled by going to <strong>Settings | Plugins</strong> and enabling <strong>Groovy</strong> plugin checkbox.</p>
<p><img src="img/groovy_plugin_enabled.png" alt="Groovy plugin" /></p>
<p>Parts of IntelliJ IDEA are written in Groovy, and you will get compilation errors if you dont have the plugin enabled.</p>
</li>
<li>
<p>Make sure you have the UI Designer plugin enabled. Most of the IntelliJ IDEA platform UI is built using the UI Designer, and the version you build will not run correctly if you dont have the plugin enabled.</p>
<p><img src="img/ui_designer_plugin_enabled.png" alt="UI Designer plugin" /></p>
</li>
<li>Open the directory with the source code as a directory-based project.</li>
<li>
<p>Configure a Java SDK named <em>IDEA jdk</em> (case sensitive), pointing to an installation of JDK 1.8</p>
<p><img src="img/configure_sdk.png" alt="Configure SDK" /></p>
</li>
<li>
<p>Add <code class="code highlight language-text">lib\\tools.jar</code> from the JDK installation directory to the classpath of IDEA JDK</p>
<p><img src="img/tools_jar.png" alt="tools.jar" /></p>
</li>
<li>Use <strong>Build | Make Project</strong> to build the code.</li>
<li>
<p>To run the code, use the <em>IDEA</em> shared run configuration provided by the project.</p>
<p><img src="img/idea_run_configuration.png" alt="IDEA Run Configuration" /></p>
</li>
</ul>
<a name="building-and-running-from-the-command-line" class="elem-anchor"></a>
<h2>Building and Running from the Command Line<a href="#building-and-running-from-the-command-line" class="anchor-link"><span></span></a></h2>
<p>To build the distribution archive of <em>IntelliJ IDEA Community Edition</em>, execute the <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/build.xml" data-bypass="yes" target="_blank"><span>build.xml</span></a> Ant build script in the root directory of the source code.</p>
<p><img src="img/ant_build_xml.png" alt="Execute Ant Build Script" /></p>
<p>The results of the build execution can be found at <em>out/artifacts</em>.</p>
<div class="last-modified">
Last modified: 6 January 2016
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,102 @@
---
title: Check Out And Build Community Edition
---
## Installing Git
The source code of IntelliJ IDEA Community Edition is stored in a Git repository. Therefore, in order to check out the sources, you need to have Git installed. We recommend using the [msys git](https://msysgit.github.io) distribution on Windows and [git-osx-installer](http://code.google.com/p/git-osx-installer/) on Mac.
## Checking Out the Code
You can check out the code either by using IntelliJ IDEA or from the command line.
**Checking out from IntelliJ IDEA:**
* Select **VCS \| Checkout from Version Control \| Git** from the main menu
* In the **Git Repository URL** field, enter `git://git.jetbrains.org/idea/community.git`
![Check Out Community](img/check_out_community.png)
**Checking out from the command line:**
Please execute the following command:
```
git clone --depth 1 git://git.jetbrains.org/idea/community.git idea
```
The [master](https://github.com/JetBrains/intellij-community/tree/master) branch currently contains the code for the most recent development version of IntelliJ IDEA. Source code of older releases of IntelliJ IDEA can be found in the following branches:
| IntelliJ Product version | Branch name/number |
|--------------------------|-------------------------------------------------------------------|
| 15.0.x | [143](https://github.com/JetBrains/intellij-community/tree/143) |
| 14.1.x | [141](https://github.com/JetBrains/intellij-community/tree/141) |
| 14.0.x | [139](https://github.com/JetBrains/intellij-community/tree/139) |
| 13.1.x | [135](https://github.com/JetBrains/intellij-community/tree/135) |
| 13.0.x | [133](https://github.com/JetBrains/intellij-community/tree/133) |
| 12.0.x | [123](https://github.com/JetBrains/intellij-community/tree/123) |
| 11.1.x | [117](https://github.com/JetBrains/intellij-community/tree/117) |
| 11.0.x | [nika](https://github.com/JetBrains/intellij-community/tree/nika) |
| 10.5.x | [xena](https://github.com/JetBrains/intellij-community/tree/xena) |
| 10.0.x | [x0x](https://github.com/JetBrains/intellij-community/tree/x0x) |
| 9.x | [maia](https://github.com/JetBrains/intellij-community/tree/maia) |
The source code of stable releases of IntelliJ IDEA Community Edition is also available as a tarball:
- [IntelliJ IDEA Community Edition 15.0.1](http://download.jetbrains.com/idea/ideaIC-15.0.1-src.tar.bz2)
- [IntelliJ IDEA Community Edition 14.1.4](http://download.jetbrains.com/idea/ideaIC-14.1.4-src.tar.bz2)
- [IntelliJ IDEA Community Edition 13.1.6](http://download.jetbrains.com/idea/ideaIC-13.1.6-src.tar.bz2)
- [IntelliJ IDEA Community Edition 13.0.4](http://download.jetbrains.com/idea/ideaIC-13.0.4-src.tar.bz2)
- [IntelliJ IDEA Community Edition 12.1.6](http://download.jetbrains.com/idea/ideaIC-12.1.6-src.tar.bz2)
- [IntelliJ IDEA Community Edition 12.0.4](http://download.jetbrains.com/idea/ideaIC-12.0.4-src.tar.bz2)
- [IntelliJ IDEA Community Edition 11.1.4](http://download.jetbrains.com/idea/ideaIC-11.1.4-src.tar.bz2)
- [IntelliJ IDEA Community Edition 11.0.2](http://download.jetbrains.com/idea/ideaIC-11.0.2-src.tar.bz2)
- [IntelliJ IDEA Community Edition 10.5.4](http://download.jetbrains.com/idea/ideaIC-10.5.4-src.tar.bz2)
- [IntelliJ IDEA Community Edition 10.0.3](http://download.jetbrains.com/idea/ideaIC-10.0.3-src.tar.bz2)
- [IntelliJ IDEA Community Edition 9.0.4](http://download.jetbrains.com/idea/ideaIC-9.0.4-src.tar.bz2)
## Forking on GitHub
As an alternative to checking out the official repository, you can fork the GitHub mirror of the IntelliJ Platform source code, make changes in your own fork, and send us a pull request.
The GitHub mirror can be found at [https://github.com/JetBrains/intellij-community](https://github.com/JetBrains/intellij-community).
## Building and Running from the IDE
To develop plugins and applications on the IntelliJ Platform, you can use either [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) or [IntelliJ IDEA Ultimate](https://www.jetbrains.com/idea/download/).
**Building and running the code**
* Make sure you have the [Groovy plugin](https://plugins.jetbrains.com/plugin/1524) enabled by going to **Settings \| Plugins** and enabling **Groovy** plugin checkbox.
![Groovy plugin](img/groovy_plugin_enabled.png)
Parts of IntelliJ IDEA are written in Groovy, and you will get compilation errors if you don't have the plugin enabled.
* Make sure you have the UI Designer plugin enabled. Most of the IntelliJ IDEA platform UI is built using the UI Designer, and the version you build will not run correctly if you don't have the plugin enabled.
![UI Designer plugin](img/ui_designer_plugin_enabled.png)
* Open the directory with the source code as a directory-based project.
* Configure a Java SDK named *IDEA jdk* (case sensitive), pointing to an installation of JDK 1.8
![Configure SDK](img/configure_sdk.png)
* Add `lib\\tools.jar` from the JDK installation directory to the classpath of IDEA JDK
![tools.jar](img/tools_jar.png)
* Use **Build \| Make Project** to build the code.
* To run the code, use the *IDEA* shared run configuration provided by the project.
![IDEA Run Configuration](img/idea_run_configuration.png)
## Building and Running from the Command Line
To build the distribution archive of *IntelliJ IDEA Community Edition*, execute the [build.xml](upsource:///build.xml) Ant build script in the root directory of the source code.
![Execute Ant Build Script](img/ant_build_xml.png)
The results of the build execution can be found at *out/artifacts*.

View File

@ -1,112 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Creating Your First Plugin / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/getting_started">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Creating Your First Plugin</h1>
<p>This documentation section will help you get started with developing plugins for the <em>IntelliJ Platform</em>. You can use either <a href="https://www.jetbrains.com/idea/download/" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Community Edition</span></a> or <a href="https://www.jetbrains.com/idea/download/" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Ultimate</span></a> as your IDE. Both include the complete set of plugin development tools. To become more familiar with <em>IntelliJ IDEA</em>, please refer to the <a href="https://www.jetbrains.com/idea/help/" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Web Help</span></a>.</p>
<p>In this section:</p>
<ul>
<li><a href="getting_started/setting_up_environment.html"><span>Setting Up a Development Environment</span></a></li>
<li><a href="getting_started/creating_plugin_project.html"><span>Creating a Plugin Project</span></a></li>
<li><a href="getting_started/build_number_ranges.html"><span>Build Number Ranges</span></a></li>
<li><a href="getting_started/creating_an_action.html"><span>Creating an Action</span></a></li>
<li><a href="getting_started/running_and_debugging_a_plugin.html"><span>Running and Debugging a Plugin</span></a></li>
<li><a href="getting_started/deploying_plugin.html"><span>Deploying a Plugin</span></a></li>
<li><a href="getting_started/plugin_compatibility.html"><span>Plugin Compatibility with IntelliJ Platform Products</span></a></li>
<li><a href="getting_started/publishing_plugin.html"><span>Publishing a plugin to plugin repository</span></a></li>
</ul>
<div class="last-modified">
Last modified: 23 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

16
basics/getting_started.md Normal file
View File

@ -0,0 +1,16 @@
---
title: Creating Your First Plugin
---
This documentation section will help you get started with developing plugins for the *IntelliJ Platform*. You can use either [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) or [IntelliJ IDEA Ultimate](https://www.jetbrains.com/idea/download/) as your IDE. Both include the complete set of plugin development tools. To become more familiar with *IntelliJ IDEA*, please refer to the [IntelliJ IDEA Web Help](https://www.jetbrains.com/idea/help/).
In this section:
* [Setting Up a Development Environment](getting_started/setting_up_environment.md)
* [Creating a Plugin Project](getting_started/creating_plugin_project.md)
* [Build Number Ranges](getting_started/build_number_ranges.md)
* [Creating an Action](getting_started/creating_an_action.md)
* [Running and Debugging a Plugin](getting_started/running_and_debugging_a_plugin.md)
* [Deploying a Plugin](getting_started/deploying_plugin.md)
* [Plugin Compatibility with IntelliJ Platform Products](getting_started/plugin_compatibility.md)
* [Publishing a plugin to plugin repository](getting_started/publishing_plugin.md)

View File

@ -1,248 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Build Number Ranges / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/getting_started/build_number_ranges">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Build Number Ranges</h1>
<p>Use this reference of build number ranges to specify the correct <code class="code highlight language-text">since-build</code> and <code class="code highlight language-text">until-build</code> values in your plugin descriptor.</p>
<p>Starting with IntelliJ IDEA 9 beta, a multi-part build number is used, such as:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_text">IU-90.94
</code></pre>
<p>The number consists of the following parts:</p>
<ul>
<li>Product ID (IC for IDEA Community, IU for IDEA Ultimate, RM for RubyMine, PY for PyCharm, etc.)</li>
<li>Branch number (“90”)</li>
<li>Build number in the branch (“94”)</li>
</ul>
<p>Every time a release branch is created for one of the products based on IntelliJ Platform, the branch number in the release branch is incremented by 1, and the branch number in the trunk is incremented by 2. Accordingly, the trunk always has even branch numbers (90, 92, 94, etc.), while release branches have odd branch numbers (91, 93, etc.). For example, the RubyMine 7 release branch has the branch number 139.</p>
<p>Multi-part build numbers can also be used in the <code class="code highlight language-text">since-build</code> and <code class="code highlight language-text">until-build</code> attributes of <code class="code highlight language-text">idea-version</code>. Usually you should omit the product ID and use only the branch number and build number, for example:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="nt">&lt;idea-version</span> <span class="na">since-build=</span><span class="s">"94.539"</span><span class="nt">/&gt;</span>
</code></pre>
<p>The following branch numbers are used for IntelliJ Platform-based products and build numbers of recent IDE versions:</p>
<ul>
<li>branch 143 - IntelliJ IDEA 15, WebStorm 11, PyCharm 5, PhpStorm 10, RubyMine 8, AppCode 3.3, CLion 1.2, DataGrip 1.0</li>
<li>branch 141 - IntelliJ IDEA 14.1, WebStorm 10, PyCharm 4.1, Android Studio 1.3</li>
<li>branch 139 - IntelliJ IDEA 14, WebStorm 9, PyCharm 4, PhpStorm 8, RubyMine 7</li>
<li>branch 135 - IntelliJ IDEA 13.1, WebStorm 8</li>
<li>branch 133 - IntelliJ IDEA 13, PyCharm 3.1, WebStorm 7, PhpStorm 7</li>
<li>branch 131 - WebStorm 7, PyCharm 3.0, PhpStorm 7</li>
<li>branch 129 - IntelliJ IDEA 12.1, bug-fix updates for PyCharm 2.7, PhpStorm/WebStorm 6</li>
<li>branch 127 - PhpStorm/WebStorm 6.0, AppCode 2.0</li>
<li>branch 125 - PyCharm 2.7, RubyMine 5.0</li>
<li>branch 123 - IntelliJ IDEA 12
<ul>
<li>12.0 - 123.72</li>
</ul>
</li>
<li>branch 121 - AppCode 1.6, PyCharm 2.6, PhpStorm/WebStorm 5.0</li>
<li>branch 119 - RubyMine 4.5</li>
<li>branch 117 - IntelliJ IDEA 11.1, PyCharm 2.5, RubyMine 4.0.x, AppCode 1.5, PhpStorm/WebStorm 4.0
<ul>
<li>11.1 - 117.105</li>
<li>11.1.1 - 117.117</li>
<li>11.1.2 - 117.418</li>
<li>11.1.3 - 117.798</li>
</ul>
</li>
<li>branch 111 - IntelliJ IDEA 11.0
<ul>
<li>11.0 - 111.69</li>
<li>11.0.1 - 111.167</li>
<li>11.0.2 - 111.277</li>
</ul>
</li>
<li>branch 107 - IDEA 10.5
<ul>
<li>10.5 - 107.105</li>
<li>10.5.1 - 107.322</li>
<li>10.5.2 - 107.587</li>
</ul>
</li>
<li>branch 103 - IDEA 10.0.2+
<ul>
<li>10.0.2 - 103.72</li>
<li>10.0.3 - 103.255</li>
</ul>
</li>
<li>10.0 - 99.18
<ul>
<li>10.0.1 - 99.32</li>
</ul>
</li>
<li>branch 95 - IDEA 9.0.2+
<ul>
<li>9.0.2 - 95.66</li>
<li>9.0.3 - 95.429</li>
<li>9.0.4 - 95.627</li>
<li>branch 99 - IDEA 10.0</li>
</ul>
</li>
<li>branch 93 - IDEA 9.0
<ul>
<li>9.0 - 93.13</li>
<li>9.0.1 - 93.94</li>
</ul>
</li>
</ul>
<hr />
<p>Previous versions of IntelliJ IDEA use linear build numbers, with the following ranges:</p>
<ul>
<li>IntelliJ IDEA 8.1.x - 9500-9999
<ul>
<li>IntelliJ IDEA 8.1 - 9732</li>
</ul>
</li>
<li>IntelliJ IDEA 8.0.x - 9100-9499
<ul>
<li>IntelliJ IDEA 8.0.1 - 9164</li>
</ul>
</li>
<li>IntelliJ IDEA 8.0 - 8000-9099
<ul>
<li>IntelliJ IDEA 8.0M1 - 8664</li>
<li>IntelliJ IDEA 8.0 - 9013</li>
</ul>
</li>
<li>IntelliJ IDEA 7.0.2+ - 7500-7999
<ul>
<li>7.0.2 - 7590</li>
<li>7.0.3 - 7757</li>
<li>7.0.5 - 7971</li>
</ul>
</li>
<li>IntelliJ IDEA 7.0 final - 7200-7499
<ul>
<li>7.0 final - 7361</li>
</ul>
</li>
<li>IntelliJ IDEA 7.0 pre-M2 - 6900-7199
<ul>
<li>7.0 M2 - 7126</li>
</ul>
</li>
<li>IntelliJ IDEA 7.0 pre-M1 - 6500-6899
<ul>
<li>7.0 M1 - 6813</li>
</ul>
</li>
<li>IntelliJ IDEA 6.0.2 branch - 6000-6499
<ul>
<li>6.0.5 - 6180</li>
<li>6.0.6 - 6197</li>
</ul>
</li>
<li>IntelliJ IDEA 6.0 branch - 5000-5999
<ul>
<li>6.0.1 - 5784</li>
</ul>
</li>
<li>IntelliJ IDEA 5.1 branch - 4000-4999
<ul>
<li>5.1.2 - 4267</li>
</ul>
</li>
</ul>
<div class="last-modified">
Last modified: 17 December 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,96 @@
---
title: Build Number Ranges
---
Use this reference of build number ranges to specify the correct `since-build` and `until-build` values in your plugin descriptor.
Starting with IntelliJ IDEA 9 beta, a multi-part build number is used, such as:
```
IU-90.94
```
The number consists of the following parts:
* Product ID (IC for IDEA Community, IU for IDEA Ultimate, RM for RubyMine, PY for PyCharm, etc.)
* Branch number ("90")
* Build number in the branch ("94")
Every time a release branch is created for one of the products based on IntelliJ Platform, the branch number in the release branch is incremented by 1, and the branch number in the trunk is incremented by 2. Accordingly, the trunk always has even branch numbers (90, 92, 94, etc.), while release branches have odd branch numbers (91, 93, etc.). For example, the RubyMine 7 release branch has the branch number 139.
Multi-part build numbers can also be used in the `since-build` and `until-build` attributes of `idea-version`. Usually you should omit the product ID and use only the branch number and build number, for example:
```xml
<idea-version since-build="94.539"/>
```
The following branch numbers are used for IntelliJ Platform-based products and build numbers of recent IDE versions:
* branch 143 - IntelliJ IDEA 15, WebStorm 11, PyCharm 5, PhpStorm 10, RubyMine 8, AppCode 3.3, CLion 1.2, DataGrip 1.0
* branch 141 - IntelliJ IDEA 14.1, WebStorm 10, PyCharm 4.1, Android Studio 1.3
* branch 139 - IntelliJ IDEA 14, WebStorm 9, PyCharm 4, PhpStorm 8, RubyMine 7
* branch 135 - IntelliJ IDEA 13.1, WebStorm 8
* branch 133 - IntelliJ IDEA 13, PyCharm 3.1, WebStorm 7, PhpStorm 7
* branch 131 - WebStorm 7, PyCharm 3.0, PhpStorm 7
* branch 129 - IntelliJ IDEA 12.1, bug-fix updates for PyCharm 2.7, PhpStorm/WebStorm 6
* branch 127 - PhpStorm/WebStorm 6.0, AppCode 2.0
* branch 125 - PyCharm 2.7, RubyMine 5.0
* branch 123 - IntelliJ IDEA 12
* 12.0 - 123.72
* branch 121 - AppCode 1.6, PyCharm 2.6, PhpStorm/WebStorm 5.0
* branch 119 - RubyMine 4.5
* branch 117 - IntelliJ IDEA 11.1, PyCharm 2.5, RubyMine 4.0.x, AppCode 1.5, PhpStorm/WebStorm 4.0
* 11.1 - 117.105
* 11.1.1 - 117.117
* 11.1.2 - 117.418
* 11.1.3 - 117.798
* branch 111 - IntelliJ IDEA 11.0
* 11.0 - 111.69
* 11.0.1 - 111.167
* 11.0.2 - 111.277
* branch 107 - IDEA 10.5
* 10.5 - 107.105
* 10.5.1 - 107.322
* 10.5.2 - 107.587
* branch 103 - IDEA 10.0.2\+
* 10.0.2 - 103.72
* 10.0.3 - 103.255
* 10.0 - 99.18
* 10.0.1 - 99.32
* branch 95 - IDEA 9.0.2\+
* 9.0.2 - 95.66
* 9.0.3 - 95.429
* 9.0.4 - 95.627
* branch 99 - IDEA 10.0
* branch 93 - IDEA 9.0
* 9.0 - 93.13
* 9.0.1 - 93.94
---
Previous versions of IntelliJ IDEA use linear build numbers, with the following ranges:
* IntelliJ IDEA 8.1.x - 9500-9999
* IntelliJ IDEA 8.1 - 9732
* IntelliJ IDEA 8.0.x - 9100-9499
* IntelliJ IDEA 8.0.1 - 9164
* IntelliJ IDEA 8.0 - 8000-9099
* IntelliJ IDEA 8.0M1 - 8664
* IntelliJ IDEA 8.0 - 9013
* IntelliJ IDEA 7.0.2\+ - 7500-7999
* 7.0.2 - 7590
* 7.0.3 - 7757
* 7.0.5 - 7971
* IntelliJ IDEA 7.0 final - 7200-7499
* 7.0 final - 7361
* IntelliJ IDEA 7.0 pre-M2 - 6900-7199
* 7.0 M2 - 7126
* IntelliJ IDEA 7.0 pre-M1 - 6500-6899
* 7.0 M1 - 6813
* IntelliJ IDEA 6.0.2 branch - 6000-6499
* 6.0.5 - 6180
* 6.0.6 - 6197
* IntelliJ IDEA 6.0 branch - 5000-5999
* 6.0.1 - 5784
* IntelliJ IDEA 5.1 branch - 4000-4999
* 5.1.2 - 4267

View File

@ -1,204 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Creating an action / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/getting_started/creating_an_action">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Creating an action</h1>
<p>Your plugins can customize the IntelliJ Platform UI by adding new items to the menus and toolbars. The IntelliJ Platform provides the class <a href="https://upsource.jetbrains.com/idea-ce/file/idea-ce-1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java" data-bypass="yes" target="_blank"><span>AnAction.java</span></a> whose <code class="code highlight language-text">actionPerformed</code> method is called each time you select a menu item or click a toolbar button.</p>
<p>To create custom actions in the <em>IntelliJ Platform</em>, you should perform two basic steps:</p>
<ol>
<li>In your plugin, define an action or a system of actions that add their own items to menus and toolbars.</li>
<li>Register your actions.</li>
</ol>
<p>This topic outlines the above steps. For detailed information and samples, refer to <a href="/intellij-sdk-docs/basics/action_system.html"><span>IntelliJ Platform Action System</span></a>.</p>
<a name="defining-actions" class="elem-anchor"></a>
<h3>Defining actions<a href="#defining-actions" class="anchor-link"><span></span></a></h3>
<p>An action is a class derived from the <code class="code highlight language-text">AnAction</code> class. To define your action, in your plugin, create a Java class derived from the <code class="code highlight language-text">AnAction</code> class. In this class, override the <code class="code highlight language-text">actionPerformed</code> method to be called when a menu item or a toolbar button is selected.</p>
<p>To clarify this procedure, consider the following code snippet that defines the <code class="code highlight language-text">TextBoxes</code> class derived from the <code class="code highlight language-text">AnAction</code> class:</p>
<pre><code class="code-block__wrapper code-block _highlighted lang_java"><span class="kd">public</span> <span class="kd">class</span> <span class="nc">TextBoxes</span> <span class="kd">extends</span> <span class="n">AnAction</span> <span class="o">{</span>
<span class="c1">// If you register the action from Java code, this constructor is used to set the menu item name</span>
<span class="c1">// (optionally, you can specify the menu description and an icon to display next to the menu item).</span>
<span class="c1">// You can omit this constructor when registering the action in the plugin.xml file.</span>
<span class="kd">public</span> <span class="nf">TextBoxes</span><span class="o">()</span> <span class="o">{</span>
<span class="c1">// Set the menu item name.</span>
<span class="kd">super</span><span class="o">(</span><span class="s">"Text _Boxes"</span><span class="o">);</span>
<span class="c1">// Set the menu item name, description and icon.</span>
<span class="c1">// super("Text _Boxes","Item description",IconLoader.getIcon("/Mypackage/icon.png"));</span>
<span class="o">}</span>
<span class="kd">public</span> <span class="kt">void</span> <span class="nf">actionPerformed</span><span class="o">(</span><span class="n">AnActionEvent</span> <span class="n">event</span><span class="o">)</span> <span class="o">{</span>
<span class="n">Project</span> <span class="n">project</span> <span class="o">=</span> <span class="n">event</span><span class="o">.</span><span class="na">getData</span><span class="o">(</span><span class="n">PlatformDataKeys</span><span class="o">.</span><span class="na">PROJECT</span><span class="o">);</span>
<span class="n">String</span> <span class="n">txt</span><span class="o">=</span> <span class="n">Messages</span><span class="o">.</span><span class="na">showInputDialog</span><span class="o">(</span><span class="n">project</span><span class="o">,</span> <span class="s">"What is your name?"</span><span class="o">,</span> <span class="s">"Input your name"</span><span class="o">,</span> <span class="n">Messages</span><span class="o">.</span><span class="na">getQuestionIcon</span><span class="o">());</span>
<span class="n">Messages</span><span class="o">.</span><span class="na">showMessageDialog</span><span class="o">(</span><span class="n">project</span><span class="o">,</span> <span class="s">"Hello, "</span> <span class="o">+</span> <span class="n">txt</span> <span class="o">+</span> <span class="s">"!\n I am glad to see you."</span><span class="o">,</span> <span class="s">"Information"</span><span class="o">,</span> <span class="n">Messages</span><span class="o">.</span><span class="na">getInformationIcon</span><span class="o">());</span>
<span class="o">}</span>
<span class="o">}</span>
</code></pre>
<p>Note that optionally, you can define a set of classes derived from the <code class="code highlight language-text">AnAction</code> class. In this case, your plugin will define a system of actions.</p>
<a name="registering-actions" class="elem-anchor"></a>
<h3>Registering actions<a href="#registering-actions" class="anchor-link"><span></span></a></h3>
<p>Once you have defined an action or a system of actions, you must register them to specify the menu items or toolbar buttons associated with actions. You can register actions in one of the following ways:</p>
<ul>
<li>Register actions in the <code class="code highlight language-text">&lt;actions&gt;</code> section of the <code class="code highlight language-text">plugin.xml</code> file.</li>
<li>Register actions from Java code.</li>
</ul>
<p>This section provides some examples that illustrate how to register actions. For more information, refer to <a href="/intellij-sdk-docs/basics/action_system.html"><span>IntelliJ Platform Action System</span></a>.</p>
<a name="registering-actions-in-the-pluginxml-file" class="elem-anchor"></a>
<h4>Registering actions in the plugin.xml file</h4>
<p>To register your actions, make appropriate changes to the <code class="code highlight language-text">&lt;actions&gt;</code> section of the plugin.xml file for your IDEA project. The following fragment of the plugin.xml file adds the Sample Menu group (item) to the main menu. Clicking this item allows you to access <strong>Sample Menu | Text Boxes and Sample Menu | Show Dialog</strong> menu commands:</p>
<p><img src="img/sample_menu.jpg" alt="Sample Menu" /></p>
<pre><code class="code-block__wrapper code-block _highlighted lang_xml"><span class="nt">&lt;actions&gt;</span>
<span class="nt">&lt;group</span> <span class="na">id=</span><span class="s">"MyPlugin.SampleMenu"</span> <span class="na">text=</span><span class="s">"_Sample Menu"</span> <span class="na">description=</span><span class="s">"Sample menu"</span><span class="nt">&gt;</span>
<span class="nt">&lt;add-to-group</span> <span class="na">group-id=</span><span class="s">"MainMenu"</span> <span class="na">anchor=</span><span class="s">"last"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;action</span> <span class="na">id=</span><span class="s">"Myplugin.Textboxes"</span> <span class="na">class=</span><span class="s">"Mypackage.TextBoxes"</span> <span class="na">text=</span><span class="s">"Text _Boxes"</span> <span class="na">description=</span><span class="s">"A test menu item"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;action</span> <span class="na">id=</span><span class="s">"Myplugin.Dialogs"</span> <span class="na">class=</span><span class="s">"Mypackage.MyShowDialog"</span> <span class="na">text=</span><span class="s">"Show _Dialog"</span> <span class="na">description=</span><span class="s">"A test menu item"</span> <span class="nt">/&gt;</span>
<span class="nt">&lt;/group&gt;</span>
<span class="nt">&lt;/actions&gt;</span>
</code></pre>
<p>This fragment of the plugin.xml file demonstrates only some elements you can use in the <code class="code highlight language-text">&lt;actions&gt;</code> section to register your actions. For information about all elements designed to register your actions, refer to <a href="/intellij-sdk-docs/basics/action_system.html"><span>IntelliJ Platform Action System</span></a>.</p>
<a name="registering-actions-from-java-code" class="elem-anchor"></a>
<h4>Registering actions from Java code</h4>
<p>Alternatively, you can register your actions from Java code. For more information and samples that illustrate how to register actions from Java code, see <a href="/intellij-sdk-docs/basics/action_system.html"><span>IntelliJ Platform Action System</span></a>.</p>
<a name="quick-creation-of-actions" class="elem-anchor"></a>
<h3>Quick creation of actions<a href="#quick-creation-of-actions" class="anchor-link"><span></span></a></h3>
<p>The IntelliJ Platform provides the <strong>New Action</strong> wizard that suggests a simplified way of creating actions, with all the required infrastructure. The wizard helps you declare the action class and automatically makes appropriate changes to the <code class="code highlight language-text">&lt;actions&gt;</code> section of the plugin.xml file.</p>
<p>Note that you can use this wizard only to add a new action to an existing action group on the main menu or toolbar. If you want to create a new action group, and then add an action to this group, follow instructions earlier in this document.</p>
<p><strong>To create and register an action with the New Action wizard</strong></p>
<ol>
<li>In your project, on the context menu of the destination package click <strong>New</strong> or press <strong>Alt + Insert</strong>.</li>
<li>On the <strong>New</strong> menu, click <strong>Action</strong>.</li>
</ol>
<p><img src="img/new_action_template.png" alt="New Action Template" /></p>
<ol>
<li>On the <strong>New Action</strong> page that opens, fill in the following fields, and then click <strong>OK</strong>:</li>
</ol>
<ul>
<li><strong>Action ID</strong>: Enter the unique ID of the action. Recommended format: <code class="code highlight language-text">PluginName.ID</code></li>
<li><strong>Class Name</strong>: Enter the name of the action class to be created.</li>
<li><strong>Name</strong>: Enter the name of the menu item or tooltip for toolbar button associated with action.</li>
<li><strong>Description</strong>: Optionally, enter the action description. The IDEA status bar indicates this description when focusing the action.</li>
<li>In the <strong>Add to Group</strong> area, under <strong>Groups</strong>, <strong>Actions</strong> and <strong>Anchor</strong>, specify the action group to which to add a newly created action, and the position of the newly created action relative to other existing actions.</li>
<li>In the <strong>Keyboard Shortcuts</strong> area, optionally, specify the first and second keystrokes of the action.</li>
</ul>
<p><img src="img/new_action_page.png" alt="New Action Page" /></p>
<p>The IntelliJ Platform generates a <code class="code highlight language-text">.java</code> file with the specified class name, registers the newly created action in the plugin.xml file, adds a node to the module tree view, and opens the created action class file in the editor.</p>
<div class="last-modified">
Last modified: 30 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

View File

@ -0,0 +1,97 @@
---
title: Creating an action
---
Your plugins can customize the IntelliJ Platform UI by adding new items to the menus and toolbars. The IntelliJ Platform provides the class [AnAction.java](upsource:///platform/editor-ui-api/src/com/intellij/openapi/actionSystem/AnAction.java) whose `actionPerformed` method is called each time you select a menu item or click a toolbar button.
To create custom actions in the *IntelliJ Platform*, you should perform two basic steps:
1. In your plugin, define an action or a system of actions that add their own items to menus and toolbars.
2. Register your actions.
This topic outlines the above steps. For detailed information and samples, refer to [IntelliJ Platform Action System](/basics/action_system.md).
### Defining actions
An action is a class derived from the `AnAction` class. To define your action, in your plugin, create a Java class derived from the `AnAction` class. In this class, override the `actionPerformed` method to be called when a menu item or a toolbar button is selected.
To clarify this procedure, consider the following code snippet that defines the `TextBoxes` class derived from the `AnAction` class:
```java
public class TextBoxes extends AnAction {
// If you register the action from Java code, this constructor is used to set the menu item name
// (optionally, you can specify the menu description and an icon to display next to the menu item).
// You can omit this constructor when registering the action in the plugin.xml file.
public TextBoxes() {
// Set the menu item name.
super("Text _Boxes");
// Set the menu item name, description and icon.
// super("Text _Boxes","Item description",IconLoader.getIcon("/Mypackage/icon.png"));
}
public void actionPerformed(AnActionEvent event) {
Project project = event.getData(PlatformDataKeys.PROJECT);
String txt= Messages.showInputDialog(project, "What is your name?", "Input your name", Messages.getQuestionIcon());
Messages.showMessageDialog(project, "Hello, " + txt + "!\n I am glad to see you.", "Information", Messages.getInformationIcon());
}
}
```
Note that optionally, you can define a set of classes derived from the `AnAction` class. In this case, your plugin will define a system of actions.
### Registering actions
Once you have defined an action or a system of actions, you must register them to specify the menu items or toolbar buttons associated with actions. You can register actions in one of the following ways:
* Register actions in the `<actions>` section of the `plugin.xml` file.
* Register actions from Java code.
This section provides some examples that illustrate how to register actions. For more information, refer to [IntelliJ Platform Action System](/basics/action_system.md).
#### Registering actions in the plugin.xml file
To register your actions, make appropriate changes to the `<actions>` section of the plugin.xml file for your IDEA project. The following fragment of the plugin.xml file adds the Sample Menu group (item) to the main menu. Clicking this item allows you to access **Sample Menu \| Text Boxes and Sample Menu \| Show Dialog** menu commands:
![Sample Menu](img/sample_menu.jpg)
```xml
<actions>
<group id="MyPlugin.SampleMenu" text="_Sample Menu" description="Sample menu">
<add-to-group group-id="MainMenu" anchor="last" />
<action id="Myplugin.Textboxes" class="Mypackage.TextBoxes" text="Text _Boxes" description="A test menu item" />
<action id="Myplugin.Dialogs" class="Mypackage.MyShowDialog" text="Show _Dialog" description="A test menu item" />
</group>
</actions>
```
This fragment of the plugin.xml file demonstrates only some elements you can use in the `<actions>` section to register your actions. For information about all elements designed to register your actions, refer to [IntelliJ Platform Action System](/basics/action_system.md).
#### Registering actions from Java code
Alternatively, you can register your actions from Java code. For more information and samples that illustrate how to register actions from Java code, see [IntelliJ Platform Action System](/basics/action_system.md).
### Quick creation of actions
The IntelliJ Platform provides the **New Action** wizard that suggests a simplified way of creating actions, with all the required infrastructure. The wizard helps you declare the action class and automatically makes appropriate changes to the `<actions>` section of the plugin.xml file.
Note that you can use this wizard only to add a new action to an existing action group on the main menu or toolbar. If you want to create a new action group, and then add an action to this group, follow instructions earlier in this document.
**To create and register an action with the New Action wizard**
1. In your project, on the context menu of the destination package click **New** or press **Alt + Insert**.
2. On the **New** menu, click **Action**.
![New Action Template](img/new_action_template.png)
3. On the **New Action** page that opens, fill in the following fields, and then click **OK**:
* **Action ID**: Enter the unique ID of the action. Recommended format: `PluginName.ID`
* **Class Name**: Enter the name of the action class to be created.
* **Name**: Enter the name of the menu item or tooltip for toolbar button associated with action.
* **Description**: Optionally, enter the action description. The IDEA status bar indicates this description when focusing the action.
* In the **Add to Group** area, under **Groups**, **Actions** and **Anchor**, specify the action group to which to add a newly created action, and the position of the newly created action relative to other existing actions.
* In the **Keyboard Shortcuts** area, optionally, specify the first and second keystrokes of the action.
![New Action Page](img/new_action_page.png)
The IntelliJ Platform generates a `.java` file with the specified class name, registers the newly created action in the plugin.xml file, adds a node to the module tree view, and opens the created action class file in the editor.

View File

@ -1,117 +0,0 @@
<!doctype html>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>Creating a Plugin Project / IntelliJ Platform SDK DevGuide</title>
<link rel="stylesheet" href="/intellij-sdk-docs/app/css/styles.min.css">
<!-- non-retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-72x72.png" sizes="72x72">
<!-- retina iPhone pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-114x114.png" sizes="114x114">
<!-- retina iPad pre iOS 7 -->
<link rel="apple-touch-icon" href="/intellij-sdk-docs/apple-touch-icon-144x144.png" sizes="144x144">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="/intellij-sdk-docs/apple-touch-icon-precomposed.png">
<!-- normal favicon -->
<link rel="shortcut icon" type="image/x-icon" href="/intellij-sdk-docs/favicon.ico">
<link rel="icon" type="image/png" href="/intellij-sdk-docs/favicon.png">
<link rel="stylesheet" href="/intellij-sdk-docs/styles/styles.css"></head>
<body data-id="basics/getting_started/creating_plugin_project">
<div class="wrapper">
<section class="panel _nav">
<header class="panel__header">
<div class="container">
<form class="search-box">
<label for="search-box__input" class="search-box__label">
<input type="text" class="search-box__input" id="search-box__input" placeholder="Search IntelliJ Platform SDK DevGuide">
</label>
<div class="search-box__clear" title="Clear"></div>
</form>
</div>
</header>
<nav class="panel__content">
<div class="container _nav">
<menu class="nav-tree"></menu>
</div>
<div class="container _footer panel__footer">
<p><a href="https://youtrack.jetbrains.com/issues/IJSDK">Send feedback</a></p>
<p>&copy; 2000&ndash;2016 <a href="//www.jetbrains.com">JetBrains</a> s.r.o.<br>
All rights reserved.</p>
</div>
</nav>
</section>
<main class="panel _main" role="main">
<header class="panel__header">
<div class="container">
<h3>IntelliJ Platform SDK DevGuide</h3>
<div class="shortcuts-switcher"><label for="switch-shortcuts">Keymap:</label><select id="switch-shortcuts" class="select _shortcuts" height="1">
<option data-group="primary" value="default" selected>Default</option>
<option data-group="primary" value="default_for_gnome">GNOME</option>
<option data-group="primary" value="default_for_kde">KDE</option>
<option data-group="primary" value="default_for_xwin">XWindow</option>
<option data-group="primary" value="emacs">Emacs</option>
<option data-group="primary" value="jbuilder">JBuilder</option>
<option data-group="primary" value="visual_studio">Visual Studio</option>
<option data-group="primary" value="netbeans_6.5">NetBeans 6.5</option>
<option data-group="primary" value="eclipse">Eclipse</option>
<option data-group="secondary" value="mac_os_x_10.5_">OS X 10.5+</option>
<option data-group="secondary" value="mac_os_x">OS X</option>
<option data-group="secondary" value="eclipse_mac_os_x">OS X Eclipse</option></select>
</div>
<div class="panel-trigger"></div>
</div>
</header>
<section class="panel__content">
<div class="container">
<article class="article" data-shortcut-switcher="false">
<h1>Creating a Plugin Project</h1>
<p>This section explains how you can create a new plugin project from scratch using the New Project wizard. Optionally, you can import an existing project or import a project from external models. You can also add a new plugin module to an existing <em>IntelliJ Platform</em> project.
For more information, refer to the <a href="https://www.jetbrains.com/idea/help/new-project-wizard.html" data-bypass="yes" target="_blank"><span>IntelliJ IDEA Web Help</span></a>.</p>
<a name="to-create-a-plugin-project" class="elem-anchor"></a>
<h2>To create a plugin project:<a href="#to-create-a-plugin-project" class="anchor-link"><span></span></a></h2>
<ul>
<li>
<p>On the main menu, choose <strong>File | New | Project</strong>. The <em>New Project</em>
wizard starts.</p>
<p><img src="img/new_project_wizard.png" alt="New Project Wizard" /></p>
</li>
<li>Set <em>IntelliJ Platform Plugin</em> project type</li>
<li>Click <strong>Next</strong></li>
<li>Set desired project name</li>
<li>Click <strong>Finish</strong> to generate project structure files</li>
<li>Go to <strong>File | Project Structure</strong> to customize project settings if required</li>
</ul>
<div class="last-modified">
Last modified: 30 November 2015
</div>
</article>
<section class="disqus">
<div id="disqus_thread"></div>
</section>
</div>
</section>
</main>
</div>
<script data-main="/intellij-sdk-docs/app/js/main.build" data-baseurl="/intellij-sdk-docs/" src="/intellij-sdk-docs/app/js/vendor/requirejs/require.js"></script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More