|
46 | 46 | import javax.swing.JLabel;
|
47 | 47 | import javax.swing.JOptionPane;
|
48 | 48 | import javax.swing.JPanel;
|
49 |
| -import javax.swing.JSplitPane; |
50 | 49 | import javax.swing.JToolBar;
|
51 | 50 | import javax.swing.KeyStroke;
|
52 | 51 | import javax.swing.border.EmptyBorder;
|
@@ -86,7 +85,6 @@ public class ConsolePanel extends AbstractPanel {
|
86 | 85 | private JButton optionsButton;
|
87 | 86 | private JLabel scriptTitle = null;
|
88 | 87 | private CommandPanel commandPanel = null;
|
89 |
| - private OutputPanel outputPanel = null; |
90 | 88 | private KeyListener listener = null;
|
91 | 89 |
|
92 | 90 | private ScriptWrapper script = null;
|
@@ -135,15 +133,8 @@ public ConsolePanel(ExtensionScriptsUI extension) {
|
135 | 133 | panelContent = new JPanel(new GridBagLayout());
|
136 | 134 | this.add(panelContent, BorderLayout.CENTER);
|
137 | 135 |
|
138 |
| - JSplitPane splitPane = new JSplitPane(); |
139 |
| - splitPane.setDividerSize(3); |
140 |
| - splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT); |
141 |
| - splitPane.setResizeWeight(0.5D); |
142 |
| - splitPane.setTopComponent(getCommandPanel()); |
143 |
| - splitPane.setBottomComponent(getOutputPanel()); |
144 |
| - |
145 | 136 | panelContent.add(this.getPanelToolbar(), LayoutHelper.getGBC(0, 0, 1, 1.0D, 0.0D));
|
146 |
| - panelContent.add(splitPane, LayoutHelper.getGBC(0, 1, 1, 1.0D, 1.0D)); |
| 137 | + panelContent.add(getCommandPanel(), LayoutHelper.getGBC(0, 1, 1, 1.0D, 1.0D)); |
147 | 138 | }
|
148 | 139 |
|
149 | 140 | private boolean isScriptUpdatedOnDisk() {
|
@@ -456,8 +447,6 @@ private void runScript() {
|
456 | 447 |
|
457 | 448 | getRunButton().setEnabled(false);
|
458 | 449 |
|
459 |
| - getOutputPanel().preScriptInvoke(); |
460 |
| - |
461 | 450 | // Update it, in case its been changed
|
462 | 451 | script.setContents(getCommandScript());
|
463 | 452 |
|
@@ -546,19 +535,6 @@ public void actionPerformed(ActionEvent e) {
|
546 | 535 | return commandPanel;
|
547 | 536 | }
|
548 | 537 |
|
549 |
| - protected OutputPanel getOutputPanel() { |
550 |
| - if (outputPanel == null) { |
551 |
| - outputPanel = new OutputPanel(extension); |
552 |
| - resetOutputPanel(); |
553 |
| - } |
554 |
| - return outputPanel; |
555 |
| - } |
556 |
| - |
557 |
| - protected void resetOutputPanel() { |
558 |
| - outputPanel.clear(); |
559 |
| - outputPanel.append(Constant.messages.getString("scripts.welcome.results")); |
560 |
| - } |
561 |
| - |
562 | 538 | public String getCommandScript() {
|
563 | 539 | return this.getCommandPanel().getCommandScript();
|
564 | 540 | }
|
@@ -796,7 +772,14 @@ public void run() {
|
796 | 772 | try {
|
797 | 773 | extension.getExtScript().invokeScript(script);
|
798 | 774 | } catch (Exception e) {
|
799 |
| - getOutputPanel().append(e); |
| 775 | + if (extension.getView() != null) { |
| 776 | + extension |
| 777 | + .getView() |
| 778 | + .getOutputPanel() |
| 779 | + .append( |
| 780 | + ExtensionScriptsUI.extractScriptExceptionMessage(e), |
| 781 | + script.getName()); |
| 782 | + } |
800 | 783 | } finally {
|
801 | 784 | WeakReference<ScriptExecutorThread> refScriptExecutorThread =
|
802 | 785 | runnableScriptsToThreadMap.remove(script);
|
|
0 commit comments