Merge remote-tracking branch 'origin/master'

This commit is contained in:
Breandan Considine 2016-03-01 20:39:02 -05:00
commit fd29e0d189
9 changed files with 34 additions and 50 deletions

View File

@ -26,7 +26,7 @@ In the former case, the instance of the state class is typically stored as a fie
```java
class MyService implements PersistentStateComponent<MyService.State> {
class State {
static class State {
public String value;
}
@ -79,29 +79,17 @@ State class should have a `equals` method, but if it is not implemented, state o
In order to specify where exactly the persisted values will be stored, you need to add a `@State` annotation to the `PersistentStateComponent` class. It has the following fields:
* `name` (required) - specifies the name of the state (name of the root tag in XML)
* One or more of `@com.intellij.openapi.components.Storage` annotations (required) - specify the storage locations for `.ipr` and directory-based projects
* `reloadable` (optional) - if set to false, complete project reload is required when the XML file is changed externally and the state has changed.
* `name` (required) specifies the name of the state (name of the root tag in XML).
* `storages` — one or more of `@com.intellij.openapi.components.Storage` annotations to specify the storage locations. Optional for project level values — standard project file will be used in this case.
* `reloadable` (optional) — if set to false, complete project (or application) reload is required when the XML file is changed externally and the state has changed.
The simplest ways of specifying the `@Storage` annotation are as follows:
The simplest ways of specifying the `@Storage` annotation are as follows (since IntelliJ IDEA 16, for previous versions please see [old version](https://github.com/JetBrains/intellij-sdk-docs/blob/5dcb02991cf828a7d4680d125ce56b4c10234146/basics/persisting_state_of_components.md) of this document):
* `@Storage(id = "other", file = StoragePathMacros.APP_CONFIG + "/yourName.xml")` for application level values
* `@Storage(id = "other", file = StoragePathMacros.PROJECT_FILE)` for values stored in the project file (for `.ipr` based projects)
* `@Storage(id = "dir", file = StoragePathMacros.PROJECT_CONFIG_DIR + "/other.xml", scheme = StorageScheme.DIRECTORY_BASED)})` for values stored in the project directory (for directory based projects)
* `@Storage(id = "other", file = StoragePathMacros.WORKSPACE_FILE)` for values stored in the workspace file
* `@Storage("yourName.xml")` If component is project-level — for `.ipr` based projects standard project file will be used automatically, you don't need to specify anything.
The `id` parameter of the `@Storage` annotation can be used to exclude specific fields from serialization in specific formats. If you do not need to exclude anything, you can set the `id` to an arbitrary string value. If you need to specify where the values are stored when the directory-based project format is used, you need to add the second `@Storage` annotation with the scheme parameter set to `StorageScheme.DIRECTORY_BASED`, for example:
* `@Storage(StoragePathMacros.WORKSPACE_FILE)` for values stored in the workspace file.
```java
@State(name = "AntConfiguration",
storages = {
@Storage(id = "default", file = StoragePathMacros.PROJECT_FILE),
@Storage(id = "dir", file = StoragePathMacros.PROJECT_CONFIG_DIR + "/ant.xml", scheme = StorageScheme.DIRECTORY_BASED)
}
)
```
By specifying a different value for the `file` parameter, you can cause the state to be persisted in a different file. For application level components strongly recommended to use custom file, using of `other.xml` is deprecated.
By specifying a different value for the `value` parameter (`file` before IntelliJ IDEA 16), you can cause the state to be persisted in a different file. For application level components strongly recommended to use custom file, using of `other.xml` is deprecated.
The `roamingType` parameter of the `@Storage` annotation specifies the roaming type when the Settings Repository plugin is used.

View File

@ -5,7 +5,7 @@ title: Contributing to the IntelliJ Platform
#### Participate in the Community
- **Participate in newsgroups and forums**
There are several community [forums and newsgroups](http://www.jetbrains.net/devnet/community/idea) you can join to discuss IntelliJ IDEA. The forums are an excellent source for users and contributors interested in having technical discussions, answering questions, or resolving potential issues for newcomers.
There are several community [forums and newsgroups](https://intellij-support.jetbrains.com/hc/en-us/community/topics) you can join to discuss IntelliJ IDEA. The forums are an excellent source for users and contributors interested in having technical discussions, answering questions, or resolving potential issues for newcomers.
- **Link to jetbrains.org**
The success of any open source project depends on the number of people who use the product and contribute back to the project. By linking to jetbrains.org, you can increase the chances of a new user or contributor finding out about the project and joining the community. If you're as excited about IntelliJ IDEA Community Edition as we are, you can show it by linking to us. Project logos and other assets are [also available](https://www.jetbrains.com/company/press/).
- **Promote IntelliJ Platform and IntelliJ IDEA Community Edition**

View File

@ -5,15 +5,15 @@ title: IntelliJ Platform SDK Documentation
## Welcome to the IntelliJ Platform SDK Documentation!
Here you can find [basic information](basics.md) about the *IntelliJ Platform SDK*, in particular how to **[get started](basics/getting_started.md)** with developing plugins for IntelliJ IDEA and other JetBrains IDEs.
Here you can find [basic information](basics.md) about the *IntelliJ Platform SDK*, in particular how to **[get started](basics/getting_started.md)** with developing plugins for IntelliJ IDEA and other IDEs.
More details about specific development topics can be found in the [Architecture Reference Guide](reference_guide.md).
A set of **[step-by-step tutorials](tutorials.md)** with code samples will lead you through the common use cases for the *IntelliJ Platform SDK*.
The [Plugin Development FAQ](faq.md) section contains a series of issues commonly discussed on our [Open API and Plugin Development](https://devnet.jetbrains.com/community/idea/open_api_and_plugin_development) forums.
The [Plugin Development FAQ](faq.md) section contains a series of issues commonly discussed on our [Open API and Plugin Development](https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development) forums.
One of the ways to improve the *IntelliJ SDK* documentation is to **[contribute to the project](CONTRIBUTING.md)**. Any kind of content including tutorials, articles about *IntelliJ* architecture or code samples that can help plugin developers is kindly welcome. Please read the [Contribution Guidelines](CONTRIBUTING.md) if you would like to share your knowledge.
One of the ways to improve the *IntelliJ SDK* documentation is to **[contribute to the project](CONTRIBUTING.md)**. Any kind of content including tutorials, articles about architecture or code samples that can help plugin developers is kindly welcome. Please read the [Contribution Guidelines](CONTRIBUTING.md) if you would like to share your knowledge.
Please let us know about any **content inconsistencies**, outdated materials, cosmetic issues, or other defects you may find by submitting an issue to [YouTrack](https://youtrack.jetbrains.com/issues/IJSDK). If you haven't found a documentation topic that answers your questions, feel free to file a **[request](https://youtrack.jetbrains.com/newIssue?project=IJSDK)**.

View File

@ -36,4 +36,4 @@ Providing custom language support includes the following major steps:
* [Additional Minor Features](/reference_guide/custom_language_support/additional_minor_features.md)
Please ask questions or suggest missing topics in [plugin development forum](https://devnet.jetbrains.com/community/idea/open_api_and_plugin_development).
Please ask questions or suggest missing topics in [plugin development forum](https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development).

View File

@ -2,7 +2,7 @@
title: Frameworks and External APIs
---
The following section explains how to access components of external frameworks from inside the *IntelliJ Platform*.
The following section explains how to access specific frameworks from inside the *IntelliJ Platform*.
This includes:
* [XML DOM API](/reference_guide/frameworks_and_external_apis/xml_dom_api.md)

View File

@ -25,16 +25,16 @@ Follow these steps to modify existing IntelliJ Platform SDK:
If you use other Spring functionality (e.g. Spring EL) in your plugin, make sure to add all required JARs to your IntelliJ Platform SDK classpath to make your plugin's tests work.
Please use only Spring-related functionality exposed in `spring-api.jar` (where sources are provided) in your plugin. Using any other "internal" (implementation) classes from Spring plugin itself (`spring.jar`) is _not_ supported.
Please use only Spring-related functionality exposed in `spring-api.jar` (where sources are provided) in your plugin. Using any other "internal" (implementation) classes from Spring plugin itself (`spring.jar`) is _not_ supported.
### plugin.xml
Add `<depends>com.intellij.spring</depends>` to your `plugin.xml` to require "Spring Support" plugin to be activated. All available extension points are available under `com.intellij.spring` prefix.
Add `<depends>com.intellij.spring</depends>` to your `plugin.xml` to require "Spring Support" plugin to be activated. All available extension points are provided under `com.intellij.spring` prefix.
Note that "Spring Support" plugin itself has dependencies to a few other plugins which need to be enabled in your sandbox (see notifications on startup).
## Main concepts
A Spring facet can be attached on a Module.
Spring facets usually contain one more user-configured/provided filesets, which group a set of Spring related configuration files (XML, Code or .properties files).
Spring facets usually contain one more user-configured or automatically provided filesets, which group a set of Spring related configuration files (XML, Code or .properties files).
A fileset usually corresponds to an actual application context configuration at runtime. Hierarchies can be modeled by depending on another fileset (possibly from another module).
@ -80,11 +80,13 @@ Choose one of `com.intellij.spring.CommonSpringModel#findBeansByPsiClassXXX` var
_Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#findBeans`
_Version 16_: note deprecation of `SpringModelSearchParameters.BeanClass#withInheritors(GlobalSearchScope)`
##### Find out if bean with given name/type exists
_Version 14_: `com.intellij.spring.model.utils.SpringModelSearchers#doesBeanExist` (please note deprecated methods)
##### Mark bean as infrastructure bean
_Version 14_: implement `SpringInfrastructureBean`, such beans obtain special icon and can be filtered in various places in UI
_Version 14_: implement `SpringInfrastructureBean`, such beans obtain special icon and can be filtered in various places in UI.
### XML Configuration
All support for XML-based Spring configuration files is provided via [DOM-API](xml_dom_api.md).

