RSS

Search Engine

Wednesday, June 2, 2010

More Tips

7.1. Problems view

The problems view displays problems in your projects. You can open it via Windows -> Show View -> Problems

You can configure the problems view, e.g. if you only want to display the problems from the current selected project, select "Configure Contents".

7.2. Important Preference Settings

Eclipse allows to set semicolons (and other elements) automatically.

Eclipse allows to format the source code and to organize the imports at save.

Tip

You can export your Preferences settings from one workspace via File -> Export -> General -> Preferences. Similar you can import them again into your workspace.

7.3. Task Management

If you use // TODO in the coding this indicates a task for eclipse and you find it in the task view of Eclipse.

For more advanced tasks you can use Eclipse Mylyn Tutorial .

7.4. Working Sets

A common problem in Eclipse is that your data in your workspace grows and therefore your workspace is not well structured anymore. You can use working sets to organize your displayed projects / data. To setup your working set select in the Package Explorer -> Show -> Working Sets.

Press new on the following dialog to create a working set.

On the following dialog select java, select the source folder you would like to see and give it a name. You can now easily display only the files you want to see.

7.5. Synchronize package explorer with code display

The package explorer allows to display the associated file from the current selected editor. Example: if you working on foo.java and you change in the editor to bar.java then the display in the package explorer will change.

To activate this press "Link with Editor".

7.6. Code Templates

If you have to type frequently the same code / part of the document you can maintain templates which can be activate via autocomplete (Ctrl + Space).

For example lets assume you are frequently creating "public void name(){}" methods. You could define a template which creates the method body for you.

To create a template for this select the menu Window->Preferences and Open Java -> Editor -> Templates

Press New. Create the following template. ${cursor} indicates that the cursor should be placed at this position after applying the template.

This this example the name "npm" is your keyword.

Now every time you type the keyword in the Java editor and press Ctrl+Space the system will replace your text with your template.

0 comments:

Post a Comment