Eclipse Papercut #2 – Changing Eclipse subversive default behavior

Update: Igor Burilo (Eclipse Subversive developer) was kind enough to accept a modified version of patch developed in this episode. While I’m very happy about this, this unfortunately renders this example irrelevant . You still might want to read this to see how to checkout code from the Eclipse version control system.

In this second part of my 7 Paper Cuts in Eclipse I want to change some standard Eclipse code.

This second papercut is a bit more complex as the first papercut; I’m planning to return to simpler examples in the next papercut.

So lets define the papercut:

I frequently create example projects which I share in a svn repository. For related projects I use the mulitproject layout. The standard in subversion is “Simple Mode – One project for one repository”. Therefore everytime I share a project I have to switch in the subversion dialog from “Simple Mode” to “Advanced Mode”.


Nothing big? I agree, hence the perfect example for a papercut.

To change the coding of this dialog we need to find the class which is responsible to display this page. Plug-in Spy make this easy via Alt + Shift + F1.


Now you need to download the source code of the plug-in ””. This plug-in is stored in svn and can get access via subversion itself. The URL for the subversion repository view is: “”. See here to learn how to use svn and cvs to access the Eclipse code

Add this repository in the “SVN Repository” view and check-out (download) the plug-ins ”” and “”. You find them in “trunk”.


Looking at the coding of changing the selection only requires a few lines to be changed.

I use Eclipse Preferences to remember the last user selection.

protected SelectProjectNamePageSimpleModeComposite simpleModeComposite;
	protected ShareProjectNameAdvancedModeComposite advancedModeComposite;
	private static String SELECTION_MODE = "isSimpleMode";
	public SelectProjectNamePage() {
			"",  //$NON-NLS-1$
			SVNTeamUIPlugin.instance().getImageDescriptor("icons/wizards/newconnect.gif")); //$NON-NLS-1$
		Preferences preferences = new ConfigurationScope()
		Preferences preference = preferences.node("note1");
		this.isSimpleMode = preference.getBoolean(SELECTION_MODE, true);;				

and I have to change a few more lines to use isSimpleMode everywhere:

this.advancedModeRadionButton.setSelection(!this.isSimpleMode); // Either or

And I have to set the preference in the ModeListener

	protected class ModeListener extends SelectionAdapter {
		public void widgetSelected(SelectionEvent e) {
			//change controls area mode
			Button modeButton = (Button) e.widget;
			if (SelectProjectNamePage.this.simpleModeRadionButton == modeButton && SelectProjectNamePage.this.isSimpleMode == false) {
				SelectProjectNamePage.this.isSimpleMode = true;
				preference.putBoolean(SELECTION_MODE, true);
			} else if (SelectProjectNamePage.this.advancedModeRadionButton == modeButton && SelectProjectNamePage.this.isSimpleMode == true) {
				SelectProjectNamePage.this.isSimpleMode = false;
				preference.putBoolean(SELECTION_MODE, false);

The full source code is attached.


If you now export these two plug-ins into your runnig Eclipse, this dialog will remember the last selection (Simple vrs. Advanced).

As I hope this behavior is useful to others I created a bug report (with a patch). See Bug . I hope the subversion programmers will consider this patch (or an improved version of it).

Remember sharing is good. Open Source does not only allow you to solve your issues but it makes it easy to contribute back.

See Eclipse Papercuts to get all posts in this series.

About Lars Vogel

Lars Vogel is the founder and CEO of the vogella GmbH and works as Eclipse and Android consultant, trainer and book author. He is a regular speaker at international conferences, He is the primary author of With more than one million visitors per month this website is one of the central sources for Java, Eclipse and Android programming information.
This entry was posted in Eclipse, Papercut and tagged , , , , . Bookmark the permalink.

2 Responses to Eclipse Papercut #2 – Changing Eclipse subversive default behavior

  1. Jörg Thönnes says:

    Hello Lars,

    just picked this up from the Eclipse Subversive newsgroup.
    Great idea to share that! I am intending to provide some feature to Subversive some day…
    so this would be a good start.

    Thanks, Jörg

  2. vogella says:

    Hallo Jörg,

    I glad that this is helpful. Cheers, Lars

Comments are closed.