Skip to main content
Jump to: navigation, search

Difference between revisions of "Roster Menus"

(New page: I've been doing a little prototyping, and have created the ability to create a 'roster menu'...i.e. a dynamically created menu from the ECF contacts list/roster. So, for example, here's m...)
 
Line 1: Line 1:
I've been doing a little prototyping, and have created the ability to create a 'roster menu'...i.e. a dynamically created menu from the ECF contacts list/roster.
+
I've created the ability 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:
 
So, for example, here's my current contacts list:
Line 5: Line 5:
 
[[Image:contacts.png]]
 
[[Image:contacts.png]]
  
Here's a new *roster menu*, that shows *as a menu* the active roster entries (buddies)
+
Here's a new roster menu, that shows as a menu the active roster entries (buddies)
  
 
[[Image:contactsmenu.png]]
 
[[Image:contactsmenu.png]]
 +
 +
Note that this menu can be added to '''any''' existing menu using the platform UI [[Menu Contributions]] mechanisms.
 +
 +
The way this works is that a plugin can add markup like the following to specify a new roster menu contribution:
 +
 +
<pre>
 +
  <extension
 +
        point="org.eclipse.ui.menus">
 +
      <menuContribution
 +
            locationURI="popup:org.eclipse.ecf.presence.ui.MultiRosterView?before=additions">
 +
        <dynamic
 +
              class="org.eclipse.ecf.presence.ui.menu.NoopRosterMenuContributionItem"
 +
              id="org.eclipse.ecf.presence.collab.ui.dynamic5">
 +
        </dynamic>
 +
      </menuContribution>
 +
  </extension>
 +
</pre>
 +
 +
Notice the class '''org.eclipse.ecf.presence.ui.menu.NoopRosterMenuContributionItem'''.  This is a new class that creates a roster menu contribution that does nothing (performs a noop).  The command handler associated with this contribution item does nothing, so that when the Ted Kubaska menu item is chosen, nothing happens.
 +
 +
It's possible, and easy, however to create a subclass of

Revision as of 20:41, 30 October 2007

I've created the ability 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:

Contacts.png

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

Contactsmenu.png

Note that this menu can be added to any existing menu using the platform UI Menu Contributions mechanisms.

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

   <extension
         point="org.eclipse.ui.menus">
      <menuContribution
            locationURI="popup:org.eclipse.ecf.presence.ui.MultiRosterView?before=additions">
         <dynamic
               class="org.eclipse.ecf.presence.ui.menu.NoopRosterMenuContributionItem"
               id="org.eclipse.ecf.presence.collab.ui.dynamic5">
         </dynamic>
      </menuContribution>
   </extension>

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

It's possible, and easy, however to create a subclass of

Back to the top