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?