Esempio n. 1
0
 public Image renderAsImage() {
   if (this.m_o != null) {
     if (this.m_o instanceof ICall) {
       ICall call = (ICall) this.m_o;
       IAttribute att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
       if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_REJECTED)) {
         return SWTImageManager.getInstance(PIMRuntime.getInstance())
             .get(IJAMConst.IMAGE_KEY_REJECTED_GIF);
       }
       // att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
       if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_ACCEPTED)) {
         return SWTImageManager.getInstance(PIMRuntime.getInstance())
             .get(IJAMConst.IMAGE_KEY_ACCEPTED_GIF);
       }
       // att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_CALLSTATUS);
       if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_OUTGOING)) {
         return SWTImageManager.getInstance(PIMRuntime.getInstance())
             .get(IJAMConst.IMAGE_KEY_OUTGOING_GIF);
       }
       if (att != null && att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_MISSED)) {
         return SWTImageManager.getInstance(PIMRuntime.getInstance())
             .get(IJAMConst.IMAGE_KEY_AWAY_GIF);
       }
       /**
        * // 2008/11/08: work-a-round for showing old status fields att =
        * call.getAttribute(IJAMConst.ATTRIBUTE_NAME_REJECTED); if (att != null &&
        * att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) { return
        * SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_REJECTED_GIF);
        * } att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_ACCEPTED); if (att != null &&
        * att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) { return
        * SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_ACCEPTED_GIF);
        * } att = call.getAttribute(IJAMConst.ATTRIBUTE_NAME_OUTGOING); if (att != null &&
        * att.getValue().equalsIgnoreCase(IJAMConst.ATTRIBUTE_VALUE_YES)) { return
        * SWTImageManager.getInstance(PIMRuntime.getInstance()).get(IJAMConst.IMAGE_KEY_OUTGOING_GIF);
        * }
        */
       return SWTImageManager.getInstance(PIMRuntime.getInstance())
           .get(IJAMConst.IMAGE_KEY_AWAY_GIF);
     }
   }
   return null;
 }
  public Object clone() throws CloneNotSupportedException {
    Name cloneName =
        new Name(
            this.getName().getFirstname(),
            this.getName().getLastname(),
            this.getName().getAdditional());

    List clonePhones = new ArrayList(m_phones.size());
    Phonenumber pn = null;
    for (int i = 0, j = m_phones.size(); i < j; i++) {
      pn = new Phonenumber(((IPhonenumber) m_phones.get(i)).getTelephoneNumber());
      pn.setAreaCode(((IPhonenumber) m_phones.get(i)).getAreaCode());
      pn.setCallNumber(((IPhonenumber) m_phones.get(i)).getCallNumber());
      pn.setIntAreaCode(((IPhonenumber) m_phones.get(i)).getIntAreaCode());
      pn.setClired(((IPhonenumber) m_phones.get(i)).isClired());
      clonePhones.add(pn);
    }

    AttributeMap cloneAttribs = new AttributeMap(this.getAttributes().size());

    Iterator i = this.getAttributes().iterator();
    IAttribute att = null;
    while (i.hasNext()) {
      att = (IAttribute) i.next();
      Attribute cloneAttrib = new Attribute(att.getName(), att.getValue());
      cloneAttribs.add(cloneAttrib);
    }

    if (clonePhones.size() == 0) clonePhones.add(this.getPhoneNumber());

    MultiPhoneCaller cloneCaller =
        new MultiPhoneCaller(this.getUUID(), cloneName, clonePhones, cloneAttribs);
    if (clonePhones.size() > 0) cloneCaller.setPhoneNumber((IPhonenumber) clonePhones.get(0));

    return cloneCaller;
  }