Package hamsam.api

Examples of hamsam.api.URLComponent


        ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
      String linkText = sb.substring(urlStart, urlEnd);
      try
      {
        if(linkText.startsWith("www"))
          ret.add(new URLComponent(linkText, new URL("http://" + linkText)));
        else
          ret.add(new URLComponent(linkText, new URL(linkText)));
      }
      catch(MalformedURLException e)
      {
        ret.add(new TextComponent(linkText));
      }
View Full Code Here


         SmileyComponent smiley = (SmileyComponent) comp;
        ret.append(smiley.getText());
       }
       else if(comp instanceof URLComponent)
       {
         URLComponent url = (URLComponent) comp;
        ret.append(url.getLinkText());
       }
    }

    return ret.toString();
  }
View Full Code Here

        ret.add(new TextComponent(sb.substring(txtStart, urlStart)));
      String linkText = sb.substring(urlStart, urlEnd);
      try
      {
        if(linkText.startsWith("www"))
          ret.add(new URLComponent(linkText, new URL("http://" + linkText)));
        else
          ret.add(new URLComponent(linkText, new URL(linkText)));
      }
      catch(MalformedURLException e)
      {
        ret.add(new TextComponent(linkText));
      }
View Full Code Here

      else if (comp instanceof SmileyComponent) {
        SmileyComponent sml = (SmileyComponent) comp;
        System.out.print("<smiley>" + sml.getName());
      }
      else if (comp instanceof URLComponent) {
        URLComponent url = (URLComponent) comp;
        System.out.print("<url>" + url.getLinkText());
      }
      else
        System.out.println(comp);
    }
View Full Code Here

        SmileyComponent smiley = (SmileyComponent) comp;
        buff.append(smiley.getText());
      }
      else if(comp instanceof URLComponent)
      {
        URLComponent url = (URLComponent) comp;
        buff.append(url.getLinkURL());
      }
    }
   
    return new MsnMessage(font, color, buff.toString());
  }
View Full Code Here

TOP

Related Classes of hamsam.api.URLComponent

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.