use of org.eclipse.ecf.internal.examples.webinar.util.RosterWriterHelper in project ecf by eclipse.
the class ShowSelectedRosterContribution method makeActions.
/* (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() {
// Write selected roster to console
new RosterWriterHelper().writeRosterToConsole(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;
}
use of org.eclipse.ecf.internal.examples.webinar.util.RosterWriterHelper in project ecf by eclipse.
the class ShowAllRostersContribution method getContributionItems.
/* (non-Javadoc)
* @see org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
*/
protected IContributionItem[] getContributionItems() {
IAction action = new Action() {
public void run() {
// Get containers from container manager
IContainer[] containers = Activator.getDefault().getContainers();
List l = new ArrayList();
for (int i = 0; i < containers.length; i++) {
// Make sure the container is connected
if (containers[i].getConnectedID() != null) {
// Make sure container implements IPresenceContainerAdapter API
Object o = containers[i].getAdapter(IPresenceContainerAdapter.class);
if (o != null)
l.add(o);
}
}
IPresenceContainerAdapter[] adapters = (IPresenceContainerAdapter[]) l.toArray(new IPresenceContainerAdapter[] {});
for (int i = 0; i < adapters.length; i++) {
// Show all rosters on console...or do other things with it here.
new RosterWriterHelper().writeRosterToConsole(adapters[i].getRosterManager().getRoster());
}
}
};
action.setText("show all rosters on console");
return new IContributionItem[] { new ActionContributionItem(action) };
}
Aggregations