From: SVN by r. <sv...@ca...> - 2008-07-27 11:36:55
|
Author: roy Date: 2008-07-27 13:36:47 +0200 (Sun, 27 Jul 2008) New Revision: 270 Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java Log: catch exceptions in paint() print sql command as entered Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java =================================================================== --- src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-07-27 11:27:29 UTC (rev 269) +++ src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-07-27 11:36:47 UTC (rev 270) @@ -361,7 +361,11 @@ public abstract int getScreenHeight(); private void repaint() { if (paint) { - paint(); + try { + paint(); + } catch(Throwable t) { + error(t); + } } } public abstract void paint(); @@ -453,9 +457,6 @@ } beep(); // TODO clear search?? return; - /*} else if (sqlCommand.getCommandString().equalsIgnoreCase("exit")) { - close(); - return;*/ } else if (executeCommand(sqlCommand)) { // clear command history if (commandIndex != commandHistory.size()-1) { @@ -577,6 +578,15 @@ * Output data to the screen. * @param data the data to print to the screen. */ + protected synchronized void output(List<? extends CharSequence> data) { + for(CharSequence c : data) { + output(c); + } + } + /** + * Output data to the screen. + * @param data the data to print to the screen. + */ protected synchronized void output(CharSequence data) { screenBuffer.addAll(getLines(data)); if (spoolWriter != null) { @@ -777,7 +787,7 @@ Logger.getLogger(AbstractSQLShellWindow.class.getName()).log(Level.SEVERE, null, ex); } } - output(commandString); + output(sqlCommand.getLines()); if (direct || !command.backgroundProcessSupported()) { output(command.execute(sqlCommand)); } else { |