Add a 'Submit Log' button to the log viewer which sends me the log file via S3, and makes a note at my.jbidwatcher.com that it's been uploaded.
- M jbidwatcher/trunk/src/com/jbidwatcher/ui/UserActions.java view
- M jbidwatcher/trunk/src/com/jbidwatcher/ui/util/OptionUI.java view
| 932 | 937 | |
|---|---|---|
| 1197 | 1197 | logText = EMPTY_LOG; |
| 1198 | 1198 | } |
| 1199 | 1199 | |
| 1200 | JFrame logFrame = _oui.showTextDisplay(logText, logBoxSize, Constants.PROGRAM_NAME + " " + frameName, false); | |
| 1200 | JFrame logFrame = _oui.getTextDisplay(logText, logBoxSize, Constants.PROGRAM_NAME + " " + frameName, false); | |
| 1201 | JButton logButton = new JButton("Submit Log"); | |
| 1202 | logButton.addActionListener(new ActionListener() { | |
| 1203 | public void actionPerformed(ActionEvent e) { | |
| 1204 | DoSubmitLogFile(); | |
| 1205 | } | |
| 1206 | }); | |
| 1207 | JPanel buttonBox = new JPanel(new BorderLayout()); | |
| 1208 | buttonBox.add(logButton, BorderLayout.EAST); | |
| 1209 | logFrame.add(buttonBox, BorderLayout.SOUTH); | |
| 1210 | ||
| 1211 | logFrame.pack(); | |
| 1212 | logFrame.setSize(logBoxSize.width, logBoxSize.height); | |
| 1213 | logFrame.setVisible(true); | |
| 1201 | 1214 | logFrame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); |
| 1202 | 1215 | } |
| 1203 | 1216 | |
| 913 | 937 | |
|---|---|---|
| 254 | 254 | * @return - The JFrame of the display. |
| 255 | 255 | */ |
| 256 | 256 | public JFrame showTextDisplay(StringBuffer inSB, Dimension inSize, String frameName, boolean isHTML) { |
| 257 | JFrame otherFrame = getTextDisplay(inSB, inSize, frameName, isHTML); | |
| 258 | otherFrame.pack(); | |
| 259 | otherFrame.setSize(inSize.width, inSize.height); | |
| 260 | otherFrame.setVisible(true); | |
| 261 | ||
| 262 | return otherFrame; | |
| 263 | } | |
| 264 | ||
| 265 | public JFrame getTextDisplay(StringBuffer inSB, Dimension inSize, String frameName, boolean isHTML) { | |
| 257 | 266 | JFrame otherFrame; |
| 258 | 267 | JBEditorPane jep; |
| 259 | 268 | JScrollPane jsp; |
| --- | --- | |
| 267 | 276 | otherFrame.getContentPane().add(jsp); |
| 268 | 277 | jep.setCaretPosition(0); |
| 269 | 278 | otherFrame.setLocation(getCenter(inSize)); |
| 270 | otherFrame.pack(); | |
| 271 | otherFrame.setSize(inSize.width, inSize.height); | |
| 272 | otherFrame.setVisible(true); | |
| 273 | ||
| 274 | 279 | return otherFrame; |
| 275 | 280 | } |
| 276 | 281 | |
