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

Conversation

Projects
None yet
3 participants
@ice1000
Contributor

ice1000 commented Jan 10, 2018

No description provided.

@zolotov

zolotov suggested changes Jan 11, 2018 edited

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.

This comment has been minimized.

@zolotov

zolotov Jan 11, 2018

Member

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

This comment has been minimized.

@ice1000

ice1000 Jan 11, 2018

Contributor

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/>

This comment has been minimized.

@zolotov

zolotov Jan 11, 2018

Member

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

This comment has been minimized.

@ice1000

ice1000 Jan 11, 2018

Contributor

Will remove.

}
```
Optionally, you can override `getIcon` to set an icon to your SDK type.

This comment has been minimized.

@zolotov

zolotov Jan 11, 2018

Member

getIcon is self-descriptive

This comment has been minimized.

@ice1000

ice1000 Jan 11, 2018

Contributor

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.*;

This comment has been minimized.

@zolotov

zolotov Jan 11, 2018

Member

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.

This comment has been minimized.

@ice1000

ice1000 Jan 11, 2018

Contributor

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):

This comment has been minimized.

@zolotov

zolotov Jan 11, 2018

Member

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.

This comment has been minimized.

@ice1000

ice1000 Jan 11, 2018

Contributor

Updated.

@zolotov

This comment has been minimized.

Member

zolotov commented Jan 11, 2018

thanks!

@citizenmatt citizenmatt merged commit b713ca6 into JetBrains:master Jan 11, 2018

@ice1000 ice1000 deleted the ice1000:patch-1 branch Jan 11, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment