Package javolution.text

Examples of javolution.text.TextBuilder


      if(npcId > 0)
      {
        reLoadNpcDropList(npcId);

        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        TextBuilder replyMSG = new TextBuilder("<html><title>Drop data modify complete!</title>");
        replyMSG.append("<body>");
        replyMSG.append("<center><button value=\"DropList\" action=\"bypass -h admin_show_droplist "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></center>");
        replyMSG.append("</body></html>");

        adminReply.setHtml(replyMSG.toString());
        activeChar.sendPacket(adminReply);
      }
      else
        activeChar.sendMessage("unknown error!");
    }
View Full Code Here


      statement.close();

      reLoadNpcDropList(npcId);

      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
      TextBuilder replyMSG = new TextBuilder("<html><title>Add drop data complete!</title>");
      replyMSG.append("<body>");
      replyMSG.append("<center><button value=\"Continue add\" action=\"bypass -h admin_add_drop "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
      replyMSG.append("<br><br><button value=\"DropList\" action=\"bypass -h admin_show_droplist "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
      replyMSG.append("</center></body></html>");

      adminReply.setHtml(replyMSG.toString());
      activeChar.sendPacket(adminReply);
    }
    catch(Exception e){}
    finally
    {
View Full Code Here

  /**
   * @return
   */
  public String getPacketStats()
  {
    TextBuilder tb = new TextBuilder();
    ThreadFactory tf = _generalPacketsThreadPool.getThreadFactory();
    if (tf instanceof PriorityThreadFactory)
    {
      tb.append("General Packet Thread Pool:\r\n");
      tb.append("Tasks in the queue: "+_generalPacketsThreadPool.getQueue().size()+"\r\n");
      tb.append("Showing threads stack trace:\r\n");
      PriorityThreadFactory ptf = (PriorityThreadFactory) tf;
      int count = ptf.getGroup().activeCount();
      Thread[] threads = new Thread[count+2];
      ptf.getGroup().enumerate(threads);
      tb.append("There should be "+count+" Threads\r\n");
      for(Thread t : threads)
      {
        if(t == null)
          continue;
        tb.append(t.getName()+"\r\n");
        for(StackTraceElement ste :t.getStackTrace())
        {
          tb.append(ste.toString());
          tb.append("\r\n");
        }
      }
    }
    tb.append("Packet Tp stack traces printed.\r\n");
    return tb.toString();
  }
View Full Code Here

    return tb.toString();
  }

  public String getIOPacketStats()
  {
    TextBuilder tb = new TextBuilder();
    ThreadFactory tf = _ioPacketsThreadPool.getThreadFactory();
    if (tf instanceof PriorityThreadFactory)
    {
      tb.append("I/O Packet Thread Pool:\r\n");
      tb.append("Tasks in the queue: "+_ioPacketsThreadPool.getQueue().size()+"\r\n");
      tb.append("Showing threads stack trace:\r\n");
      PriorityThreadFactory ptf = (PriorityThreadFactory) tf;
      int count = ptf.getGroup().activeCount();
      Thread[] threads = new Thread[count+2];
      ptf.getGroup().enumerate(threads);
      tb.append("There should be "+count+" Threads\r\n");
      for(Thread t : threads)
      {
        if(t == null)
          continue;
        tb.append(t.getName()+"\r\n");
        for(StackTraceElement ste :t.getStackTrace())
        {
          tb.append(ste.toString());
          tb.append("\r\n");
        }
      }
    }
    tb.append("Packet Tp stack traces printed.\r\n");
    return tb.toString();
  }
View Full Code Here

        {
            L2PcInstance pc = L2World.getInstance().getPlayer(target);
            if(pc!=null){
                NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

                TextBuilder replyMSG = new TextBuilder("<html><body>");

                replyMSG.append("<center><font color=\"LEVEL\">[ L2J EVENT ENGINE ]</font></center><br>");
                replyMSG.append("<br>Statistics for player <font color=\"LEVEL\">" + pc.getName() + "</font><br>");
                replyMSG.append("Total kills <font color=\"FF0000\">" + pc.kills.size() + "</font><br>");
                replyMSG.append("<br>Detailed list: <br>");
                Iterator<String> it = pc.kills.iterator();
                while(it.hasNext()){
                    replyMSG.append("<font color=\"FF0000\">" + it.next() + "</font><br>");
                }
                replyMSG.append("</body></html>");

                adminReply.setHtml(replyMSG.toString());
                activeChar.sendPacket(adminReply);
            }


        }
View Full Code Here

    {
        if (id != COMMAND_IDS[0]) return false;

        String penaltyStr = "No current penalties in effect.";

        TextBuilder htmlContent = new TextBuilder("<html><body>");
        htmlContent.append("<center><table width=\"270\" border=\"0\" bgcolor=\"111111\">");
        htmlContent.append("<tr><td width=\"170\">Penalty</td>");
        htmlContent.append("<td width=\"100\" align=\"center\">Expiration Date</td></tr>");
        htmlContent.append("</table><table width=\"270\" border=\"0\">");
        htmlContent.append("<tr><td>" + penaltyStr + "</td></tr>");
        htmlContent.append("</table></center>");
        htmlContent.append("</body></html>");

        NpcHtmlMessage penaltyHtml = new NpcHtmlMessage(0);
        penaltyHtml.setHtml(htmlContent.toString());
        activeChar.sendPacket(penaltyHtml);

        return true;
    }
View Full Code Here

    return tb.toString();
  }

  public String getGeneralStats()
  {
    TextBuilder tb = new TextBuilder();
    ThreadFactory tf = _generalThreadPool.getThreadFactory();
    if (tf instanceof PriorityThreadFactory)
    {
      tb.append("General Thread Pool:\r\n");
      tb.append("Tasks in the queue: "+_generalThreadPool.getQueue().size()+"\r\n");
      tb.append("Showing threads stack trace:\r\n");
      PriorityThreadFactory ptf = (PriorityThreadFactory) tf;
      int count = ptf.getGroup().activeCount();
      Thread[] threads = new Thread[count+2];
      ptf.getGroup().enumerate(threads);
      tb.append("There should be "+count+" Threads\r\n");
      for(Thread t : threads)
      {
        if(t == null)
          continue;
        tb.append(t.getName()+"\r\n");
        for(StackTraceElement ste :t.getStackTrace())
        {
          tb.append(ste.toString());
          tb.append("\r\n");
        }
      }
    }
    tb.append("Packet Tp stack traces printed.\r\n");
    return tb.toString();
  }
View Full Code Here

  public void listAnnouncements(L2PcInstance activeChar)
  {
        String content = HtmCache.getInstance().getHtmForce("data/html/admin/announce.htm");
        NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
        adminReply.setHtml(content);
        TextBuilder replyMSG = new TextBuilder("<br>");
    for (int i = 0; i < _announcements.size(); i++)
    {
      replyMSG.append("<table width=260><tr><td width=220>" + _announcements.get(i) + "</td><td width=40>");
      replyMSG.append("<button value=\"Delete\" action=\"bypass -h admin_del_announcement " + i + "\" width=60 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td></tr></table>");
    }
        adminReply.replace("%announces%", replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

        activeChar.sendPacket(new SystemMessage(SystemMessageId.NO_CB_IN_MY_CLAN));
        parsecmd("_bbsclan_clanlist",activeChar);
      }
      else
      {
                TextBuilder html = new TextBuilder("<html><body><center><br><br>");
        html.append("<br1><br1><table border=0 cellspacing=0 cellpadding=0>");
        html.append("<tr><td FIXWIDTH=15>&nbsp;</td>");
        html.append("<td width=610 height=30 align=left>");
        html.append("<a action=\"bypass _bbshome\">HOME</a> &gt; <a action=\"bypass _bbsclan_clanlist\"> CLAN COMMUNITY </a>  &gt; <a action=\"bypass _bbsclan_clanhome;"
          + clanId + "\"> &amp;$802; </a>");
        html.append("</td></tr></table>");
        html.append("<table border=0 cellspacing=0 cellpadding=0 width=610 bgcolor=434343>");
        html.append("<tr><td height=10></td></tr>");
        html.append("<tr>");
        html.append("<td fixWIDTH=5></td>");
        html.append("<td fixwidth=600>");
        html.append("<a action=\"bypass _bbsclan_clanhome;" + clanId
          + ";announce\">[CLAN ANNOUNCEMENT]</a> <a action=\"bypass _bbsclan_clanhome;"
          + clanId + ";cbb\">[CLAN BULLETIN BOARD]</a>");
        html.append("<a action=\"bypass _bbsclan_clanhome;" + clanId
          + ";cmail\">[CLAN MAIL]</a>&nbsp;&nbsp;");
        html.append("<a action=\"bypass _bbsclan_clanhome;" + clanId
          + ";cnotice\">[CLAN NOTICE]</a>&nbsp;&nbsp;");
        html.append("</td>");
        html.append("<td fixWIDTH=5></td>");
        html.append("</tr>");
        html.append("<tr><td height=10></td></tr>");
        html.append("</table>");
        html.append("<table border=0 cellspacing=0 cellpadding=0 width=610>");
        html.append("<tr><td height=10></td></tr>");
        html.append("<tr><td fixWIDTH=5></td>");
        html.append("<td fixwidth=290 valign=top>");
        html.append("</td>");
        html.append("<td fixWIDTH=5></td>");
        html.append("<td fixWIDTH=5 align=center valign=top><img src=\"l2ui.squaregray\" width=2  height=128></td>");
        html.append("<td fixWIDTH=5></td>");
        html.append("<td fixwidth=295>");
        html.append("<table border=0 cellspacing=0 cellpadding=0 width=295>");
        html.append("<tr>");
        html.append("<td fixWIDTH=100 align=left>CLAN NAME</td>");
        html.append("<td fixWIDTH=195 align=left>" + cl.getName() + "</td>");
        html.append("</tr>");
        html.append("<tr><td height=7></td></tr>");
        html.append("<tr>");
        html.append("<td fixWIDTH=100 align=left>CLAN LEVEL</td>");
        html.append("<td fixWIDTH=195 align=left height=16>" + cl.getLevel() + "</td>");
        html.append("</tr>");
        html.append("<tr><td height=7></td></tr>");
        html.append("<tr>");
        html.append("<td fixWIDTH=100 align=left>CLAN MEMBERS</td>");
        html.append("<td fixWIDTH=195 align=left height=16>" + cl.getMembersCount() + "</td>");
        html.append("</tr>");
        html.append("<tr><td height=7></td></tr>");
        html.append("<tr>");
        html.append("<td fixWIDTH=100 align=left>CLAN LEADER</td>");
        html.append("<td fixWIDTH=195 align=left height=16>" + cl.getLeaderName() + "</td>");
        html.append("</tr>");
        html.append("<tr><td height=7></td></tr>");
        //ADMINISTRATOR ??
        /*html.append("<tr>");
         html.append("<td fixWIDTH=100 align=left>ADMINISTRATOR</td>");
         html.append("<td fixWIDTH=195 align=left height=16>"+cl.getLeaderName()+"</td>");
         html.append("</tr>");*/
        html.append("<tr><td height=7></td></tr>");
        html.append("<tr>");
        html.append("<td fixWIDTH=100 align=left>ALLIANCE</td>");
        html.append("<td fixWIDTH=195 align=left height=16>"
          + ((cl.getAllyName() != null) ? cl.getAllyName() : "") + "</td>");
        html.append("</tr>");
        html.append("</table>");
        html.append("</td>");
        html.append("<td fixWIDTH=5></td>");
        html.append("</tr>");
        html.append("<tr><td height=10></td></tr>");
        html.append("</table>");
        //TODO: the BB for clan :)
        //html.append("<table border=0 cellspacing=0 cellpadding=0 width=610  bgcolor=333333>");
        html.append("<img src=\"L2UI.squareblank\" width=\"1\" height=\"5\">");
        html.append("<img src=\"L2UI.squaregray\" width=\"610\" height=\"1\">");
        html.append("<br>");
        html.append("</center>");
        html.append("<br> <br>");
        html.append("</body>");
        html.append("</html>");
        separateAndSend(html.toString(), activeChar);
      }
    }
  }
View Full Code Here

   * @param forum
   * @param p
   */
  private void showHtmlEditPost(Topic topic, L2PcInstance activeChar, Forum forum, Post p)
  {
        TextBuilder html = new TextBuilder("<html>");
    html.append("<body><br><br>");
    html.append("<table border=0 width=610><tr><td width=10></td><td width=600 align=left>");
    html.append("<a action=\"bypass _bbshome\">HOME</a>&nbsp;>&nbsp;<a action=\"bypass _bbsmemo\">"+forum.getName()+" Form</a>");
    html.append("</td></tr>");
    html.append("</table>");
    html.append("<img src=\"L2UI.squareblank\" width=\"1\" height=\"10\">");
    html.append("<center>");
    html.append("<table border=0 cellspacing=0 cellpadding=0>");
    html.append("<tr><td width=610><img src=\"sek.cbui355\" width=\"610\" height=\"1\"><br1><img src=\"sek.cbui355\" width=\"610\" height=\"1\"></td></tr>");
    html.append("</table>");
    html.append("<table fixwidth=610 border=0 cellspacing=0 cellpadding=0>");
    html.append("<tr><td><img src=\"l2ui.mini_logo\" width=5 height=20></td></tr>");
    html.append("<tr>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("<td align=center FIXWIDTH=60 height=29>&$413;</td>");
    html.append("<td FIXWIDTH=540>"+ topic.getName() +"</td>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("</tr></table>");
    html.append("<table fixwidth=610 border=0 cellspacing=0 cellpadding=0>");
    html.append("<tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr>");
    html.append("<tr>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("<td align=center FIXWIDTH=60 height=29 valign=top>&$427;</td>");
    html.append("<td align=center FIXWIDTH=540><MultiEdit var =\"Content\" width=535 height=313></td>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("</tr>");
    html.append("<tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr>");
    html.append("</table>");
    html.append("<table fixwidth=610 border=0 cellspacing=0 cellpadding=0>");
    html.append("<tr><td><img src=\"l2ui.mini_logo\" width=5 height=10></td></tr>");
    html.append("<tr>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("<td align=center FIXWIDTH=60 height=29>&nbsp;</td>");
    html.append("<td align=center FIXWIDTH=70><button value=\"&$140;\" action=\"Write Post "+forum.getID()+";"+topic.getID()+";0 _ Content Content Content\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\" ></td>");
    html.append("<td align=center FIXWIDTH=70><button value = \"&$141;\" action=\"bypass _bbsmemo\" back=\"l2ui_ch3.smallbutton2_down\" width=65 height=20 fore=\"l2ui_ch3.smallbutton2\"> </td>");
    html.append("<td align=center FIXWIDTH=400>&nbsp;</td>");
    html.append("<td><img src=\"l2ui.mini_logo\" width=5 height=1></td>");
    html.append("</tr></table>");
    html.append("</center>");
    html.append("</body>");
    html.append("</html>");
    send1001(html.toString(),activeChar);
      send1002(activeChar,p.getCPost(0).postTxt,topic.getName(),DateFormat.getInstance().format(new Date(topic.getDate())));
  }
View Full Code Here

TOP

Related Classes of javolution.text.TextBuilder

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.