| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <title>Using the New button</title> |
| |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <h3> |
| Using the New button</h3> |
| <P CLASS="Para">We have seen how to create resources using <b>File > New</b> |
| and <b>New</b> from the context menu of one of the navigation views. We will |
| now create a file for our project using the third alternative, the toolbar <b>New</b> |
| button.</P> |
| <ol> |
| <li> |
| <P CLASS="Para">Select the folder JanesFolder in one of the navigation views.</P> |
| </li> |
| <li> |
| <P CLASS="Para">In the Workbench window's toolbar, activate the drop-down |
| menu on the New Wizard button <img src="../images/Image15_new_button.png" alt="New Wizard Button" border="0"> |
| and select <b>File</b>. To activate the drop-down menu simply click on the |
| down arrow.</P> |
| <P CLASS="Para"> <img src="../images/Image16_new_pulldown.png" alt="New Wizard Pulldown" border="0"></P> |
| </li> |
| <li> |
| <P CLASS="Para"> In the New File wizard, your folder's name and path already |
| appear by default in the <b> Enter or select the parent folder </b> field. |
| This is because you chose to create the new file while this folder was selected |
| in one of the navigation views and the view was active.</P> |
| </li> |
| <li> |
| <P CLASS="Para"> In the <b> File name</b> field, type a unique name for a |
| new text file, including the .txt file extension. Do not use spaces or special |
| characters in this file name (for example, "JanesFile.txt").</P> |
| </li> |
| <li> |
| <P CLASS="Para"> Click <b>Finish</b> when you are done.</P> |
| </li> |
| <li> |
| <P CLASS="Para"> The Workbench has an editor capable of editing text files. |
| A text editor is automatically opened on the newly created file.</P> |
| </li> |
| <li> |
| <P CLASS="Para"> In the text editor, type in the following five lines:</P> |
| <blockquote> |
| <P CLASS="Para"><i>This is a sample text file.<br> |
| There is not much else<br> |
| we can really say about it other<br> |
| than it has five lines of<br> |
| text that are rather dull.</i></P> |
| </blockquote> |
| <P CLASS="Para">Notice that the editor tab has an asterisk (*) at the left |
| of the filename. The asterisk indicates that the editor has unsaved changes.</P> |
| <blockquote> |
| <P CLASS="Para"><img src="../images/Image17b_unsaved_changes.png" alt="Editor Unsaved Changes" border="0"></P> |
| </blockquote> |
| </li> |
| <li> |
| <P CLASS="Para"> In the Workbench window's toolbar, click the Save button |
| <img src="../images/Image17_save_button.png" alt="Save Button" border="0"> |
| to save your work.</P> |
| </li> |
| <li> |
| <P CLASS="Para"> In one of the navigation views ensure your folder is still |
| selected and the navigation view is active.</P> |
| </li> |
| <li> |
| <P CLASS="Para"> Click <strong>New Wizard </strong>in the Workbench toolbar. |
| Previously we clicked on the drop-down arrow of the New button. Here we |
| clicked on the button itself which has the same effect as choosing <b>File |
| > New > Other...</b></P> |
| </li> |
| <li> |
| <P CLASS="Para"> In the New wizard, select <b>Simple</b> <strong>></strong> |
| <b>File</b>. Then click <b>Next</b>. </P> |
| </li> |
| <li> <P CLASS="Para"> Once again, your folder's name and path appears by default in the <b> Enter |
| or select the parent folder </b> field. </P></li> |
| <li> |
| <P CLASS="Para"> In the <b>File name</b> field, type a unique name for an |
| .ini file. Do not use any spaces or special characters in the file name |
| (for example, "JanesINIFile.ini"). Click Finish when you are done. </P> |
| </li> |
| <li> |
| <P CLASS="Para"> Since the Workbench does not have any editors registered |
| for .ini files, it may launch an external editor on the file if one is registered |
| with the operating system. For the moment, close the editor. </P> |
| </li> |
| </ol> |
| <P>Now that we have created our resources, one of the navigation views shows our two projects, |
| the folder and its two files. To the right of one of the navigation views is the text |
| editor open on the first file we created (JanesFile.txt). To proceed with the |
| following example create a second file (JanesFile2.txt). </P> |
| |
| |
| <P><img src="../images/Image18_created_resources.png" alt="Eclipse Workbench" border="0"> |
| </P> |
| |
| |
| <P>Click the new JanesFile2.txt editor tab. Now select the file JanesINIFile.ini |
| in one of the navigation views. Then select <b>Link with Editor</b> on one of |
| the navigation views. Lastly, click on the editor tab for JanesFile.txt. Notice |
| how the navigation view updated itself to select the file you are currently |
| editing (JanesFile.txt). If you don't like this automatic update you can easily |
| turn it off by deselecting <b>Link with Editor</b>.</P> |
| |
| |
| |
| |
| </BODY> |
| </HTML> |