Improve Show Information and Set Shipping dialogs.

by mrs, 08 Nov, 2009 12:23 AM
1021 1024  
18641864   public static final String endRow = "</td></tr>";
18651865 
18661866   // TODO -- Extract this crap out to a EntryHTMLBuilder class, which gets instantiated with an AuctionEntry object.
1867   public String buildInfoHTML() {
1868     return buildInfoHTML(false);
1867   public String buildInfoHTML(boolean includeEvents) {
1868     return buildInfoHTML(includeEvents, false);
18691869   }
18701870 
1871   public String buildInfoHTML(boolean forRSS) {
1871   public String buildInfoHTML(boolean includeEvents, boolean forRSS) {
18721872     String prompt = "";
18731873 
18741874     if(forRSS) {
------
18931893         addedThumbnail = true;
18941894       }
18951895     }
1896     prompt = buildInfoBody(prompt, addedThumbnail);
1896     prompt = buildInfoBody(prompt, includeEvents, addedThumbnail);
18971897 
18981898    return(prompt);
18991899   }
------
19021902     return newRow + label + newCol + value.toString() + endRow;
19031903   }
19041904 
1905   private String buildInfoBody(String prompt, boolean addedThumbnail) {
1905   private String buildInfoBody(String prompt, boolean includeEvents, boolean addedThumbnail) {
19061906     if(!isFixed()) {
19071907       prompt += buildRow("Currently", getCurBid() + " (" + getNumBidders() + " Bids)");
19081908       prompt += buildRow("High bidder", getHighBidder());
------
19641964       prompt += "<b>" + getComment() + "</b><br>";
19651965     }
19661966 
1967     prompt += "<b><u>Events</u></b><blockquote>" + getStatusHistory() + "</blockquote>";
1967     if(includeEvents) prompt += "<b><u>Events</u></b><blockquote>" + getStatusHistory() + "</blockquote>";
19681968     return prompt;
19691969   }
19701970 
1017 1024  
480480     StringBuffer prompt = new StringBuffer();
481481     for (int aRowList : rowList) {
482482       AuctionEntry stepAE = (AuctionEntry) mTabs.getIndexedEntry(aRowList);
483       prompt.append(stepAE.buildInfoHTML()).append("<hr>");
483       prompt.append(stepAE.buildInfoHTML(true)).append("<hr>");
484484     }
485485     int width = getInteger("info.width", 480);
486486     int height = getInteger("info.height", Math.min(372, rowList.length * 30 + 200));
------
495495         }
496496       };
497497 
498     final JFrame newFrame = _oui.showChoiceTextDisplay(new JHTMLOutput("Information", prompt).getStringBuffer(), statusBox, "Information...", buttons, "Information...", al);
498     final JFrame newFrame = _oui.showChoiceTextDisplay(new JHTMLOutput("Information", prompt).getStringBuffer(), statusBox, "Information...", buttons, null, al);
499499     newFrame.addComponentListener(new ComponentAdapter() {
500500       public void componentResized(ComponentEvent e) {
501501         JConfig.setDisplayConfiguration("info.width", Integer.toString(newFrame.getWidth()));
------
798798       return;
799799     }
800800 
801     String prompt = "<html><body>" + ae.buildInfoHTML();
801     String prompt = "<html><body>" + ae.buildInfoHTML(false);
802802     prompt += "<br><b>How much is shipping?</b></body></html>";
803803     String endResult[] = promptString(src, prompt, "Shipping", null, null, null);
804804 
937 1024  
349349     otherFrame.setMinimumSize(inSize);
350350     otherFrame.getContentPane().add(insidePanel);
351351     insidePanel.add(jsp, BorderLayout.CENTER);
352     insidePanel.setBorder(BorderFactory.createTitledBorder(borderTitle));
352     if(borderTitle != null) {
353       insidePanel.setBorder(BorderFactory.createTitledBorder(borderTitle));
354     } else {
355       insidePanel.setBorder(BorderFactory.createEmptyBorder());
356     }
353357     JPanel bottomPanel = new JPanel();
354358     bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS));
355359