Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SDK creation and customization guide #75

Merged
merged 2 commits into from Jan 11, 2018
Merged

Add SDK creation and customization guide #75

merged 2 commits into from Jan 11, 2018

Conversation

ice1000
Copy link
Contributor

@ice1000 ice1000 commented Jan 10, 2018

No description provided.

Copy link
Member

@zolotov zolotov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thank you for the PR.

I think that suggested documentation duplicates javadoc and abstract methods and tends to obsolescence. Please consider making suggested changes.

## Working with your own SDK

To create your own SDK, You need to create a class extends `SdkType`, and set your recommended SDK name, SDK home path, a presentable name. <br/>
Finally you need to implement `isValidSdkHome` to do the SDK validation, and this example just check if the given path is a directory.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see much sense in this. isValidSdkHome is an abstract method, it's obvious that user should implement it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll edit it.


## Working with your own SDK

To create your own SDK, You need to create a class extends `SdkType`, and set your recommended SDK name, SDK home path, a presentable name. <br/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All these methods are abstract, there is no need to say that they must be implemented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will remove.

}
```

Optionally, you can override `getIcon` to set an icon to your SDK type.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getIcon is self-descriptive

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

Finally you need to implement `isValidSdkHome` to do the SDK validation, and this example just check if the given path is a directory.

```java
import com.intellij.openapi.projectRoots.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The methods used in example either self-descriptive or contain javadoc. I'd say it's better to add documentation to setupSdkPath and provide a link to SdkType class.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link provided.

The last method is not abstract, so it's possible to remove it. But to save your SDK settings
(say, the next time you open your IDE, the SDK will still be there), you should override it.

To let users create or select an existing SDK, you may do this in some configuration panels (like, module wizard, facet, or run configuration):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To let users create or select an existing SDK,

I don't see how ProjectJdksEditor is related to an ability to create SDK.

It's not clear where to put this code. I believe it's enough to provide a link to ProjectJdksEditor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

@zolotov
Copy link
Member

zolotov commented Jan 11, 2018

thanks!

@citizenmatt citizenmatt merged commit b713ca6 into JetBrains:master Jan 11, 2018
@ice1000 ice1000 deleted the patch-1 branch January 11, 2018 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants