Eclipse Workbench Tidbits

Table of contents

.Xdefaults for Eclipse on Solaris

Make your favorite Workbench look nice on your favorite platform.

This file contains fonts information, background-colors and more. I use this for Eclipse 2.1 on Solaris 8 Sparc (Gnome and CDE).

It makes using Eclipse / Motif a bit less annoying :-). Note that as of today (date below), there are no solaris-gtk versions of Eclipse 2.1 and Eclipse 3.0.

Apply with

$ rdbm ~/.Xdefaults

and restart Eclipse.

The built-in CVS client of the Eclipse SDK

This is about CVS in conjunction with Eclipse 2.1. Info about CVS' update output is in the CVS section.

General

Always update before committing, doesn't matter which tool you use!

Crank up CVS' verbosity level (Window / Preferences / Team).

Turn on CVS Label decorations to show CVS info in Resource perspective / Navigator and Java perspective / Package explorer: Windows / Preferences; Workbench -> Label decorations; CVS. You can adjust them in Team -> CVS -> Label decorations.

Local help system: search for term "cvs merged" or read the eclipse team cvs 2.1 faq.

Using a CVSNT server

Eclipse doesn't like CVSNT's repository prefix feature and might complain. Synchronization might not work when you use it; switch this off (checkbox on CVSNT's settings tab "repositories"), then change your CVS repository paths in all tools:

This does not work for Eclipse 2.1 on Solaris. Eclipse will not accept the CVS path.

CVS perspective, synchronize view

This one has two modes ("filters"): incoming (from repository) and outgoing (to repository). It will always show conflicts, independent from filter.

Kick it up via the context menu: Team / Synchronize with Repository....

Resolving conflicts

  1. Get version from repo -> throw away your work
  2. Commit your changes -> throw away so. else's work. You should know what you are doing.
  3. Merge manually: synchronize view, comparison editor (hint: Double-click editor title to maximize within workbench)
  4. Merge automatically: like CVS update, given that there are no conflicts within a single line.
3. Merge manually

Comparison editor has those "next / prev conflict" buttons -> cycle through and decide for each conflict to accept, reject or merge. Alt: copy the whole version from CVS over your local file.

Subsequently, save the file. Your local file will be overwritten with the merged version.

Then choose Mark as Merged from the context menu; this will mark the file as an outgoing change instead of a conflict. Now commit.

4. Merge automatically

In Java perspective / package explorer or Resource perspective / navigator pick Team / Update. This has the same semantics as a cvs update - that is, CVS will fetch the repository's contents and will try to merge automatically (given that you're working on text).

This definitely won't work when there are differences within a line. In this case, CVS will mark the location in the file - but in either case, read other coder's commit messages and carefully check your files before commiting.

Eclipse CVS version tree plugin

Jan and André built an Eclipse plugin which shows your CVS revisions and branches. Check it out at

Random Hints

Don't share Classpath / Libs data

Put your .classpath file in the .cvsignore list (Resource view / navigator) now unless

  1. other developers work with identical paths
  2. reasonable (local) variables are used (Window -> Preferences -> Java -> Classpath Variables)

Java project vs. Simple project

In Java development, be sure to choose "Checkout As..." instead of "Checkout As Project". If you don't, you will have to edit the .project file to make Eclipse thinking of it as a Java project (take the natures and build stuff from another Java project's .project file, then refresh).

Remove / Restore

Remove a file as you would with other CVS clients: delete the file, then commit (or sync) a parent.

Removed files can be restored from the context menu of the project: Team / Restore from Repository....

The CVS plugin in Eclipse has an option to prune empty directories (they won't show up anymore).

Global ".cvsignore"

There is a feature to give name patterns to the Team plugins. If those match the file will be ignored (Window -> Preferences -> Team -> Ignored Resources).

Multiple monitors and Eclipse 2.1

The pseudo-SDI-design of the Eclipse workbench makes multi-screen environments less useful. But there are two things to note:

Moving on

In this regard, 3.0 is much nicer: at least in the Windows environment, one can drag views out of the Eclipse main window to the other screen. The focus handling of those "palette-style" views outside the page is a bit strange, but all in all it works great.

Using 2560x1024

Making use of a multi-screen solution (2560x1024) with Eclipse 3.0 release

One of the greatest features of 3.0. Thank you, Eclipse.org!