Welcome to the Joint-Venture Blog from Fabio Cortesi and Stefan Jäger.
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.
Today I’m going to show you two other important shortcuts. Both shortcuts are useful inside a class and offers an inline search.
CTRL + T (t for type), which shows the type hierarchy:

CTRL + O (o for outline), which shows all members:

Sometimes, it’s very useful to watch the source code of a class file. But for this comfort, it’s necessary to download the source files and attach them in Eclipse. With the most important libraries, it make sense to spend time with downloading sources. But not with all rarely used libraries. A simple solution is the use of JadClipse. JadClipse decompiles class files with the help of the Jad Decompiler on the fly. There is no need for any source any more (of course, there are the usual limitations with decompilation).
Just download it and install it like described on the homepage (you also need to download the Jad Decompiler executable from the Jad website).
If you want to learn some shortcuts for a program, the best way is to do this step by step. Also in Eclipse. Today I will show you two important shortcuts, which are useful in very large projects:
use CTRL + SHIFT + T (T like Type) to search a class, interface, and so on. This search supports CamelCase. If a class is called ThisIsMyTestClass, typing of the capital letters also finds this class (just type TIMTC). 
use CTRL + SHIFT + R (R like Resource) to search a ANT build file, text files, ore something like that: 
Ever wondered, how you can force a team to use same code style and same code convention?
If you use Eclipse, there is a simple solution. Just install these two plug-ins und the live will be easier
- Checkstyle
Used to check the layout of the code. Do all methods have it’s Javadoc? Has the file the company header? Can be easily used in Eclipse and with Ant.
enable Checkstyle on a project:
run Checkstyle (could also be done by ANT):
check out the warnings on the left border:
- FormatOnSave
Eclipse plug-in, which formats the code on every save. Simply install this plug-in on the Eclipse installation of every team member and the code is now always in correct format. Just don’t forget to define the right format template on each installation.

OI = Organize Imports (on save)
SM = Sort Members (on save)
CI = Correct Identation (on save)
F = Format (on save)
« Newer Posts



