Package org.eclipse.ecf.presence

Examples of org.eclipse.ecf.presence.IPresenceContainerAdapter


    }

    private IRosterManager getLocalRosterManager() {
        IContainer container = (IContainer) this.adapter.getAdapter(IContainer.class);
        if (container != null) {
            IPresenceContainerAdapter presenceContainerAdapter = (IPresenceContainerAdapter) container
                    .getAdapter(IPresenceContainerAdapter.class);
            if (presenceContainerAdapter != null) {
                return presenceContainerAdapter.getRosterManager();
            }
        }
        return null;
    }
View Full Code Here


    protected IContributionItem[] getContributionItems() {
        // If we are already engaged in a share (either as initiator or as receiver)
        // Then present menu item to stop
        for (Object each: getPresenceContainerAdapters()) {
            if (!(each instanceof IPresenceContainerAdapter)) continue;
            IPresenceContainerAdapter pca = (IPresenceContainerAdapter) each;
           
            SelectionShare share = getStringShareForPresenceContainerAdapter(pca);
            if (share != null && share.isSharing()) {
                return getMenuContributionForStopShare(pca.getRosterManager().getRoster(), share);
            }
        }
        return super.getContributionItems();
    }
View Full Code Here

    IContainerManager containerManager = Activator.getDefault().getContainerManager();
    if (containerManager == null)
      return presenceContainers;
    IContainer[] containers = containerManager.getAllContainers();
    for (int i = 0; i < containers.length; i++) {
      IPresenceContainerAdapter presenceContainerAdapter = (IPresenceContainerAdapter) containers[i].getAdapter(IPresenceContainerAdapter.class);
      if ((containers[i].getConnectedID() != null) && (presenceContainerAdapter != null)) {
        presenceContainers.add(presenceContainerAdapter);
      }
    }
    return presenceContainers;
View Full Code Here

    }
    return true;
  }

  private URLShare getURLShare(IRosterEntry rosterEntry1) {
    final IPresenceContainerAdapter pca = rosterEntry1.getRoster().getPresenceContainerAdapter();
    if (pca == null)
      return null;
    final IContainer container = (IContainer) pca.getAdapter(IContainer.class);
    if (container == null)
      return null;
    return URLShare.getURLShare(container.getID());
  }
View Full Code Here

   *         cannot be accessed.
   */
  protected IContainer getContainerForRosterEntry(IRosterEntry group) {
    if (group == null)
      return null;
    IPresenceContainerAdapter pca = group.getRoster().getPresenceContainerAdapter();
    if (pca != null)
      return (IContainer) pca.getAdapter(IContainer.class);
    return null;
  }
View Full Code Here

   *         cannot be accessed.
   */
  protected IContainer getContainerForRoster(IRoster roster) {
    if (roster == null)
      return null;
    IPresenceContainerAdapter pca = roster.getPresenceContainerAdapter();
    if (pca != null)
      return (IContainer) pca.getAdapter(IContainer.class);
    return null;
  }
View Full Code Here

    addContactAction = new Action(Messages.MultiRosterView_AddContact, SharedImages.getImageDescriptor(SharedImages.IMG_ADD_BUDDY)) {
      public void run() {
        ITreeSelection selection = (ITreeSelection) treeViewer.getSelection();
        IResult contact = (IResult) selection.getFirstElement();
        if (MessageDialog.openConfirm(null, Messages.AddContactDialog_DialogTitle, NLS.bind(Messages.SearchContactDialog_AddContactMessage, contact.getUser().getName()))) {
          IPresenceContainerAdapter ipca = account.getPresenceContainerAdapter();
          IRosterSubscriptionSender sender = ipca.getRosterManager().getRosterSubscriptionSender();
          try {
            sender.sendRosterAdd(contact.getUser().getID().getName(), contact.getUser().getName(), null);
          } catch (ECFException e) {
            Activator.getDefault().getLog().log(e.getStatus());
          }
View Full Code Here

   *         cannot be accessed.
   */
  protected IContainer getContainerForRosterEntry(IRosterEntry entry) {
    if (entry == null)
      return null;
    IPresenceContainerAdapter pca = entry.getRoster().getPresenceContainerAdapter();
    if (pca != null)
      return (IContainer) pca.getAdapter(IContainer.class);
    return null;
  }
View Full Code Here

  }

  IRosterManager getLocalRosterManager() {
    IContainer container = (IContainer) this.adapter.getAdapter(IContainer.class);
    if (container != null) {
      IPresenceContainerAdapter presenceContainerAdapter = (IPresenceContainerAdapter) container.getAdapter(IPresenceContainerAdapter.class);
      if (presenceContainerAdapter != null) {
        return presenceContainerAdapter.getRosterManager();
      }
    }
    return null;
  }
View Full Code Here

      targetID = IDFactory.getDefault().createID(namespace,
          bot.getConnectID());

      firePreConnect();

      IPresenceContainerAdapter presenceAdapter = (IPresenceContainerAdapter) container
          .getAdapter(IPresenceContainerAdapter.class);

      presenceAdapter.getChatManager().addMessageListener(this);

      String password = bot.getPassword();
      IConnectContext context = (password == null) ? null
          : ConnectContextFactory
              .createPasswordConnectContext(password);
View Full Code Here

TOP

Related Classes of org.eclipse.ecf.presence.IPresenceContainerAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.