Archive for March, 2010

Eclipse e4 EclipseCon tutorial – Slides are online

Tuesday, March 30th, 2010

On behalf of Tom Schindl and Kai Toedter I uploaded the Eclipse e4 tutorial slides.

Eclipse e4 Tutorial – EclipseCon 2010
View more presentations from LarsVogel.
 

The Ghost in the shell – Transparency

Tuesday, March 16th, 2010

I recently re-read the post Creating a Notification Popup Widget from Emil Crumhorn.

Using the alpha functionality you can get a nice effects, e.g. a ghost shell. For example put the following into your View code into the method createPartControl() in the “RCP with a view” example. See Eclipse RCP Tutorial for details on RCP development.

	Shell shell = PlatformUI.getWorkbench()
		.getActiveWorkbenchWindow().getShell();
		int cur = shell.getAlpha();
		cur -= 150;
		System.out.println(cur);
		shell.setAlpha(cur);

And you get the following result:

Of course this is not very practical but you can use this to have a nice fade out effect of your RCP application. To get this put the following two methods into the class “ApplicationWorkbenchWindowAdvisor “.


	@Override
	public void postWindowClose() {
		Shell shell = PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getShell();
		while (shell.getAlpha() > 0) {
			int alphaValue = shell.getAlpha() - 8;
			int newAlpha = alphaValue > 0 ? alphaValue : 0;
			shell.setAlpha(newAlpha);
                        // Consider evil ;-)  non-alpha systems
			if (shell.getAlpha()== 255){
				break;
			}
			wait(50);
			shell.update();

		}
		super.postWindowClose();
	}

	public static void wait(int n) {
		long t0, t1;
		t0 = System.currentTimeMillis();
		do {
			t1 = System.currentTimeMillis();
		} while (t1 - t0 < n);
	}

I tried to demonstrate via a small video this but unfortunately my screencast does not show the fade out effect. Therefore you have to try it yourself; it looks really nice.

 

Going plugin (from an OSGi bundle)

Friday, March 12th, 2010

The Eclipse plugin creation wizard allows to create OSGi bundles or Eclipse plugins.

The most notable difference is that the PDE plugin editor does not show the extension tab.

I recently wanted to use an plugin extension in a project which I initially created based on OSGi; therefore I wanted to enable the “Extension” and the “Extension Point” tab in the PDE editor.

To do this remove the line “pluginProject.extensions.false” from the file .settings/org.eclipse.pde.core.prefs. Re-open the “MANIFEST.MF” and the Extensions tab will show.

Many thanks to Neil Bartlett for sharing this tip via twitter.

 

One of a kind – Generating UUID with EMF

Thursday, March 11th, 2010

Eclipse EMF provides the functionality to create universally unique identifier as described in A Universally Unique IDentifier (UUID) URN Namespace

To use this functionality just add a dependency to “org.eclipse.emf.ecore” to your plugin and you can start using it.

package de.vogella.emf.uuid;

import org.eclipse.emf.ecore.util.EcoreUtil;

public class MakeUniqueIds {
	public static void main(String[] args) {
		for (int i=0; i<100; i++){
			System.out.println(EcoreUtil.generateUUID());
		}
	}
}

For example you may get “_Fj9QPC0XEd-zxLXA4jfyXA” as a result.

Eclipse e4 is currently using this functionality to generated unique model Id's. The responsible class for this is "org.eclipse.e4.workbench.ui.internal.E4XMIResource".

Thanks to Remy Suen for providing this info on the e4 mailing list.

 

Eclipse e4 New look and feel – A round the tab world

Wednesday, March 10th, 2010

Eclipse e4 M4 has introduce a new look and feel for the tabs in the workbench. See Eclipse e4 M4 New and Noteworthy. Unfortunately the news and noteworthy document did not give information how to enable this feature.

The e4 mailing list has recently discussed this topic and Remy Suen was kind enough to provide this information. To turn this feature on you have to add the tag “newtablook” to your PartStack.

For example if you create an new e4 application with the e4 wizard you can add this tag via:


