RosterWidget

RosterWidget – What is it?

RosterImage Small

It is a widget that visualizes a list of prioritized items.
It has 3 parameters:

  • orientation (horizontal vs vertical)
  • gravity (left/right/top/bottom)
  • entrance mode (left/right/top/bottom)

For instance the following animation illustrates SwingRosterWidget horizontal, with items heading towards left (gravity=left) and entrance mode set to bottom :


SwingRosterImage

Each new item entering the roster panel appears on the right side, sliding upwards, then it “falls down” to the left. If it is the least significant item (i.e. it has the least priority of all items in the roster) it will bounce nicely when it collides with the right-most item. If there are other less-significant items, they will make up free space for this new one by moving right, and the item will take its place between them.

Items are sorted by priority. Each has an image and can have a tooltip hint. When an item is clicked, given listener is called back and the item is removed from the panel. Items can also expire after given time – then Expiration Listener is called back and the item is also removed.

Each item can be represented in view layer by one of following widgets:

  • Button
  • Image
  • Label
  • Toolbar item

or others, dependent on framework used (Swing, SWT). Developers can also use other widgets or even GUI frameworks by extending appriopriate classes.

Each item can have following attributes set:

  • Image
  • Priority
  • Expiration timeout (in seconds)
  • onClick Callback function (Listener)
  • Hint text (Tooltip)
  • onExpire callback function (Expire Listener)

Additionally, if widget used for representing an item supports these attributes, they can also be used

  • Text
  • Color

What can it be used for?

  • RSS Readers can let the user know about feed updates
  • Email applications could notify the user about new mail and upcoming events
  • Instant Messaging clients (like Pidgin, Psi) could draw user’s attention to incoming messages
  • It is a way to visualize ToDo lists, considering item priority and type
  • A way to visualize errors too, sorted by severity, they indicate type of error with an image
  • System management tools could issue a notification about problems and get a response back from the user.
  • It can also provide means to communicate with applications running in the background, deamons, or without UI. Such apps could inform the user about their state via RosterWidget or ask him/her questions how to handle particular situations.

Demo application

A little demo application is available here

Future enchancements

I plan to support SWT version of RosterWidget to allow integration with Eclipse RCP platform. It could be used along with Eclipse Communication Framework to notify about events.

I also want to write a Dojo Toolkit custom widget so it could be used with AJAX/COMET applications like chat services, stock prices feeds, friends messages and more.

Another idea would be to port it to GNOME environment. The widget would be rewritten in C++ based on gtkmm library. Then GTK+ adapter would allow GNOME applications developers to use the widget.

RosterWidget functionality resembles an enhancement of Notification Area (SysTray). GTK+ wrappers would enable me to create PyGTK component so it could be also used by python/gnome applications. Moreover, a GNOME applet could be developed in python, and desktop applications signal the user about events via RosterApplet. This applet will expose a service (object+method) within DBus system to allow applications to add and remove items. In case an item was clicked, RosterApplet would call the application back via DBus to inform it about user’s interest in particular event so the app could perform appropriate action. In case an item expires, the applet would also inform the app that the user didn’t want to investigate the event.

This way IM clients like Pidgin, Psi or email apps like Evolution could inform the user about incoming messages by placing an item within RosterApplet. If the user is interested in opening the message, he/she would click on the item, and the applet would inform the application about that so it could show the message. Also this pattern could be used by RSS readers, printing deamons and many more. Every application could use RosterApplet instead of placing an icon in the SysTray.

In future also SysTray could be modified to forward signals to RosterApplet if the user decides it is more convienient to use.

Another use case would be to filter system log enties (dmesg) and inform the user about events. It could be particularly helpful for administrative and diagnostic tasks, since it would show the user what is happening within the system without going through dmesg output.

Leave a Reply