mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 09:47:50 +08:00
Escape unescaped angle brackets, fixes IJSDK-56
This commit is contained in:
parent
eff6b5b48b
commit
4b14c47af3
@ -35,11 +35,11 @@ The ```AnActionEvent``` instance is also passed to the ```actionPerformed``` met
|
||||
|
||||
## 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.
|
||||
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.
|
||||
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 -->
|
||||
@ -113,7 +113,7 @@ You can create a plugin that registers actions on IDEA startup using the followi
|
||||
*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.
|
||||
# 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:
|
||||
@ -149,7 +149,7 @@ public class MyPluginRegistration implements ApplicationComponent {
|
||||
Note, that the sample ```TextBoxes``` class is described in
|
||||
[Getting Started with Plugin Development](/basics/getting_started.html).
|
||||
|
||||
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:
|
||||
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>
|
||||
|
@ -35,7 +35,7 @@ bean class.
|
||||
To access this extension point, create a Java class that implements the
|
||||
[FileViewProviderFactory](https://github.com/JetBrains/intellij-community/blob/master/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:
|
||||
To declare the extension to the _fileType.fileViewProviderFactory_ extension point, to the \<extensions\> section of the plugin.xml file, add the following syntax:
|
||||
|
||||
```
|
||||
<fileType.fileViewProviderFactory filetype=%file type% implementationClass=%class name%>
|
||||
|
@ -26,7 +26,7 @@ Refer to it as an example to understand this topic better.
|
||||
|
||||
Each specific index implementation is a class extending
|
||||
[FileBasedIndexExtension](https://github.com/JetBrains/intellij-community/blob/master/platform/indexing-api/src/com/intellij/util/indexing/FileBasedIndexExtension.java).
|
||||
A file-base index should be registered in the <fileBasedIndex> extension point.
|
||||
A file-base index should be registered in the \<fileBasedIndex\> extension point.
|
||||
|
||||
The implementation of a file-based contains of the following main parts:
|
||||
|
||||
|
@ -43,7 +43,7 @@ The name of a component is returned by its ```getComponentName()``` method.
|
||||
|
||||
### Components Naming Notation
|
||||
|
||||
It is recommended to name components in _<plugin_name>.<component_name>_ form.
|
||||
It is recommended to name components in \<plugin_name\>.\<component_name\> form.
|
||||
|
||||
### Application Level Components
|
||||
|
||||
@ -115,7 +115,7 @@ Note that module-level components must be registered in the ```<module-component
|
||||
#### Quick creation of module components
|
||||
|
||||
*IntelliJ IDEA* suggests a simplified way to create module components, with all the required infrastructure.
|
||||
The IDEA interface will help you declare the module component's implementation class, and will automatically make appropriate changes to the <module-components> section of the `plugin.xml` file.
|
||||
The IDEA interface will help you declare the module component's implementation class, and will automatically make appropriate changes to the \<module-components\> section of the `plugin.xml` file.
|
||||
|
||||
*To create and register a module component*
|
||||
|
||||
@ -160,7 +160,7 @@ For more information and samples, refer to
|
||||
|
||||
The defaults (components' predefined settings) should be placed in the *\<component_name\>.xml* file.
|
||||
Place this file in the plugin's classpath in the folder corresponding to the default package.
|
||||
The ```readExternal()``` method will be called on the <component> root tag.
|
||||
The ```readExternal()``` method will be called on the \<component\> root tag.
|
||||
|
||||
If a component has defaults, the ```readExternal()``` method is called twice:
|
||||
|
||||
|
@ -8,11 +8,11 @@ In order to do so, you need to perform the following two steps:
|
||||
* Add the jars of the plugin you're depending on to the classpath of your *IntelliJ Platform SDK*.
|
||||
**Note**: Don't add the plugin jars as a library: this will fail at runtime because IntelliJ Platform will load two separate copies of the dependency plugin classes.
|
||||
|
||||
* Add a <depends> tag to your plugin.xml, adding the ID of the plugin you're depending on as the contents of the tag.
|
||||
* Add a \<depends\> tag to your plugin.xml, adding the ID of the plugin you're depending on as the contents of the tag.
|
||||
For example:
|
||||
|
||||
```xml
|
||||
<depends>org.jetbrains.idea.maven</depends>
|
||||
```
|
||||
|
||||
To find out the ID of the plugin you're depending on, locate the META-INF/plugin.xml file inside its jar and check the contents of the <id> tag.
|
||||
To find out the ID of the plugin you're depending on, locate the META-INF/plugin.xml file inside its jar and check the contents of the \<id\> tag.
|
||||
|
@ -56,7 +56,7 @@ public class MyBeanClass1 extends AbstractExtensionPointBean {
|
||||
|
||||
}
|
||||
```
|
||||
Note that to declare an extension designed to access the MyExtensionPoint1 extension point, your plugin.xml file must contain the <MyExtensionPoint1> tag with the "key" and "implementationClass" attributes set to appropriate values (see the sample plugin.xml file below).
|
||||
Note that to declare an extension designed to access the MyExtensionPoint1 extension point, your plugin.xml file must contain the \<MyExtensionPoint1\> tag with the "key" and "implementationClass" attributes set to appropriate values (see the sample plugin.xml file below).
|
||||
|
||||
*To declare an extension*
|
||||
|
||||
|
@ -35,7 +35,7 @@ A _library_ is an archive of compiled code (such as JAR files) that your modules
|
||||
|
||||
* **Project Library**: the library classes are visible within the project and the library information is recorded in the project \*.ipr file or in _.idea/libraries_.
|
||||
|
||||
* **Global Library**: the library information is recorded in the _applicationLibraries.xml_ file into the _<User Home>/.IntelliJIdea/config/options_ directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
* **Global Library**: the library information is recorded in the _applicationLibraries.xml_ file into the \<User Home\>/.IntelliJIdea/config/options_ directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
|
||||
For more information about libraries, refer to
|
||||
[Library](http://www.jetbrains.com/idea/webhelp/library.html).
|
||||
|
@ -32,7 +32,7 @@ IntelliJ IDEA supports three types of libraries:
|
||||
|
||||
* **Module Library**: the library classes are visible only in this module and the library information is recorded in the module *.iml file.
|
||||
* **Project Library**: the library classes are visible within the project and the library information is recorded in the project *.ipr file or in .idea/libraries.
|
||||
* **Global Library**: the library information is recorded in the applicationLibraries.xml file into the <User Home>/.IntelliJIdea/config/options directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
* **Global Library**: the library information is recorded in the applicationLibraries.xml file into the \<User Home\>/.IntelliJIdea/config/options directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
|
||||
For more information about libraries, refer to
|
||||
[Library] (http://www.jetbrains.com/idea/webhelp/library.html).
|
||||
|
@ -50,7 +50,7 @@ mechanism to support plugins. There are several service interfaces (e.g. `Builde
|
||||
|
||||
### Registering a plugin for External Builder
|
||||
|
||||
Sources of a plugin for External Builder should be put in a separate module. By convention such module has name '...-jps-plugin' and its sources are placed under 'jps-plugin' directory in the main plugin directory. Use `<compileServer.plugin>` extension to add the plugin to classpath of external build process, the plugin jar should be named "<jps module name>.jar". 'Build' | 'Prepare Plugin Module for deployment' action will automatically pack 'jps-plugin' part to a separate jar accordingly.
|
||||
Sources of a plugin for External Builder should be put in a separate module. By convention such module has name '...-jps-plugin' and its sources are placed under 'jps-plugin' directory in the main plugin directory. Use \<compileServer.plugin\> extension to add the plugin to classpath of external build process, the plugin jar should be named \<jps module name\>.jar. 'Build' | 'Prepare Plugin Module for deployment' action will automatically pack 'jps-plugin' part to a separate jar accordingly.
|
||||
|
||||
### Debugging a plugin for External Builder
|
||||
|
||||
@ -73,7 +73,7 @@ The build process has built-in self-cpu-profiling capabilities. To enable them d
|
||||
|
||||
3. Make sure automatic make is turned off
|
||||
|
||||
After this every build process run should result in a CPU snapshot stored in <user-home>/Snapshots directory.
|
||||
After this every build process run should result in a CPU snapshot stored in \<user-home\>/Snapshots directory.
|
||||
Snapshots are named like "ExternalBuild\-\{date\}.snapshot".
|
||||
|
||||
Specifying `-Dprofiling.mode=false` will turn profiling off.
|
||||
|
@ -7,7 +7,7 @@ IntelliJ IDEA supports three types of libraries:
|
||||
|
||||
* **Module Library**: the library classes are visible only in this module and the library information is recorded in the module *.iml file.
|
||||
* **Project Library**: the library classes are visible within the project and the library information is recorded in the project *.ipr file or in .idea/libraries.
|
||||
* **Global Library**: the library information is recorded in the applicationLibraries.xml file into the <User Home>/.IntelliJIdea/config/options directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
* **Global Library**: the library information is recorded in the applicationLibraries.xml file into the \<User Home\>/.IntelliJIdea/config/options directory. Global libraries are similar to project libraries, but are visible for the different projects.
|
||||
|
||||
For more information about libraries, refer to
|
||||
[Library](http://www.jetbrains.com/idea/webhelp/library.html).
|
||||
|
Loading…
x
Reference in New Issue
Block a user