Difference between revisions of "Team1/Evaluating snippets"
(Created page with ''''14. Evaluating Snippets''' 1. We will use the Java Scrapbook to experiment with code fragments before putting them in your program. 2. In the File menu select, '''New -> …') |
|||
Line 1: | Line 1: | ||
− | + | === 14. Evaluating Snippets === | |
− | 1. We will use the Java Scrapbook to experiment with code fragments before putting them in your program. | + | 14.1. We will use the Java Scrapbook to experiment with code fragments before putting them in your program. |
− | 2. In the File menu select, '''New -> Other -> Java -> Java Run/Debug -> Scrapbook Page''' | + | 14.2. In the File menu select, '''New -> Other -> Java -> Java Run/Debug -> Scrapbook Page''' |
− | [[Image:Lab1_14.jpg| | + | [[Image:Lab1_14.jpg|300px ]] |
− | 3. In the "Enter or select the folder" field, browse below to select the JUnit project directory. | + | 14.3. In the "Enter or select the folder" field, browse below to select the JUnit project directory. |
− | 4. In the "File name" field, type a name for your scrapbook. | + | 14.4. In the "File name" field, type a name for your scrapbook. |
− | 5. Click "Finish" when you are done. | + | 14.5. Click "Finish" when you are done. |
− | 6. In this editor you may enter your code snippet (in this example, System.getProperties()). | + | 14.6. In this editor you may enter your code snippet (in this example, System.getProperties()). |
− | 7. You can see the result of your snippet by selecting the line and selecting "Display" from the context menu. | + | 14.7. You can see the result of your snippet by selecting the line and selecting "Display" from the context menu. |
− | [[Image:Lab1_14_1.jpg| | + | [[Image:Lab1_14_1.jpg|500px ]] |
− | 8. After the evaluation completes, the result is highlighted in the scrapbook page. | + | 14.8. After the evaluation completes, the result is highlighted in the scrapbook page. |
− | 9. You can inspect the result by selecting text and choosing "Inspect" from the context menu. | + | 14.9. You can inspect the result by selecting text and choosing "Inspect" from the context menu. |
− | 10. When you are done, you can save your changes to keep the snippet for future use. | + | 14.10. When you are done, you can save your changes to keep the snippet for future use. |
Latest revision as of 08:08, 1 February 2011
14. Evaluating Snippets
14.1. We will use the Java Scrapbook to experiment with code fragments before putting them in your program.
14.2. In the File menu select, New -> Other -> Java -> Java Run/Debug -> Scrapbook Page
14.3. In the "Enter or select the folder" field, browse below to select the JUnit project directory.
14.4. In the "File name" field, type a name for your scrapbook.
14.5. Click "Finish" when you are done.
14.6. In this editor you may enter your code snippet (in this example, System.getProperties()).
14.7. You can see the result of your snippet by selecting the line and selecting "Display" from the context menu.
14.8. After the evaluation completes, the result is highlighted in the scrapbook page.
14.9. You can inspect the result by selecting text and choosing "Inspect" from the context menu.
14.10. When you are done, you can save your changes to keep the snippet for future use.