Text Editor Tips and Tricks
Eclipse has many powerful features that can save developers a lot of time, compared to other text editors:
- Highlighting an Object in the editor and selecting “Open Declaration” (either by hitting F3 or using the right-click context menu) will open the Object’s script. This will even work with Objects in the mx... package structure.
- If you delete a file and want to get the file back, right click on the containing folder and select “Restore from Local History”. This will bring up a list of every save that you have ever made to the file. You can then restore the file from a date/time menu.
- For linking external resources (i.e. a third party classpath) to a project do the following: Go to Windows/ Preferences/General/Workspace/Linked Resources and add your external classpath and a classpath variable for it to the list. In your project create a new folder and in the new folder dialog give it a name, click the ‘advanced’ button and check ‘Link to folder in the file system’. Click the ‘Variables...’ button and choose the variable that you entered before in the Linked Resources prefs. In the project properties (right-click on your project/properties)under ‘ActionScript2 Project’ add the linked folder name to the list. After that it’s possible to open the external classes by highlighting their type names and pressing F3.
- A good tip for the search (control + h) box, especially if you’re just using Eclipse for Flash development: if you hit the “custom” button in the lower left hand corner, you can turn off all the searches but the File search. This way, it will always default to that when you open the search. I do Java development in Eclipse and I still only use the File search.
Templates Tips and Tricks
Eclipse Templates create a shortcut system to increase developer workflow. Templates can be customized to allow custom shortcuts and custom scripts. Templates work by typing key words (such as “constructor”) and hitting ctrl-enter to get a list of available shortcuts for that command word.
For an example of the power of Eclipse templates, complete the sequence below:
- type “for” and hit ctrl-enter (the eclipse shortcut to access the template system)
- Select “for-Iterator over an array”. A for loop structuer will be built and the caret will be moved to the iterator variable in the for loop.
- Type a name for ther iterator (ie: i).
- Hit tab.
- Now the caret is moved into the Array position. Type a name for the Array.
- Hit tab again. You will be moved to the end of the for loop.
Using Eclipse templates, a developer can quickly create shortcuts to accomplish repetitive coding tasks.
eclipse_tips_and_tricks.txt · Last modified: 2005/07/29 12:38