Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 527a033

Browse files
committedNov 26, 2015
Minor reformatting. No content updates
1 parent 6cb2bf4 commit 527a033

File tree

5 files changed

+45
-122
lines changed

5 files changed

+45
-122
lines changed
 

‎reference_guide.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
title: Architecture Reference Guide
33
---
44

5-
This documentation section contains more in-depth explanation of different API components.
6-
If you are not familiar with *IntelliJ Platform* API please refer to
7-
[Basics](basics.md)
8-
section.
5+
This documentation section contains more in-depth explanation of different API components. If you are not familiar with the *IntelliJ Platform* API please refer to the [Basics](basics.md) section.
96

107
* [Project Model](reference_guide/project_model.md)
118
* [Project Wizard](reference_guide/project_wizard.md)
@@ -16,4 +13,4 @@ section.
1613
* [Messaging Infrastructure](reference_guide/messaging_infrastructure.md)
1714
* [Multiple Carets](reference_guide/multiple_carets.md)
1815
* [Color Scheme Management](reference_guide/color_scheme_management.md)
19-
* [User Interface Components](user_interface_components/user_interface_components.md)
16+
* [User Interface Components](user_interface_components/user_interface_components.md)

‎reference_guide/project_model.md

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,18 @@
22
title: Project Model. Roots and Libraries. Configuring Project from Code.
33
---
44

