Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
student:jgrasp:help [2018/08/10 13:50] – created bernstdhstudent:jgrasp:help [2021/11/28 16:41] (current) bernstdh
Line 35: Line 35:
  
   - Select the text you want to change.   - Select the text you want to change.
-  - Click on <key>Edit</key>+<key>Spaces/Tabs</key>         and then <key>Tabify</key> or <key>Untabify</key>.+  - Click on <key>Edit</key>+<key>Spaces/Tabs</key> and then <key>Tabify</key> or <key>Untabify</key>.
  
-==== Using checkstyle ====+ 
 +==== Setting the End of Line Character ==== 
 + 
 +Linux/Unix, MS-Windows, and OS X all use slightly different characters to indicate the end of a line and this can cause problems with some tools. As a general rule, it is safest to use the Linux/Unix standard. 
 + 
 +You can instruct jGRASP to use the Unix format when you save a file by clicking on <key>File</key>+<key>Save as</key> and then selecting "Binary/Unix" under "Format"
 + 
 + 
 +==== Cleaning-Up Indenting ==== 
 + 
 + 
 +jGRASP does not have a command that re-indents code, but you can trick it into doing so. 
 + 
 + 
 +  - Click on  <key>View</key>+<key>Generate CSD</key> (or the {{student:jgrasp:jgrasp-viewcsd.png}} button). 
 +  - Click on  <key>View</key>+<key>Remove CSD</key> (or the {{student:jgrasp:jgrasp-removecsd.png}} button). 
 + 
 + 
 +==== Using Checkstyle ====
  
  
Line 50: Line 68:
  
  
 +=== Setting the checkstyle binary ("JAR file") ===
 +  - Download an appropriate checkstyle jar file, either provided by your instructor or from [[https://github.com/checkstyle/checkstyle/releases/download/checkstyle-8.45.1/checkstyle-8.45.1-all.jar|this link to 8.45]].
 +    * Right-click and choose "Save Link As...'
 +    * put this somewhere on the computer that you won't accidentally delete it before you're done with it.
 +  - In jGRASP, click on <key>Tools</key>, pull down     to <key>Checkstyle</key> and across     to <key>Settings</key>. For the field labeled "Checkstyle Home or Jar" , click <key>Browse</key>, navigate to the ''%%.xml%%'' file. Then, click on <key>OK</key>.
 === Running Checkstyle === === Running Checkstyle ===
  
Line 56: Line 79:
  
  
-==== Cleaning-Up Indenting ====+=== Correcting "File does not end with a newline" Defects ===
  
 +Most styleguides require that files end in a newline character. So, it is important to use the Linux/Unix [[ #Setting the End of Line Character | end of line character. ]]
  
-jGRASP does not have a command that re-indents code, but you can trick it into doing so. 
  
- 
-  - Click on  <key>View</key>+<key>Generate CSD</key> (or the {{student:jgrasp:jgrasp-viewcsd.png}} button). 
-  - Click on  <key>View</key>+<key>Remove CSD</key> (or the {{student:jgrasp:jgrasp-removecsd.png}} button). 
  
 ==== Using JUnit with jGRASP ==== ==== Using JUnit with jGRASP ====
Line 76: Line 96:
  
 If you have properly configured jGRASP, the "Create JUnit test file"  button, {{jgrasp-CreateJUnitTestFile.png}}, will appear  whenever you open a ''%%.java%%'' file. If you have properly configured jGRASP, the "Create JUnit test file"  button, {{jgrasp-CreateJUnitTestFile.png}}, will appear  whenever you open a ''%%.java%%'' file.
 +
 +
 +== Classpath ==
  
 Though it's not absolutely necessary (depending on how you create  your test classes), you should also add  ''%%junit.jar%%'' to the CLASSPATH for your workspace. To do  so, click on <key>Settings</key>-<key>PATH/CLASSPATH</key>  -<key>Workspace</key> and select the CLASSPATHS tab. Then, click on  <key>New</key> and add ''%%junit.jar%%''. Though it's not absolutely necessary (depending on how you create  your test classes), you should also add  ''%%junit.jar%%'' to the CLASSPATH for your workspace. To do  so, click on <key>Settings</key>-<key>PATH/CLASSPATH</key>  -<key>Workspace</key> and select the CLASSPATHS tab. Then, click on  <key>New</key> and add ''%%junit.jar%%''.
Line 86: Line 109:
  
  
-Unless you understand what it is doint, you should probably delete  all of the code that jGrasp inserts into this class and start from  scratch.+Unless you understand what it is doing, you should probably delete  all of the code that jGrasp inserts into this class and start from  scratch.