Examples of IRosterEntry


Examples of org.eclipse.ecf.presence.roster.IRosterEntry

        super(entry);
    }
   
    @Override
    public Object execute(ExecutionEvent event) throws ExecutionException {
        IRosterEntry rosterEntry = getRosterEntry();
        if (rosterEntry == null) return null;
       
        IRoster roster = rosterEntry.getRoster();
        IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
        if (container.getConnectedID() == null)
            showErrorMessage("not connected.");
            SelectionShare sender = ECFContribution.getDefault().getStringShare(container.getID());
            if (sender == null)
                showErrorMessage("no sender.");
//            currently share anyway to be able do do better debugging
//            if (sender.isSharing())
//                showErrorMessage("sharing already started.");
//            final ITextEditor textEditor = getTextEditor();
//            if (textEditor == null)
//                showErrorMessage(Messages.DocShareRosterMenuHandler_EXCEPTION_EDITOR_NOT_TEXT);
//            final String inputName = getInputName(textEditor);
//            if (inputName == null)
//                showErrorMessage(Messages.DocShareRosterMenuHandler_NO_FILENAME_WITH_CONTENT);
            final IUser user = roster.getUser();
            sender.startShare(user.getID(), rosterEntry.getUser().getID());
       
        return null;
    }
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

 
  protected IRosterEntry makeRosterEntry(IRosterItem parent, User user) {
    String userName = user.getScreen_name();
    ID userID;
    IRosterEntry entry;
      try {
        userID = IDFactory.getDefault().createID(targetID.getNamespace(), userName);

        IUser child = new org.eclipse.ecf.core.user.User(userID,userName);
        IPresence presence = new Presence(IPresence.Type.AVAILABLE);
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

    super(id);
  }

  protected IAction[] makeActions() {
    // Else check for Roster entry
    final IRosterEntry entry = getSelectedRosterEntry();
    final IContainer c = getContainerForRosterEntry(entry);
    // If roster entry is selected and it has a container
    if (entry != null && c != null) {
      final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
      // If the container has channel container adapter and is online/available
      if (channelAdapter != null && isAvailable(entry)) {
        final ViewShare tmp = ViewShare.getViewShare(c.getID());
        // If there is an URL share associated with this container
        if (tmp != null) {
          final ViewShare viewshare = tmp;
          final IAction action = new Action() {
            public void run() {
              viewshare.sendOpenViewRequest(entry.getRoster().getUser().getName(), entry.getUser().getID());
            }
          };
          action.setText(Messages.ViewShareRosterEntryContributionItem_VIEWSHARE_MENU_TEXT);
          action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
          return new IAction[] {action};
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

    super(id);
  }

  protected IAction[] makeActions() {
    // Else check for Roster entry
    final IRosterEntry entry = getSelectedRosterEntry();
    final IContainer c = getContainerForRosterEntry(entry);
    // If roster entry is selected and it has a container
    if (entry != null && c != null) {
      final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
      // If the container has channel container adapter and is online/available
      if (channelAdapter != null && isAvailable(entry)) {
        final URLShare tmp = URLShare.getURLShare(c.getID());
        // If there is an URL share associated with this container
        if (tmp != null) {
          final URLShare urlshare = tmp;
          final IAction action = new Action() {
            public void run() {
              urlshare.showDialogAndSendURL(entry.getRoster().getUser().getName(), entry.getUser().getID());
            }
          };
          action.setText(Messages.URLShareRosterEntryContributionItem_SEND_URL_MENU_TEXT);
          action.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, Messages.URLShareRosterContributionItem_BROWSER_ICON));
          return new IAction[] {action};
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

    super(id);
  }

  protected IAction[] makeActions() {
    // Else check for Roster entry
    final IRosterEntry entry = getSelectedRosterEntry();
    final IContainer c = getContainerForRosterEntry(entry);
    // If roster entry is selected and it has a container
    if (entry != null && c != null) {
      final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
      // If the container has channel container adapter and is online/available
      if (channelAdapter != null && isAvailable(entry)) {
        final ScreenCaptureShare tmp = ScreenCaptureShare.getScreenCaptureShare(c.getID());
        // If there is an URL share associated with this container
        if (tmp != null) {
          final ScreenCaptureShare screencaptureshare = tmp;
          final IAction action = new Action() {
            public void run() {
              MessageDialog dialog = new MessageDialog(null, Messages.ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_TITLE, Window.getDefaultImage(), Messages.ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_MESSAGE, MessageDialog.QUESTION, new String[] {NLS.bind(Messages.ScreenCaptureShareRosterEntryContributionItem_VERIFY_SEND_BUTTON_TEXT, entry.getName()), Messages.ScreenCaptureShareRosterEntryContributionItem_VERIFY_CANCEL_BUTTON_TEXT}, 0);
              if (dialog.open() == Window.OK) {
                ScreenCaptureJob screenCaptureJob = new ScreenCaptureJob(Display.getCurrent(), entry.getUser().getID(), entry.getUser().getName(), new IImageSender() {
                  public void sendImage(ID targetID, ImageData imageData) {
                    screencaptureshare.sendImage(entry.getRoster().getUser().getID(), entry.getRoster().getUser().getName(), targetID, imageData);
                  }
                });
                screenCaptureJob.schedule(SCREEN_CAPTURE_DELAY);
              }
            }
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

  protected IAction[] makeActions() {
    final TextSelection selection = ConsoleShare.getSelection();
    if (selection == null)
      return null;
    // Else check for Roster entry
    final IRosterEntry entry = getSelectedRosterEntry();
    final IContainer c = getContainerForRosterEntry(entry);
    // If roster entry is selected and it has a container
    if (entry != null && c != null) {
      final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
      // If the container has channel container adapter and is online/available
      if (channelAdapter != null && isAvailable(entry)) {
        final ConsoleShare tmp = ConsoleShare.getStackShare(c.getID());
        // If there is an URL share associated with this container
        if (tmp != null) {
          final ConsoleShare stackshare = tmp;
          final IAction action = new Action() {
            public void run() {
              stackshare.sendShareConsoleSelection(entry.getRoster().getUser().getName(), entry.getUser().getID(), selection.getText());
            }
          };
          action.setText(Messages.ConsoleShare_RosterEntryMenu);
          action.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, Messages.ConsoleShare_RosterContributionItem_CONSOLE_ICON));
          return new IAction[] {action};
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

    public boolean matchItem(Object item) {
      if (!(item instanceof IRosterEntry)) {
        return false;
      }
      IRosterEntry rosterItem = (IRosterEntry) item;
      return matches(rosterItem.getName());
    }
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

  /**
   * @throws ExecutionException 
   */
  public Object execute(ExecutionEvent arg0) throws ExecutionException {
    IRosterEntry rosterEntry = getRosterEntry();
    if (rosterEntry != null) {
      IRoster roster = rosterEntry.getRoster();
      final IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
      if (container.getConnectedID() == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_NOT_CONNECTED);
      final DocShare sender = Activator.getDefault().getDocShare(container.getID());
      if (sender == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_NO_SENDER);
      if (sender.isSharing())
        showErrorMessage(Messages.DocShareRosterMenuHandler_ERROR_EDITOR_ALREADY_SHARING);
      final ITextEditor textEditor = getTextEditor();
      if (textEditor == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_EXCEPTION_EDITOR_NOT_TEXT);
      final String inputName = getInputName(textEditor);
      if (inputName == null)
        showErrorMessage(Messages.DocShareRosterMenuHandler_NO_FILENAME_WITH_CONTENT);
      final IUser user = roster.getUser();
      sender.startShare(user.getID(), user.getName(), rosterEntry.getUser().getID(), inputName, textEditor);
    }
    return null;
  }
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

    BrowseDialog dialog = new BrowseDialog(window.getShell(), containers);
    int status = dialog.open();
    if (status == Window.OK) {
      Object[] object = dialog.getResult();
      IRosterEntry entry = (IRosterEntry) object[0];
      IRoster roster = entry.getRoster();
      if (roster != null) {
        IChatManager manager = roster.getPresenceContainerAdapter().getChatManager();
        IChatMessageSender icms = manager.getChatMessageSender();
        ITypingMessageSender itms = manager.getTypingMessageSender();
        try {
          MessagesView view = (MessagesView) window.getActivePage().showView(MessagesView.VIEW_ID);
          view.selectTab(icms, itms, roster.getUser().getID(), entry.getUser().getID());
        } catch (PartInitException e) {
          e.printStackTrace();
        }
      }
    }
View Full Code Here

Examples of org.eclipse.ecf.presence.roster.IRosterEntry

        Object element) {
     
      if (!(element instanceof IRosterEntry)) {
        return false;
      }
      IRosterEntry entry = (IRosterEntry) element;
     
      // check if we are showing online only
      if (online && entry.getPresence() != null && IPresence.Type.UNAVAILABLE == entry.getPresence().getType())
        return false;
     
      return true;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.