mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-29 17:57:53 +08:00
Add missing image and update formatting
This commit is contained in:
parent
2d000580e8
commit
2e41dd7fa6
BIN
user_interface_components/img/sample_calendar.png
Normal file
BIN
user_interface_components/img/sample_calendar.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
@ -65,7 +65,7 @@ If closing tabs is enabled in general, you can disable closing of specific tabs
|
|||||||
|
|
||||||
## How to Create a Tool Window?
|
## How to Create a Tool Window?
|
||||||
|
|
||||||
The IntelliJ IDEA core provides the _toolWindow_ [extension point](/basics/plugin_structure/plugin_extensions_and_extension_points.md) that you can use to create and configure your custom tool windows. This extension point is declared using the [ToolWindowEP](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowEP.java) bean class.
|
The IntelliJ Platform provides the _toolWindow_ [extension point](/basics/plugin_structure/plugin_extensions_and_extension_points.md) that you can use to create and configure your custom tool windows. This extension point is declared using the [ToolWindowEP](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowEP.java) bean class.
|
||||||
|
|
||||||
To create a tool window, first declare an extension to the _toolWindow_ extension point.
|
To create a tool window, first declare an extension to the _toolWindow_ extension point.
|
||||||
|
|
||||||
@ -75,8 +75,8 @@ To create a plugin that displays a custom tool window, perform the following ste
|
|||||||
|
|
||||||
1. In your plugin project, create a Java class that implements the [ToolWindowFactory](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java)interface.
|
1. In your plugin project, create a Java class that implements the [ToolWindowFactory](upsource:///platform/platform-api/src/com/intellij/openapi/wm/ToolWindowFactory.java)interface.
|
||||||
2. In this class, override the `createToolWindowContent` method. This method specifies the content for your tool window.
|
2. In this class, override the `createToolWindowContent` method. This method specifies the content for your tool window.
|
||||||
3. In the plugin configuration file plugin.xml, create the _<extensions defaultExtensionNs="com.intellij"> </extensions>_ section.
|
3. In the plugin configuration file plugin.xml, create the `<extensions defaultExtensionNs="com.intellij">...</extensions>` section.
|
||||||
4. To this section, add the _<toolWindow>_ element, and for this element, set the following attributes declared in the ToolWindowEP bean class:
|
4. To this section, add the `<toolWindow>` element, and for this element, set the following attributes declared in the ToolWindowEP bean class:
|
||||||
- **id** (required): specifies the tool window caption.
|
- **id** (required): specifies the tool window caption.
|
||||||
- **anchor** (required): specifies the tool window bar where the tool window button will be displayed. Possible values: "left", "right", "top", "bottom."
|
- **anchor** (required): specifies the tool window bar where the tool window button will be displayed. Possible values: "left", "right", "top", "bottom."
|
||||||
- **secondary** (optional): when true, the tool window button will be shown on the lower part of the tool window bar. Default value is false.
|
- **secondary** (optional): when true, the tool window button will be shown on the lower part of the tool window bar. Default value is false.
|
||||||
@ -86,12 +86,11 @@ To create a plugin that displays a custom tool window, perform the following ste
|
|||||||
|
|
||||||
To clarify the above procedure, consider the following fragment of the `plugin.xml` file:
|
To clarify the above procedure, consider the following fragment of the `plugin.xml` file:
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
```xml
|
||||||
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<toolWindow id="My Sample Tool Window" icon="/myPackage/icon.png" anchor="right" factoryClass="myPackage.MyToolWindowFactory">
|
<toolWindow id="My Sample Tool Window" icon="/myPackage/icon.png" anchor="right" factoryClass="myPackage.MyToolWindowFactory"/>
|
||||||
|
</extensions>
|
||||||
</toolWindow>
|
```
|
||||||
</extensions>
|
|
||||||
|
|
||||||
### Sample Plugin
|
### Sample Plugin
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user