mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
tool_windows.md: formatting
This commit is contained in:
parent
fc84c8ce71
commit
f3d4c675ab
@ -76,18 +76,18 @@ To create a plugin that displays a custom tool window, perform the following ste
|
||||
2. In this class, override the `createToolWindowContent` method. This method specifies the content for the tool window.
|
||||
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:
|
||||
- **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", or "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`.
|
||||
- **factoryClass** (required): specifies the class implementing the `ToolWindowFactory` interface (see Step 1).
|
||||
- **icon** (optional): specifies path to the icon that identifies the tool window, if any.
|
||||
- **conditionClass** (optional): specifies a class that implements [`Condition<Project>`](upsource:///platform/util-rt/src/com/intellij/openapi/util/Condition.java). Using this class, define conditions to be met to display tool window button. When returning `false`, the tool window button is not displayed on tool window bar.
|
||||
- `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", or "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`.
|
||||
- `factoryClass` (required): specifies the class implementing the `ToolWindowFactory` interface (see Step 1).
|
||||
- `icon` (optional): specifies path to the icon that identifies the tool window, if any.
|
||||
- `conditionClass` (optional): specifies a class that implements [`Condition<Project>`](upsource:///platform/util-rt/src/com/intellij/openapi/util/Condition.java). Using this class, define conditions to be met to display tool window button. When returning `false`, the tool window button is not displayed on tool window bar.
|
||||
|
||||
To clarify the above procedure, consider the following fragment of the `plugin.xml` file:
|
||||
|
||||
```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/toolWindowIcon.svg" anchor="right" factoryClass="myPackage.MyToolWindowFactory"/>
|
||||
</extensions>
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user