Modify template used in generating `toString` method in Java code editor in IntelliJ
I have seen some documentation such as this and some Stack Overflow questions like this which talk about templates, perhaps Velocity templates, used by IntelliJ when generating a toString
method in a Java class.
But no where can I find where this template lives, or how to access it from within IntelliJ.
➥ Exactly how does one find and edit the toString
generation template in IntelliJ 2018?
java templates intellij-idea tostring
add a comment |
I have seen some documentation such as this and some Stack Overflow questions like this which talk about templates, perhaps Velocity templates, used by IntelliJ when generating a toString
method in a Java class.
But no where can I find where this template lives, or how to access it from within IntelliJ.
➥ Exactly how does one find and edit the toString
generation template in IntelliJ 2018?
java templates intellij-idea tostring
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
It's OK, selecttoString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.
– user10639668
Nov 17 '18 at 19:43
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking theSettings
button. I had not realized there was more going on there than a simple pick-list.
– Basil Bourque
Nov 17 '18 at 20:12
add a comment |
I have seen some documentation such as this and some Stack Overflow questions like this which talk about templates, perhaps Velocity templates, used by IntelliJ when generating a toString
method in a Java class.
But no where can I find where this template lives, or how to access it from within IntelliJ.
➥ Exactly how does one find and edit the toString
generation template in IntelliJ 2018?
java templates intellij-idea tostring
I have seen some documentation such as this and some Stack Overflow questions like this which talk about templates, perhaps Velocity templates, used by IntelliJ when generating a toString
method in a Java class.
But no where can I find where this template lives, or how to access it from within IntelliJ.
➥ Exactly how does one find and edit the toString
generation template in IntelliJ 2018?
java templates intellij-idea tostring
java templates intellij-idea tostring
edited Nov 17 '18 at 20:07
Basil Bourque
asked Nov 17 '18 at 17:36
Basil BourqueBasil Bourque
109k26375538
109k26375538
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
It's OK, selecttoString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.
– user10639668
Nov 17 '18 at 19:43
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking theSettings
button. I had not realized there was more going on there than a simple pick-list.
– Basil Bourque
Nov 17 '18 at 20:12
add a comment |
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
It's OK, selecttoString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.
– user10639668
Nov 17 '18 at 19:43
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking theSettings
button. I had not realized there was more going on there than a simple pick-list.
– Basil Bourque
Nov 17 '18 at 20:12
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
It's OK, select
toString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.– user10639668
Nov 17 '18 at 19:43
It's OK, select
toString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.– user10639668
Nov 17 '18 at 19:43
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking the
Settings
button. I had not realized there was more going on there than a simple pick-list.– Basil Bourque
Nov 17 '18 at 20:12
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking the
Settings
button. I had not realized there was more going on there than a simple pick-list.– Basil Bourque
Nov 17 '18 at 20:12
add a comment |
1 Answer
1
active
oldest
votes
Go to Code -> Generate and select toString()
from the contextual menu:
Next, click the Settings
button in upper corner.
In the toString() Generation Settings
window that appears, select Templates
tab.
Add template:
Finally, add the Velocity code then click apply:
I do not see any of this when choosingCode
>Generate
. See my screenshot added to my Question.
– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53353806%2fmodify-template-used-in-generating-tostring-method-in-java-code-editor-in-inte%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Go to Code -> Generate and select toString()
from the contextual menu:
Next, click the Settings
button in upper corner.
In the toString() Generation Settings
window that appears, select Templates
tab.
Add template:
Finally, add the Velocity code then click apply:
I do not see any of this when choosingCode
>Generate
. See my screenshot added to my Question.
– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
add a comment |
Go to Code -> Generate and select toString()
from the contextual menu:
Next, click the Settings
button in upper corner.
In the toString() Generation Settings
window that appears, select Templates
tab.
Add template:
Finally, add the Velocity code then click apply:
I do not see any of this when choosingCode
>Generate
. See my screenshot added to my Question.
– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
add a comment |
Go to Code -> Generate and select toString()
from the contextual menu:
Next, click the Settings
button in upper corner.
In the toString() Generation Settings
window that appears, select Templates
tab.
Add template:
Finally, add the Velocity code then click apply:
Go to Code -> Generate and select toString()
from the contextual menu:
Next, click the Settings
button in upper corner.
In the toString() Generation Settings
window that appears, select Templates
tab.
Add template:
Finally, add the Velocity code then click apply:
edited Nov 17 '18 at 20:10
Basil Bourque
109k26375538
109k26375538
answered Nov 17 '18 at 17:55
user10639668
I do not see any of this when choosingCode
>Generate
. See my screenshot added to my Question.
– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
add a comment |
I do not see any of this when choosingCode
>Generate
. See my screenshot added to my Question.
– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
I do not see any of this when choosing
Code
> Generate
. See my screenshot added to my Question.– Basil Bourque
Nov 17 '18 at 19:06
I do not see any of this when choosing
Code
> Generate
. See my screenshot added to my Question.– Basil Bourque
Nov 17 '18 at 19:06
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
@BasilBourque See my updated answer.
– user10639668
Nov 17 '18 at 19:48
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53353806%2fmodify-template-used-in-generating-tostring-method-in-java-code-editor-in-inte%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
hmmm… 2 favorites, but 0 upvotes on this Question. Stack Overflow moves in mysterious ways.
– Basil Bourque
Nov 17 '18 at 19:07
It's OK, select
toString()
from the contextual menu. ... now you have one upvote. My only concern: I'm having the Ultimate edition and I'm not sure this feature is available for Community edition.– user10639668
Nov 17 '18 at 19:43
@EugenCovaci Well, d'uh! I see now. Thank you. I did not think about clicking the
Settings
button. I had not realized there was more going on there than a simple pick-list.– Basil Bourque
Nov 17 '18 at 20:12