use of org.eclipse.ecf.presence.IPresenceContainerAdapter in project ecf by eclipse.
the class RosterWriterHelper method writeAllRostersToConsole.
public void writeAllRostersToConsole() {
Object[] adapters = getConnectedContainerAdapters(IPresenceContainerAdapter.class);
for (int i = 0; i < adapters.length; i++) {
IPresenceContainerAdapter presenceAdapter = (IPresenceContainerAdapter) adapters[i];
showRosterItems(presenceAdapter.getRosterManager().getRoster());
}
}
use of org.eclipse.ecf.presence.IPresenceContainerAdapter 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) };
}
use of org.eclipse.ecf.presence.IPresenceContainerAdapter in project ecf by eclipse.
the class AbstractAdapterAccessTest method testGetPresenceContainerAdapter.
public void testGetPresenceContainerAdapter() {
final IPresenceContainerAdapter adapter = getPresenceAdapter();
assertNotNull(adapter);
}
use of org.eclipse.ecf.presence.IPresenceContainerAdapter in project ecf by eclipse.
the class AbstractAdapterAccessTest method testGetChatManager.
public void testGetChatManager() {
final IPresenceContainerAdapter adapter = getPresenceAdapter();
assertNotNull(adapter);
final IChatManager chatManager = adapter.getChatManager();
assertNotNull(chatManager);
}
use of org.eclipse.ecf.presence.IPresenceContainerAdapter in project ecf by eclipse.
the class AbstractAdapterAccessTest method testGetRosterManager.
public void testGetRosterManager() {
final IPresenceContainerAdapter adapter = getPresenceAdapter();
assertNotNull(adapter);
final IRosterManager rosterManager = adapter.getRosterManager();
assertNotNull(rosterManager);
}
Aggregations