5-
This section considers internal architecture *IntelliJ Platform* projects
6-
and gives overview for classes and packages of the API used to manipulate with projects and their components, such as modules, facets, libraries, SDK.
7-
For general information about the concept of a projects and concepts related to it, refer to
8-
[Project](http://www.jetbrains.com/idea/help/project.html),
9-
[Module](http://www.jetbrains.com/idea/help/module.html),
10-
[Library](http://www.jetbrains.com/idea/help/library.html),
11-
and
12-
[Facet](http://www.jetbrains.com/idea/help/facet.html)
13-
in
14-
[IntelliJ IDEA Web Help](https://www.jetbrains.com/idea/help/intellij-idea.html).
5+
This section considers the internal architecture of *IntelliJ Platform* projects and gives an overview for classes and packages of the API used to manipulate with projects and their components, such as modules, facets, libraries, SDK.
156

7+
For general information about the concept of a projects and concepts related to it, refer to [Project](http://www.jetbrains.com/idea/help/project.html), [Module](http://www.jetbrains.com/idea/help/module.html), [Library](http://www.jetbrains.com/idea/help/library.html), and [Facet](http://www.jetbrains.com/idea/help/facet.html) in the [IntelliJ IDEA Web Help](https://www.jetbrains.com/idea/help/intellij-idea.html).
168

179
## Project Structure
1810

19-
A project consists of one or several modules.
20-
Each module includes the plugin source code and so called order entries that refer to SDK and libraries the module uses.
21-
By default, all modules uses the project SDK.
22-
In addition, a module can optionally have a set of facets.
23-
This document explains how you can explore and change the structure of projects using API.
11+
A project consists of one or several modules. Each module includes source code and so called order entries that refer to SDK and libraries the module uses. By default, all modules use the project SDK. In addition, a module can optionally have a set of facets. This document explains how you can explore and change the structure of projects using API.
2412

2513
Main project structure components are:
2614

27-
* [Project](/reference_guide/project_model/project.md)
28-
itself
29-
15+
* [Project](/reference_guide/project_model/project.md)
3016
* [Module](/reference_guide/project_model/module.md)
31-
3217
* [SDK](/reference_guide/project_model/sdk.md)
33-
3418
* [Library](/reference_guide/project_model/library.md)
35-
3619
* [Facet](/reference_guide/project_model/facet.md)
37-
38-

‎reference_guide/project_model/module.md

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
---
22
title: Module
33
---
4-
A module is a discrete unit of functionality that can be run, tested, and debugged independently.
5-
Modules includes such things as source code, build scripts, unit tests, deployment descriptors, etc.
6-
In the project, each module can use a specific SDK or inherit SDK defined on the project level (see the [SDK](sdk.md) section later in this document).
7-
A module can depend on other modules of the project.
8-
9-
## Getting Current Module
10-
To determine the module in the project in question to which the specified `VirtualFile` belongs use `ModuleUtilCore#findModuleForFile`.
11-
Use `ModuleUtilCore#findModuleForPsiElement` to find the module for a given `PsiElement`.
12-
13-
## Accessing Module Roots
14-
Information about module roots can be accessed via the class
15-
[ModuleRootManager.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleRootManager.java),
16-
for example, an instance of
17-
[ModuleFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleFileIndex.java)
18-
can be obtained, which is analogical to the
19-
[ProjectFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java)
20-
but in the scope of a module
4+
5+
A _module_ is a discrete unit of functionality that can be run, tested, and debugged independently. Modules includes such things as source code, build scripts, unit tests, deployment descriptors, etc. In the project, each module can use a specific SDK or inherit the SDK defined on the project level (see the [SDK](sdk.md) section later in this guide). A module can depend on other modules of the project.
6+
7+
## Getting the current module
8+
9+
To determine the module in the project in question to which the specified `VirtualFile` belongs use `ModuleUtilCore#findModuleForFile`. Use `ModuleUtilCore#findModuleForPsiElement` to find the module for a given `PsiElement`.
10+
11+
## Accessing module roots
12+
13+
Information about module roots can be accessed via the class [ModuleRootManager.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleRootManager.java), for example, an instance of [ModuleFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleFileIndex.java) can be obtained, which is similar to the [ProjectFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java) but in the scope of a module.
2114

2215
```java
2316
ModuleRootManager.getInstance(currentModule).getFileIndex()
2417
```
2518

26-
### Checking Belonging to a Module Source Root
19+
## Checking belonging to a module source root
2720

28-
To check if a virtual file or directory belongs to a module source root, use the `ProjectFileIndex.getSourceRootForFile` method.
29-
This method returns null if the file or directory does not belong to any source root of modules in the project.
21+
To check if a virtual file or directory belongs to a module source root, use the `ProjectFileIndex.getSourceRootForFile` method. This method returns null if the file or directory does not belong to any source root of modules in the project.
3022

3123
```java
3224
VirtualFile moduleSourceRoot = ProjectRootManager.getInstance(project).getFileIndex().getSourceRootForFile(virtualFileOrDirectory);

‎reference_guide/project_model/project.md

Lines changed: 16 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -2,82 +2,46 @@
22
title: Project
33
---
44

5-
In IntelliJ IDEA, a project encapsulates all your source code, libraries, build instructions into a single organizational unit.
6-
Everything you do in IntelliJ IDEA, is done within the context of a project.
7-
A project defines some collections referred to as modules and libraries.
8-
Depending on the logical and functional requirements to the project, you can create a single-module or a multi-module project.
5+
In *IntelliJ IDEA*, a project encapsulates all your source code, libraries, build instructions into a single organizational unit. Everything you do in *IntelliJ IDEA*, is done within the context of a project. A project defines some collections referred to as modules and libraries. Depending on the logical and functional requirements to the project, you can create a single-module or a multi-module project.
96

10-
## Working with Projects
7+
## Working with projects
118

12-
*IntelliJ Platform* stores the project configuration data in XML files.
13-
The list of those files depends on the plugin
14-
[project](http://www.jetbrains.com/idea/help/project.html)
15-
format.
16-
For file-based format projects, the information core to the project itself (e.g. location of the component modules, compiler settings, etc.) is stored in the <%project name%>.IPR file.
17-
The information about modules the project includes is stored in <%module name%>.IML files.
18-
Module files are created for each module.
9+
The *IntelliJ Platform* stores the project configuration data in XML files. The list of those files depends on the plugin [project](http://www.jetbrains.com/idea/help/project.html) format.
1910

20-
For directory-based format projects, the project and workspace settings are stored in a number of XML files under the <%Project home directory%>/.idea directory.
21-
Each XML file is responsible for its own set of settings and can be recognized by its name: projectCodeStyle.xml, encodings.xml, vcs.xml etc.
22-
As for the file-based format projects, .IML files describe modules.
11+
For file based format projects, the information core to the project itself (e.g. location of the component modules, compiler settings, etc.) is stored in the `%project_name%.ipr` file. The information about modules the project includes is stored in `%module_name%.iml` files. Module files are created for each module.
2312

24-
Main classes providing work with the project model are located in the package
25-
[projectModel-api.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-api/src/com/intellij/openapi).
26-
Basic API classes and interfaces for the concepts of
27-
[project](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/project/Project.java),
28-
[module](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/module/Module.java),
29-
[application](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/application/Application.java),
30-
and
31-
[component](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/components/ProjectComponent.java)
32-
are placed in the
33-
[core-api.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/core-api/src/com/intellij/openapi)
34-
package.
13+
For directory based format projects, the project and workspace settings are stored in a number of XML files under the `%project_home_directory%/.idea` directory. Each XML file is responsible for its own set of settings and can be recognized by its name: `projectCodeStyle.xml`, `encodings.xml`, `vcs.xml` etc. As for the file-based format projects, `.iml` files describe modules.
3514

15+
Main classes providing work with the project model are located in the package [projectModel-api.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-api/src/com/intellij/openapi). Basic API classes and interfaces for the concepts of [project](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/project/Project.java), [module](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/module/Module.java), [application](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/application/Application.java), and [component](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/core-api/src/com/intellij/openapi/components/ProjectComponent.java) are placed in the [core-api.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/core-api/src/com/intellij/openapi) package.
3616

37-
### Finding Source Roots
38-
39-
To get an array of all the source roots for a project use
40-
`ProjectRootManager.getContentSourceRoots()`
41-
method like this code snippet shows:
17+
### Finding source roots
4218

19+
To get an array of all the source roots for a project use `ProjectRootManager.getContentSourceRoots()` method like this code snippet shows:
4320

4421
```java
4522
VirtualFile[] vFiles = ProjectRootManager.getInstance(project).getContentSourceRoots();
4623
```
4724

25+
### Checking if a file belongs to a project
4826

49-
### Checking if File Belongs to a Project
50-
51-
Use
52-
[ProjectFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java)
53-
to get this information.
27+
Use [ProjectFileIndex.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectFileIndex.java) to get this information.
5428

5529
### Getting an Instance of the ProjectFileIndex Interface
5630

57-
Use the ProjectRootManager.getFileIndex() method. For example:
31+
Use the `ProjectRootManager.getFileIndex()` method. For example:
5832

5933
```java
6034
ProjectFileIndex projectFileIndex = ProjectRootManager.getInstance(project).getFileIndex();
6135
```
6236

63-
Note that this method returns `null` if the file does not belong to any module.
64-
You can also use the `ProjectFileIndex.getContentRootForFile()` method to get the module content root to which the specified file or directory belongs:
37+
Note that this method returns `null` if the file does not belong to any module. You can also use the `ProjectFileIndex.getContentRootForFile()` method to get the module content root to which the specified file or directory belongs:
6538

6639
```java
6740
VirtualFile moduleContentRoot = ProjectRootManager.getInstance(project).getFileIndex().getContentRootForFile(virtualFileOrDirectory);
68-
```
41+
```
6942

7043
## Changing the project structure
7144

72-
Utility classes which can be used for modifying a project structure can be found in the package
73-
[projectModel-impl.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-impl/src/com/intellij/openapi).
74-
It's
75-
[roots](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-impl/src/com/intellij/openapi/roots/)
76-
subpackage contains instances and utilities meant to work with project and module source roots, including
77-
[ModuleRootModificationUtil.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java)
78-
and
79-
[ProjectRootUtil.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootUtil.java)
80-
81-
Refer to the
82-
[basic example](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/project_model/src/com/intellij/tutorials/project/model/ModificationAction.java)
83-
of on-the-fly project structure modification to learn how it can be implemented.
45+
Utility classes which can be used for modifying a project structure can be found in the package [projectModel-impl.openapi](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-impl/src/com/intellij/openapi). It's [roots](https://github.com/JetBrains/intellij-community/tree/master/platform/projectModel-impl/src/com/intellij/openapi/roots/) subpackage contains instances and utilities meant to work with project and module source roots, including [ModuleRootModificationUtil.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ModuleRootModificationUtil.java) and [ProjectRootUtil.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-impl/src/com/intellij/openapi/projectRoots/impl/ProjectRootUtil.java).
46+
47+
Refer to the [basic example](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/project_model/src/com/intellij/tutorials/project/model/ModificationAction.java) of on-the-fly project structure modification to learn how it can be implemented.

‎reference_guide/project_model/sdk.md

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,51 +2,40 @@
22
title: SDK
33
---
44

5-
Every project uses a Software Development Kit (SDK).
6-
For Java projects, SDK is referred to as JDK (Java Development Kit).
7-
SDK determines which API library is used to build the project. If your project is multi-module, the project SDK by default is common for all modules within the project.
8-
Optionally, you can configure individual SDK for each module.
9-
For more information about SDKs, see
10-
[SDK](https://www.jetbrains.com/idea/help/sdk.html)
11-
and
12-
[Configuring Global, Project and Module SDKs](https://www.jetbrains.com/idea/help/configuring-global-project-and-module-sdks.html)
13-
in IntelliJ IDEA Web Help.
14-
15-
### Getting Project SDK Information
16-
17-
Main information about the project SDK can be accessed via
18-
[ProjectRootManager.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectRootManager.java)
19-
like the following example shows
5+
Every project uses a Software Development Kit (SDK). For Java projects, the SDK is referred to as the JDK (Java Development Kit). The SDK determines which API library is used to build the project. If your project is multi-module, the project SDK by default is common for all modules within the project. Optionally, you can configure individual SDKs for each module. For more information about SDKs, see [SDK](https://www.jetbrains.com/idea/help/sdk.html) and [Configuring Global, Project and Module SDKs](https://www.jetbrains.com/idea/help/configuring-global-project-and-module-sdks.html) in IntelliJ IDEA Web Help.
6+
7+
## Getting project SDK information
8+
9+
Main information about the project SDK can be accessed via [ProjectRootManager.java](https://upsource.jetbrains.com/idea-community/file/1731d054af4ca27aa827c03929e27eeb0e6a8366/platform/projectModel-api/src/com/intellij/openapi/roots/ProjectRootManager.java) like the following example shows
2010

2111
```java
2212
String projectSdk = ProjectRootManager.getInstance(project).getProjectSdk();
2313
```
2414

25-
### Getting And Setting Project SDK Attributes
15+
## Getting and setting project SDK attributes
2616

27-
* To get the project-level SDK
17+
* To get the project level SDK
2818

2919
```java
3020
Sdk projectSDK = ProjectRootManager.getInstance(project).getProjectSdk();
3121
```
3222

33-
* To get the project-level SDK name:
23+
* To get the project level SDK name:
3424

3525
```java
3626
String projectSDKName = ProjectRootManager.getInstance(project).getProjectSdkName();
3727
```
3828

39-
* To set the project-level SDK:
29+
* To set the project level SDK:
4030

4131
```java
4232
ProjectRootManager.getInstance(project).setProjectSdk(Sdk jdk);
4333
```
4434

45-
* To set the project-level SDK name:
35+
* To set the project level SDK name:
4636

4737
```java
4838
ProjectRootManager.getInstance(project).setProjectSdkName(String name);
4939
```
5040

51-
See the following [code sample](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/project_model/src/com/intellij/tutorials/project/model/ProjectSdkAction.java)
52-
to get more familiar with SDK manipulation tool set.
41+
See the following [code sample](https://github.com/JetBrains/intellij-sdk-docs/blob/master/code_samples/project_model/src/com/intellij/tutorials/project/model/ProjectSdkAction.java) to get more familiar with SDK manipulation tool set.

0 commit comments

Comments
 (0)
Please sign in to comment.