I have registered a Copyright profile in preferences and set it as the default. I also have a scope registered for that profile set to "All". I can add it to a file by doing "cmd+N (generate) -> Copyright".
I don't want to have to do this manually for every new class I create. how can I have this automatically added to all new classes from now on?
Press Ctrl+Alt+S to open the IDE settings and select Editor | Copyright. From the Default project copyright list, select the profile you want to use as the default profile. Apply the changes and close the dialog. After that you can add the copyright to the necessary files.
Add a new commentType /** before a declaration and press Enter . The IDE auto-completes the doc comment for you. For information on how to disable this feature, refer to Disable automatic comments.
Go to Settings -> Editor -> Live Templates , click the Plus Icon Button (on the right). In the "Abbreviation" field, enter the string that should activate the template (e.g. @a ), and in the "Template Text" area enter the string to complete (e.g. @author - My Name ).
You have to set the Default Project Copyright for your project.
Go to File | Settings | Editor | Copyright
, after you have made a new Copyright Profile
, you must select it from the drop-down list as the Default project copyright
.
You have to set this for every project, but once it is set, it should automatically be inserted at the top of every new file created in that project.
Copyright is not added automatically to the new files, you can use the Update Copyright action on the project root node in the Project View to add/update it for all the files at once or you can enable Update Copyright option in the Commit Project
dialog to be sure that files shared via VCS always have the most recent copyright.
UPDATE: I've verified that copyright is added automatically for me, however it may be hard to notice that it was actually added as by default it appears at the very top of the file and is collapsed, editor also doesn't scroll to the top and remains where it was. If you scroll editor up and unfold the top comment, you should be able to see the automatically added copyright. You can also change the Location in files setting per file type to see that it's added when the new file is created.
Here is the screencast showing that it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With