/build/distribution/IzPack/src/lib/com/izforge/izpack/panels/CompilePanel.java

https://bitbucket.org/jorgenio/gvsig · Java · 697 lines · 441 code · 117 blank · 139 comment · 30 complexity · 7dc300bec1e970162d8702a20723d1a1 MD5 · raw file

  1. /*
  2. * $Id: CompilePanel.java 5819 2006-06-14 07:29:09Z cesar $
  3. * IzPack
  4. * Copyright (C) 2001-2003 Julien Ponge, Tino Schwarze
  5. *
  6. * File : CompilePanel.java
  7. * Description : A panel to compile files after installation
  8. * Author's email : julien@izforge.com
  9. * Author's Website : http://www.izforge.com
  10. *
  11. * This program is free software; you can redistribute it and/or
  12. * modify it under the terms of the GNU General Public License
  13. * as published by the Free Software Foundation; either version 2
  14. * of the License, or any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24. */
  25. package com.izforge.izpack.panels;
  26. import java.awt.Dimension;
  27. import java.awt.Font;
  28. import java.awt.GridBagConstraints;
  29. import java.awt.GridBagLayout;
  30. import java.awt.Insets;
  31. import java.awt.event.ActionEvent;
  32. import java.awt.event.ActionListener;
  33. import java.io.File;
  34. import java.io.IOException;
  35. import java.util.Iterator;
  36. import javax.swing.BoxLayout;
  37. import javax.swing.JButton;
  38. import javax.swing.JComboBox;
  39. import javax.swing.JDialog;
  40. import javax.swing.JFileChooser;
  41. import javax.swing.JLabel;
  42. import javax.swing.JPanel;
  43. import javax.swing.JProgressBar;
  44. import javax.swing.JScrollPane;
  45. import javax.swing.JTabbedPane;
  46. import javax.swing.JTextArea;
  47. import javax.swing.SwingConstants;
  48. import net.n3.nanoxml.XMLElement;
  49. import com.izforge.izpack.gui.ButtonFactory;
  50. import com.izforge.izpack.gui.LabelFactory;
  51. import com.izforge.izpack.installer.CompileHandler;
  52. import com.izforge.izpack.installer.CompileResult;
  53. import com.izforge.izpack.installer.CompileWorker;
  54. import com.izforge.izpack.installer.InstallData;
  55. import com.izforge.izpack.installer.InstallerFrame;
  56. import com.izforge.izpack.installer.IzPanel;
  57. /**
  58. * The compile panel class.
  59. *
  60. * This class allows .java files to be compiled after installation.
  61. *
  62. * Parts of the code have been taken from InstallPanel.java and
  63. * modified a lot.
  64. *
  65. * @author Tino Schwarze
  66. * @author Julien Ponge
  67. */
  68. public class CompilePanel extends IzPanel implements ActionListener, CompileHandler
  69. {
  70. /** The combobox for compiler selection. */
  71. protected JComboBox compilerComboBox;
  72. /** The combobox for compiler argument selection. */
  73. protected JComboBox argumentsComboBox;
  74. /** The start button. */
  75. protected JButton startButton;
  76. /** The browse button. */
  77. protected JButton browseButton;
  78. /** The tip label. */
  79. protected JLabel tipLabel;
  80. /** The operation label . */
  81. protected JLabel opLabel;
  82. /** The pack progress bar. */
  83. protected JProgressBar packProgressBar;
  84. /** The operation label . */
  85. protected JLabel overallLabel;
  86. /** The overall progress bar. */
  87. protected JProgressBar overallProgressBar;
  88. /** True if the compilation has been done. */
  89. private boolean validated = false;
  90. /** The compilation worker. Does all the work. */
  91. private CompileWorker worker;
  92. /** Number of jobs to compile. Used for progress indication. */
  93. private int noOfJobs;
  94. /**
  95. * The constructor.
  96. *
  97. * @param parent The parent window.
  98. * @param idata The installation data.
  99. */
  100. public CompilePanel(InstallerFrame parent, InstallData idata)
  101. throws IOException
  102. {
  103. super(parent, idata);
  104. this.worker = new CompileWorker (idata, this);
  105. GridBagConstraints gridBagConstraints;
  106. JLabel heading = new JLabel();
  107. // put everything but the heading into it's own panel
  108. // (to center it vertically)
  109. JPanel subpanel = new JPanel ();
  110. JLabel compilerLabel = new JLabel();
  111. compilerComboBox = new JComboBox();
  112. this.browseButton = ButtonFactory.createButton (parent.langpack.getString ("CompilePanel.browse"), idata.buttonsHColor);
  113. JLabel argumentsLabel = new JLabel();
  114. this.argumentsComboBox = new JComboBox();
  115. this.startButton = ButtonFactory.createButton (parent.langpack.getString ("CompilePanel.start"), idata.buttonsHColor);
  116. this.tipLabel = LabelFactory.create(parent.langpack.getString ("CompilePanel.tip"),
  117. parent.icons.getImageIcon ("tip"), SwingConstants.TRAILING);
  118. this.opLabel = new JLabel();
  119. packProgressBar = new JProgressBar();
  120. this.overallLabel = new JLabel();
  121. this.overallProgressBar = new JProgressBar();
  122. setLayout(new GridBagLayout());
  123. Font font = heading.getFont ();
  124. font = font.deriveFont (Font.BOLD, font.getSize() * 2.0f);
  125. heading.setFont(font);
  126. heading.setHorizontalAlignment(SwingConstants.CENTER);
  127. heading.setText(parent.langpack.getString ("CompilePanel.heading"));
  128. heading.setVerticalAlignment(SwingConstants.TOP);
  129. gridBagConstraints = new GridBagConstraints();
  130. gridBagConstraints.gridy = 0;
  131. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  132. gridBagConstraints.anchor = GridBagConstraints.NORTH;
  133. gridBagConstraints.weightx = 1.0;
  134. gridBagConstraints.weighty = 0.1;
  135. add(heading, gridBagConstraints);
  136. gridBagConstraints = new GridBagConstraints();
  137. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  138. gridBagConstraints.anchor = GridBagConstraints.CENTER;
  139. gridBagConstraints.gridy = 1;
  140. gridBagConstraints.weightx = 1.0;
  141. gridBagConstraints.weighty = 0.9;
  142. add (subpanel, gridBagConstraints);
  143. subpanel.setLayout(new GridBagLayout());
  144. int row = 0;
  145. compilerLabel.setHorizontalAlignment(SwingConstants.LEFT);
  146. compilerLabel.setLabelFor(compilerComboBox);
  147. compilerLabel.setText(parent.langpack.getString ("CompilePanel.choose_compiler"));
  148. gridBagConstraints = new GridBagConstraints();
  149. gridBagConstraints.gridy = row;
  150. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  151. //gridBagConstraints.weighty = 0.1;
  152. subpanel.add(compilerLabel, gridBagConstraints);
  153. compilerComboBox.setEditable(true);
  154. gridBagConstraints = new GridBagConstraints();
  155. gridBagConstraints.gridy = row++;
  156. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  157. //gridBagConstraints.weighty = 0.1;
  158. Iterator it = this.worker.getAvailableCompilers().iterator();
  159. while (it.hasNext())
  160. compilerComboBox.addItem ((String)it.next());
  161. subpanel.add(compilerComboBox, gridBagConstraints);
  162. gridBagConstraints = new GridBagConstraints();
  163. gridBagConstraints.gridy = row++;
  164. gridBagConstraints.gridx = 1;
  165. gridBagConstraints.anchor = GridBagConstraints.EAST;
  166. browseButton.addActionListener (this);
  167. subpanel.add(browseButton, gridBagConstraints);
  168. argumentsLabel.setHorizontalAlignment(SwingConstants.LEFT);
  169. argumentsLabel.setLabelFor(argumentsComboBox);
  170. argumentsLabel.setText(parent.langpack.getString ("CompilePanel.additional_arguments"));
  171. //argumentsLabel.setToolTipText("");
  172. gridBagConstraints = new GridBagConstraints();
  173. gridBagConstraints.gridy = row;
  174. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  175. gridBagConstraints.weightx = 0.5;
  176. //gridBagConstraints.weighty = 0.1;
  177. subpanel.add(argumentsLabel, gridBagConstraints);
  178. argumentsComboBox.setEditable(true);
  179. gridBagConstraints = new GridBagConstraints();
  180. gridBagConstraints.gridy = row++;
  181. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  182. gridBagConstraints.weightx = 0.5;
  183. //gridBagConstraints.weighty = 0.1;
  184. it = this.worker.getAvailableArguments ().iterator();
  185. while (it.hasNext())
  186. argumentsComboBox.addItem ((String)it.next());
  187. subpanel.add(argumentsComboBox, gridBagConstraints);
  188. // leave some space above the label
  189. gridBagConstraints.insets = new Insets (10, 0, 0, 0);
  190. gridBagConstraints = new GridBagConstraints();
  191. gridBagConstraints.gridy = row++;
  192. gridBagConstraints.gridwidth = 2;
  193. gridBagConstraints.fill = GridBagConstraints.NONE;
  194. gridBagConstraints.anchor = GridBagConstraints.NORTHWEST;
  195. subpanel.add(tipLabel, gridBagConstraints);
  196. opLabel.setText(" ");
  197. gridBagConstraints = new GridBagConstraints();
  198. gridBagConstraints.gridy = row++;
  199. gridBagConstraints.gridwidth = 2;
  200. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  201. subpanel.add(opLabel, gridBagConstraints);
  202. packProgressBar.setValue(0);
  203. packProgressBar.setString(parent.langpack.getString ("CompilePanel.progress.initial"));
  204. packProgressBar.setStringPainted(true);
  205. gridBagConstraints = new GridBagConstraints();
  206. gridBagConstraints.gridy = row++;
  207. gridBagConstraints.gridwidth = 2;
  208. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  209. gridBagConstraints.anchor = GridBagConstraints.SOUTH;
  210. subpanel.add(packProgressBar, gridBagConstraints);
  211. overallLabel.setText (parent.langpack.getString ("CompilePanel.progress.overall"));
  212. gridBagConstraints = new GridBagConstraints();
  213. gridBagConstraints.gridy = row++;
  214. gridBagConstraints.gridwidth = 2;
  215. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  216. subpanel.add(overallLabel, gridBagConstraints);
  217. overallProgressBar.setValue(0);
  218. overallProgressBar.setString("");
  219. overallProgressBar.setStringPainted(true);
  220. gridBagConstraints = new GridBagConstraints();
  221. gridBagConstraints.gridy = row++;
  222. gridBagConstraints.gridwidth = 2;
  223. gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
  224. gridBagConstraints.anchor = GridBagConstraints.SOUTH;
  225. subpanel.add(overallProgressBar, gridBagConstraints);
  226. startButton.setText(parent.langpack.getString ("CompilePanel.start"));
  227. startButton.addActionListener (this);
  228. gridBagConstraints = new GridBagConstraints();
  229. gridBagConstraints.gridx = 0;
  230. gridBagConstraints.gridwidth = 2;
  231. gridBagConstraints.gridy = row++;
  232. gridBagConstraints.fill = GridBagConstraints.NONE;
  233. // leave some space above the button
  234. gridBagConstraints.insets = new Insets (5, 0, 0, 0);
  235. subpanel.add(startButton, gridBagConstraints);
  236. }
  237. /**
  238. * Indicates wether the panel has been validated or not.
  239. *
  240. * @return The validation state.
  241. */
  242. public boolean isValidated()
  243. {
  244. return validated;
  245. }
  246. /**
  247. * Action function, called when the start button is pressed.
  248. */
  249. public void actionPerformed (ActionEvent e)
  250. {
  251. if (e.getSource() == this.startButton)
  252. {
  253. this.worker.setCompiler ((String)this.compilerComboBox.getSelectedItem ());
  254. this.worker.setCompilerArguments ((String)this.argumentsComboBox.getSelectedItem ());
  255. this.blockGUI ();
  256. this.worker.startThread ();
  257. }
  258. else if (e.getSource () == this.browseButton)
  259. {
  260. this.parent.blockGUI ();
  261. JFileChooser chooser = new JFileChooser ();
  262. chooser.setCurrentDirectory (new File ((String)this.compilerComboBox.getSelectedItem()).getParentFile ());
  263. int result = chooser.showDialog (this.parent, this.parent.langpack.getString ("CompilePanel.browse.approve"));
  264. if (result == JFileChooser.APPROVE_OPTION)
  265. {
  266. File file_chosen = chooser.getSelectedFile();
  267. if (file_chosen.isFile ())
  268. {
  269. this.compilerComboBox.setSelectedItem (file_chosen.getAbsolutePath());
  270. }
  271. }
  272. this.parent.releaseGUI();
  273. }
  274. }
  275. /**
  276. * Block the GUI - disalow input.
  277. */
  278. protected void blockGUI ()
  279. {
  280. // disable all controls
  281. this.startButton.setEnabled (false);
  282. this.browseButton.setEnabled (false);
  283. this.compilerComboBox.setEnabled (false);
  284. this.argumentsComboBox.setEnabled (false);
  285. this.parent.blockGUI();
  286. }
  287. /**
  288. * Release the GUI - allow input.
  289. *
  290. * @param allowconfig allow the user to enter new configuration
  291. */
  292. protected void releaseGUI (boolean allowconfig)
  293. {
  294. // disable all controls
  295. if (allowconfig)
  296. {
  297. this.startButton.setEnabled (true);
  298. this.browseButton.setEnabled (true);
  299. this.compilerComboBox.setEnabled (true);
  300. this.argumentsComboBox.setEnabled (true);
  301. }
  302. this.parent.releaseGUI();
  303. }
  304. /**
  305. * An error was encountered.
  306. *
  307. * @param error The error information.
  308. * @see com.izforge.izpack.installer.CompileHandler
  309. */
  310. public void handleCompileError (CompileResult error)
  311. {
  312. String message = error.getMessage ();
  313. opLabel.setText(message);
  314. CompilerErrorDialog dialog = new CompilerErrorDialog (parent, message, idata.buttonsHColor);
  315. dialog.show (error);
  316. if (dialog.getResult() == CompilerErrorDialog.RESULT_IGNORE)
  317. {
  318. error.setAction (CompileResult.ACTION_CONTINUE);
  319. }
  320. else if (dialog.getResult() == CompilerErrorDialog.RESULT_RECONFIGURE)
  321. {
  322. error.setAction (CompileResult.ACTION_RECONFIGURE);
  323. }
  324. else // default case: abort
  325. {
  326. error.setAction (CompileResult.ACTION_ABORT);
  327. }
  328. }
  329. /** The compiler starts. */
  330. public void startAction (String name, int noOfJobs)
  331. {
  332. this.noOfJobs = noOfJobs;
  333. overallProgressBar.setMaximum (noOfJobs);
  334. parent.lockPrevButton();
  335. }
  336. /** The compiler stops. */
  337. public void stopAction ()
  338. {
  339. CompileResult result = this.worker.getResult ();
  340. this.releaseGUI(result.isReconfigure());
  341. if (result.isContinue())
  342. {
  343. parent.lockPrevButton();
  344. packProgressBar.setString(parent.langpack.getString("CompilePanel.progress.finished"));
  345. packProgressBar.setEnabled(false);
  346. packProgressBar.setValue (packProgressBar.getMaximum());
  347. overallProgressBar.setValue (this.noOfJobs);
  348. String no_of_jobs = Integer.toString (this.noOfJobs);
  349. overallProgressBar.setString (no_of_jobs + " / " + no_of_jobs);
  350. overallProgressBar.setEnabled (false);
  351. opLabel.setText(" ");
  352. opLabel.setEnabled(false);
  353. validated = true;
  354. idata.installSuccess = true;
  355. if (idata.panels.indexOf(this) != (idata.panels.size() - 1))
  356. parent.unlockNextButton();
  357. }
  358. else
  359. {
  360. idata.installSuccess = false;
  361. }
  362. }
  363. /**
  364. * Normal progress indicator.
  365. *
  366. * @param val The progression value.
  367. * @param msg The progression message.
  368. */
  369. public void progress (int val, String msg)
  370. {
  371. //Debug.trace ("progress: " + val + " " + msg);
  372. packProgressBar.setValue(val + 1);
  373. opLabel.setText(msg);
  374. }
  375. /**
  376. * Job changing.
  377. *
  378. * @param jobName The job name.
  379. * @param max The new maximum progress.
  380. * @param jobNo The job number.
  381. */
  382. public void nextStep (String jobName, int max, int jobNo)
  383. {
  384. packProgressBar.setValue(0);
  385. packProgressBar.setMaximum(max);
  386. packProgressBar.setString(jobName);
  387. opLabel.setText ("");
  388. overallProgressBar.setValue (jobNo);
  389. overallProgressBar.setString (Integer.toString (jobNo) + " / " + Integer.toString (this.noOfJobs));
  390. }
  391. /** Called when the panel becomes active. */
  392. public void panelActivate()
  393. {
  394. // get compilers again (because they might contain variables from former panels)
  395. Iterator it = this.worker.getAvailableCompilers().iterator();
  396. compilerComboBox.removeAllItems();
  397. while (it.hasNext())
  398. compilerComboBox.addItem ((String)it.next());
  399. // We clip the panel
  400. Dimension dim = parent.getPanelsContainerSize();
  401. dim.width = dim.width - (dim.width / 4);
  402. dim.height = 150;
  403. setMinimumSize(dim);
  404. setMaximumSize(dim);
  405. setPreferredSize(dim);
  406. parent.lockNextButton();
  407. }
  408. /** Create XML data for automated installation. */
  409. public void makeXMLData (XMLElement panelRoot)
  410. {
  411. // just save the compiler chosen and the arguments
  412. XMLElement compiler = new XMLElement ("compiler");
  413. compiler.setContent (this.worker.getCompiler());
  414. panelRoot.addChild (compiler);
  415. XMLElement args = new XMLElement ("arguments");
  416. args.setContent (this.worker.getCompilerArguments());
  417. panelRoot.addChild (args);
  418. }
  419. /**
  420. * Show a special dialog for compiler errors.
  421. *
  422. * This dialog is neccessary because we have lots of information if
  423. * compilation failed. We'd also like the user to chose whether
  424. * to ignore the error or not.
  425. */
  426. protected class CompilerErrorDialog extends JDialog implements ActionListener
  427. {
  428. /** user closed the dialog without pressing "Ignore" or "Abort" */
  429. public static final int RESULT_NONE = 0;
  430. /** user pressed "Ignore" button */
  431. public static final int RESULT_IGNORE = 23;
  432. /** user pressed "Abort" button */
  433. public static final int RESULT_ABORT = 42;
  434. /** user pressed "Reconfigure" button */
  435. public static final int RESULT_RECONFIGURE = 47;
  436. /** visual goodie: button hightlight color */
  437. private java.awt.Color buttonHColor = null;
  438. /** Creates new form compilerErrorDialog */
  439. public CompilerErrorDialog(java.awt.Frame parent, String title, java.awt.Color buttonHColor)
  440. {
  441. super(parent, title, true);
  442. this.buttonHColor = buttonHColor;
  443. initComponents();
  444. }
  445. /** This method is called from within the constructor to
  446. * initialize the form.
  447. *
  448. * Generated with help from NetBeans IDE.
  449. */
  450. private void initComponents()
  451. {
  452. JPanel errorMessagePane = new JPanel();
  453. errorMessageText = new JTextArea();
  454. JTextArea seeBelowText = new JTextArea ();
  455. JTabbedPane errorDisplayPane = new JTabbedPane();
  456. JScrollPane commandScrollPane = new JScrollPane();
  457. commandText = new JTextArea();
  458. JScrollPane stdOutScrollPane = new JScrollPane();
  459. stdOutText = new JTextArea();
  460. JScrollPane stdErrScrollPane = new JScrollPane();
  461. stdErrText = new JTextArea();
  462. JPanel buttonsPanel = new JPanel();
  463. reconfigButton = ButtonFactory.createButton (parent.langpack.getString ("CompilePanel.error.reconfigure"), this.buttonHColor);
  464. ignoreButton = ButtonFactory.createButton (parent.langpack.getString ("CompilePanel.error.ignore"), this.buttonHColor);
  465. abortButton = ButtonFactory.createButton (parent.langpack.getString ("CompilePanel.error.abort"), this.buttonHColor);
  466. addWindowListener(new java.awt.event.WindowAdapter() {
  467. public void windowClosing(java.awt.event.WindowEvent evt) {
  468. closeDialog(evt);
  469. }
  470. });
  471. errorMessagePane.setLayout (new BoxLayout (errorMessagePane, BoxLayout.Y_AXIS));
  472. errorMessageText.setBackground(super.getBackground());
  473. errorMessageText.setEditable(false);
  474. errorMessageText.setLineWrap(true);
  475. //errorMessageText.setText("The compiler does not seem to work. See below for the command we tried to execute and the results.");
  476. //errorMessageText.setToolTipText("null");
  477. errorMessageText.setWrapStyleWord(true);
  478. errorMessagePane.add(errorMessageText);
  479. seeBelowText.setBackground(super.getBackground());
  480. seeBelowText.setEditable(false);
  481. seeBelowText.setLineWrap(true);
  482. seeBelowText.setWrapStyleWord(true);
  483. seeBelowText.setText (parent.langpack.getString ("CompilePanel.error.seebelow"));
  484. errorMessagePane.add (seeBelowText);
  485. getContentPane().add(errorMessagePane, java.awt.BorderLayout.NORTH);
  486. // use 12pt monospace font for compiler output etc.
  487. Font output_font = new Font ("Monospaced", Font.PLAIN, 12);
  488. //errorDisplayPane.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
  489. //errorDisplayPane.setName("null");
  490. commandText.setFont (output_font);
  491. commandText.setEditable(false);
  492. commandText.setRows(10);
  493. commandText.setColumns(82);
  494. commandText.setWrapStyleWord(true);
  495. commandText.setLineWrap(true);
  496. //commandText.setText("akjfkajfeafjakefjakfkaejfja");
  497. commandScrollPane.setViewportView(commandText);
  498. errorDisplayPane.addTab("Command", commandScrollPane);
  499. stdOutText.setFont (output_font);
  500. stdOutText.setEditable(false);
  501. stdOutText.setWrapStyleWord(true);
  502. stdOutText.setLineWrap(true);
  503. stdOutScrollPane.setViewportView(stdOutText);
  504. errorDisplayPane.addTab("Standard Output", null, stdOutScrollPane);
  505. stdErrText.setFont (output_font);
  506. stdErrText.setEditable(false);
  507. stdErrText.setWrapStyleWord(true);
  508. stdErrText.setLineWrap(true);
  509. stdErrScrollPane.setViewportView(stdErrText);
  510. errorDisplayPane.addTab("Standard Error", null, stdErrScrollPane);
  511. getContentPane().add(errorDisplayPane, java.awt.BorderLayout.CENTER);
  512. buttonsPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT));
  513. reconfigButton.addActionListener (this);
  514. buttonsPanel.add(reconfigButton);
  515. ignoreButton.addActionListener (this);
  516. buttonsPanel.add(ignoreButton);
  517. abortButton.addActionListener (this);
  518. buttonsPanel.add(abortButton);
  519. getContentPane().add(buttonsPanel, java.awt.BorderLayout.SOUTH);
  520. pack();
  521. }
  522. /** Closes the dialog */
  523. protected void closeDialog(java.awt.event.WindowEvent evt)
  524. {
  525. setVisible(false);
  526. dispose();
  527. }
  528. public void show (CompileResult error)
  529. {
  530. this.errorMessageText.setText (error.getMessage ());
  531. this.commandText.setText (error.getCmdline ());
  532. this.stdOutText.setText (error.getStdout ());
  533. this.stdErrText.setText (error.getStderr ());
  534. super.show();
  535. }
  536. public int getResult ()
  537. {
  538. return this.result;
  539. }
  540. public void actionPerformed (ActionEvent e)
  541. {
  542. boolean closenow = false;
  543. if (e.getSource () == this.ignoreButton)
  544. {
  545. this.result = RESULT_IGNORE;
  546. closenow = true;
  547. }
  548. else if (e.getSource () == this.abortButton)
  549. {
  550. this.result = RESULT_ABORT;
  551. closenow = true;
  552. }
  553. else if (e.getSource () == this.reconfigButton)
  554. {
  555. this.result = RESULT_RECONFIGURE;
  556. closenow = true;
  557. }
  558. if (closenow)
  559. {
  560. this.setVisible (false);
  561. this.dispose ();
  562. }
  563. }
  564. // Variables declaration - do not modify//GEN-BEGIN:variables
  565. private JTextArea commandText;
  566. //private JScrollPane stdOutScrollPane;
  567. private JTextArea stdErrText;
  568. //private JPanel buttonsPanel;
  569. //private JScrollPane commandScrollPane;
  570. private JTextArea errorMessageText;
  571. //private JScrollPane stdErrScrollPane;
  572. private JButton ignoreButton;
  573. private JTextArea stdOutText;
  574. private JButton abortButton;
  575. private JButton reconfigButton;
  576. //private JTabbedPane errorDisplayPane;
  577. // End of variables declaration//GEN-END:variables
  578. private int result = RESULT_NONE;
  579. }
  580. }