Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Workbench User Guide
Previous Page Home Next Page

Using the New button

We have seen how to create resources using File > New and New 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 New button.

  1. Select the folder JanesFolder in one of the navigation views.

  2. In the Workbench window's toolbar, activate the drop-down menu on the New Wizard button New Wizard Button and select File. To activate the drop-down menu simply click on the down arrow.

    New Wizard Pulldown

  3. In the New File wizard, your folder's name and path already appear by default in the Enter or select the parent folder 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.

  4. In the File name 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").

  5. Click Finish when you are done.

  6. The Workbench has an editor capable of editing text files. A text editor is automatically opened on the newly created file.

  7. In the text editor, type in the following five lines:

    This is a sample text file.
    There is not much else
    we can really say about it other
    than it has five lines of
    text that are rather dull.

    Notice that the editor tab has an asterisk (*) at the left of the filename. The asterisk indicates that the editor has unsaved changes.

    Editor Unsaved Changes

  8. In the Workbench window's toolbar, click the Save button Save Button to save your work.

  9. In one of the navigation views ensure your folder is still selected and the navigation view is active.

  10. Click New Wizard 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 File > New > Other...

  11. In the New wizard, select General > File. Then click Next.

  12. Once again, your folder's name and path appears by default in the Enter or select the parent folder field. 

  13. In the File name 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. 

  14. 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.

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).

Eclipse Workbench

Click the new JanesFile2.txt editor tab. Now select the file JanesINIFile.ini in one of the navigation views. Then select the Link with Editor Link with Editor button in the local toolbar or view menu Link with Editor of 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 Link with Editor.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire