Skip to main content
Jump to: navigation, search

Roster Menus

It's now possible to create a Roster Menu...i.e. a dynamically created menu from the ECF contacts list/roster.

So, for example, here's my current contacts list:


Here's a new roster menu, that shows as a menu the active roster entries (buddies)


Note that this menu can be added to any existing menu using the platform UI Menu Contributions mechanisms. So this roster menu can be used to interact with roster entry items in any appropriate context (e.g. an editor, a view, workbench, etc).

The way this works is that a plugin can add markup similar to the following to specify a new roster menu contribution:


Notice the class This is a new class that creates a roster menu contribution that does nothing (performs a noop). The way this works is that the command handler associated with this contribution item does nothing, so that when the Ted Kubaska menu item is chosen, nothing happens.

It's easy, however to create a subclass of [ and customize the roster menu behavior. The following is the implementation of

public class NoopRosterMenuContributionItem extends AbstractRosterMenuContributionItem {

	protected AbstractRosterMenuHandler createRosterEntryHandler(IRosterEntry rosterEntry) {
		return new AbstractRosterMenuHandler(rosterEntry) {
			public Object execute(ExecutionEvent arg0) throws ExecutionException {
				System.out.println("execute(" + arg0 + ") on rosterEntry=" + getRosterEntry()); 
				return null;



Copyright © Eclipse Foundation, Inc. All Rights Reserved.