Search in sources :

Example 1 with TCPClientSOContainer

use of org.eclipse.ecf.provider.generic.TCPClientSOContainer in project ecf by eclipse.

the class PresenceContainerAdapterFactory method getAdapter.

public Object getAdapter(Object adaptableObject, Class adapterType) {
    if (adapterType.equals(IPresenceContainerAdapter.class)) {
        TCPClientSOContainer container = (TCPClientSOContainer) adaptableObject;
        ISharedObjectManager manager = container.getSharedObjectManager();
        ID[] ids = manager.getSharedObjectIDs();
        for (int i = 0; i < ids.length; i++) {
            ISharedObject object = manager.getSharedObject(ids[i]);
            if (object instanceof EclipseCollabSharedObject) {
                EclipseCollabSharedObject ecso = (EclipseCollabSharedObject) object;
                return ecso.getPresenceContainer();
            }
        }
    }
    return null;
}
Also used : EclipseCollabSharedObject(org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject) ISharedObjectManager(org.eclipse.ecf.core.sharedobject.ISharedObjectManager) ID(org.eclipse.ecf.core.identity.ID) ISharedObject(org.eclipse.ecf.core.sharedobject.ISharedObject) TCPClientSOContainer(org.eclipse.ecf.provider.generic.TCPClientSOContainer)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)1 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)1 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)1 EclipseCollabSharedObject (org.eclipse.ecf.example.collab.share.EclipseCollabSharedObject)1 TCPClientSOContainer (org.eclipse.ecf.provider.generic.TCPClientSOContainer)1