Package com.anzsoft.client.XMPP.mandioca

Examples of com.anzsoft.client.XMPP.mandioca.XmppVCard


     SoundController soundController = new SoundController();
     Sound sound = soundController.createSound(Sound.MIME_TYPE_AUDIO_MPEG,
         "sound/im_send.wav");
     sound.play();
    
     XmppVCard selfv = JabberApp.instance().getSelfVCard();
     String nick = XmppID.parseId(JabberApp.instance().getSession().getUser().getID()).toStringNoResource();
     if(selfv!=null)
     {
       if(!selfv.nickName().isEmpty())
         nick = selfv.nickName();
       else if(!selfv.fullName().isEmpty())
         nick = selfv.fullName();
     }
     room.sendMessage(inputText);
     setInputText("");
     input.focus();
   }
View Full Code Here


    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
    imageElement.setAttribute("widht", "45");
    XmppVCard vc = null;
    if(local)
      vc = JabberApp.instance().getSelfVCard();
    else
      vc = vcard;
    if(!GXT.isIE&&vc != null&&!vc.photo().isEmpty())
      imageElement.setSrc("data:image;base64,"+vc.photo());
    else
      imageElement.setSrc("images/default_avatar.png");
   
    tdElement = DOM.createTD();
    tdElement.setInnerHTML("&nbsp&nbsp");
View Full Code Here

    Element imgElement = DOM.createImg();
    ImageElement imageElement = ImageElement.as(imgElement);
    tdElement.appendChild(imageElement);
    imageElement.setAttribute("height", "45");
    imageElement.setAttribute("widht", "45");
    XmppVCard vc = null;
    if(local)
      vc = JabberApp.instance().getSelfVCard();
    else
      vc = vcard;
    if(!GXT.isIE&&vc != null&&!vc.photo().isEmpty())
      imageElement.setSrc("data:image;base64,"+vc.photo());
    else
      imageElement.setSrc(JabberApp.instance().getAvatarUrl(jid));
   
    tdElement = DOM.createTD();
    tdElement.setInnerHTML("&nbsp&nbsp");
View Full Code Here

     SoundController soundController = new SoundController();
     Sound sound = soundController.createSound(Sound.MIME_TYPE_AUDIO_MPEG,
         "sound/im_send.wav");
     sound.play();
    
     XmppVCard selfv = JabberApp.instance().getSelfVCard();
     String nick = XmppID.parseId(JabberApp.instance().getSession().getUser().getID()).toStringNoResource();
     if(selfv!=null)
     {
       if(!selfv.nickName().isEmpty())
         nick = selfv.nickName();
       else if(!selfv.fullName().isEmpty())
         nick = selfv.fullName();
     }
     addMessage(nick,inputText,true);
     chat.sendMessage(inputText);
     setInputText("");
     input.focus();
View Full Code Here

  }
 
  public String getNick()
  {
    String nick = getJid().getNode();
    XmppVCard v = getSelfVCard();
    if(v != null)
    {
      if(v.nickName()!=null&&!v.nickName().isEmpty())
        nick = v.nickName();
      else if(v.fullName()!=null&&!v.fullName().isEmpty())
        nick = v.fullName();
    }
    return nick;
  }
View Full Code Here

   *
   */
  private void publish()
  {
    publishButton.setEnabled(false);
    final XmppVCard v = makeVCard();
    XmppQuery iq = JabberApp.instance().getSession().getFactory().createQuery();
    iq.setIQ("", XmppQuery.TYPE_SET, TextUtils.genUniqueId());
    Element vcardEl = v.toXml(iq.getDoc());
    iq.getNode().appendChild(vcardEl);
   
    JabberApp.instance().getSession().send(iq, new XmppPacketListener()
    {
      public void onPacketReceived(XmppPacket packet)
View Full Code Here

  }
 
  public void getInfo(final XmppID jid)
  {
    setHeading(jid.toStringNoResource());
    XmppVCard vcard = XmppVCardFactory.instance().get(jid, new VCardListener()
    {
      public void onVCard(final XmppID id,final XmppVCard card)
      {
        setData(card);
      }
View Full Code Here

    aboutTextArea.setEnabled(enabled);
  }
 
  private XmppVCard makeVCard()
  {
    XmppVCard v = new XmppVCard();
    v.setFullName(fullNameField.getValue());
    v.setNickName(nickNameField.getValue());
    v.setBday(birthdayField.getValue());
   
    if(this.vcard != null&&this.vcard.photo()!=null&&!this.vcard.photo().isEmpty())
    {
      v.setPhoto(this.vcard.photo());
    }
   
    if(emailField.getValue()!=null&&!emailField.getValue().isEmpty())
    {
      Email email = v.newEmail();
      email.internet = true;
      email.userid = emailField.getValue();
     
      v.emailList.add(email);
    }
   
    v.setUrl(homepageField.getValue());
   
    if(phoneField.getValue()!=null&&!phoneField.getValue().isEmpty())
    {
      Phone p = v.newPhone();
      p.home = true;
      p.voice = true;
      p.number = phoneField.getValue();
     
      v.phoneList.add(p);
    }
   
    if((streetField.getValue()!=null&&!streetField.getValue().isEmpty())||
        (cityField.getValue()!=null&&!cityField.getValue().isEmpty())||
        (stateField.getValue()!=null&&!stateField.getValue().isEmpty())||
        (pCodeField.getValue()!=null&&!pCodeField.getValue().isEmpty())||
        (countryField.getValue()!=null&&!countryField.getValue().isEmpty()))
    {
      Address addr = v.newAddress();
      addr.home = true;
      addr.street = streetField.getValue();
      addr.locality = cityField.getValue();
      addr.region = stateField.getValue();
      addr.pcode = pCodeField.getValue();
      addr.country = countryField.getValue();
     
      v.addressList.add(addr);
    }
   
    Org org = v.newOrg();
    org.name = companyField.getValue();
   
    if(departmentField.getValue()!=null&&!departmentField.getValue().isEmpty())
    {
      org.unit.add(departmentField.getValue());
    }
    v.setOrg(org);
   
   
    v.setTitle(positionField.getValue());
    v.setRole(roleField.getValue());
    v.setDesc(aboutTextArea.getValue());
    return v;
  }
View Full Code Here

TOP

Related Classes of com.anzsoft.client.XMPP.mandioca.XmppVCard

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.