Search in sources :

Example 11 with IPresenceContainerAdapter

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());
    }
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter)

Example 12 with IPresenceContainerAdapter

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) };
}
Also used : IAction(org.eclipse.jface.action.IAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) IContributionItem(org.eclipse.jface.action.IContributionItem) ArrayList(java.util.ArrayList) RosterWriterHelper(org.eclipse.ecf.internal.examples.webinar.util.RosterWriterHelper) IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) ActionContributionItem(org.eclipse.jface.action.ActionContributionItem) List(java.util.List) ArrayList(java.util.ArrayList) IContainer(org.eclipse.ecf.core.IContainer)

Example 13 with IPresenceContainerAdapter

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);
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter)

Example 14 with IPresenceContainerAdapter

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);
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) IChatManager(org.eclipse.ecf.presence.im.IChatManager)

Example 15 with IPresenceContainerAdapter

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);
}
Also used : IPresenceContainerAdapter(org.eclipse.ecf.presence.IPresenceContainerAdapter) IRosterManager(org.eclipse.ecf.presence.roster.IRosterManager)

Aggregations

IPresenceContainerAdapter (org.eclipse.ecf.presence.IPresenceContainerAdapter)18 IContainer (org.eclipse.ecf.core.IContainer)5 IRosterManager (org.eclipse.ecf.presence.roster.IRosterManager)4 IChatManager (org.eclipse.ecf.presence.im.IChatManager)3 Iterator (java.util.Iterator)2 List (java.util.List)2 Namespace (org.eclipse.ecf.core.identity.Namespace)2 ArrayList (java.util.ArrayList)1 Collection (java.util.Collection)1 Entry (java.util.Map.Entry)1 IProject (org.eclipse.core.resources.IProject)1 IResource (org.eclipse.core.resources.IResource)1 IAdaptable (org.eclipse.core.runtime.IAdaptable)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)1 IContainerListener (org.eclipse.ecf.core.IContainerListener)1 IContainerManager (org.eclipse.ecf.core.IContainerManager)1 IContainerConnectedEvent (org.eclipse.ecf.core.events.IContainerConnectedEvent)1 IContainerEvent (org.eclipse.ecf.core.events.IContainerEvent)1