Package javolution.text

Examples of javolution.text.TextBuilder


    return false;
  }

  public void sendPendingPetitionList(L2PcInstance activeChar)
  {
        TextBuilder htmlContent = new TextBuilder("<html><body>" +
    "<center><font color=\"LEVEL\">Current Petitions</font><br><table width=\"300\">");
    SimpleDateFormat dateFormat = new SimpleDateFormat("dd MMM HH:mm z");

    if (getPendingPetitionCount() == 0)
      htmlContent.append("<tr><td colspan=\"4\">There are no currently pending petitions.</td></tr>");
    else
      htmlContent.append("<tr><td></td><td><font color=\"999999\">Petitioner</font></td>" +
      "<td><font color=\"999999\">Petition Type</font></td><td><font color=\"999999\">Submitted</font></td></tr>");

    for (Petition currPetition : getPendingPetitions().values())
    {
            if (currPetition == null)
                continue;

      htmlContent.append("<tr><td>");

      if (currPetition.getState() != PetitionState.In_Process)
        htmlContent.append("<button value=\"View\" action=\"bypass -h admin_view_petition " + currPetition.getId() + "\" " +
    "width=\"40\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\">");
      else
        htmlContent.append("<font color=\"999999\">In Process</font>");

      htmlContent.append("</td><td>" + currPetition.getPetitioner().getName() +
                         "</td><td>" + currPetition.getTypeAsString() + "</td><td>" +
                         dateFormat.format(new Date(currPetition.getSubmitTime())) + "</td></tr>");
    }

    htmlContent.append("</table><br><button value=\"Refresh\" action=\"bypass -h admin_view_petitions\" width=\"50\" " +
                       "height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br><button value=\"Back\" action=\"bypass -h admin_admin\" " +
    "width=\"40\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"></center></body></html>");

    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);
  }
View Full Code Here


    if (!isValidPetition(petitionId))
      return;

    Petition currPetition = getPendingPetitions().get(petitionId);
        TextBuilder htmlContent = new TextBuilder("<html><body>");
    SimpleDateFormat dateFormat = new SimpleDateFormat("EEE dd MMM HH:mm z");

    htmlContent.append("<center><br><font color=\"LEVEL\">Petition #" + currPetition.getId() + "</font><br1>");
    htmlContent.append("<img src=\"L2UI.SquareGray\" width=\"200\" height=\"1\"></center><br>");
    htmlContent.append("Submit Time: " + dateFormat.format(new Date(currPetition.getSubmitTime())) + "<br1>");
    htmlContent.append("Petitioner: " + currPetition.getPetitioner().getName() + "<br1>");
    htmlContent.append("Petition Type: " + currPetition.getTypeAsString() + "<br>" + currPetition.getContent() + "<br>");
    htmlContent.append("<center><button value=\"Accept\" action=\"bypass -h admin_accept_petition " + currPetition.getId() + "\"" +
    "width=\"50\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br1>");
    htmlContent.append("<button value=\"Reject\" action=\"bypass -h admin_reject_petition " + currPetition.getId() + "\" " +
    "width=\"50\" height=\"15\" back=\"sek.cbui94\" fore=\"sek.cbui92\"><br>");
    htmlContent.append("<button value=\"Back\" action=\"bypass -h admin_view_petitions\" width=\"40\" height=\"15\" back=\"sek.cbui94\" " +
    "fore=\"sek.cbui92\"></center>");
    htmlContent.append("</body></html>");

    NpcHtmlMessage htmlMsg = new NpcHtmlMessage(0);
    htmlMsg.setHtml(htmlContent.toString());
    activeChar.sendPacket(htmlMsg);
  }
