You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(34) |
Nov
(7) |
Dec
(2) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(29) |
Feb
(10) |
Mar
(14) |
Apr
(4) |
May
(2) |
Jun
|
Jul
(14) |
Aug
(25) |
Sep
(6) |
Oct
(18) |
Nov
(4) |
Dec
(14) |
| 2009 |
Jan
(28) |
Feb
(15) |
Mar
(15) |
Apr
(8) |
May
|
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(12) |
Oct
(1) |
Nov
|
Dec
(22) |
| 2010 |
Jan
(14) |
Feb
|
Mar
(2) |
Apr
|
May
(7) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
|
From: SVN by r. <sv...@ca...> - 2007-11-14 21:28:43
|
Author: roy
Date: 2007-11-14 22:26:47 +0100 (Wed, 14 Nov 2007)
New Revision: 200
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
some quit command changes..
made last executed command the last in the history list
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-14 21:22:34 UTC (rev 199)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-14 21:26:47 UTC (rev 200)
@@ -126,7 +126,9 @@
commands.register("HELP[\\s]*.*", new HelpCommand());
commands.register("HISTORY[\\s]*.*", new HistoryCommand());
commands.register("SPOOL[\\s]*.*", new SpoolCommand());
- commands.register("(QUIT|EXIT|\\\\Q)[\\s]*", new QuitCommand());
+ commands.register("QUIT[\\s]*", new QuitCommand("quit"));
+ commands.register("EXIT[\\s]*", new QuitCommand("exit"));
+ //commands.register("\\\\Q[\\s]*", new QuitCommand("\\q"));
commands.register("@.*", new ExecuteBatchCommand());
MAX_LINE_LENGTH = Toolkit.getScreenWidth()-(2+PROMPT.length()+2+1); // 2 spaces bouds.. prompt + "> "
@@ -312,9 +314,16 @@
if (executeCommand(sqlCommand)) {
// clear command history
if (commandIndex != commandHistory.size()-1) {
+ SQLCommand tmpLines = commandLines;
commandLines = commandHistory.get(commandHistory.size()-1);
+ if (commandLines.getCommandString().equals("")) {
+ commandHistory.add(commandHistory.size()-1, tmpLines);
+ } else {
+ commandHistory.add(tmpLines);
+ commandLines = tmpLines;
+ }
}
- if (commandLines.getLines().size() != 1 || commandLines.getLines().get(0).length() != 0) {
+ if (!commandLines.getCommandString().equals("")) {
commandLines = new SQLCommand();
commandHistory.add(commandLines);
newLine();
@@ -947,6 +956,11 @@
* Exit the client.
*/
private class QuitCommand implements Command {
+ private String cmd;
+
+ public QuitCommand(String cmd) {
+ this.cmd = cmd;
+ }
public CharSequence execute(SQLCommand command) {
hide(); // quit
return "Application terminated.";
@@ -955,7 +969,7 @@
return "Quit(exit) the application.";
}
public CharSequence getCommandString() {
- return "quit";
+ return cmd;
}
/**
* Returns some tab completion info for the specified command.
|
|
From: SVN by r. <sv...@ca...> - 2007-11-14 21:24:35
|
Author: roy
Date: 2007-11-14 22:22:34 +0100 (Wed, 14 Nov 2007)
New Revision: 199
Modified:
src/main/java/nl/improved/sqlclient/DBConnector.java
Log:
reset pwd when usernmae is provided
Modified: src/main/java/nl/improved/sqlclient/DBConnector.java
===================================================================
--- src/main/java/nl/improved/sqlclient/DBConnector.java 2007-11-07 11:50:18 UTC (rev 198)
+++ src/main/java/nl/improved/sqlclient/DBConnector.java 2007-11-14 21:22:34 UTC (rev 199)
@@ -209,18 +209,28 @@
throw new SQLException("Failed to connect: Could not initialize driver '"+settings.getDriver()+"'", e);
}
+
String username;
+ String password;
if (usr == null || usr.length() == 0) {
username = settings.getUsername();
+ if (pwd == null) {
+ password = settings.getPassword();
+ } else {
+ password = pwd;
+ }
} else {
username = usr;
+ if (username != null && !username.equals(settings.getUsername())) {
+ password = pwd;
+ } else {
+ if (pwd == null) {
+ password = settings.getPassword();
+ } else {
+ password = pwd;
+ }
+ }
}
- String password;
- if (pwd == null) {
- password = settings.getPassword();
- } else {
- password = pwd;
- }
if (username == null || password == null) {
LoginDialog ld = new LoginDialog(username, password);
|
|
From: SVN by r. <sv...@ca...> - 2007-11-07 11:53:21
|
Author: roy
Date: 2007-11-07 12:50:18 +0100 (Wed, 07 Nov 2007)
New Revision: 198
Modified:
ChangeLog
Log:
mention changes
Modified: ChangeLog
===================================================================
--- ChangeLog 2007-11-07 11:50:04 UTC (rev 197)
+++ ChangeLog 2007-11-07 11:50:18 UTC (rev 198)
@@ -4,6 +4,8 @@
* desc
* execute batch command
* show
+ * allow enter in pwd field to 'ok' data
+ TODO: flush pwd when username manually set and doesn't match default username
0.3 (09-10-2007)
* focus fix in login dialog
* Improve desc table to show primary key
|
|
From: SVN by r. <sv...@ca...> - 2007-11-07 11:53:14
|
Author: roy
Date: 2007-11-07 12:50:04 +0100 (Wed, 07 Nov 2007)
New Revision: 197
Modified:
src/main/java/nl/improved/sqlclient/DBConnector.java
Log:
added check for special char
Modified: src/main/java/nl/improved/sqlclient/DBConnector.java
===================================================================
--- src/main/java/nl/improved/sqlclient/DBConnector.java 2007-11-06 12:17:19 UTC (rev 196)
+++ src/main/java/nl/improved/sqlclient/DBConnector.java 2007-11-07 11:50:04 UTC (rev 197)
@@ -319,7 +319,7 @@
setUsername(username);
passfield = new PasswordField() {
protected boolean handleInput(InputChar ch) {
- if (ch.getCharacter() == '\n') {
+ if (!ch.isSpecialCode() && ch.getCharacter() == '\n') {
okButtonPressedSlot();
return false;
}
|
|
From: SVN by r. <sv...@ca...> - 2007-11-06 12:19:20
|
Author: robert
Date: 2007-11-06 13:17:19 +0100 (Tue, 06 Nov 2007)
New Revision: 196
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
Added possibility to quit with the \q command
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-06 12:07:48 UTC (rev 195)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-06 12:17:19 UTC (rev 196)
@@ -126,7 +126,7 @@
commands.register("HELP[\\s]*.*", new HelpCommand());
commands.register("HISTORY[\\s]*.*", new HistoryCommand());
commands.register("SPOOL[\\s]*.*", new SpoolCommand());
- commands.register("(QUIT|EXIT|\\\Q)[\\s]*", new QuitCommand());
+ commands.register("(QUIT|EXIT|\\\\Q)[\\s]*", new QuitCommand());
commands.register("@.*", new ExecuteBatchCommand());
MAX_LINE_LENGTH = Toolkit.getScreenWidth()-(2+PROMPT.length()+2+1); // 2 spaces bouds.. prompt + "> "
|
|
From: SVN by r. <sv...@ca...> - 2007-11-06 12:09:52
|
Author: robert
Date: 2007-11-06 13:07:48 +0100 (Tue, 06 Nov 2007)
New Revision: 195
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
Added possibility to quit with the \q command
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-06 10:50:30 UTC (rev 194)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-11-06 12:07:48 UTC (rev 195)
@@ -126,7 +126,7 @@
commands.register("HELP[\\s]*.*", new HelpCommand());
commands.register("HISTORY[\\s]*.*", new HistoryCommand());
commands.register("SPOOL[\\s]*.*", new SpoolCommand());
- commands.register("(QUIT|EXIT)[\\s]*", new QuitCommand());
+ commands.register("(QUIT|EXIT|\\\Q)[\\s]*", new QuitCommand());
commands.register("@.*", new ExecuteBatchCommand());
MAX_LINE_LENGTH = Toolkit.getScreenWidth()-(2+PROMPT.length()+2+1); // 2 spaces bouds.. prompt + "> "
|
|
From: SVN by r. <sv...@ca...> - 2007-11-06 10:52:38
|
Author: roy
Date: 2007-11-06 11:50:30 +0100 (Tue, 06 Nov 2007)
New Revision: 194
Modified:
src/main/java/nl/improved/sqlclient/SQLUtil.java
src/test/java/nl/improved/sqlclient/SQLUtilTest.java
Log:
fixed index out of bounds
Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-29 15:31:08 UTC (rev 193)
+++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-11-06 10:50:30 UTC (rev 194)
@@ -216,7 +216,7 @@
, Arrays.asList(new String[]{"WHERE"}), end);
}
String end;
- startOfCommand = startOfCommand.substring(startOfCommand.indexOf("FROM"));
+ startOfCommand = startOfCommand.substring(startOfCommand.toUpperCase().indexOf("FROM"));
if (startOfCommand.indexOf(',') > 0) {
end = startOfCommand.substring(startOfCommand.lastIndexOf(',')+1).trim();
} else {
Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java
===================================================================
--- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-29 15:31:08 UTC (rev 193)
+++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-11-06 10:50:30 UTC (rev 194)
@@ -135,6 +135,15 @@
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
+ sqlCommand = Arrays.asList(new String[]{"select * from A"});
+ cursorPos = new Point(sqlCommand.get(0).length(),0);
+ info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ assertNotNull(info);
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ matches = info.getPossibleMatches();
+ assertEquals(0, matches.size());
+ assertEquals("A", info.getStart());
+
sqlCommand = Arrays.asList(new String[]{"SELECT * FROM A, B"});
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
|
|
From: SVN by r. <sv...@ca...> - 2007-10-29 15:31:11
|
Author: roy
Date: 2007-10-29 16:31:08 +0100 (Mon, 29 Oct 2007)
New Revision: 193
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
made exit quit the application as well (as per request)
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-29 08:15:01 UTC (rev 192)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-29 15:31:08 UTC (rev 193)
@@ -126,7 +126,7 @@
commands.register("HELP[\\s]*.*", new HelpCommand());
commands.register("HISTORY[\\s]*.*", new HistoryCommand());
commands.register("SPOOL[\\s]*.*", new SpoolCommand());
- commands.register("QUIT[\\s]*", new QuitCommand());
+ commands.register("(QUIT|EXIT)[\\s]*", new QuitCommand());
commands.register("@.*", new ExecuteBatchCommand());
MAX_LINE_LENGTH = Toolkit.getScreenWidth()-(2+PROMPT.length()+2+1); // 2 spaces bouds.. prompt + "> "
@@ -952,7 +952,7 @@
return "Application terminated.";
}
public CharSequence getHelp() {
- return "Quit the application.";
+ return "Quit(exit) the application.";
}
public CharSequence getCommandString() {
return "quit";
|
|
From: SVN by r. <sv...@ca...> - 2007-10-29 08:15:13
|
Author: roy
Date: 2007-10-29 09:15:01 +0100 (Mon, 29 Oct 2007)
New Revision: 192
Modified:
src/main/java/nl/improved/sqlclient/DBConnector.java
Log:
per request: make enter in pwd field press ok
Modified: src/main/java/nl/improved/sqlclient/DBConnector.java
===================================================================
--- src/main/java/nl/improved/sqlclient/DBConnector.java 2007-10-28 20:08:10 UTC (rev 191)
+++ src/main/java/nl/improved/sqlclient/DBConnector.java 2007-10-29 08:15:01 UTC (rev 192)
@@ -23,6 +23,7 @@
import java.util.Set;
import java.util.Map;
import java.util.Properties;
+import jcurses.system.InputChar;
import jcurses.event.ActionEvent;
import jcurses.event.ActionListener;
import jcurses.widgets.Button;
@@ -316,14 +317,21 @@
super(10,10, 50, 7, true,"Connect");
userfield = new TextField();
setUsername(username);
- passfield = new PasswordField();
+ passfield = new PasswordField() {
+ protected boolean handleInput(InputChar ch) {
+ if (ch.getCharacter() == '\n') {
+ okButtonPressedSlot();
+ return false;
+ }
+ return super.handleInput(ch);
+ }
+ };
setPassword(password);
Button okButton = new Button("Ok");
okButton.addListener(new ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- LoginDialog.this.exitOk = true;
- LoginDialog.this.close();
+ public void actionPerformed(ActionEvent event) {
+ okButtonPressedSlot();
}
});
Button cancelButton = new Button("Cancel");
@@ -344,7 +352,12 @@
glm.addWidget(okButton, 1,2,1,1, WidgetsConstants.ALIGNMENT_CENTER, WidgetsConstants.ALIGNMENT_CENTER);
glm.addWidget(cancelButton, 2,2,1,1, WidgetsConstants.ALIGNMENT_CENTER, WidgetsConstants.ALIGNMENT_CENTER);
+
}
+ public void okButtonPressedSlot() {
+ exitOk = true;
+ close();
+ }
@Override
protected void activate() {
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 20:09:03
|
Author: roy
Date: 2007-10-28 21:08:10 +0100 (Sun, 28 Oct 2007)
New Revision: 191
Added:
src/test/java/nl/improved/sqlclient/commands/
src/test/java/nl/improved/sqlclient/commands/ShowCommandTest.java
Modified:
ChangeLog
src/main/java/nl/improved/sqlclient/SQLCommand.java
src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
Log:
added tab completion for show command
Modified: ChangeLog
===================================================================
--- ChangeLog 2007-10-28 19:25:48 UTC (rev 190)
+++ ChangeLog 2007-10-28 20:08:10 UTC (rev 191)
@@ -3,6 +3,7 @@
* Added tabcompletion for:
* desc
* execute batch command
+ * show
0.3 (09-10-2007)
* focus fix in login dialog
* Improve desc table to show primary key
Modified: src/main/java/nl/improved/sqlclient/SQLCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLCommand.java 2007-10-28 19:25:48 UTC (rev 190)
+++ src/main/java/nl/improved/sqlclient/SQLCommand.java 2007-10-28 20:08:10 UTC (rev 191)
@@ -55,7 +55,7 @@
}
returnValue.append(parts.next());
}
- return returnValue.toString().trim();
+ return returnValue.toString();
}
public String getCommandString() {
String returnString = getUntrimmedCommandString();
Modified: src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 19:25:48 UTC (rev 190)
+++ src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 20:08:10 UTC (rev 191)
@@ -20,6 +20,7 @@
import nl.improved.sqlclient.Point;
import nl.improved.sqlclient.SQLUtil;
import nl.improved.sqlclient.TabCompletionInfo;
+import java.util.Arrays;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
@@ -103,7 +104,24 @@
* @return some tab completion info for the specified command.
*/
public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
- return null;
+ String commandString = command.getUntrimmedCommandString();
+ String commandStringUpper = commandString.toUpperCase();
+
+ if (commandStringUpper.matches("[\\s]*SHOW[\\s]+TABLES[\\s]+HAVING[\\s]+([A-Z]|_|-|[0-9])*")) {
+ String end = commandString.trim().substring(commandString.trim().lastIndexOf(' ')+1).trim();
+ if (end.equalsIgnoreCase("HAVING")) {
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.COLUMN_NAMES, Arrays.asList(new String[]{"%"}), "");
+ } else {
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.COLUMN_NAMES, Arrays.asList(new String[]{"%"}), end);
+ }
+ }
+
+ String startOfCommand = SQLUtil.getStartOfCommand(command.getLines(), commandPoint);
+ String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
+ if (commandStringUpper.matches("SHOW[\\s]+(|T|TA|TAB|TABL|TABLE)")) {
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN, Arrays.asList(new String[]{"TABLES"}), end);
+ }
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN, Arrays.asList(new String[]{"HAVING"}), end);
}
/**
Added: src/test/java/nl/improved/sqlclient/commands/ShowCommandTest.java
===================================================================
--- src/test/java/nl/improved/sqlclient/commands/ShowCommandTest.java (rev 0)
+++ src/test/java/nl/improved/sqlclient/commands/ShowCommandTest.java 2007-10-28 20:08:10 UTC (rev 191)
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2007 Roy van der Kuil (ro...@va...) and Stefan Rotman (st...@ro...)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package nl.improved.sqlclient.commands;
+
+import nl.improved.sqlclient.*;
+import java.util.Arrays;
+import java.util.List;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+public class ShowCommandTest extends TestCase {
+
+ private static final boolean testFailures = true;
+
+ public ShowCommandTest() {
+ }
+
+ public void testGetTabCompletionInfo() {
+ ShowCommand cmd = new ShowCommand();
+ SQLCommand sqlCommand = new SQLCommand();
+ sqlCommand.getEditableLines().add(new StringBuilder("SHOW TABLES HAVING "));
+ Point cursorPos = new Point(sqlCommand.getLines().get(0).length(),0);
+ TabCompletionInfo info = cmd.getTabCompletionInfo(sqlCommand, cursorPos);
+ assertNotNull(info);
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(1, info.getPossibleMatches().size());
+ assertEquals("%", info.getPossibleMatches().get(0));
+ assertEquals("", info.getStart());
+ }
+
+}
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 19:26:48
|
Author: roy
Date: 2007-10-28 20:25:48 +0100 (Sun, 28 Oct 2007)
New Revision: 190
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
Log:
more tab completion fixes for @ command
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:57:24 UTC (rev 189)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 19:25:48 UTC (rev 190)
@@ -1160,8 +1160,15 @@
dirName = ".";
} else {
fileName = toFileName(fileName);
- if (fileName.indexOf('/') > 0) {
- dirName = new File(fileName).getParent();
+ if (fileName.indexOf('/') >= 0) {
+ File file = new File(fileName);
+ if (file.isDirectory()) {
+ fileName = "";
+ dirName = file.getAbsolutePath()+"/";
+ } else {
+ fileName = file.getName();
+ dirName = file.getParent();
+ }
} else {
dirName = ".";
}
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 11:58:27
|
Author: roy
Date: 2007-10-28 12:57:24 +0100 (Sun, 28 Oct 2007)
New Revision: 189
Modified:
ChangeLog
src/main/java/nl/improved/sqlclient/SQLShell.java
src/main/java/nl/improved/sqlclient/TabCompletionInfo.java
Log:
added batch command completion (list filenames)
Modified: ChangeLog
===================================================================
--- ChangeLog 2007-10-28 11:41:30 UTC (rev 188)
+++ ChangeLog 2007-10-28 11:57:24 UTC (rev 189)
@@ -1,3 +1,8 @@
+0.4
+ * Improve tab comnpletion
+ * Added tabcompletion for:
+ * desc
+ * execute batch command
0.3 (09-10-2007)
* focus fix in login dialog
* Improve desc table to show primary key
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:41:30 UTC (rev 188)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:57:24 UTC (rev 189)
@@ -585,6 +585,9 @@
if (info.getMatchType() == TabCompletionInfo.MatchType.COLUMN_NAMES) {
return nullToEmpty(findMatch(getColumnNames(info.getPossibleMatches()), info.getStart()));
}
+ if (info.getMatchType() == TabCompletionInfo.MatchType.UNKNOWN) {
+ return nullToEmpty(findMatch(info.getPossibleMatches(), info.getStart()));
+ }
Toolkit.beep();
return "";
}
@@ -1150,8 +1153,22 @@
* @return some tab completion info for the specified command.
*/
public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
- return null;
+ String fileName = command.getCommandString().substring(1).trim(); // cutoff '@'
+ String dirName;
+ if (fileName.equals("")) {
+ fileName = ".";
+ dirName = ".";
+ } else {
+ fileName = toFileName(fileName);
+ if (fileName.indexOf('/') > 0) {
+ dirName = new File(fileName).getParent();
+ } else {
+ dirName = ".";
+ }
+ }
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN,Arrays.asList(new File(dirName).list()) , fileName);
}
+
public CharSequence getHelp() {
return "Specify filename to execute a 'batch' command.\n"+
"For example '@mystatements.sql' executes all statements part of the mystatements.sql file in the current directory."+
Modified: src/main/java/nl/improved/sqlclient/TabCompletionInfo.java
===================================================================
--- src/main/java/nl/improved/sqlclient/TabCompletionInfo.java 2007-10-28 11:41:30 UTC (rev 188)
+++ src/main/java/nl/improved/sqlclient/TabCompletionInfo.java 2007-10-28 11:57:24 UTC (rev 189)
@@ -18,7 +18,7 @@
import java.util.List;
public class TabCompletionInfo {
- public enum MatchType {SQL_KEYWORD, TABLE_NAMES, COLUMN_NAMES, UNKNOWN}
+ public enum MatchType {SQL_KEYWORD, TABLE_NAMES, COLUMN_NAMES, FILE_NAMES, UNKNOWN}
private MatchType type;
private List<String> possibleMatches;
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 11:42:31
|
Author: roy
Date: 2007-10-28 12:41:30 +0100 (Sun, 28 Oct 2007)
New Revision: 188
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
src/main/java/nl/improved/sqlclient/commands/Command.java
src/main/java/nl/improved/sqlclient/commands/DescCommand.java
src/main/java/nl/improved/sqlclient/commands/InfoCommand.java
src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
Log:
made desc command work somewhat again...
TODO: make de<tab> include desc option as well.. instead of only 'delete from'
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:12:50 UTC (rev 187)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:41:30 UTC (rev 188)
@@ -553,7 +553,28 @@
* @return the tab completion value.
*/
protected CharSequence getTabCompletion(SQLCommand commandLines, Point cursorPosition) {
- TabCompletionInfo info = SQLUtil.getTabCompletionInfo(commandLines, cursorPosition);
+ TabCompletionInfo info = null;
+ String cmd = commandLines.getCommandString();
+ if (cmd.length() > 0) {
+ if (cmd.indexOf(' ') > 0) {
+ cmd = cmd.substring(0, cmd.indexOf(' ')).trim();
+ }
+ Command tmpCommand = commands.findCommand(cmd);
+ if (tmpCommand == null) {
+ for (Command c : commands.getCommands()) {
+ if (cmd.equalsIgnoreCase(c.getCommandString().toString())) {
+ tmpCommand = c;
+ break;
+ }
+ }
+ }
+ if (tmpCommand != null) {
+ info = tmpCommand.getTabCompletionInfo(commandLines, cursorPosition);
+ }
+ }
+ if (info == null) {
+ info = SQLUtil.getTabCompletionInfo(commandLines, cursorPosition);
+ }
if (info.getMatchType() == TabCompletionInfo.MatchType.SQL_KEYWORD) {
return nullToEmpty(findMatch(info.getPossibleMatches(), info.getStart()));
}
@@ -795,7 +816,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
@@ -846,7 +867,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
@@ -878,7 +899,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
@@ -910,7 +931,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
@@ -939,7 +960,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
}
@@ -1020,7 +1041,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
@@ -1079,7 +1100,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
@@ -1128,7 +1149,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
public CharSequence getHelp() {
Modified: src/main/java/nl/improved/sqlclient/commands/Command.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/Command.java 2007-10-28 11:12:50 UTC (rev 187)
+++ src/main/java/nl/improved/sqlclient/commands/Command.java 2007-10-28 11:41:30 UTC (rev 188)
@@ -42,7 +42,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint);
+ TabCompletionInfo getTabCompletionInfo(SQLCommand commandInfo, Point commandPoint);
/**
* Returns a explenation string of how to use this command.
* @return a explenation string of how to use this command.
Modified: src/main/java/nl/improved/sqlclient/commands/DescCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-10-28 11:12:50 UTC (rev 187)
+++ src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-10-28 11:41:30 UTC (rev 188)
@@ -106,7 +106,9 @@
}
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
+ List commandInfo = command.getLines();
+
String startOfCommand = SQLUtil.getStartOfCommand(commandInfo, commandPoint);
String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
return new TabCompletionInfo(TabCompletionInfo.MatchType.TABLE_NAMES, new ArrayList<String>(), end);
Modified: src/main/java/nl/improved/sqlclient/commands/InfoCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/InfoCommand.java 2007-10-28 11:12:50 UTC (rev 187)
+++ src/main/java/nl/improved/sqlclient/commands/InfoCommand.java 2007-10-28 11:41:30 UTC (rev 188)
@@ -74,7 +74,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
Modified: src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 11:12:50 UTC (rev 187)
+++ src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 11:41:30 UTC (rev 188)
@@ -102,7 +102,7 @@
* @param commandPoint the cursor position
* @return some tab completion info for the specified command.
*/
- public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public TabCompletionInfo getTabCompletionInfo(SQLCommand command, Point commandPoint) {
return null;
}
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 11:13:54
|
Author: roy
Date: 2007-10-28 12:12:50 +0100 (Sun, 28 Oct 2007)
New Revision: 187
Added:
src/main/java/nl/improved/sqlclient/TabCompletionInfo.java
Modified:
src/main/java/nl/improved/sqlclient/SQLShell.java
src/main/java/nl/improved/sqlclient/SQLUtil.java
src/main/java/nl/improved/sqlclient/commands/Command.java
src/main/java/nl/improved/sqlclient/commands/DescCommand.java
src/main/java/nl/improved/sqlclient/commands/InfoCommand.java
src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
src/test/java/nl/improved/sqlclient/SQLUtilTest.java
Log:
initial refactor step to add support to tab completion of commands...
NOTE: currently tab completion for desc is broken because of this
Modified: src/main/java/nl/improved/sqlclient/SQLShell.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -553,15 +553,15 @@
* @return the tab completion value.
*/
protected CharSequence getTabCompletion(SQLCommand commandLines, Point cursorPosition) {
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(commandLines, cursorPosition);
- if (info.getMatchType() == SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD) {
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(commandLines, cursorPosition);
+ if (info.getMatchType() == TabCompletionInfo.MatchType.SQL_KEYWORD) {
return nullToEmpty(findMatch(info.getPossibleMatches(), info.getStart()));
}
- if (info.getMatchType() == SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES) {
+ if (info.getMatchType() == TabCompletionInfo.MatchType.TABLE_NAMES) {
//debug("table completion for \""+info.getStart()+"\"");
return nullToEmpty(findMatch(getTableNames(), info.getStart()));
}
- if (info.getMatchType() == SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES) {
+ if (info.getMatchType() == TabCompletionInfo.MatchType.COLUMN_NAMES) {
return nullToEmpty(findMatch(getColumnNames(info.getPossibleMatches()), info.getStart()));
}
Toolkit.beep();
@@ -789,6 +789,16 @@
return "connect";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
+
public CharSequence getHelp() {
StringBuffer buf = new StringBuffer();
Iterator<String> idents = DBConnector.getInstance().getPredefinedConnectionIdentifiers().iterator();
@@ -830,6 +840,15 @@
return "disconnect";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "Close the current conection to the database";
}
@@ -853,6 +872,15 @@
return "window";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "window resize: notify the sql client of a screen resize";
}
@@ -876,6 +904,15 @@
return "history";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "Show history of executed statements\n" +
"By using '/<search>' you can search the command history" ;
@@ -896,6 +933,15 @@
public CharSequence getCommandString() {
return "quit";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
}
/**
* Provide help to the user.
@@ -968,6 +1014,15 @@
return "help";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "this command. Please use 'help' to get a list of available commands you can use.";
}
@@ -1018,6 +1073,15 @@
return "spool";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "filename: Spool all output and queries to the specified file\n"+
"off : Stop spooling data to the file.\n" +
@@ -1058,6 +1122,15 @@
return "@";
}
+ /**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
public CharSequence getHelp() {
return "Specify filename to execute a 'batch' command.\n"+
"For example '@mystatements.sql' executes all statements part of the mystatements.sql file in the current directory."+
Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -134,13 +134,13 @@
public static TabCompletionInfo getTabCompletionInfo(List<? extends CharSequence> commandInfo, Point commandPoint) {
if (commandInfo.size() == 1 && commandInfo.get(0).length() == 0) {
return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD
- , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DESC"}));
+ , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"}));
}
String startOfCommand = getStartOfCommand(commandInfo, commandPoint);
String lastKeyword = getLastKeyWord(startOfCommand);
if (lastKeyword == null) {
return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD
- , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DESC"}), startOfCommand);
+ , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"}), startOfCommand);
}
if (lastKeyword.equalsIgnoreCase("UPDATE")) {
String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
@@ -258,13 +258,11 @@
return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD
, Arrays.asList(new String[]{"AND", "OR", "IN", "GROUP BY", "ORDER BY"}));
} else if (lastKeyword.equalsIgnoreCase("DESC")) {
- String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
- return new TabCompletionInfo(TabCompletionInfo.MatchType.TABLE_NAMES, new ArrayList<String>(), end);
}
return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN, Arrays.asList(new String[0]));
}
- private static String getStartOfCommand(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ public static String getStartOfCommand(List<? extends CharSequence> commandInfo, Point commandPoint) {
StringBuffer buff = new StringBuffer();
for (int i = 0; i <= commandPoint.y; i++) {
if (i == commandPoint.y) {
@@ -291,33 +289,4 @@
}
return spaceIndex;
}
-
- public static class TabCompletionInfo {
- public enum MatchType {SQL_KEYWORD, TABLE_NAMES, COLUMN_NAMES, UNKNOWN}
-
- private MatchType type;
- private List<String> possibleMatches;
- private String start;
-
- private TabCompletionInfo(MatchType type, List<String> possibleMatches) {
- this(type, possibleMatches, "");
- }
-
- private TabCompletionInfo(MatchType type, List<String> possibleMatches, String start) {
- this.type = type;
- this.possibleMatches = possibleMatches;
- this.start = start;
- }
-
- public MatchType getMatchType() {
- return type;
- }
- public List<String> getPossibleMatches() {
- return possibleMatches;
- }
- public String getStart() {
- return start;
- }
-
- }
}
Added: src/main/java/nl/improved/sqlclient/TabCompletionInfo.java
===================================================================
--- src/main/java/nl/improved/sqlclient/TabCompletionInfo.java (rev 0)
+++ src/main/java/nl/improved/sqlclient/TabCompletionInfo.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2007 Roy van der Kuil (ro...@va...) and Stefan Rotman (st...@ro...)
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package nl.improved.sqlclient;
+
+import java.util.List;
+
+public class TabCompletionInfo {
+ public enum MatchType {SQL_KEYWORD, TABLE_NAMES, COLUMN_NAMES, UNKNOWN}
+
+ private MatchType type;
+ private List<String> possibleMatches;
+ private String start;
+
+ public TabCompletionInfo(MatchType type, List<String> possibleMatches) {
+ this(type, possibleMatches, "");
+ }
+
+ public TabCompletionInfo(MatchType type, List<String> possibleMatches, String start) {
+ this.type = type;
+ this.possibleMatches = possibleMatches;
+ this.start = start;
+ }
+
+ public MatchType getMatchType() {
+ return type;
+ }
+ public List<String> getPossibleMatches() {
+ return possibleMatches;
+ }
+ public String getStart() {
+ return start;
+ }
+
+}
Modified: src/main/java/nl/improved/sqlclient/commands/Command.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/Command.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/commands/Command.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -15,7 +15,11 @@
*/
package nl.improved.sqlclient.commands;
+import java.util.List;
import nl.improved.sqlclient.SQLCommand;
+import nl.improved.sqlclient.Point;
+import nl.improved.sqlclient.SQLUtil;
+import nl.improved.sqlclient.TabCompletionInfo;
/**
* Implement this interface to add a specific command to the sql client.
*/
@@ -31,7 +35,15 @@
* @return the command key that should show up in the help list.
*/
CharSequence getCommandString();
+
/**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint);
+ /**
* Returns a explenation string of how to use this command.
* @return a explenation string of how to use this command.
*/
Modified: src/main/java/nl/improved/sqlclient/commands/DescCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -15,6 +15,11 @@
*/
package nl.improved.sqlclient.commands;
+import java.util.List;
+import java.util.ArrayList;
+import nl.improved.sqlclient.Point;
+import nl.improved.sqlclient.SQLUtil;
+import nl.improved.sqlclient.TabCompletionInfo;
import nl.improved.sqlclient.SQLCommand;
import nl.improved.sqlclient.DBConnector;
import nl.improved.sqlclient.util.ResultBuilder;
@@ -100,6 +105,12 @@
return "desc";
}
+
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ String startOfCommand = SQLUtil.getStartOfCommand(commandInfo, commandPoint);
+ String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
+ return new TabCompletionInfo(TabCompletionInfo.MatchType.TABLE_NAMES, new ArrayList<String>(), end);
+ }
/**
* Return the command help.
* @return the command help.
Modified: src/main/java/nl/improved/sqlclient/commands/InfoCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/InfoCommand.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/commands/InfoCommand.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -15,6 +15,9 @@
*/
package nl.improved.sqlclient.commands;
+import java.util.List;
+import nl.improved.sqlclient.Point;
+import nl.improved.sqlclient.TabCompletionInfo;
import nl.improved.sqlclient.SQLCommand;
import nl.improved.sqlclient.DBConnector;
import java.sql.SQLException;
@@ -66,6 +69,16 @@
}
/**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
+
+ /**
* Return the command help.
* @return the command help.
*/
Modified: src/main/java/nl/improved/sqlclient/commands/ShowCommand.java
===================================================================
--- src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/main/java/nl/improved/sqlclient/commands/ShowCommand.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -17,6 +17,9 @@
import nl.improved.sqlclient.SQLCommand;
import nl.improved.sqlclient.DBConnector;
+import nl.improved.sqlclient.Point;
+import nl.improved.sqlclient.SQLUtil;
+import nl.improved.sqlclient.TabCompletionInfo;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
@@ -94,6 +97,16 @@
}
/**
+ * Returns some tab completion info for the specified command.
+ * @param commandInfo the command lines
+ * @param commandPoint the cursor position
+ * @return some tab completion info for the specified command.
+ */
+ public TabCompletionInfo getTabCompletion(List<? extends CharSequence> commandInfo, Point commandPoint) {
+ return null;
+ }
+
+ /**
* Return the command help.
* @return the command help.
*/
Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java
===================================================================
--- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-28 10:42:25 UTC (rev 186)
+++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-28 11:12:50 UTC (rev 187)
@@ -38,32 +38,31 @@
assertEquals("from", SQLUtil.getLastKeyWord(sql));
sql = "SELECT * FROM";
assertEquals("FROM", SQLUtil.getLastKeyWord(sql));
- sql = "DESC indummy";
- assertEquals("DESC", SQLUtil.getLastKeyWord(sql));
- sql = "DESC dummyin ";
- assertEquals("DESC", SQLUtil.getLastKeyWord(sql));
+// sql = "DESC indummy";
+// assertEquals("DESC", SQLUtil.getLastKeyWord(sql));
+// sql = "DESC dummyin ";
+// assertEquals("DESC", SQLUtil.getLastKeyWord(sql));
}
public void testTabCompletionInfoBLANK() {
List<String> sqlCommand = Arrays.asList(new String[]{""});
Point cursorPos = new Point(0,0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertTrue(matches.contains("SELECT"));
assertTrue(matches.contains("INSERT INTO"));
assertTrue(matches.contains("DELETE FROM"));
assertTrue(matches.contains("UPDATE"));
- assertTrue(matches.contains("DESC"));
}
public void testTabCompletionInfoSELECT() {
List<String> sqlCommand = Arrays.asList(new String[]{"SELECT A"});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
@@ -72,7 +71,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
@@ -80,7 +79,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("FROM"));
@@ -89,7 +88,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("FROM"));
@@ -99,7 +98,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("FROM"));
@@ -109,7 +108,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("FROM"));
@@ -119,7 +118,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertEquals("A", matches.get(0));
@@ -129,9 +128,9 @@
public void testTabCompletionInfoFROM() {
List<String> sqlCommand = Arrays.asList(new String[]{"SELECT * FROM A"});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
@@ -140,7 +139,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("B", info.getStart());
@@ -149,7 +148,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("B", info.getStart());
@@ -158,7 +157,7 @@
cursorPos = new Point("SELECT * FROM A".length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
@@ -167,7 +166,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
@@ -176,9 +175,9 @@
public void testTabCompletionInfoWHERE() {
List<String> sqlCommand = Arrays.asList(new String[]{"SELECT * FROM A,B "});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("WHERE"));
@@ -187,7 +186,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("WHERE"));
@@ -197,9 +196,9 @@
public void testTabCompletionInfoWHEREConditions() {
List<String> sqlCommand = Arrays.asList(new String[]{"SELECT * FROM A,B WHERE "});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(2, matches.size());
assertTrue(matches.contains("A"));
@@ -209,7 +208,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(2, matches.size());
assertTrue(matches.contains("A"));
@@ -220,7 +219,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(2, matches.size());
assertTrue(matches.contains("A"));
@@ -231,7 +230,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertTrue(matches.contains("A"));
@@ -242,7 +241,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(2, matches.size());
assertTrue(matches.contains("A"));
@@ -253,7 +252,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(2, matches.size());
assertTrue(matches.contains("A"));
@@ -264,7 +263,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertTrue(matches.contains("A"));
assertTrue(matches.contains("B"));
@@ -274,7 +273,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertTrue(matches.contains("A"));
assertTrue(matches.contains("B"));
@@ -284,7 +283,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertTrue(matches.contains("AND"));
assertTrue(matches.contains("OR"));
@@ -323,9 +322,9 @@
public void testUpdateTabCompletion() {
List<String> sqlCommand = Arrays.asList(new String[]{"UPDATE A"});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
@@ -334,7 +333,7 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertEquals("SET", matches.get(0));
@@ -344,20 +343,21 @@
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType());
matches = info.getPossibleMatches();
assertEquals(1, matches.size());
assertEquals("A", matches.get(0));
assertEquals("", info.getStart());
}
- public void testTabCompletionInfoDESC() {
+/* public void testTabCompletionInfoDESC() {
List<String> sqlCommand = Arrays.asList(new String[]{"DESC "});
Point cursorPos = new Point(sqlCommand.get(0).length(),0);
- SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
assertNotNull(info);
- assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ assertEquals(TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
List<String> matches = info.getPossibleMatches();
assertEquals(0, matches.size());
}
+*/
}
|
|
From: SVN by r. <sv...@ca...> - 2007-10-28 10:43:32
|
Author: roy
Date: 2007-10-28 11:42:25 +0100 (Sun, 28 Oct 2007)
New Revision: 186
Modified:
src/main/java/nl/improved/sqlclient/SQLUtil.java
src/test/java/nl/improved/sqlclient/SQLUtilTest.java
Log:
tab completion fix for from with multiple column select
Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-26 12:20:56 UTC (rev 185)
+++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-28 10:42:25 UTC (rev 186)
@@ -216,6 +216,7 @@
, Arrays.asList(new String[]{"WHERE"}), end);
}
String end;
+ startOfCommand = startOfCommand.substring(startOfCommand.indexOf("FROM"));
if (startOfCommand.indexOf(',') > 0) {
end = startOfCommand.substring(startOfCommand.lastIndexOf(',')+1).trim();
} else {
Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java
===================================================================
--- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-26 12:20:56 UTC (rev 185)
+++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-28 10:42:25 UTC (rev 186)
@@ -162,6 +162,15 @@
matches = info.getPossibleMatches();
assertEquals(0, matches.size());
assertEquals("A", info.getStart());
+
+ sqlCommand = Arrays.asList(new String[]{"SELECT A.b, A.c FROM A"});
+ cursorPos = new Point(sqlCommand.get(0).length(),0);
+ info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ assertNotNull(info);
+ assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType());
+ matches = info.getPossibleMatches();
+ assertEquals(0, matches.size());
+ assertEquals("A", info.getStart());
}
public void testTabCompletionInfoWHERE() {
|
|
From: SVN by r. <sv...@ca...> - 2007-10-26 12:21:01
|
Author: roy
Date: 2007-10-26 14:20:56 +0200 (Fri, 26 Oct 2007)
New Revision: 185
Modified:
src/main/java/nl/improved/sqlclient/SQLUtil.java
src/test/java/nl/improved/sqlclient/SQLUtilTest.java
Log:
added more 'failing' queries .. and added fix
Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java
===================================================================
--- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-09 10:15:53 UTC (rev 184)
+++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-26 12:20:56 UTC (rev 185)
@@ -37,7 +37,7 @@
/**
* A column name regular expression statement.
*/
- private static final String COLUMN = "[A-Z]+"+NAMING_CHAR+"*";
+ private static final String COLUMN = "(\\*|[A-Z]+"+NAMING_CHAR+"*)";
/**
* A variable (table name + columnname) regular expression statement.
*/
@@ -166,9 +166,10 @@
// if it looks like:
// SELECT x
// return "FROM"
- String upCommand = startOfCommand.trim().toUpperCase();
+ String upCommand = startOfCommand.toUpperCase();
if (upCommand.length() > "SELECT".length()) {
- if (upCommand.substring("SELECT".length()).matches("[\\s]*(\\*|"+VAR+"[\\s])([\\s]*,[\\s]*"+VAR+"+)*( |\t)*(|F|FR|FRO|FROM)")) {
+ if (upCommand.substring(upCommand.indexOf("SELECT") + "SELECT".length())
+ .matches("[\\s]+"+VAR+"(|[\\s]*,[\\s]*"+VAR+"[\\s]*)[\\s]+(|F|FR|FRO|FROM)")) {
String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1);
return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD
, Arrays.asList(new String[]{"FROM"}), end);
Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java
===================================================================
--- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-09 10:15:53 UTC (rev 184)
+++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-26 12:20:56 UTC (rev 185)
@@ -95,6 +95,26 @@
assertTrue(matches.contains("FROM"));
assertEquals("FR", info.getStart());
+ sqlCommand = Arrays.asList(new String[]{"SELECT a.test FR"});
+ cursorPos = new Point(sqlCommand.get(0).length(),0);
+ info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ assertNotNull(info);
+ assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ matches = info.getPossibleMatches();
+ assertEquals(1, matches.size());
+ assertTrue(matches.contains("FROM"));
+ assertEquals("FR", info.getStart());
+
+ sqlCommand = Arrays.asList(new String[]{"SELECT a.test, a.tost FR"});
+ cursorPos = new Point(sqlCommand.get(0).length(),0);
+ info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
+ assertNotNull(info);
+ assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType());
+ matches = info.getPossibleMatches();
+ assertEquals(1, matches.size());
+ assertTrue(matches.contains("FROM"));
+ assertEquals("FR", info.getStart());
+
sqlCommand = Arrays.asList(new String[]{"SELECT A."});
cursorPos = new Point(sqlCommand.get(0).length(),0);
info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos);
|
|
From: SVN by r. <sv...@ca...> - 2007-10-09 10:16:55
|
Author: rotman Date: 2007-10-09 12:15:53 +0200 (Tue, 09 Oct 2007) New Revision: 184 Modified: src/www/content/news.txt Log: link news-items to the SF newspost Modified: src/www/content/news.txt =================================================================== --- src/www/content/news.txt 2007-10-09 10:15:37 UTC (rev 183) +++ src/www/content/news.txt 2007-10-09 10:15:53 UTC (rev 184) @@ -1,5 +1,5 @@ -2007-10-09 release 0.3 -2007-09-16 release 0.2 +2007-10-09 <a href="http://sourceforge.net/forum/forum.php?forum_id=743419" target="_blank">release 0.3</a> +2007-09-16 <a href="http://sourceforge.net/forum/forum.php?forum_id=736699" target="_blank">release 0.2</a> 2007-09-15 release of website 2007-09-07 start design website -2007-08-01 release 0.1 +2007-08-01 <a href="http://sourceforge.net/forum/forum.php?forum_id=731541" target="_blank">release 0.1</a> |
|
From: SVN by r. <sv...@ca...> - 2007-10-09 10:16:41
|
Author: rotman
Date: 2007-10-09 12:15:37 +0200 (Tue, 09 Oct 2007)
New Revision: 183
Modified:
src/www/design/style.css
Log:
style fix (thanks to Ronald)
Modified: src/www/design/style.css
===================================================================
--- src/www/design/style.css 2007-10-09 09:32:41 UTC (rev 182)
+++ src/www/design/style.css 2007-10-09 10:15:37 UTC (rev 183)
@@ -41,7 +41,7 @@
top : 100px;
}
-div.menu a:link, a:active, a:visited {
+div.menu a:link, div.menu a:active, div.menu a:visited {
font-size: 13pt;
text-decoration: underline;
}
|
|
From: SVN by r. <sv...@ca...> - 2007-10-09 09:33:45
|
Author: rotman Date: 2007-10-09 11:32:41 +0200 (Tue, 09 Oct 2007) New Revision: 182 Modified: pom.xml Log: Ensure that future commits won't be accidentally committed into 0.3 version ;) Modified: pom.xml =================================================================== --- pom.xml 2007-10-09 09:16:28 UTC (rev 181) +++ pom.xml 2007-10-09 09:32:41 UTC (rev 182) @@ -19,7 +19,7 @@ <groupId>nl.improved</groupId> <artifactId>sqlshell</artifactId> <packaging>jar</packaging> - <version>0.3</version> + <version>0.4-SNAPSHOT</version> <name>SQLShell ~ the improved sqlclient</name> <url>http://sqlshell.sourceforge.org</url> <build> |
|
From: SVN by r. <sv...@ca...> - 2007-10-09 09:17:33
|
Author: rotman Date: 2007-10-09 11:16:28 +0200 (Tue, 09 Oct 2007) New Revision: 181 Modified: ChangeLog Log: Set a release date on the 0.3 release Modified: ChangeLog =================================================================== --- ChangeLog 2007-10-09 08:32:47 UTC (rev 180) +++ ChangeLog 2007-10-09 09:16:28 UTC (rev 181) @@ -1,4 +1,4 @@ -0.3 (Unreleased) +0.3 (09-10-2007) * focus fix in login dialog * Improve desc table to show primary key * BUGFIX: fix to stop spooled lines being appended to each other. |
|
From: SVN by r. <sv...@ca...> - 2007-10-09 08:33:53
|
Author: rotman Date: 2007-10-09 10:32:47 +0200 (Tue, 09 Oct 2007) New Revision: 180 Modified: src/www/content/news.txt Log: Change order of newsitems; Mention 0.3 release Modified: src/www/content/news.txt =================================================================== --- src/www/content/news.txt 2007-10-09 08:32:18 UTC (rev 179) +++ src/www/content/news.txt 2007-10-09 08:32:47 UTC (rev 180) @@ -1,5 +1,5 @@ +2007-10-09 release 0.3 +2007-09-16 release 0.2 +2007-09-15 release of website +2007-09-07 start design website 2007-08-01 release 0.1 -2007-09-07 start design website -2007-09-15 release of website -2007-09-16 release 0.2 - |
|
From: SVN by r. <sv...@ca...> - 2007-10-09 08:33:21
|
Author: rotman
Date: 2007-10-09 10:32:18 +0200 (Tue, 09 Oct 2007)
New Revision: 179
Modified:
sqlshell
Log:
this is where the classpath was fixed (not in the pom... duh)
Modified: sqlshell
===================================================================
--- sqlshell 2007-10-09 08:31:46 UTC (rev 178)
+++ sqlshell 2007-10-09 08:32:18 UTC (rev 179)
@@ -27,14 +27,14 @@
JCURSES=${WORKINGDIR}/lib
# Where to find the SQLShell classes
-#SQLSHELL=${WORKINGDIR}:${WORKINGDIR}/sqlshell.jar
+#SQLSHELL=${WORKINGDIR}/sqlshell.jar
SQLSHELL=target/classes
# Jars providing drivers for the databases to support.
DRIVERS="${WORKINGDIR}/lib/hsqldb-1.8.0.jar"
# The classpath to use when running
-CP=${SQLSHELL}:${JCURSES}/jcurses.jar
+CP=${WORKINGDIR}:${SQLSHELL}:${JCURSES}/jcurses.jar
for DRIVER in ${DRIVERS} ; do
CP=${CP}:${DRIVER}
done
|
|
From: SVN by r. <sv...@ca...> - 2007-10-09 08:32:53
|
Author: rotman
Date: 2007-10-09 10:31:46 +0200 (Tue, 09 Oct 2007)
New Revision: 178
Modified:
makejars.sh
Log:
Classpath was fixed, so that affects our awk line
Modified: makejars.sh
===================================================================
--- makejars.sh 2007-10-09 08:31:13 UTC (rev 177)
+++ makejars.sh 2007-10-09 08:31:46 UTC (rev 178)
@@ -1,6 +1,6 @@
#!/bin/bash
PROJECT=sqlshell
-VERSION=0.2
+VERSION=0.3
#cleanup
rm -Rf release
@@ -40,7 +40,7 @@
cd bin
find . -name "*.svn" | xargs rm -Rf
mv sqlshell _sqlshell
-cat _sqlshell | awk '{ gsub("SQLSHELL=target/classes","#SQLSHELL=target/classes"); gsub("#SQLSHELL=\${WORKINGDIR}:\${WORKINGDIR}/sqlshell.jar","SQLSHELL=${WORKINGDIR}:${WORKINGDIR}/sqlshell.jar"); print }' > sqlshell
+cat _sqlshell | awk '{ gsub("SQLSHELL=target/classes","#SQLSHELL=target/classes"); gsub("#SQLSHELL=\${WORKINGDIR}/sqlshell.jar","SQLSHELL=${WORKINGDIR}/sqlshell.jar"); print }' > sqlshell
chmod +x sqlshell
rm _sqlshell
tar zcf ../${PROJECT}-bin-${VERSION}.tgz .
|
|
From: SVN by r. <sv...@ca...> - 2007-10-09 08:32:17
|
Author: rotman Date: 2007-10-09 10:31:13 +0200 (Tue, 09 Oct 2007) New Revision: 177 Modified: pom.xml Log: Set 0.3 final version; Remove hsqldb dependency, Fix Classpath Modified: pom.xml =================================================================== --- pom.xml 2007-10-09 08:30:05 UTC (rev 176) +++ pom.xml 2007-10-09 08:31:13 UTC (rev 177) @@ -19,9 +19,9 @@ <groupId>nl.improved</groupId> <artifactId>sqlshell</artifactId> <packaging>jar</packaging> - <version>0.3-SNAPSHOT</version> - <name>Improved SQLShell</name> - <!--url>http://maven.apache.org</url--> + <version>0.3</version> + <name>SQLShell ~ the improved sqlclient</name> + <url>http://sqlshell.sourceforge.org</url> <build> <defaultGoal>compile</defaultGoal> <plugins> @@ -41,11 +41,6 @@ <version>0.9.5</version> </dependency> <dependency> - <groupId>hsqldb</groupId> - <artifactId>hsqldb</artifactId> - <version>1.8.0.7</version> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> |
|
From: SVN by r. <sv...@ca...> - 2007-10-09 08:31:14
|
Author: rotman
Date: 2007-10-09 10:30:05 +0200 (Tue, 09 Oct 2007)
New Revision: 176
Modified:
ChangeLog
Log:
Set a date for the 0.1
Modified: ChangeLog
===================================================================
--- ChangeLog 2007-10-08 15:43:13 UTC (rev 175)
+++ ChangeLog 2007-10-09 08:30:05 UTC (rev 176)
@@ -30,7 +30,7 @@
* Improve desc table to show not null
* scroll all the way down when key typed that is not pageup/down
-0.1
+0.1 (01-08-2007)
* connection settings via db.properties and input of password in a seperate dialog
configuration can be done by editing a simple db.properties file
* command history (key up/down)
|