Twitter github

What Eclipse can learn from Firefox…

So, I was bored of doing homage to Michael Porter in terms of his wonderful 5 forces (only 6 more months left of b-school!)… I decided to download some sweet firefox extensions.

Holy, I’m shitening in me shorts! The extension download and installed itself in one click. No update sites, no confusion, no 7 clicks to download something.

I thought, how can we try to replicate some of Firefox’s extension story (probably part of the reason it’s been so successful) in Eclipse? So, what better way to think of ideas than to hack out a quick and dirty prototype.

Our first stop is the cool RCP Browser Example Check it out and add two new dependencies (org.eclipse.update.core and org.eclipse.update.ui).

The next stop is to learn about the cool SWT Browser widget. It has a method that rocks: addLocationListener. Let’s prototype something easy, how about simplifying how we reach update sites?


...
browser.addLocationListener(new LocationAdapter() {
public void changing(LocationEvent event) {
if (event.location.endsWith("site.xml")) {
try {
IUpdateSearchCategory category =
UpdateSearchRequest.createDefaultSiteSearchCategory();
UpdateSearchScope scope = new UpdateSearchScope();
scope.addSearchSite(
event.location, new URL(event.location), new String[] {});
UpdateSearchRequest request =
new UpdateSearchRequest(category, scope);

UpdateJob job = new UpdateJob("My Update Job", request);
InstallWizardOperation operation =
new InstallWizardOperation();
operation.run(Display.getDefault().getActiveShell(), job);
} catch (MalformedURLException e) {
e.printStackTrace();
}
}
};
...

This code will popup the update site ui when we reach a site.xml file. See the simplicity and power in this approach?

Now imagine if we can do this for other more important cases…


...
browser.addLocationListener(new LocationAdapter() {
public void changing(LocationEvent event) {
if (event.location.endsWith(".eclipse")) {
// maybe we have downloadable sites or features?
// this should be like firefoxes .xpi extensions
}
if (event.location.startsWith("eclipse://")) {
// our own protocol handler, wooo!
// we can do anything here...
}
};
...

If Eclipse had its own extension (file) like firefox does, we could effectively
pack anything into it. This would take a bit of work though to define what exactly
belongs in the file and the metadata associated with it. I’m sure we could use OSGi’s bundle repository format for this. Or we could have our own protocol handler and do cool things (similar to irc:// or skype://).

In the end, Eclipse is great for developers (including the current update manager). We can do a lot of things with it. It was designed with the developer in mind. However, RCP changed everything. The developer is no longer the only person using Eclipse. Now we have report designers, poor college students leeching things, traders, scientists, etc… If Eclipse expects greater adoption in the RCP space, our users will demand a better update story.

What are people’s thoughts on this situation?

  • Benjamin Muskalla

    Some time ago, i thought about something like this too. It seems there’s already a bug report for [1].

    You mentioned the method to add such a functionality to the SWT browser widget. In FF, it’s called Protocol Handler and could be done like this:

    Open up your about:config and add these 2 keys:

    network.protocol-handler.app.eclipse (string) = /path/to/eclipse/eclipse -addupdatesite
    network.protocol-handler.external.eclipse (boolean) = true

    Now we only need to cover the “-addupdatesite” parameter and open up the update manager in an active eclipse instance (which could be the hardest part of the whole story).

    Maybe someone has interest to look at something like this. I would be happy to use update sites in that way 🙂

  • Benjamin Muskalla

    Some time ago, i thought about something like this too. It seems there’s already a bug report for [1].You mentioned the method to add such a functionality to the SWT browser widget. In FF, it’s called Protocol Handler and could be done like this:Open up your about:config and add these 2 keys:network.protocol-handler.app.eclipse (string) = /path/to/eclipse/eclipse -addupdatesitenetwork.protocol-handler.external.eclipse (boolean) = trueNow we only need to cover the “-addupdatesite” parameter and open up the update manager in an active eclipse instance (which could be the hardest part of the whole story).Maybe someone has interest to look at something like this. I would be happy to use update sites in that way 🙂

  • Benjamin Muskalla

    hehe…forget the URL for [1] 🙂

    [1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=120789

  • Benjamin Muskalla

    hehe…forget the URL for [1] :)[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=120789

  • AlBlue

    Atom already has this sussed. You simply look for a ‘link’ in the HTML header, and it shows you a feed — much like this web page shows an atom feed for comments. There’s absolutely nothing that mandates an atom feed to carry only HTML or text; you can make up whatever content you want, as long as it is XML (or can be encoded into XML).

  • AlBlue

    Atom already has this sussed. You simply look for a ‘link’ in the HTML header, and it shows you a feed — much like this web page shows an atom feed for comments. There’s absolutely nothing that mandates an atom feed to carry only HTML or text; you can make up whatever content you want, as long as it is XML (or can be encoded into XML).

  • bob

    This is exactly what the Composite Application Infrastructure for the up and coming Lotus Expeditor do. You can install a composite application using the application catalog or using the “cai” protocol. The cai protocol handler allows for the sending of URL links to new features and applications. The CAI also allows for installation of new plugins without a reboot! Next is upgrade…

  • bob

    This is exactly what the Composite Application Infrastructure for the up and coming Lotus Expeditor do. You can install a composite application using the application catalog or using the “cai” protocol. The cai protocol handler allows for the sending of URL links to new features and applications. The CAI also allows for installation of new plugins without a reboot! Next is upgrade…

  • Michael Scharf
  • Michael Scharf