View Full Code Here

      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Delete</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Delete entry in merchantList.");
    replyMSG.append("<br>Item to Delete: "+ItemTable.getInstance().getTemplate(itemID).getName());
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td width=100>Value</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>Price</td><td>"+tradeList.getPriceForItemId(itemID)+"</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center><br><br><br>");
    replyMSG.append("<button value=\"Confirm\" action=\"bypass -h admin_delShopItem " + tradeListID + " " + itemID + " 1\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<br><button value=\"Back\" action=\"bypass -h admin_showShopList " + tradeListID +" 1\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center>");
    replyMSG.append("</body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

      return;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder();
    replyMSG.append("<html><title>Merchant Shop Item Add</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Add a new entry in merchantList.");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=100>Property</td><td>Edit Field</td></tr>");
    replyMSG.append("<tr><td><br></td><td></td></tr>");
    replyMSG.append("<tr><td>ItemID</td><td><edit var=\"itemID\" width=80></td></tr>");
    replyMSG.append("<tr><td>Price</td><td><edit var=\"price\" width=80></td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center><br><br><br>");
    replyMSG.append("<button value=\"Save\" action=\"bypass -h admin_addShopItem " + tradeListID + " $itemID $price\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<br><button value=\"Back\" action=\"bypass -h admin_showShopList " + tradeListID +" 1\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center>");
    replyMSG.append("</body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

    L2TradeList tradeList = TradeController.getInstance().getBuyList(tradeListID);
    if (page > tradeList.getItems().size() / PAGE_LIMIT + 1 || page < 1)
      return;

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);
    TextBuilder html = itemListHtml(tradeList, page);

    adminReply.setHtml(html.toString());
    activeChar.sendPacket(adminReply);

  }
View Full Code Here

  }

  private TextBuilder itemListHtml(L2TradeList tradeList, int page)
  {
    TextBuilder replyMSG = new TextBuilder();

    replyMSG.append("<html><title>Merchant Shop List Page: "+page+"</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Edit, add or delete entries in a merchantList.");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td width=150>Item Name</td><td width=60>Price</td><td width=40>Delete</td></tr>");
    int start = ((page-1) * PAGE_LIMIT);
    int end = Math.min(((page-1) * PAGE_LIMIT) + (PAGE_LIMIT-1), tradeList.getItems().size() - 1);
    for (L2ItemInstance item : tradeList.getItems(start, end+1))
    {
      replyMSG.append("<tr><td><a action=\"bypass -h admin_editShopItem "+tradeList.getListId()+" "+item.getItemId()+"\">"+item.getItem().getName()+"</a></td>");
      replyMSG.append("<td>"+item.getPriceToSell()+"</td>");
      replyMSG.append("<td><button value=\"Del\" action=\"bypass -h admin_delShopItem "+tradeList.getListId()+" "+item.getItemId()+"\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
      replyMSG.append("</tr>");
    }//*/
    replyMSG.append("<tr>");
    int min = 1;
    int max = tradeList.getItems().size() / PAGE_LIMIT + 1;
    if (page > 1)
    {
      replyMSG.append("<td><button value=\"Page"+(page - 1)+"\" action=\"bypass -h admin_showShopList "+tradeList.getListId()+" "+(page - 1)+"\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    }
    if (page < max)
    {
      if (page <= min)
        replyMSG.append("<td></td>");
      replyMSG.append("<td><button value=\"Page"+(page + 1)+"\" action=\"bypass -h admin_showShopList "+tradeList.getListId()+" "+(page + 1)+"\" width=40 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\"></td>");
    }
    replyMSG.append("</tr><tr><td>.</td></tr>");
    replyMSG.append("</table>");
    replyMSG.append("<center>");
    replyMSG.append("<button value=\"Add\" action=\"bypass -h admin_addShopItem "+tradeList.getListId()+"\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<button value=\"Close\" action=\"bypass -h admin_close_window\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center></body></html>");

    return replyMSG;
  }
View Full Code Here

      return ;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>Merchant Shop Lists</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Select a list to view");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>Mecrchant List ID</td></tr>");

    for (L2TradeList tradeList : tradeLists)
    {
      if (tradeList != null)
        replyMSG.append("<tr><td><a action=\"bypass -h admin_showShopList "+tradeList.getListId()+" 1\">Trade List "+tradeList.getListId()+"</a></td></tr>");
    }

    replyMSG.append("</table>");
    replyMSG.append("<center>");
    replyMSG.append("<button value=\"Close\" action=\"bypass -h admin_close_window\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center></body></html>");

    adminReply.setHtml(replyMSG.toString());
    activeChar.sendPacket(adminReply);
  }
View Full Code Here

      return ;
    }

    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>NPC: "+ npcData.name + "("+npcData.npcId+") 's drop manage</title>");
    replyMSG.append("<body>");
    replyMSG.append("<br>Notes: click[drop_id]to show the detail of drop data,click[del] to delete the drop data!");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>npc_id itemId category</td><td>item[id]</td><td>type</td><td>del</td></tr>");

    for(L2DropCategory cat:npcData.getDropData())
      for(L2DropData drop : cat.getAllDrops())
      {
        replyMSG.append("<tr><td><a action=\"bypass -h admin_edit_drop " + npcData.npcId + " " + drop.getItemId()+ " " + cat.getCategoryType() + "\">"
            + npcData.npcId + " " + drop.getItemId() + " " + cat.getCategoryType() + "</a></td>" +
            "<td>" + ItemTable.getInstance().getTemplate(drop.getItemId()).getName() + "[" + drop.getItemId() + "]" + "</td><td>" + (drop.isQuestDrop()?"Q":(cat.isSweep()?"S":"D")) + "</td><td>" +
            "<a action=\"bypass -h admin_del_drop " + npcData.npcId + " " + drop.getItemId() +" "+ cat.getCategoryType() +"\">del</a></td></tr>");
      }

    replyMSG.append("</table>");
    replyMSG.append("<center>");
    replyMSG.append("<button value=\"Add DropData\" action=\"bypass -h admin_add_drop "+ npcId + "\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<button value=\"Close\" action=\"bypass -h admin_close_window\" width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center></body></html>");

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

  }
