Improve Show Information and Set Shipping dialogs.
- M jbidwatcher/trunk/src/com/jbidwatcher/auction/AuctionEntry.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/ui/UserActions.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/ui/util/OptionUI.java view
| 1021 | 1024 | |
|---|---|---|
| 1864 | 1864 | public static final String endRow = "</td></tr>"; |
| 1865 | 1865 | |
| 1866 | 1866 | // 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); | |
| 1869 | 1869 | } |
| 1870 | 1870 | |
| 1871 | public String buildInfoHTML(boolean forRSS) { | |
| 1871 | public String buildInfoHTML(boolean includeEvents, boolean forRSS) { | |
| 1872 | 1872 | String prompt = ""; |
| 1873 | 1873 | |
| 1874 | 1874 | if(forRSS) { |
| --- | --- | |
| 1893 | 1893 | addedThumbnail = true; |
| 1894 | 1894 | } |
| 1895 | 1895 | } |
| 1896 | prompt = buildInfoBody(prompt, addedThumbnail); | |
| 1896 | prompt = buildInfoBody(prompt, includeEvents, addedThumbnail); | |
| 1897 | 1897 | |
| 1898 | 1898 | return(prompt); |
| 1899 | 1899 | } |
| --- | --- | |
| 1902 | 1902 | return newRow + label + newCol + value.toString() + endRow; |
| 1903 | 1903 | } |
| 1904 | 1904 | |
| 1905 | private String buildInfoBody(String prompt, boolean addedThumbnail) { | |
| 1905 | private String buildInfoBody(String prompt, boolean includeEvents, boolean addedThumbnail) { | |
| 1906 | 1906 | if(!isFixed()) { |
| 1907 | 1907 | prompt += buildRow("Currently", getCurBid() + " (" + getNumBidders() + " Bids)"); |
| 1908 | 1908 | prompt += buildRow("High bidder", getHighBidder()); |
| --- | --- | |
| 1964 | 1964 | prompt += "<b>" + getComment() + "</b><br>"; |
| 1965 | 1965 | } |
| 1966 | 1966 | |
| 1967 | prompt += "<b><u>Events</u></b><blockquote>" + getStatusHistory() + "</blockquote>"; | |
| 1967 | if(includeEvents) prompt += "<b><u>Events</u></b><blockquote>" + getStatusHistory() + "</blockquote>"; | |
| 1968 | 1968 | return prompt; |
| 1969 | 1969 | } |
| 1970 | 1970 | |
| 1017 | 1024 | |
|---|---|---|
| 480 | 480 | StringBuffer prompt = new StringBuffer(); |
| 481 | 481 | for (int aRowList : rowList) { |
| 482 | 482 | AuctionEntry stepAE = (AuctionEntry) mTabs.getIndexedEntry(aRowList); |
| 483 | prompt.append(stepAE.buildInfoHTML()).append("<hr>"); | |
| 483 | prompt.append(stepAE.buildInfoHTML(true)).append("<hr>"); | |
| 484 | 484 | } |
| 485 | 485 | int width = getInteger("info.width", 480); |
| 486 | 486 | int height = getInteger("info.height", Math.min(372, rowList.length * 30 + 200)); |
| --- | --- | |
| 495 | 495 | } |
| 496 | 496 | }; |
| 497 | 497 | |
| 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); | |
| 499 | 499 | newFrame.addComponentListener(new ComponentAdapter() { |
| 500 | 500 | public void componentResized(ComponentEvent e) { |
| 501 | 501 | JConfig.setDisplayConfiguration("info.width", Integer.toString(newFrame.getWidth())); |
| --- | --- | |
| 798 | 798 | return; |
| 799 | 799 | } |
| 800 | 800 | |
| 801 | String prompt = "<html><body>" + ae.buildInfoHTML(); | |
| 801 | String prompt = "<html><body>" + ae.buildInfoHTML(false); | |
| 802 | 802 | prompt += "<br><b>How much is shipping?</b></body></html>"; |
| 803 | 803 | String endResult[] = promptString(src, prompt, "Shipping", null, null, null); |
| 804 | 804 | |
| 937 | 1024 | |
|---|---|---|
| 349 | 349 | otherFrame.setMinimumSize(inSize); |
| 350 | 350 | otherFrame.getContentPane().add(insidePanel); |
| 351 | 351 | 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 | } | |
| 353 | 357 | JPanel bottomPanel = new JPanel(); |
| 354 | 358 | bottomPanel.setLayout(new BoxLayout(bottomPanel, BoxLayout.X_AXIS)); |
| 355 | 359 | |
