Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 882a103b691cbd1a5592fc47a03afb17cf2cee96 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package org.eclipse.ecf.internal.examples.webinar.util.roster;

import org.eclipse.ecf.internal.examples.webinar.util.RosterWriter;
import org.eclipse.ecf.presence.roster.IRoster;
import org.eclipse.ecf.presence.ui.roster.AbstractRosterContributionItem;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

public class RosterContributionItem1 extends AbstractRosterContributionItem {

	/* (non-Javadoc)
	 * @see org.eclipse.ecf.presence.ui.roster.AbstractPresenceContributionItem#makeActions()
	 */
	protected IAction[] makeActions() {
		final IRoster roster = getSelectedRoster();
		if (roster != null) {
			IAction action = new Action() {
				public void run() {
					RosterWriter accessor = new RosterWriter();
					accessor.showRoster(roster);
				}
			};
			action.setText("Show this roster on console");
			action.setImageDescriptor(PlatformUI.getWorkbench()
					.getSharedImages().getImageDescriptor(
							ISharedImages.IMG_DEF_VIEW));
			return new IAction[] { action };
		} else return null;
	}

}

Back to the top