Java-Gnome bindings doesn’t support callbacks at the moment. It can generate code for signals only. To add action callbacks, I reimplemented it as action signal. Here’s an example code to show how to add signals:
notification.addAction("a", "Action 1.a", new Notification.Action() { public void onAction(Notification source, String action) { System.out.println("1.a"); } });
The implementation currently has one drawback. Signals are not disconnected properly. This causes two issues. One, signals aren’t disconnected if actions are removed with clearActions(). Two, if actions with same actionIDs are added signals for all are triggered. Andrew will be adding support for signal disconnection to java-gnome and I’ll be using it in libnotify branch.









02/11/2010 at 8:16 am
What do I need to import ? Are there any jar files needed ? Can you make the sample codes more self contained ?
02/11/2010 at 12:15 pm
You need java-gnome which this binding is part of. The java-gnome distribution has an example on bindings which can also be viewed online.