Package custom

Examples of custom.RichText


  public ChangeStatus(RosterList rl, Display d){
    super();
    this.rl = rl;
    this.d = d;
    form = new Form("Current status:");
    statusText = new RichText(d);
    statusText.setCanvasWidth(rl.getRoster().getWidth());
    statusText.addImage(RosterItem.getImageByStatus(rl.getProfile().getStatusID()));
    statusText.addContent(rl.getProfile().getStatus().equals("")?"<No status text>":rl.getProfile().getStatus());
    statusText.finish();
    form.append(statusText);
View Full Code Here


    super();
    roster = l;
    ri = r;
    this.d = d;
    form = new Form(r.getName());
    statusHolder = new RichText(d);
    statusHolder.setCanvasWidth(roster.getRoster().getWidth());
    System.out.println("MessageForm "+roster.getRoster().getWidth());
    statusHolder.addImage(RosterItem.getImageByStatus(0));
    statusHolder.finish();
    tb = new TextField(null, "", 2000, TextField.ANY);
View Full Code Here

    if(cl.getTimeZone().useDaylightTime())
      h = cl.get(Calendar.HOUR_OF_DAY)+1;
    else
      h = cl.get(Calendar.HOUR_OF_DAY);
    String t = h+":"+(cl.get(Calendar.MINUTE)<10? "0"+cl.get(Calendar.MINUTE) : ""+cl.get(Calendar.MINUTE));
    RichText message = new RichText(d);
   
    message.setCanvasWidth(getMessageForm().getForm().getWidth());
   
    if(from)
    {
      times.addElement(t+" << ");
      message.addContent(t+" << ", rl.getProfile().COLOR_FROM, true);
      message.setDefaultCommand(getMessageForm().getQuote());
      message.setItemCommandListener(getMessageForm());
    }
    else
    {
      times.addElement(t+" >> ");
      message.addContent(t+" >> ", rl.getProfile().COLOR_TO, true);
    }
    if(rl.getProfile().getSmiles()>0)
    {
      //Smile processor here
      Vector strs = new Vector();
      strs.addElement(m);
      Vector smils = new Vector();
      for(int i=0; i<smiles.length; i++)
      {
        for(int j=0; j<strs.size(); j++)
        {
          int ind = -1;
          String s =strs.elementAt(j).toString();
          if((ind = s.indexOf(smiles[i]))!=-1)
          {
            String s1 = s.substring(0, ind);
            String s2 = s.substring(ind+smiles[i].length());
            strs.insertElementAt(s2, j+1);
            strs.removeElementAt(j);
            strs.insertElementAt(s1, j);
            smils.insertElementAt(smilep[i], j);
          }
        }
      }
      for(int i=0; i<strs.size(); i++)
      {
        message.addContent(strs.elementAt(i).toString());
        if(i<smils.size())
        {
          message.addImage(getImage("/smiles/"+smils.elementAt(i)+".png"));
        }
      }
    }
    else
      message.addContent(m);
    message.finish();
    getMessageForm().getForm().insert(2, message);
    isNew = true;
    if(d.getCurrent()==getMessageForm().getForm())
    {
      isNew = false;
View Full Code Here

  /**
   * @return Returns the statusStr.
   */
  public void setStatusInfoForMessage()
  {
    RichText rt = new RichText(rl.getDisplay());
    rt.setCanvasWidth(rl.getRoster().getWidth());
    rt.addImage(getImg());
    rt.addContent(" "+(getStatusStr().equals("")?"<No status text>":getStatusStr()));
    rt.finish();
    getMessageForm().getForm().setTitle(name);
    getMessageForm().getForm().delete(0);
    getMessageForm().getForm().insert(0, rt);
//    getMessageForm().setStatusHolder(rt);
  }
View Full Code Here

  }

  public void addMail(String from, String subj, String body)
  {
    mailCount++;
    RichText rt = new RichText(d);
    rt.setCanvasWidth(rl.getRoster().getWidth());
    rt.addImage(mailImg);
    rt.addContent(" From: ", rt.getDefaultColor(), true);
    rt.addContent(from+"\n");
    rt.addContent("Subject: ", rt.getDefaultColor(), true);
    rt.addContent(subj+"\n");
    rt.addContent(body);
    rt.finish();
    f.insert(0, rt);
    f.setTitle("New messages: "+mailCount);
  }
View Full Code Here

TOP

Related Classes of custom.RichText

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.