Thursday, October 22, 2009

Using firefox extensions in mozilla prism

Matt Gertner, creator of the Mozilla Prism firefox addon/SSB, just posted some basics on how to get a firefox extension working with prism.

Thought it was interesting for those messing with site-specific browsers...

http://browsing.justdiscourse.com/2009/10/22/prism-and-extensions/

Tuesday, October 20, 2009

A Pidgin plugin for Growl for Windows

I've been fond of Growl on the mac as a pretty standard notification mechanism.

Growl for Windows is a project that uses the same protocols to do notification on the windows side.

After a discussion in the forums, someone has finally implemented support for one of the last core apps that was missing for a long time: pidgin.

http://blog.growlforwindows.com/2009/10/pigdin-growl-sittin-in-tree.html

Previously there was a snarl->growl bridge called gnarly that would notify growl of messages, but it's nice to see that such a popular app is getting some attention :).

W00t for open source :).

Monday, October 12, 2009

FindBugs in IntelliJ IDEA

I was just perusing the plugin repository for IntelliJ IDEA plugins recently and came across the FindBugs plugin. It will analyze your code and give you a categorized list of potential problems in your code that links to the source. It bundles the latest FindBugs implementation so there is no need to download that as well.

It looks promising for catching things I may have missed in my code.

There is currently a bug where when you first use it, you need to go into the settings for FindBugs and click on Restore Defaults. That initializes the list of detectors that it uses.

Links:
http://findbugs.sourceforge.net - the findbugs home page
https://findbugs-idea.dev.java.net - the findbugs IntelliJ IDEA home page
http://www.jetbrains.com/idea - the IntelliJ IDEA home page

Friday, October 9, 2009

Additional stuff from Developing with Mozilla Prism

Yesterday in my presentation on Developing with Mozilla Prism, I had some difficulties getting an app to work because of an intermittent bug in prism right now.

I did want to post the webapp.js code for the Google Reader prism app that I was showing during the presentation:

/**
* Google Reader web app script
*/

function n(app, msg) {
window.platform.showNotification(app, msg, null);
}

/**
* standard webrunner plugin api
*/
function startup() {
}

function preload() {
}

function load() {
Reader.load();
}

function shutdown() {
Reader.shutdown();
}

function error() {
}

var Reader = {
_timer : null,
_unreadCount : 0,
_window : null,

receiveMessage : function() {
//window.platform.sound().beep();
window.platform.getAttention();

n("Google Reader", "You have " + Reader._unreadCount + " unread item(s).");
},

_init : function() {
Reader._unreadCount = 0;
Reader._window = window;
},

run : function() {
if (Reader._unreadCount == undefined)
Reader._unreadCount = 0;

var title = Reader._window.top.document.title;

var matches = title.match(/Google Reader \((\d+)\)/);
if (matches) {
if (matches[1] > Reader._unreadCount) {
Reader._unreadCount = matches[1];
Reader.receiveMessage();
}

Reader._unreadCount = matches[1];
}
},

load : function() {
Reader._init();
// kick off a polling timer to check for new articles
Reader._timer = Reader._window.setInterval(Reader.run, 5000);
},

shutdown : function() {
if (Reader._timer)
Reader._window.clearInterval(Reader._timer);
}
};


Also, the MIME type to add to your httpd.conf to allow prism webapp bundles to load properly by linking to them is:

AddType application/x-webapp .webapp


Talking with Matt Gertner a little about adding javascript to your own web page... He said that you could use the window.platform stuff in your webapp and that would, in many cases, simply replace the need for webapp.js since your web page would then essentially become prism aware. That's another option for trying to distribute a prism app.

For more information on prism - check out https://developer.mozilla.org/en/Prism

Thursday, October 8, 2009

Slides for Developing with Mozilla Prism

I just wanted to post my slides for my presentation this afternoon on Developing with Mozilla Prism.

It will be in the Auditorium at 3 PM. I hope to see you there!

I received a bag of stuff from Mozilla to give away - various fun mozilla/firefox stickers and mozilla firefox badge lanyards.

Slides (pdf through Google Docs)

Saturday, October 3, 2009

Utah Open Source conference 2009 - Developing with Mozilla Prism

I will be speaking at the Utah Open Source conference next Thursday at 3 PM on Developing with Mozilla Prism.

I'm excited because Mozilla Prism is nearing a final release of 1.0 - it's at 1.0 b2 at this point. I talked to a Mozilla employee, Mark Finkle, who works on Prism, in addition to Fennec, their mobile browser project. He talked to Mozilla HQ and it sounds like I'll be able to get some Mozilla swag to give away at the presentation!

I'm also trying to start a community around building a prism webapp bundle library that I'll talk about more in my presentation. I thought it would be nice to have some open source examples of Prism web application bundles that people could refer to and add to. So I created a Google Code project called prism-apps.

In any case, check out the Prism project and come to the presentation!

(I'll post my slides later in the week as I finalize them.)

Friday, October 2, 2009

Subtle difference - extending ListResourceBundle vs ResourceBundle

I've been mucking about extending ListResourceBundle and then just plain ResourceBundle trying to get things to work with a base case - a custom resource bundle.

Taking a look at the Java i18n tutorial, extending ListResourceBundle doesn't require subclassing the default bundle; see here.

Then taking a look at the ResourceBundle javadocs and their custom resource bundle example, you *do* have to extend the default bundle; see here.

So:

public class MyListResources_it extends ListResourceBundle {
...
}

as opposed to:

public class MyResources_it extends MyResources {
...
}

Kind of a confusing inconsistency - maybe the ListResourceBundle is just smarter about its look up.