View Full Code Here

      PreparedStatement statement = con.prepareStatement("SELECT mobId, itemId, min, max, category, chance FROM droplist WHERE mobId=" + npcId + " AND itemId=" + itemId+ " AND category=" + category);
      ResultSet dropData = statement.executeQuery();

      NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

      TextBuilder replyMSG = new TextBuilder("<html><title>the detail of dropdata: (" + npcId + " " + itemId + " " + category + ")</title>");
      replyMSG.append("<body>");

      if(dropData.next()){
        replyMSG.append("<table>");
        replyMSG.append("<tr><td>Appertain of NPC</td><td>"+ NpcTable.getInstance().getTemplate(dropData.getInt("mobId")).name + "</td></tr>");
        replyMSG.append("<tr><td>ItemName</td><td>"+ ItemTable.getInstance().getTemplate(dropData.getInt("itemId")).getName() + "(" + dropData.getInt("itemId") + ")</td></tr>");
        replyMSG.append("<tr><td>Category</td><td>"+ ((category==-1)?"sweep":Integer.toString(category)) + "</td></tr>");
        replyMSG.append("<tr><td>MIN(" + dropData.getInt("min") + ")</td><td><edit var=\"min\" width=80></td></tr>");
        replyMSG.append("<tr><td>MAX(" + dropData.getInt("max") + ")</td><td><edit var=\"max\" width=80></td></tr>");
        replyMSG.append("<tr><td>CHANCE("+ dropData.getInt("chance") + ")</td><td><edit var=\"chance\" width=80></td></tr>");
        replyMSG.append("</table>");

        replyMSG.append("<center>");
        replyMSG.append("<button value=\"Save Modify\" action=\"bypass -h admin_edit_drop " + npcId + " " + itemId + " " + category +" $min $max $chance\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + dropData.getInt("mobId") +"\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
        replyMSG.append("</center>");
      }

      dropData.close();
      statement.close();

      replyMSG.append("</body></html>");
      adminReply.setHtml(replyMSG.toString());

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

  private void showAddDropData(L2PcInstance activeChar, L2NpcTemplate npcData)
  {
    NpcHtmlMessage adminReply = new NpcHtmlMessage(5);

    TextBuilder replyMSG = new TextBuilder("<html><title>Add dropdata to " + npcData.name + "(" + npcData.npcId + ")</title>");
    replyMSG.append("<body>");
    replyMSG.append("<table>");
    replyMSG.append("<tr><td>Item-Id</td><td><edit var=\"itemId\" width=80></td></tr>");
    replyMSG.append("<tr><td>MIN</td><td><edit var=\"min\" width=80></td></tr>");
    replyMSG.append("<tr><td>MAX</td><td><edit var=\"max\" width=80></td></tr>");
    replyMSG.append("<tr><td>CATEGORY(sweep=-1)</td><td><edit var=\"category\" width=80></td></tr>");
    replyMSG.append("<tr><td>CHANCE(0-1000000)</td><td><edit var=\"chance\" width=80></td></tr>");
    replyMSG.append("</table>");

    replyMSG.append("<center>");
    replyMSG.append("<button value=\"SAVE\" action=\"bypass -h admin_add_drop " + npcData.npcId + " $itemId $category $min $max $chance\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("<br><button value=\"DropList\" action=\"bypass -h admin_show_droplist " + npcData.npcId +"\"  width=100 height=15 back=\"sek.cbui94\" fore=\"sek.cbui92\">");
    replyMSG.append("</center>");
    replyMSG.append("</body></html>");
    adminReply.setHtml(replyMSG.toString());

    activeChar.sendPacket(adminReply);
  }
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.