From: SVN by r. <sv...@ca...> - 2008-10-13 13:31:13
|
Author: roy Date: 2008-10-13 15:30:59 +0200 (Mon, 13 Oct 2008) New Revision: 317 Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java src/main/java/nl/improved/sqlclient/charva/SQLShellComponent.java Log: fixed some exceptions ignore mouse cursor for now.. Modified: src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java =================================================================== --- src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-10-12 13:09:16 UTC (rev 316) +++ src/main/java/nl/improved/sqlclient/AbstractSQLShellWindow.java 2008-10-13 13:30:59 UTC (rev 317) @@ -1575,12 +1575,13 @@ */ protected List<String> formatCommandLines(boolean showPrompt, String emptyLine, List<CharSequence> currentLines) { List<String> tmpList = new ArrayList<String>(); - for (int i = 0; i < currentLines.size(); i++) { + List<CharSequence> pCurrentLines = new ArrayList<CharSequence>(currentLines); + for (int i = 0; i < pCurrentLines.size(); i++) { if (i == 0 && showPrompt) { - tmpList.add(Screen.PROMPT+"> "+currentLines.get(i)); + tmpList.add(Screen.PROMPT+"> "+pCurrentLines.get(i)); } else { String nrI = Integer.toString(i+1); - tmpList.add(emptyLine.substring(0,Screen.PROMPT.length() - nrI.length()) + nrI+"> "+currentLines.get(i)); + tmpList.add(emptyLine.substring(0,Screen.PROMPT.length() - nrI.length()) + nrI+"> "+pCurrentLines.get(i)); } } return tmpList; Modified: src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java =================================================================== --- src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java 2008-10-12 13:09:16 UTC (rev 316) +++ src/main/java/nl/improved/sqlclient/charva/CharvaSQLShellWindow.java 2008-10-13 13:30:59 UTC (rev 317) @@ -12,6 +12,7 @@ import charvax.swing.JMenuItem; import charvax.swing.JPopupMenu; import java.sql.SQLException; +import java.util.ArrayList; import java.util.List; import java.util.Vector; import nl.improved.sqlclient.AbstractSQLShellWindow; @@ -56,12 +57,12 @@ public void paint(Screen screen) { int totalLineCount = 0; StringBuilder newText = new StringBuilder(); - for (CharSequence seq: screen.getScreenBuffer()) { + for (CharSequence seq: new ArrayList<CharSequence>(screen.getScreenBuffer())) { newText.append(seq.toString()); newText.append("\n"); totalLineCount++; } - for (SQLCommand s : getUnprocessedCommands()) { + for (SQLCommand s : new ArrayList<SQLCommand>(getUnprocessedCommands())) { for (CharSequence seq: s.getLines()) { newText.append(screen.getEmptyLine().substring(0, Screen.PROMPT.length()) + ">"); newText.append(seq.toString()); Modified: src/main/java/nl/improved/sqlclient/charva/SQLShellComponent.java =================================================================== --- src/main/java/nl/improved/sqlclient/charva/SQLShellComponent.java 2008-10-12 13:09:16 UTC (rev 316) +++ src/main/java/nl/improved/sqlclient/charva/SQLShellComponent.java 2008-10-13 13:30:59 UTC (rev 317) @@ -9,6 +9,7 @@ import charva.awt.Point; import charva.awt.Toolkit; import charva.awt.event.KeyEvent; +import charva.awt.event.MouseEvent; import charvax.swing.JFrame; import charvax.swing.JTextArea; @@ -26,6 +27,12 @@ sqlshellWindow.keyTyped(arg0); } + @Override + public void processMouseEvent(MouseEvent arg0) { + } + + + public static void main(String[] args) { JFrame frame = new JFrame(); SQLShellComponent component = new SQLShellComponent(); |