View File

@ -526,7 +526,7 @@ All the fields here are actually bound to controls in a GUI form.
Very often you'll have to create your own file editor. Then, to use all the binding and undo functionality, it's suggested to inherit your `FileEditorProvider` from `PerspectiveFileEditorProvider`, create an instance of `DomFileEditor` there, and pass a `BasicDomElementComponent`. To easily create an editor with a caption at the top, like in our EJB and JSF, you may use the static method `DomFileEditor.createDomFileEditor()`. `DomFileEditor` automatically listens to all changes in the document corresponding to the given DOM element, and therefore refreshes your component on undo. If you want to listen to changes in additional documents, use the methods `addWatchedDocument()`, `removeWatchedDocument()`, `addWatchedElement()`, `removeWatchedElement()` in `DomFileEditor`.
## Conclusion
Thank you for your time and attention. We hope you've found this article really useful. You are welcome to post your questions and comments to our [Open API and Plugin Development Forum](https://devnet.jetbrains.com/community/idea/open_api_and_plugin_development).
Thank you for your time and attention. We hope you've found this article really useful. You are welcome to post your questions and comments to our [Open API and Plugin Development Forum](https://intellij-support.jetbrains.com/hc/en-us/community/topics/200366979-IntelliJ-IDEA-Open-API-and-Plugin-Development).
### Further Material
The following bundled open source plugins make (heavy) use of DOM:

