Style
- Download (right-click Save link as...) the CS200 Java Style XML file: CS200Style.xml which is based on Google Style.
- In Eclipse, open Windows > Preferences
- In the Preferences window, go to Java > Code Style > Formatter, Click on Import
- Select the CS200Style.xml that you downloaded in Step A and make sure it is the Active profile as shown and Apply and Close.
- If the following warning message pops up, that is fine. Just click OK.
- Open the Preferences dialog window again and go to General > Editors > Text Editors to see settings such as the following:
- Click Apply and Close.
File Encoding
- Now, go to Window > Preferences > General > Workspace, set "Text file encoding" to "Other: UTF-8". UTF-8 is the standard text file encoding used worldwide.
File Header Comment
- In the Quick Access box at the top right of Eclipse, type "code templates"
- Select "Code Templates - Java/Code Style"
- Select "Comments," "Files," then press "Edit..."
- Copy and paste the TOP OF FILE COMMENT BLOCK into the box
- Hit OK, then Apply and Close
- When you create a new class, just check "Generate comments" for the block to be added.
///////////////////////// TOP OF FILE COMMENT BLOCK //////////////////////////// // // Title: descriptive title of the program making use of this file // Course: course number, term, and year // // Author: your name // Email: your @wisc.edu email address // Lecturer's Name: name of your lecturer // ///////////////////////////////// CITATIONS //////////////////////////////////// // // https://pages.cs.wisc.edu/~mppowers/cs200/#academicintegrity // Source or Recipient; Description // Examples: // Jane Doe; helped me with for loop in reverse method // https://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html; // counting for loop // John Doe; I helped with switch statement in main method. // /////////////////////////////// 80 COLUMNS WIDE ////////////////////////////////
Dark Theme?
If you prefer Eclipse to have a dark theme, open the Preferences dialog window again and go to General > Appearance to select a theme.