<children xsi:type="application:PartSashContainer" xmi:id="_vTa8kiuFEd-PeMLywHTM-g" id="_vTa8kiuFEd-PeMLywHTM-g">
  <children xsi:type="application:PartStack" xmi:id="_vTa8kyuFEd-PeMLywHTM-g" id="_vTa8kyuFEd-PeMLywHTM-g">
     <tags>newtablook</tags>
   <children xsi:type="application:Part" xmi:id="_vTa8lCuFEd-PeMLywHTM-g" id="_vTa8lCuFEd-PeMLywHTM-g" label="Main"/>
</children>

This lead to the following result:

Compared to the “old” look and feel.

For this topic see also Bug 305147 which discusses to move this feature to the CSS styling capabilities.

 

10 golden rules of asking questions in the OpenSource community

Tuesday, March 9th, 2010

Based on my tutorial website I frequently receive questions from users. Some are very nice, precise, encouraging and some are of perceived bad quality. I also ask lot of questions in the Eclipse community and I try to ask good questions. Of course I frequently fail to ask good questions ;-) but at least I try.

So what makes a question, a good or even an excellent question?

I personally believe the following rules are a good guideline:

10 Golden Rules

  1. Don’t be rude
  2. Try to be as precise and as short as possible
  3. Do your homework before asking (Google, search newgroups, read tutorials,…)
  4. Try to ask one question at the time
  5. Proof-read your question after writing it
  6. Don’t expect others to do your work
  7. Avoid private email if other channels exists
  8. Remind yourself that people help you voluntarily
  9. Read and follow up on suggestions
  10. If you get a solution let others know

What do you think? Did I miss an important point?

For a detailed discussion of how to ask good questions see How to ask smart questions.

 

Slideware – Finding pretty pictures and images for presentations

Monday, March 8th, 2010

Since recently I try to deliver presentation with more visual effects based on the Presentation Zen approach. Of course one of the problems is to find nice pictures.

I’m aware of the following sites:

Thanks to Florian Heidenreich for pointing stock.xchng out to me in Twittter.

If you select images from these sites make sure to check the usage license, some may require permission from the author, others may ask you to give credit to the author, etc. Also make sure to give the author credit for his work in any case. A common approach to give credit to the author is to add a slide to the presentation which lists the URL of the pictures.

I personally really liked stock.xchng; it made it easy to find beautiful pictures which have a very permissive licenses. My first impression from Flickr was not as amazing; there are simple to many pictures to select from. Peter Friese pointed out a program ViewFinder for the Mac but I have not yet tried that.

The major pay site with beautiful artwork is istockphoto. Really great images but you have to pay for them.

If you know other web sites for nice pictures please let me know. Or perhaps you want to share your tricks how to select good images at Flickr.

 

The problem is choice – My focus topics for the remainder of 2010

Tuesday, March 2nd, 2010

There are lots and lots of exciting technologies available. Programming languages like Scala, Groovy, JavaFX, C# and frameworks as Spring, Grails, Lift, and lots more. Even within one area, for example the Eclipse framework, there are a legion of frameworks and projects which allow make things easier.

In my blog entry Predictable Irrational I discussed already that people have a tendency to leave too many options open. Having too many options open can be harmful as it prevents someone from putting focus into something. Unfortunately I’m not an exception to that tendency.

I decided that I should select 5 things for 2010 which I would like to have place a focus upon. This doesn’t mean that I won’t do anything else but I would like to define certain focus topics which I would like to gain knowledge about.

Ok and here is the list:

—————————–
Eclipse with focus on Eclipse e4
Hadoop / MapReduce
Google App Engine
GWT
Android
—————————–

Even though these are still big areas it is less then what I’m currently have on my list of things.

So why did I selected these topics?

Android is a fun platform and has a amazing programming interface which is intuitive, easy to use and fun. GWT is just to good to be ignored and the GAE provides such an easy mechanisms to host web application that I have to continue to use it.

Hadoop and distributed computing are clearly the future for the most interesting problem solving approaches. Hadoop might also provide a solution of the the usage of multi-core machines.

Eclipse, Eclipse e4 and the whole Eclipse community is very deeply implanted in my heard therefore I have to stay in this area. In addition I’m still highly influenced by the book “Pragmatic programmer” and I still believe that the advice “Know your tools well” is one of the best advices I have ever heard.

Which technologies do you think will be most relevant for you in this year?