mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 10:17:50 +08:00
cleanup, code includes
This commit is contained in:
parent
f6622fa420
commit
8b8b176054
@ -1,7 +1,9 @@
|
||||
[//]: # (title: Creating New Functions for Live Templates)
|
||||
# Creating New Functions for Live Templates
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<link-summary>Adding new functions for use in Live Templates.</link-summary>
|
||||
|
||||
The [Predefined Functions](https://www.jetbrains.com/help/idea/template-variables.html#predefined_functions) are the building blocks for creating [Parameterized Templates and Surround Templates](https://www.jetbrains.com/help/idea/using-live-templates.html#live_templates_types).
|
||||
However, sometimes the Predefined Functions are not enough.
|
||||
|
||||
@ -22,7 +24,7 @@ Three `TitleCaseMacro` methods are of particular interest:
|
||||
|
||||
```java
|
||||
```
|
||||
{src="live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java"}
|
||||
{src="live_templates/src/main/java/org/intellij/sdk/liveTemplates/TitleCaseMacro.java" include-symbol="TitleCaseMacro"}
|
||||
|
||||
## Adding a Live Template
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<link-summary>Adding custom Live Templates.</link-summary>
|
||||
|
||||
This tutorial illustrates how to add default Custom Live Templates to an IntelliJ Platform plugin, and assign valid contexts for these templates based on the surrounding code and file type.
|
||||
In addition, the tutorial discusses how to export existing Live Templates, and bundle them within a plugin.
|
||||
Any Live Template that can be created and exported can be added to a plugin by following the Template Creation, Export, and Extension Point Registration processes.
|
||||
@ -68,7 +70,7 @@ Ultimately, a file's extension determines the applicable Markdown context.
|
||||
|
||||
```java
|
||||
```
|
||||
{src="live_templates/src/main/java/org/intellij/sdk/liveTemplates/MarkdownContext.java"}
|
||||
{src="live_templates/src/main/java/org/intellij/sdk/liveTemplates/MarkdownContext.java" include-symbol="MarkdownContext"}
|
||||
|
||||
> Once the `MarkdownContext` is defined, be sure to add the new context type to the previously created Live Template settings file.
|
||||
>
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Supporting Module Types)
|
||||
# Supporting Module Types
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<link-summary>Adding custom module types.</link-summary>
|
||||
|
||||
IntelliJ Platform provides a set of standard module types.
|
||||
However, an application might need a module of a type that isn't supported yet.
|
||||
@ -37,7 +39,7 @@ Create the `DemoModuleType` implementation based on [`ModuleType`](%gh-ic%/platf
|
||||
|
||||
```java
|
||||
```
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleType.java"}
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleType.java" include-symbol="DemoModuleType"}
|
||||
|
||||
## Implement Custom Module Builder
|
||||
|
||||
@ -45,7 +47,7 @@ Create `DemoModuleBuilder` based on [`ModuleBuilder`](%gh-ic%/platform/lang-core
|
||||
|
||||
```java
|
||||
```
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java"}
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleBuilder.java" include-symbol="DemoModuleBuilder"}
|
||||
|
||||
## Provide Custom Wizard Steps
|
||||
|
||||
@ -54,7 +56,7 @@ Create a generic `DemoModuleWizardStep` based on [`ModuleWizardStep`](%gh-ic%/pl
|
||||
|
||||
```java
|
||||
```
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleWizardStep.java"}
|
||||
{src="module/src/main/java/org/intellij/sdk/module/DemoModuleWizardStep.java" include-symbol="DemoModuleWizardStep"}
|
||||
|
||||
## Creating a Module of New Type
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Run Configurations Tutorial)
|
||||
# Run Configurations Tutorial
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<link-summary>Adding custom run configuration tutorial.</link-summary>
|
||||
|
||||
<tldr>
|
||||
|
||||
@ -36,7 +38,7 @@ Implement [`ConfigurationType`](%gh-ic%/platform/execution/src/com/intellij/exec
|
||||
|
||||
```java
|
||||
```
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java"}
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationType.java" include-symbol="DemoRunConfigurationType"}
|
||||
|
||||
## Implement a ConfigurationFactory
|
||||
|
||||
@ -44,13 +46,13 @@ Implement a new [`ConfigurationFactory`](%gh-ic%/platform/execution/src/com/inte
|
||||
|
||||
```java
|
||||
```
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java"}
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoConfigurationFactory.java" include-symbol="DemoConfigurationFactory"}
|
||||
|
||||
Implement corresponding configuration options class extending [`RunConfigurationOptions`](%gh-ic%/platform/execution/src/com/intellij/execution/configurations/RunConfigurationOptions.kt) to store settings.
|
||||
|
||||
```java
|
||||
```
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationOptions.java"}
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfigurationOptions.java" include-symbol="DemoRunConfigurationOptions"}
|
||||
|
||||
## Implement a Run Configuration
|
||||
|
||||
@ -61,7 +63,7 @@ If you need to implement specific settings externalization rules and I/O behavio
|
||||
|
||||
```java
|
||||
```
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java"}
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoRunConfiguration.java" include-symbol="DemoRunConfiguration"}
|
||||
|
||||
## Create and Implement Run Configuration UI Form
|
||||
|
||||
@ -79,7 +81,7 @@ The UI Form should be bound with a Java class responsible for handling UI compon
|
||||
|
||||
```java
|
||||
```
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java"}
|
||||
{src="run_configuration/src/main/java/org/jetbrains/sdk/runConfiguration/DemoSettingsEditor.java" include-symbol="DemoSettingsEditor"}
|
||||
|
||||
## Compile and Run the Plugin
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
[//]: # (title: Modifying Project View Structure)
|
||||
# Modifying Project View Structure
|
||||
|
||||
<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
<!-- Copyright 2000-2023 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->
|
||||
|
||||
<link-summary>Modifying Project View Tutorial.</link-summary>
|
||||
|
||||
This tutorial is meant to illustrate how the project tree structure view appearance can be modified programmatically.
|
||||
|
||||
@ -29,7 +31,7 @@ The example below shows how to filter out all the Project View nodes except thos
|
||||
|
||||
```java
|
||||
```
|
||||
{src="tree_structure_provider/src/main/java/org/intellij/sdk/treeStructureProvider/TextOnlyTreeStructureProvider.java"}
|
||||
{src="tree_structure_provider/src/main/java/org/intellij/sdk/treeStructureProvider/TextOnlyTreeStructureProvider.java" include-symbol="TextOnlyTreeStructureProvider"}
|
||||
|
||||
## Compile and Run the Plugin
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user