Twitter github

Random Eclipse Tip

I was clearing out my workspace this morning and noticed a sample plug-in left over from the Eclipse in Motion: Raleigh code camp. The question asked at the code camp was how to popup a dialog when the Eclipse workbench starts. The answer lies in the org.eclipse.ui.startup extension point.

Implement the IStartup interface, for example:

public class MyStartup implements IStartup {

public void earlyStartup() {
Display.getDefault().syncExec(new Runnable() {
public void run() {
MessageDialog.openInformation(
Display.getDefault().getActiveShell(), “Title”, “Message”);
}
});
}

}

I also want to mention that this will force your plugin to activate on startup which isn’t a great thing to do.

  • Gunnar

    Uh. That’s ugly. It will also cause the plug-in to get activated at startup.

    Actually, I don’t like those plug-ins that think they need to open a pop-up when Eclipse starts. I think it’s bad usability. The Rational ClearCase plug-in is one example. When I tried it a few years back it opened a pop-up on startup for every project prompting for adding view private files to ClearCase. That was really ugly. I had around 40 plug-in projects in my workspace at that time. ๐Ÿ™

  • Gunnar

    Uh. That’s ugly. It will also cause the plug-in to get activated at startup. Actually, I don’t like those plug-ins that think they need to open a pop-up when Eclipse starts. I think it’s bad usability. The Rational ClearCase plug-in is one example. When I tried it a few years back it opened a pop-up on startup for every project prompting for adding view private files to ClearCase. That was really ugly. I had around 40 plug-in projects in my workspace at that time. ๐Ÿ™

  • zx

    It’s ugly Gunnar but the guy had a requirement for this piece of functionality.

    I agree with you that it is totally being a bad “eclipse neighbor” to other plugins.

  • zx

    It’s ugly Gunnar but the guy had a requirement for this piece of functionality.I agree with you that it is totally being a bad “eclipse neighbor” to other plugins.

  • Sri

    Eliminating this hook altogether is also bad :-). Then we will complain, Eclipse doesn’t provide a way to trigger something just after the workbench starts up, hehe.

    I guess, it depends upon how you make use of this functionality offered by Eclipse :-).

  • Sri

    Eliminating this hook altogether is also bad :-). Then we will complain, Eclipse doesn’t provide a way to trigger something just after the workbench starts up, hehe. I guess, it depends upon how you make use of this functionality offered by Eclipse :-).