View File

@ -13,8 +13,8 @@ The best way to deal with icons and other image resources is to put them to a de
![Icons](img/icons1.png)
Then you should use `getIcon()` method of `com.intellij.openapi.util.IconLoader` class in your code to get access icons.
You can define a class or an interface with icon constants:
Use `getIcon()` method of `com.intellij.openapi.util.IconLoader` to access icons.
Then define a class or an interface with icon constants:
```java
public interface DemoPluginIcons {
@ -23,21 +23,22 @@ public interface DemoPluginIcons {
Icon DEMO_ACTION = IconLoader.getIcon("/demoAction.png");
}
```
and use icons inside plugin.xml as well:
Use these constants inside `plugin.xml` as well:
```xml
<action id="DemoPlugin.DemoAction"
class="com.jetbrains.demoplugin.actions.DemoAction"
text="Demo Action"
description="This is just a demo"
icon="/demoAction.png">
</action>
icon="DemoPluginIcons.DEMO_ACTION"/>
```
### Image formats and naming notations
IntelliJ Platform supports Retina displays and has dark look and feel called Darcula.
According this all images should have 4 different representations (in some cases only 2).
Thus, every icon should have a dedicated variant for Retina devices and Darcula look and feel, all variants should be in the same directory.
In some cases you can skip `_dark` variants if the original icon looks good under Darcula.
Let's take a look on the example above.
We've got three icons:
@ -47,29 +48,22 @@ We've got three icons:
* and for a tool window.
All tool windows should have icon size of *13x13* pixels and all actions should have icon size of *16x16* pixels (tree nodes, file types, and almost all icons have size 16x16 pixels).
So, every icon should have a copy for Retina devices and Darcula look and feel.
All tool windows should have icon size of *13x13* pixels and all actions should have icon size of *16x16* pixels (tree nodes, file types and almost all icons have size 16x16 pixels).
* **iconName.png** W x H pixels (Will be used on non-Retina devices with white look and feel)
* **iconName.png** W x H pixels (Will be used on non-Retina devices with default look and feel)
* **iconName@2x.png** 2\*W x 2\*H pixels (Will be used on Retina devices with white look and feel)
* **iconName@2x.png** 2\*W x 2\*H pixels (Will be used on Retina devices with default look and feel)
* **iconName_dark.png** W x H pixels (Will be used on non-Retina devices with Darcula look and feel)
* **iconName@2x_dark.png** 2\*W x 2\*H pixels (Will be used on Retina devices with Darcula look and feel)
`IconLoader` will load the icon that matches the best depending on the current environment.
IconLoader will load the icon that matches the best depending on the current&nbsp;environment.
So, always use `IconLoader.getIcon("/iconName.png")`.
Here are examples of *toolWindowStructure.png* icon representations:
![Tool Window Structure](img/toolWindowStructure.png)
![Tool Window Structure, dark](img/toolWindowStructure_dark.png)
![Tool Window Structure, retina](img/toolWindowStructure@2x.png)
![Tool Window Structure, retina, dark](img/toolWindowStructure@2x_dark.png)
All icon variants should be in the same directory.
In some cases you can skip dark variants if the original icon looks good under Darcula.
Then you should have only two variants: icon.png and icon@2x.png

View File

@ -6,13 +6,13 @@ title: 2. Language and File Type
### 2.1. Define a language
```java
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/Simple.bnf %}
{% include /code_samples/simple_language_plugin/src/com/simpleplugin/SimpleLanguage.java %}
```
### 2.2. Define an icon
Copy the
[icon](https://raw.githubusercontent.com/cheptsov/SimplePlugin/master/src/com/simpleplugin/icons/jar-gray.png)
[icon](https://raw.githubusercontent.com/JetBrains/intellij-sdk-docs/master/code_samples/simple_language_plugin/src/com/simpleplugin/icons/jar-gray.png)
to **com.simpleplugin.icons** package.
```java