Welcome to this Blog. I am Software Engineer and work for Zühlke Engineering AG in Bern. This is my private blog, in which I will post mainly about technical stuff like Software Engineering or IT related topics. The views expressed herein do not necessarily represent those of my employer.
If you double click on a tab in Eclipse, the tab get’s opened all over the window. Now, if there is a build process running in the console, the console is always popping up. This is a little bit annoying. But there is a simple trick to solve this situation. Just disable “Show Console When Standard Out Changes” and the console will not pop up again.
Everybody, who’s working with Eclipse is knows the Content Assistant (better known as Code Completion). Just press CTRL + Space, and every possible piece of code gets completed.
But did you know, that Eclipse is also capable of using templates. Templates can be defined in Window – Preferences – Java – Editor – Templates.
For example, instead of typing the main function every time manually, just type main and press CTRL + Space, choose the template main and press Enter. The whole main method is created.
Interesting default templates are:
sysout: creates a System.out.println() entry
runnable: creates a complete Runnable inner class
public_method: template for a public method (same with private, default, and so on)
Of course, you also can define your own template. E.g. for an EJB 3.0 stateless or message-driven bean!
If you are working with CVS in your projects, there is a nice feature in Eclipse to mark all changed files. Usually, changes to the source code are only marked in the Package Explorer with a “>”. If many files are changed in the project, it’s hard to find all the changes at a single glance (expect through the Team Synchronization view).
In Eclipse, you can choose the way, how changed files should appear in the Package Explorer. For example, I changed the background color to a bright yellow and the text color to blue:
To change the appearance of changed CVS file, just do following:
- Open Windows > Preferences…
- Team > CVS > Label Decorations
- Check the box “Enable font and color decorations”
- Now open General > Appearance > Colors and Fonts
- You can change now the appearance of the changed files in the category CVS.
If you work often with several workspaces, it would be helpful to have the name of the workspace in the title bar. In Eclipse, there is a simple trick to add the name to the title bar. Just start Eclipse with the option -showlocation.
Of course, it only make sense, if you use several workspaces. E.g. one for Java 1.5 projects and another for Java 1.4 projects. Just create a shortcut to Eclipse and define with the option -data the path to the workspace.
If you have a large project, it would be helpful to limit a search to a specific set of classes, e.g. all testclasses or all application sources. In Eclipse, there is the ability of defining working sets. A working set defines a set of classes or files. For example, I defined in my current project 3 working sets. One with all project sources, one with all test sources and one with all application sources. Now, if I use the search (CTRL + H) or the open dialogs of Types (CTRL+SHIFT+T) or Resources (CTRL+SHIFT+R), I can define, in which working set I want to find or open something.
« Newer Posts — Older Posts »


