mirror of
https://github.com/Wisser/Jailer.git
synced 2026-05-15 03:53:35 -05:00
Compare commits
50 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 841ae87495 | |||
| 642f626b34 | |||
| 643a101efe | |||
| 501e532a4d | |||
| 6242c81ef5 | |||
| 5f38de3d07 | |||
| 69f883a3df | |||
| 6fa08e8c5c | |||
| 24deba340d | |||
| 11e16ae890 | |||
| d6ff7df073 | |||
| 46c60478ae | |||
| 03319d91ff | |||
| d1340a2fde | |||
| 2fba314766 | |||
| 8471f2601b | |||
| 88a3947508 | |||
| 7b220dc0ba | |||
| a62b25928e | |||
| 52e5d72fd3 | |||
| 478b276317 | |||
| 4eb4afe11e | |||
| 3d66e9571c | |||
| df8f0fb34a | |||
| 2e6cded46b | |||
| 60029b3911 | |||
| 00a3d3f998 | |||
| 1b8e7d23eb | |||
| c6a294105c | |||
| 4f29e781b7 | |||
| 352d0873d7 | |||
| 9381462f26 | |||
| d6544262b4 | |||
| fcc133ad42 | |||
| 8602f4e874 | |||
| 2d80fc8c6a | |||
| 3b4813eae2 | |||
| e7097ae5ab | |||
| 5d819c052c | |||
| 1eebad9ca0 | |||
| 7ce06142ef | |||
| 01add8cef4 | |||
| 985e439e70 | |||
| 8028354562 | |||
| 3223a78cb8 | |||
| a2a842fbc8 | |||
| f0b83319e9 | |||
| 24846fd88b | |||
| 642125857d | |||
| 4070e982ea |
+10
@@ -1,3 +1,13 @@
|
||||
**/*.iml
|
||||
*.log
|
||||
.cdsettings
|
||||
.connections
|
||||
.exportdata.ui
|
||||
.idea/
|
||||
.selecteddatamodel
|
||||
.uisettings
|
||||
!datamodel/Demo-Sakila
|
||||
!datamodel/Demo-Scott
|
||||
datamodel/*
|
||||
out/
|
||||
tmp/*.jm
|
||||
+1
-1
@@ -2,7 +2,7 @@ PostgreSQL;jdbc:postgresql://<HOST(localhost)>[:<PORT(5432)>]/[<DATABASE>];org.p
|
||||
Oracle Thin;jdbc:oracle:thin:@<HOST(localhost)>:<PORT(1521)>:<SID>;oracle.jdbc.driver.OracleDriver;;https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/19.7.0.0/ojdbc8-19.7.0.0.jar https://repo1.maven.org/maven2/com/oracle/database/xml/xdb/19.7.0.0/xdb-19.7.0.0.jar https://repo1.maven.org/maven2/com/oracle/database/xml/xmlparserv2/19.7.0.0/xmlparserv2-19.7.0.0.jar;jdbc:oracle:thin:@([^:]+).*;oracle.png
|
||||
Oracle OCI;jdbc:oracle:oci:@<TNS_NAME>;oracle.jdbc.driver.OracleDriver;;https://repo1.maven.org/maven2/com/oracle/database/jdbc/ojdbc8/19.7.0.0/ojdbc8-19.7.0.0.jar https://repo1.maven.org/maven2/com/oracle/database/xml/xdb/19.7.0.0/xdb-19.7.0.0.jar https://repo1.maven.org/maven2/com/oracle/database/xml/xmlparserv2/19.7.0.0/xmlparserv2-19.7.0.0.jar;jdbc:oracle:oci:@([^:]+).*;oracle.png
|
||||
MySQL;jdbc:mysql://<HOST(localhost)>:<PORT(3306)>[/<DATABASE>];com.mysql.jdbc.Driver;lib/mysql-connector-java-8.0.21.jar;;jdbc:mysql://.*/([^\\?]+).* jdbc:mysql://([^/:]+).* jdbc:mysql:([^/:]+).*;mysql.png
|
||||
MySQL 5;jdbc:mysql://<HOST(localhost)>:<PORT(3306)>[/<DATABASE>];org.gjt.mm.mysql.Driver;lib/mysql-connector-java-5.1.5-bin.jar;;jdbc:mysql://.*/([^\\?]+).* jdbc:mysql://([^/:]+).* jdbc:mysql:([^/:]+).*;mysql.png
|
||||
MySQL 5 (or below);jdbc:mysql://<HOST(localhost)>:<PORT(3306)>[/<DATABASE>];org.gjt.mm.mysql.Driver;lib/mysql-connector-java-5.1.5-bin.jar;;jdbc:mysql://.*/([^\\?]+).* jdbc:mysql://([^/:]+).* jdbc:mysql:([^/:]+).*;mysql.png
|
||||
MariaDB;jdbc:mariadb://<HOST(localhost)>:<PORT(3306)>[/<DATABASE>];org.mariadb.jdbc.Driver;lib/mariadb-java-client-2.7.3.jar;;jdbc:mariadb://.*/([^\\?]+).* jdbc:mariadb://([^/:]+).* jdbc:mariadb:([^/:]+).*;mariadb.png
|
||||
Microsoft SQL Server;jdbc:sqlserver://<HOST(localhost)>[\\<INSTANCE>][:<PORT>];com.microsoft.sqlserver.jdbc.SQLServerDriver;lib/mssql-jdbc-9.4.0.jre8.jar;;jdbc:sqlserver://(.*\\\\[^:\;]+).* jdbc:sqlserver://.*\\binstanceName\\s*=\\s*([^:\;]+).* jdbc:sqlserver://.*\\bdatabaseName\\s*=\\s*([^:\;]+).* jdbc:sqlserver://.*\\bservername\\s*=\\s*([^:\;]+).* jdbc:sqlserver://([^/\\\\:\;]+).*;mssql.png
|
||||
IBM Db2;jdbc:db2://<HOST(localhost)>:<PORT(50000)>/<DATABASE>;com.ibm.db2.jcc.DB2Driver;;https://repo1.maven.org/maven2/com/ibm/db2/jcc/11.5.4.0/jcc-11.5.4.0.jar;jdbc:db2://.*/(.+) jdbc:db2://([^/:]+).* jdbc:db2:([^/:]+).*;db2.png
|
||||
|
||||
|
BIN
Binary file not shown.
+16
-7
@@ -1,7 +1,22 @@
|
||||
12.4.3
|
||||
12.5.1
|
||||
- Consideration of encoding and compression when loading SQL scripts into console or file viewer.
|
||||
|
||||
12.5
|
||||
- SQL Console and desktop improvements
|
||||
- Queries are now subjected to intensive analysis,
|
||||
which makes it possible to detect primary and foreign keys and display them accordingly,
|
||||
as well as the origin table of each column.
|
||||
- Number data is now formatted and right-aligned.
|
||||
- Faster metadata acquisition with Oracle DBMS.
|
||||
- Fixed a bug that caused exports to hang when local database was used for the working tables.
|
||||
|
||||
12.4.4
|
||||
- Reset" button in the dialog for the connection settings.
|
||||
- When changing the Look&Feel, confirmation dialog appears after restart.
|
||||
|
||||
12.4.3
|
||||
- Release was rolled back because it introduced a new bug related to MySQL in the SQL console.
|
||||
|
||||
12.4.2
|
||||
- The temporary files for the local database were not always cleared away in case of an error. This has been corrected.
|
||||
- The dialog for database connection parameter entry has been improved.
|
||||
@@ -163,12 +178,6 @@
|
||||
- An error in the row count query has been corrected.
|
||||
|
||||
10.4.1
|
||||
- SQL Console and desktop improvements
|
||||
- Queries are now subjected to intensive analysis,
|
||||
which makes it possible to detect primary and foreign keys and display them accordingly,
|
||||
as well as the origin table of each column.
|
||||
- Number data is now formatted and right-aligned.
|
||||
- Faster metadata acquisition with Oracle DBMS.
|
||||
- Fixed "(Minor) Dropdown menu disabling inconsistency #40" https://github.com/Wisser/Jailer/issues/40
|
||||
- Fixed "Parameters not working when using complex filters #41" https://github.com/Wisser/Jailer/issues/41
|
||||
- New logo.
|
||||
|
||||
@@ -25,7 +25,7 @@ public class JailerVersion {
|
||||
/**
|
||||
* The Jailer version.
|
||||
*/
|
||||
public static final String VERSION = "12.4.3";
|
||||
public static final String VERSION = "12.5.1";
|
||||
|
||||
/**
|
||||
* The Jailer working tables version.
|
||||
|
||||
@@ -191,6 +191,7 @@ public class Session {
|
||||
*/
|
||||
public interface ConnectionFactory {
|
||||
Connection getConnection() throws SQLException;
|
||||
Connection createNewConnection() throws SQLException;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -372,6 +373,10 @@ public class Session {
|
||||
}
|
||||
return con;
|
||||
}
|
||||
@Override
|
||||
public Connection createNewConnection() throws SQLException {
|
||||
return dataSource.getConnection();
|
||||
}
|
||||
};
|
||||
// fail fast
|
||||
init();
|
||||
@@ -1413,6 +1418,15 @@ public class Session {
|
||||
return connectionFactory.getConnection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new connection. Must be closed from caller.
|
||||
*
|
||||
* @return a new connection
|
||||
*/
|
||||
public Connection createNewConnection() throws SQLException {
|
||||
return connectionFactory.createNewConnection();
|
||||
}
|
||||
|
||||
private InlineViewStyle inlineViewStyle;
|
||||
private boolean noInlineViewStyleFound = false;
|
||||
private final Object IVS_LOCK = new Object();
|
||||
|
||||
@@ -711,8 +711,8 @@ public class LocalEntityGraph extends EntityGraph {
|
||||
|
||||
String insert = "Insert into " + dmlTableReference(ENTITY, localSession) + " (r_entitygraph, " + upkColumnList(table, null) + ", birthday, type) " + select;
|
||||
|
||||
for (;;) rc[0] += localSession.executeUpdate(insert);
|
||||
// totalRowcount += rc[0];
|
||||
rc[0] += localSession.executeUpdate(insert);
|
||||
totalRowcount += rc[0];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+28
-52
@@ -15,6 +15,8 @@
|
||||
*/
|
||||
package net.sf.jailer.modelbuilder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
import java.sql.ResultSet;
|
||||
@@ -34,7 +36,7 @@ import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -51,8 +53,9 @@ import net.sf.jailer.datamodel.PrimaryKey;
|
||||
import net.sf.jailer.datamodel.PrimaryKeyFactory;
|
||||
import net.sf.jailer.datamodel.Table;
|
||||
import net.sf.jailer.util.CancellationHandler;
|
||||
import net.sf.jailer.util.CsvFile;
|
||||
import net.sf.jailer.util.CsvFile.Line;
|
||||
import net.sf.jailer.util.JSqlParserUtil;
|
||||
import net.sf.jailer.util.LogUtil;
|
||||
import net.sf.jailer.util.Pair;
|
||||
import net.sf.jailer.util.Quoting;
|
||||
import net.sf.jailer.util.SqlUtil;
|
||||
@@ -408,6 +411,22 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
resultSet.close();
|
||||
}
|
||||
Map<String, Map<Integer, Column>> pkColumns = new HashMap<String, Map<Integer, Column>>();
|
||||
|
||||
Pattern nonPKPattern = null;
|
||||
if (executionContext.getQualifiedDatamodelFolder() != null) {
|
||||
File nonPKFile = new File(executionContext.getQualifiedDatamodelFolder(), "nonPKColumns.csv");
|
||||
if (nonPKFile.exists()) {
|
||||
try {
|
||||
List<Line> lines = new CsvFile(nonPKFile).getLines();
|
||||
if (!lines.isEmpty() && !lines.get(0).cells.get(0).isEmpty()) {
|
||||
nonPKPattern = Pattern.compile(lines.get(0).cells.get(0));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (String tableName: tableNames) {
|
||||
Table tmp = new Table(tableName, null, false, false);
|
||||
resultSet = null;
|
||||
@@ -424,13 +443,17 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
boolean hasPK = false;
|
||||
int nextKeySeq = 0;
|
||||
while (resultSet != null && resultSet.next()) {
|
||||
String cName = resultSet.getString(4);
|
||||
if (nonPKPattern != null && nonPKPattern.matcher(cName).matches()) {
|
||||
continue;
|
||||
}
|
||||
hasPK = true;
|
||||
int keySeq = resultSet.getInt(5);
|
||||
if (DBMS.SQLITE.equals(session.dbms)) {
|
||||
// SQlite driver doesn't return the keySeq
|
||||
keySeq = nextKeySeq++;
|
||||
}
|
||||
pk.put(keySeq, new Column(quoting.quote(resultSet.getString(4)), "", 0, -1));
|
||||
pk.put(keySeq, new Column(quoting.quote(cName), "", 0, -1));
|
||||
}
|
||||
if (!hasPK) {
|
||||
_log.info("find unique index of table " + tableName);
|
||||
@@ -787,25 +810,7 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
return session.getMetaData().getPrimaryKeys(null, schema, table);
|
||||
}
|
||||
|
||||
private static Supplier<String> tableDebugSupplier = () -> "nothing";
|
||||
|
||||
public static ResultSet getTables(Session session, String schemaPattern, String tableNamePattern, String[] types) throws SQLException {
|
||||
tableDebugSupplier = () -> {
|
||||
Map<String, Integer> schema = new HashMap<String, Integer>();
|
||||
try {
|
||||
int c = 0;
|
||||
ResultSet rs = getTables(session, schemaPattern, tableNamePattern, types);
|
||||
while (rs.next()) {
|
||||
final String key = rs.getString(1) + "." + rs.getString(2) + " " + rs.getString(4);
|
||||
schema.put(key, schema.containsKey(key)? schema.get(key) + 1 : 1);
|
||||
c++;
|
||||
}
|
||||
rs.close();
|
||||
return "TabInfo: " + c + " - " + schema;
|
||||
} catch (Throwable t) {
|
||||
return t.getMessage();
|
||||
}
|
||||
};
|
||||
if (DBMS.MySQL.equals(session.dbms)) {
|
||||
return session.getMetaData().getTables(schemaPattern, null, tableNamePattern, types);
|
||||
}
|
||||
@@ -919,7 +924,7 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
}
|
||||
return session.getMetaData().getIndexInfo(null, schemaPattern, tableNamePattern, false, true);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Calls {@link DatabaseMetaData#getColumns(String, String, String, String)}. Uses schemaPattern as catalogPattern on MySQL.
|
||||
* @param withCaching
|
||||
@@ -951,33 +956,7 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
}
|
||||
ResultSet resultSet = metaDataCache.forTable(tableNamePattern);
|
||||
if (resultSet != null) {
|
||||
if (resultSet instanceof MemorizedResultSet) {
|
||||
if (((MemorizedResultSet) resultSet).getSize() == 0) {
|
||||
if (DBMS.MySQL.equals(session.dbms)) {
|
||||
resultSet = session.getMetaData().getColumns(schemaPattern, null, tableNamePattern, columnNamePattern);
|
||||
} else {
|
||||
resultSet = session.getMetaData().getColumns(null, schemaPattern, tableNamePattern, columnNamePattern);
|
||||
}
|
||||
String info = schemaPattern + ", " + tableNamePattern + ", " + columnNamePattern + ", " + withCaching + ", " + onlyIfCached + ", " + tableType + ", " + (session.dbms != null? session.dbms.getId() : null);
|
||||
info += " " + metaDataCache.toString();
|
||||
if (resultSet.next()) {
|
||||
if (!warnedF) {
|
||||
warnedF = true;
|
||||
LogUtil.warn(new RuntimeException("cache miss: " + info + " " + tableDebugSupplier.get()));
|
||||
}
|
||||
} else {
|
||||
if (!warnedNF) {
|
||||
warnedNF = true;
|
||||
LogUtil.warn(new RuntimeException("cache hit: " + info + " " + tableDebugSupplier.get()));
|
||||
}
|
||||
}
|
||||
resultSet.close();
|
||||
resultSet = null;
|
||||
}
|
||||
}
|
||||
if (resultSet != null) {
|
||||
return resultSet;
|
||||
}
|
||||
return resultSet;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -993,9 +972,6 @@ public class JDBCMetaDataBasedModelElementFinder implements ModelElementFinder {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static boolean warnedF = false;
|
||||
private static boolean warnedNF = false;
|
||||
|
||||
private static boolean setIncludeSynonyms(boolean includeSynonyms, Session session) {
|
||||
try {
|
||||
|
||||
@@ -27,7 +27,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -154,7 +153,8 @@ public class MetaDataCache {
|
||||
*/
|
||||
public static MetaDataCache readColumns(Session session, String schema) {
|
||||
_log.info("reading columns (may take some time)...");
|
||||
|
||||
Set<String> ds2 = new HashSet<String>();
|
||||
|
||||
MetaDataCache metaDataCache = new MetaDataCache();
|
||||
ResultSet rs;
|
||||
try {
|
||||
@@ -193,6 +193,7 @@ public class MetaDataCache {
|
||||
String table = (String) row[2];
|
||||
|
||||
List<Object[]> rowList = metaDataCache.cache.get(table);
|
||||
ds2.add(table);
|
||||
if (rowList == null) {
|
||||
rowList = new LinkedList<Object[]>();
|
||||
metaDataCache.cache.put(table, rowList);
|
||||
@@ -201,7 +202,6 @@ public class MetaDataCache {
|
||||
}
|
||||
metaDataCache.resultSetMetaData = new MemorizedResultSetMetaData(numCol, names, types, typeNames);
|
||||
rs.close();
|
||||
|
||||
if (metaDataCache.cache.isEmpty()) {
|
||||
metaDataCache.cache = null;
|
||||
}
|
||||
@@ -270,12 +270,12 @@ public class MetaDataCache {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
public String info(String subject) {
|
||||
try {
|
||||
Set<String> schema = new HashSet<String>();
|
||||
cache.forEach((k, v) -> v.forEach(c-> schema.add(c[0] + "." + c[1])));
|
||||
return "MetaDataCache [cache=" + cache.entrySet().stream().map(e -> e.getValue().size()).collect(Collectors.summarizingInt(n -> n)) + "/" + schema + "]";
|
||||
return "MetaDataCache [cache=" + cache.entrySet().stream().map(e -> e.getValue().size()).collect(Collectors.summarizingInt(n -> n)) + "/" + schema + "]" +
|
||||
cache.get(subject);
|
||||
} catch (Throwable t) {
|
||||
return t.getMessage();
|
||||
}
|
||||
|
||||
@@ -17,20 +17,25 @@ package net.sf.jailer.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.Charset;
|
||||
import java.text.MessageFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import net.sf.jailer.configuration.Configuration;
|
||||
import net.sf.jailer.datamodel.Table;
|
||||
@@ -251,7 +256,18 @@ public class PrintUtil {
|
||||
public String loadFile(String file, boolean ignoreComments) throws FileNotFoundException, IOException {
|
||||
StringBuilder sb;
|
||||
sb = new StringBuilder(65536);
|
||||
BufferedReader reader = new BufferedReader(new FileReader(new File(file)));
|
||||
Charset encoding = SqlUtil.retrieveEncoding(file);
|
||||
InputStream inputStream = new FileInputStream(file);
|
||||
BufferedReader reader;
|
||||
if (file.toLowerCase(Locale.ENGLISH).endsWith(".gz")) {
|
||||
reader = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream), encoding));
|
||||
} else if (file.toLowerCase(Locale.ENGLISH).endsWith(".zip")){
|
||||
ZipInputStream zis = new ZipInputStream(inputStream);
|
||||
zis.getNextEntry();
|
||||
reader = new BufferedReader(new InputStreamReader(zis, encoding));
|
||||
} else {
|
||||
reader = new BufferedReader(new InputStreamReader(inputStream, encoding));
|
||||
}
|
||||
String line = null;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
if (!ignoreComments || (line.trim().length() > 0 && !line.startsWith("#"))) {
|
||||
|
||||
@@ -200,37 +200,10 @@ public class SqlScriptExecutor {
|
||||
BufferedReader bufferedReader;
|
||||
long fileSize = 0;
|
||||
final long[] bytesRead = new long[1];
|
||||
Charset encoding = SqlUtil.retrieveEncoding(scriptFileName);
|
||||
|
||||
File file = new File(scriptFileName);
|
||||
InputStream inputStream = new FileInputStream(file);
|
||||
|
||||
Charset encoding = Charset.defaultCharset();
|
||||
|
||||
Charset uTF8 = null;
|
||||
try {
|
||||
uTF8 = Charset.forName("UTF8");
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
if (uTF8 != null) {
|
||||
// retrieve encoding
|
||||
if (scriptFileName.toLowerCase(Locale.ENGLISH).endsWith(".gz")) {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream), uTF8), 1);
|
||||
} else if (scriptFileName.toLowerCase(Locale.ENGLISH).endsWith(".zip")) {
|
||||
ZipInputStream zis = new ZipInputStream(new FileInputStream(scriptFileName));
|
||||
zis.getNextEntry();
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(zis, uTF8), 1);
|
||||
} else {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(inputStream, uTF8), 1);
|
||||
}
|
||||
String line = bufferedReader.readLine();
|
||||
if (line != null && line.contains("encoding UTF-8")) {
|
||||
encoding = uTF8;
|
||||
}
|
||||
bufferedReader.close();
|
||||
}
|
||||
|
||||
inputStream = new FileInputStream(file);
|
||||
inputStream = new FilterInputStream(inputStream) {
|
||||
@Override
|
||||
public int read() throws IOException {
|
||||
|
||||
@@ -15,7 +15,15 @@
|
||||
*/
|
||||
package net.sf.jailer.util;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.nio.charset.Charset;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.ResultSetMetaData;
|
||||
import java.sql.SQLException;
|
||||
@@ -33,6 +41,8 @@ import java.util.Set;
|
||||
import java.util.function.BiConsumer;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.ZipInputStream;
|
||||
|
||||
import net.sf.jailer.configuration.DBMS;
|
||||
import net.sf.jailer.database.SQLDialect;
|
||||
@@ -772,4 +782,44 @@ public class SqlUtil {
|
||||
return pattern.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves SQL script file encoding.
|
||||
*
|
||||
* @param scriptFileName file name of script
|
||||
*
|
||||
* @return encoding or null
|
||||
*/
|
||||
public static Charset retrieveEncoding(String scriptFileName) throws FileNotFoundException, IOException {
|
||||
File file = new File(scriptFileName);
|
||||
BufferedReader bufferedReader;
|
||||
InputStream inputStream = new FileInputStream(file);
|
||||
|
||||
Charset encoding = Charset.defaultCharset();
|
||||
|
||||
Charset uTF8 = null;
|
||||
try {
|
||||
uTF8 = Charset.forName("UTF8");
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
if (uTF8 != null) {
|
||||
// retrieve encoding
|
||||
if (scriptFileName.toLowerCase(Locale.ENGLISH).endsWith(".gz")) {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream), uTF8), 1);
|
||||
} else if (scriptFileName.toLowerCase(Locale.ENGLISH).endsWith(".zip")) {
|
||||
ZipInputStream zis = new ZipInputStream(new FileInputStream(scriptFileName));
|
||||
zis.getNextEntry();
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(zis, uTF8), 1);
|
||||
} else {
|
||||
bufferedReader = new BufferedReader(new InputStreamReader(inputStream, uTF8), 1);
|
||||
}
|
||||
String line = bufferedReader.readLine();
|
||||
if (line != null && line.contains("encoding UTF-8")) {
|
||||
encoding = uTF8;
|
||||
}
|
||||
bufferedReader.close();
|
||||
}
|
||||
return encoding;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1083,6 +1083,9 @@ public abstract class ClosureView extends javax.swing.JDialog {
|
||||
isEmpty = false;
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
width += 40;
|
||||
}
|
||||
|
||||
column.setPreferredWidth(width);
|
||||
if (isEmpty) {
|
||||
|
||||
@@ -421,7 +421,7 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
yellowdotLabel.setIcon(UIUtil.scaleIcon(yellowdotLabel, yellowDotImg));
|
||||
bluedotLabel1.setText(null);
|
||||
yellowdotLabel.setText(null);
|
||||
|
||||
|
||||
String linkS = "https://wisser.github.io/Jailer/exporting-data.htm";
|
||||
LightBorderSmallButton helpButton = new LightBorderSmallButton(UIUtil.scaleIcon(yellowdotLabel, helpImg)) {
|
||||
@Override
|
||||
@@ -476,8 +476,8 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
subsetterPanel.add(dmmdSubsetter.mainContentPanel);
|
||||
dataBrowserPanel.add(dmmdBrowser.mainContentPanel);
|
||||
|
||||
final Color bgBrowser = new Color(240, 244, 255);
|
||||
final Color bgSubsetter = new Color(255, 255, 244);
|
||||
final Color bgBrowser = new Color(238, 240, 255);
|
||||
final Color bgSubsetter = new Color(255, 255, 238);
|
||||
|
||||
moduleDataBrowserPanel.setBackground(bgBrowser);
|
||||
moduleSubsetterPanel.setBackground(bgSubsetter);
|
||||
@@ -491,8 +491,10 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
moduleSubsetterPanel.setBorder(emtypBorderS);
|
||||
|
||||
AtomicInteger selectedModule = new AtomicInteger(0);
|
||||
|
||||
JButton deselButton = new JButton("Help", UIUtil.scaleIcon(yellowdotLabel, helpImg));
|
||||
|
||||
Runnable switchToNone = ()-> {
|
||||
deselButton.setVisible(false);
|
||||
selectedModule.set(0);
|
||||
((CardLayout) modulsCardPanel.getLayout()).show(modulsCardPanel, "none");
|
||||
dmmdSubsetter.mainContentPanel.setBackground(null);
|
||||
@@ -505,6 +507,7 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
openWelcomeDialog(null);
|
||||
};
|
||||
Runnable switchToSubsetter = ()-> {
|
||||
deselButton.setVisible(true);
|
||||
selectedModule.set(1);
|
||||
((CardLayout) modulsCardPanel.getLayout()).show(modulsCardPanel, "subsetter");
|
||||
dmmdSubsetter.mainContentPanel.setBackground(bgSubsetter);
|
||||
@@ -517,6 +520,7 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
openWelcomeDialog(null);
|
||||
};
|
||||
Runnable switchToDataBrowser = ()-> {
|
||||
deselButton.setVisible(true);
|
||||
selectedModule.set(2);
|
||||
((CardLayout) modulsCardPanel.getLayout()).show(modulsCardPanel, "databrowser");
|
||||
dmmdBrowser.mainContentPanel.setBackground(bgBrowser);
|
||||
@@ -528,6 +532,7 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
titelSubsetterLabel.setIcon(null);
|
||||
openWelcomeDialog(dmmdBrowser);
|
||||
};
|
||||
deselButton.addActionListener(e -> switchToNone.run());
|
||||
|
||||
moduleDataBrowserToggleButton = new LightBorderSmallButton(
|
||||
modulBrowserImg) {
|
||||
@@ -541,19 +546,20 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
}
|
||||
@Override
|
||||
protected Color getSelectedBackgroundColor() {
|
||||
if (selectedModule.get() != 2) {
|
||||
return super.getSelectedBackgroundColor();
|
||||
} else {
|
||||
return new Color(245, 245, 245);
|
||||
}
|
||||
return bgBrowser;
|
||||
// if (selectedModule.get() != 2) {
|
||||
// return super.getSelectedBackgroundColor();
|
||||
// } else {
|
||||
// return new Color(245, 245, 245);
|
||||
// }
|
||||
}
|
||||
@Override
|
||||
protected void onClick(MouseEvent e) {
|
||||
if (selectedModule.get() != 2) {
|
||||
// if (selectedModule.get() != 2) {
|
||||
switchToDataBrowser.run();
|
||||
} else {
|
||||
switchToNone.run();
|
||||
}
|
||||
// } else {
|
||||
// switchToNone.run();
|
||||
// }
|
||||
onMouseExited();
|
||||
}
|
||||
};
|
||||
@@ -570,22 +576,30 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
}
|
||||
@Override
|
||||
protected Color getSelectedBackgroundColor() {
|
||||
if (selectedModule.get() != 1) {
|
||||
return super.getSelectedBackgroundColor();
|
||||
} else {
|
||||
return new Color(245, 245, 245);
|
||||
}
|
||||
return bgSubsetter;
|
||||
// if (selectedModule.get() != 1) {
|
||||
// return super.getSelectedBackgroundColor();
|
||||
// } else {
|
||||
// return new Color(245, 245, 245);
|
||||
// }
|
||||
}
|
||||
@Override
|
||||
protected void onClick(MouseEvent e) {
|
||||
if (selectedModule.get() != 1) {
|
||||
// if (selectedModule.get() != 1) {
|
||||
switchToSubsetter.run();
|
||||
} else {
|
||||
switchToNone.run();
|
||||
}
|
||||
// } else {
|
||||
// switchToNone.run();
|
||||
// }
|
||||
onMouseExited();
|
||||
}
|
||||
};
|
||||
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
||||
modulesPanel.add(deselButton, gridBagConstraints);
|
||||
|
||||
moduleSubsetterToggleButton.setBorder(null);
|
||||
moduleDataBrowserToggleButton.setBorder(null);
|
||||
|
||||
@@ -1341,11 +1355,23 @@ public abstract class DataModelManagerDialog extends javax.swing.JFrame {
|
||||
}
|
||||
});
|
||||
if (all) {
|
||||
if (dbConnectionDialog != null && dbConnectionDialog.currentConnection != null) {
|
||||
String alias = dbConnectionDialog.currentConnection.alias;
|
||||
UIUtil.invokeLater(8, () -> {
|
||||
dialog.selectAlias(alias);
|
||||
});
|
||||
}
|
||||
dbConnectionDialog = dialog;
|
||||
connectionDialogPanel.removeAll();
|
||||
connectionDialogPanel.add(dialog.mainPanel);
|
||||
dialog.borderPanel.setBorder(null);
|
||||
} else {
|
||||
if (recUsedConnectionDialog != null && recUsedConnectionDialog.currentConnection != null) {
|
||||
String alias = recUsedConnectionDialog.currentConnection.alias;
|
||||
UIUtil.invokeLater(8, () -> {
|
||||
dialog.selectAlias(alias);
|
||||
});
|
||||
}
|
||||
recUsedConnectionDialog = dialog;
|
||||
recUsedConnectionDialogPanel.removeAll();
|
||||
recUsedConnectionDialogPanel.add(dialog.mainPanel);
|
||||
|
||||
@@ -1419,10 +1419,13 @@ public class DbConnectionDetailsEditor extends javax.swing.JDialog {
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||
boolean ok = fillConnectionInfo();
|
||||
ConnectionInfo oldCi = new ConnectionInfo();
|
||||
oldCi.assign(ci);
|
||||
boolean ok = fillConnectionInfo();
|
||||
if (!dataModelAware && "".equals(dataModelComboBox.getSelectedItem())) {
|
||||
JOptionPane.showMessageDialog(isVisible()? this : parent, "Please specify the Data Model or create a new one.", "No Data Model", JOptionPane.ERROR_MESSAGE);
|
||||
dataModelComboBox.grabFocus();
|
||||
ci.assign(oldCi);
|
||||
ok = false;
|
||||
}
|
||||
if (ok) {
|
||||
|
||||
@@ -141,6 +141,7 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
jar2 = ci.jar2;
|
||||
jar3 = ci.jar3;
|
||||
jar4 = ci.jar4;
|
||||
dataModelFolder = ci.dataModelFolder;
|
||||
}
|
||||
|
||||
public boolean encrypt() {
|
||||
@@ -1195,7 +1196,7 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
try {
|
||||
Window w = parent instanceof Window? (Window) parent : SwingUtilities.getWindowAncestor(parent);
|
||||
BasicDataSource dataSource = UIUtil.createBasicDataSource(w, ci.driverClass, ci.url, ci.user, ci.password, 0, urls);
|
||||
SessionForUI session = SessionForUI.createSession(dataSource, dataSource.dbms, null, true, false, w);
|
||||
SessionForUI session = SessionForUI.createSession(dataSource, dataSource.dbms, null, true, false, true, w);
|
||||
String databaseProductName = null;
|
||||
if (session != null) {
|
||||
try {
|
||||
@@ -1371,7 +1372,7 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
ci.jar4 = cli.jdbcjar4 != null? cli.jdbcjar4 : "";
|
||||
ci.url = cli.url;
|
||||
ci.user = cli.user;
|
||||
ci.password = cli.password;
|
||||
ci.password = cli.password != null? cli.password : "";
|
||||
|
||||
if (ci.driverClass != null
|
||||
&& ci.url != null
|
||||
@@ -1393,7 +1394,17 @@ public class DbConnectionDialog extends javax.swing.JDialog {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
private static ImageIcon warnIcon;
|
||||
public void selectAlias(String alias) {
|
||||
for (int j = 0; j < connectionList.size(); ++j) {
|
||||
if (alias != null && alias.equals(connectionList.get(j).alias)) {
|
||||
connectionsTable.getSelectionModel().setSelectionInterval(j, j);
|
||||
connectionsTable.scrollRectToVisible(connectionsTable.getCellRect(j, 0, true));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ImageIcon warnIcon;
|
||||
private static ImageIcon scaledWarnIcon;
|
||||
private static ImageIcon okIcon;
|
||||
private static ImageIcon cancelIcon;
|
||||
|
||||
@@ -240,7 +240,6 @@ public class Environment {
|
||||
if (toBeLogged != null) {
|
||||
LogUtil.warn(toBeLogged);
|
||||
}
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
@@ -491,25 +491,6 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JComboBox" name="subjectTable">
|
||||
<Properties>
|
||||
<Property name="maximumRowCount" type="int" value="18"/>
|
||||
<Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="subjectListModel()" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="subjectTableItemStateChanged"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_VariableModifier" type="java.lang.Integer" value="0"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Container class="javax.swing.JPanel" name="jPanel10">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
|
||||
@@ -37,7 +37,6 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.KeyListener;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowFocusListener;
|
||||
import java.awt.event.WindowListener;
|
||||
@@ -323,6 +322,42 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
|
||||
boolean saveNeedsSave = needsSave;
|
||||
initComponents();
|
||||
subjectTable = new JComboBox2() {
|
||||
@Override
|
||||
public Dimension getPreferredSize() {
|
||||
Dimension size = super.getPreferredSize();
|
||||
return limitedSize(size);
|
||||
}
|
||||
@Override
|
||||
public Dimension getMinimumSize() {
|
||||
Dimension size = super.getMinimumSize();
|
||||
return limitedSize(size);
|
||||
}
|
||||
private Dimension limitedSize(Dimension size) {
|
||||
return new Dimension(Math.min(size.width, 100), size.height);
|
||||
}
|
||||
};
|
||||
subjectTable.setMaximumRowCount(18);
|
||||
subjectTable.setModel(subjectListModel());
|
||||
subjectTable.addItemListener(new java.awt.event.ItemListener() {
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
Object selectedItem = subjectTable.getSelectedItem();
|
||||
Table newSubject = null;
|
||||
if (selectedItem instanceof String) {
|
||||
if (dataModel.getTableByDisplayName(selectedItem.toString()) != null) {
|
||||
newSubject = dataModel.getTableByDisplayName(selectedItem
|
||||
.toString());
|
||||
}
|
||||
}
|
||||
changeSubject(newSubject);
|
||||
}
|
||||
});
|
||||
GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
jPanel3.add(subjectTable, gridBagConstraints);
|
||||
|
||||
connectivityState.addMouseListener(new MouseAdapter() {
|
||||
@Override
|
||||
@@ -333,7 +368,7 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
|
||||
assocStatsLabel.setText("");
|
||||
|
||||
GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 5;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.NONE;
|
||||
@@ -1406,7 +1441,6 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
condition = new javax.swing.JTextField();
|
||||
jPanel8 = new javax.swing.JPanel();
|
||||
jLabel7 = new javax.swing.JLabel();
|
||||
subjectTable = new JComboBox2();
|
||||
jPanel10 = new javax.swing.JPanel();
|
||||
exportFormat = new JComboBox2();
|
||||
exportButton = new javax.swing.JButton();
|
||||
@@ -1565,7 +1599,7 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
|
||||
layeredPane.setLayer(focusPanel, javax.swing.JLayeredPane.PALETTE_LAYER);
|
||||
layeredPane.add(focusPanel);
|
||||
focusPanel.setBounds(0, 0, 291, 33);
|
||||
focusPanel.setBounds(0, 0, 289, 33);
|
||||
|
||||
rightBorderPanel.setOpaque(false);
|
||||
rightBorderPanel.setLayout(new java.awt.GridBagLayout());
|
||||
@@ -1695,20 +1729,6 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
jPanel3.add(jPanel8, gridBagConstraints);
|
||||
|
||||
subjectTable.setMaximumRowCount(18);
|
||||
subjectTable.setModel(subjectListModel());
|
||||
subjectTable.addItemListener(new java.awt.event.ItemListener() {
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
subjectTableItemStateChanged(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
jPanel3.add(subjectTable, gridBagConstraints);
|
||||
|
||||
jPanel10.setLayout(new java.awt.GridBagLayout());
|
||||
|
||||
exportFormat.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
|
||||
@@ -2866,18 +2886,6 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
validate();
|
||||
}//GEN-LAST:event_onExportModusChanged
|
||||
|
||||
private void subjectTableItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_subjectTableItemStateChanged
|
||||
Object selectedItem = subjectTable.getSelectedItem();
|
||||
Table newSubject = null;
|
||||
if (selectedItem instanceof String) {
|
||||
if (dataModel.getTableByDisplayName(selectedItem.toString()) != null) {
|
||||
newSubject = dataModel.getTableByDisplayName(selectedItem
|
||||
.toString());
|
||||
}
|
||||
}
|
||||
changeSubject(newSubject);
|
||||
}//GEN-LAST:event_subjectTableItemStateChanged
|
||||
|
||||
private void changeSubject(Table newSubject) {
|
||||
if (newSubject != null && newSubject != subject) {
|
||||
final Table oldSubject = subject;
|
||||
@@ -2903,6 +2911,7 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
rootTable.setModel(getTableListModel());
|
||||
rootTable.setSelectedItem(null);
|
||||
rootTable.setSelectedItem(subjectTable.getSelectedItem());
|
||||
rootTable.setPreferredSize(new Dimension(Math.min(rootTable.getPreferredSize().width, 300), rootTable.getPreferredSize().height));
|
||||
updateAssocStats();
|
||||
}
|
||||
|
||||
@@ -3976,7 +3985,6 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
private javax.swing.JPanel rightBorderPanel;
|
||||
JComboBox2 rootTable;
|
||||
private javax.swing.JTabbedPane sketchTabbedPane;
|
||||
JComboBox2 subjectTable;
|
||||
private javax.swing.JTextField tagField;
|
||||
javax.swing.JPanel toolBarPanel;
|
||||
private javax.swing.JPanel toolPanel;
|
||||
@@ -3986,6 +3994,8 @@ public class ExtractionModelEditor extends javax.swing.JPanel {
|
||||
private javax.swing.JButton xmlTagApply;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
JComboBox2 subjectTable;
|
||||
|
||||
Container restrDepsView;
|
||||
|
||||
private Icon dropDownIcon;
|
||||
|
||||
@@ -85,7 +85,7 @@ public class FileView extends javax.swing.JFrame {
|
||||
this.isXml = file.toLowerCase().endsWith(".xml");
|
||||
|
||||
File f = new File(file);
|
||||
if (f.exists() && f.length() > 65L*1024L*1024L) {
|
||||
if (f.exists() && f.length() > 65L*1024L*1024L / (file.toLowerCase().endsWith(".zip") || file.toLowerCase().endsWith(".gz")? 5 : 1)) {
|
||||
int o = JOptionPane.showOptionDialog(window, "File " + f.getAbsolutePath() + "\nis large (" + (f.length() / 1024 / 1024) + " MB). Loading might fail.", "File is large", JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, null, new Object[] { "Open", "Cancel" }, "Open");
|
||||
if (o != 0) {
|
||||
dispose();
|
||||
|
||||
@@ -47,8 +47,18 @@ public class SessionForUI extends Session {
|
||||
* @param dbms the DBMS
|
||||
*/
|
||||
public static SessionForUI createSession(DataSource dataSource, DBMS dbms, Integer isolationLevel, boolean shutDownImmediatelly, boolean initInlineViewStyle, final Window w) throws SQLException {
|
||||
return createSession(dataSource, dbms, isolationLevel, shutDownImmediatelly, initInlineViewStyle, false, w);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new session.
|
||||
*
|
||||
* @param dataSource the data source
|
||||
* @param dbms the DBMS
|
||||
*/
|
||||
public static SessionForUI createSession(DataSource dataSource, DBMS dbms, Integer isolationLevel, boolean shutDownImmediatelly, boolean initInlineViewStyle, boolean testOnly, final Window w) throws SQLException {
|
||||
Session.setThreadSharesConnection();
|
||||
final SessionForUI session = new SessionForUI(dataSource, dbms, isolationLevel, shutDownImmediatelly);
|
||||
final SessionForUI session = new SessionForUI(dataSource, dbms, isolationLevel, shutDownImmediatelly, testOnly);
|
||||
final AtomicReference<Connection> con = new AtomicReference<Connection>();
|
||||
final AtomicReference<Throwable> exception = new AtomicReference<Throwable>();
|
||||
session.connectionDialog = new JDialog(w, "Connecting");
|
||||
@@ -59,14 +69,18 @@ public class SessionForUI extends Session {
|
||||
Session.setThreadSharesConnection();
|
||||
try {
|
||||
Connection newCon = session.connectionFactory.getConnection();
|
||||
if (initInlineViewStyle && !session.cancelled.get()) {
|
||||
if (session.getInlineViewStyle() == null) {
|
||||
session.setSessionProperty(SessionForUI.class, SUPPORT_WC_EDITOR, false);
|
||||
if (testOnly) {
|
||||
newCon.close();
|
||||
} else {
|
||||
if (initInlineViewStyle && !session.cancelled.get()) {
|
||||
if (session.getInlineViewStyle() == null) {
|
||||
session.setSessionProperty(SessionForUI.class, SUPPORT_WC_EDITOR, false);
|
||||
}
|
||||
}
|
||||
if (!session.cancelled.get()) {
|
||||
String defSchema = JDBCMetaDataBasedModelElementFinder.getDefaultSchema(session, session.getSchema());
|
||||
session.setSessionProperty(SessionForUI.class, "defSchema", defSchema);
|
||||
}
|
||||
}
|
||||
if (!session.cancelled.get()) {
|
||||
String defSchema = JDBCMetaDataBasedModelElementFinder.getDefaultSchema(session, session.getSchema());
|
||||
session.setSessionProperty(SessionForUI.class, "defSchema", defSchema);
|
||||
}
|
||||
if (session.cancelled.get()) {
|
||||
try {
|
||||
@@ -119,6 +133,7 @@ public class SessionForUI extends Session {
|
||||
return null;
|
||||
}
|
||||
|
||||
private boolean testOnly;
|
||||
private JPanel connectingPanel = new JPanel();
|
||||
private JLabel jLabel1 = new JLabel();
|
||||
private JButton cancelConnectingButton = new JButton();
|
||||
@@ -129,9 +144,10 @@ public class SessionForUI extends Session {
|
||||
* Constructor.
|
||||
* @param shutDownImmediatelly
|
||||
*/
|
||||
private SessionForUI(DataSource dataSource, DBMS dbms, Integer isolationLevel, boolean shutDownImmediatelly) throws SQLException {
|
||||
private SessionForUI(DataSource dataSource, DBMS dbms, Integer isolationLevel, boolean shutDownImmediatelly, boolean testOnly) throws SQLException {
|
||||
super(dataSource, dbms, isolationLevel);
|
||||
this.shutDownImmediatelly = shutDownImmediatelly;
|
||||
this.testOnly = testOnly;
|
||||
connectingPanel.setBackground(java.awt.Color.white);
|
||||
|
||||
jLabel1.setForeground(java.awt.Color.red);
|
||||
@@ -162,25 +178,27 @@ public class SessionForUI extends Session {
|
||||
@Override
|
||||
public void shutDown() {
|
||||
down.set(true);
|
||||
if (shutDownImmediatelly) {
|
||||
try {
|
||||
super.shutDown();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
SessionForUI.super.shutDown();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
if (!testOnly) {
|
||||
if (shutDownImmediatelly) {
|
||||
try {
|
||||
super.shutDown();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
});
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
} else {
|
||||
Thread thread = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
SessionForUI.super.shutDown();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
thread.setDaemon(true);
|
||||
thread.start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2270
-2308
File diff suppressed because it is too large
Load Diff
@@ -184,6 +184,7 @@ import net.sf.jailer.ui.databrowser.DBConditionEditor.RSyntaxTextArea;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.FindClosureContext;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowBrowser;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowToRowLink;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.RowCounter.RowCount;
|
||||
import net.sf.jailer.ui.databrowser.metadata.MetaDataSource;
|
||||
import net.sf.jailer.ui.databrowser.sqlconsole.ColumnsTable;
|
||||
@@ -1098,9 +1099,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
initialRowHeight = rowsTable.getRowHeight();
|
||||
|
||||
rowsTable = new JTable() {
|
||||
private int x[] = new int[2];
|
||||
private int y[] = new int[2];
|
||||
private Color color = new Color(0, 0, 200, 100);
|
||||
private Color color = new Color(0, 0, 200, 60);
|
||||
|
||||
@Override
|
||||
public void paint(Graphics graphics) {
|
||||
@@ -1111,7 +1110,7 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
|
||||
int maxI = Math.min(rowsTable.getRowCount(), rows.size());
|
||||
Rectangle visRect = rowsTable.getVisibleRect();
|
||||
|
||||
|
||||
RowSorter<? extends TableModel> sorter = getRowSorter();
|
||||
if (sorter != null) {
|
||||
maxI = sorter.getViewRowCount();
|
||||
@@ -1122,7 +1121,9 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
g2d.setStroke(new BasicStroke(1));
|
||||
|
||||
int width = (int) (visRect.width * 1.4);
|
||||
|
||||
int x[] = new int[2];
|
||||
int y[] = new int[2];
|
||||
|
||||
for (int i = 0; i < maxI; ++i) {
|
||||
int mi = sorter == null? i : sorter.convertRowIndexToModel(i);
|
||||
if (mi >= rows.size()) {
|
||||
@@ -1145,32 +1146,76 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
g2d.fillRect(x[0], y[0], x[1] - x[0], y[1] - y[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(!useInheritedBlockNumbers && BrowserContentPane.this.association != null && BrowserContentPane.this.association.isInsertDestinationBeforeSource())) {
|
||||
g2d.setPaint(null);
|
||||
g2d.setStroke(new BasicStroke(1));
|
||||
|
||||
g2d.setPaint(null);
|
||||
|
||||
if (!useInheritedBlockNumbers && BrowserContentPane.this.association != null && BrowserContentPane.this.association.isInsertDestinationBeforeSource()) {
|
||||
return;
|
||||
}
|
||||
|
||||
double lastPMIndex = -1;
|
||||
for (int i = 0; i < maxI; ++i) {
|
||||
int mi = sorter == null? i : sorter.convertRowIndexToModel(i);
|
||||
if (mi >= rows.size()) {
|
||||
continue;
|
||||
int c = 0;
|
||||
int all = 0;
|
||||
for (boolean count: new boolean[] { true, false }) {
|
||||
double lastPMIndex = -1;
|
||||
for (int i = 0; i < maxI; ++i) {
|
||||
int mi = sorter == null? i : sorter.convertRowIndexToModel(i);
|
||||
if (mi >= rows.size()) {
|
||||
continue;
|
||||
}
|
||||
Row row = rows.get(mi);
|
||||
double parentModelIndex = useInheritedBlockNumbers? row.getInheritedParentModelIndex() : row.getParentModelIndex();
|
||||
++all;
|
||||
if (parentModelIndex != lastPMIndex) {
|
||||
lastPMIndex = parentModelIndex;
|
||||
if (count) {
|
||||
++c;
|
||||
} else {
|
||||
int vi = i;
|
||||
g2d.setColor(color);
|
||||
Rectangle r = rowsTable.getCellRect(vi, 0, false);
|
||||
x[0] = (int) r.getMinX();
|
||||
y[0] = (int) r.getMinY();
|
||||
r = rowsTable.getCellRect(vi, rowsTable.getColumnCount() - 1, false);
|
||||
x[1] = (int) r.getMaxX();
|
||||
y[1] = (int) r.getMinY();
|
||||
g2d.drawPolyline(x, y, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count) {
|
||||
if (c == all) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Row row = rows.get(mi);
|
||||
double parentModelIndex = useInheritedBlockNumbers? row.getInheritedParentModelIndex() : row.getParentModelIndex();
|
||||
if (parentModelIndex != lastPMIndex) {
|
||||
lastPMIndex = parentModelIndex;
|
||||
int vi = i;
|
||||
g2d.setColor(color);
|
||||
Rectangle r = rowsTable.getCellRect(vi, 0, false);
|
||||
x[0] = (int) r.getMinX();
|
||||
y[0] = (int) r.getMinY();
|
||||
r = rowsTable.getCellRect(vi, rowsTable.getColumnCount() - 1, false);
|
||||
x[1] = (int) r.getMaxX();
|
||||
y[1] = (int) r.getMinY();
|
||||
g2d.drawPolyline(x, y, 2);
|
||||
}
|
||||
if (BrowserContentPane.this.getQueryBuilderDialog() != null) { // SQL Console
|
||||
int[] selectedRows = rowsTable.getSelectedRows();
|
||||
if (selectedRows.length > 0) {
|
||||
x[0] = Integer.MAX_VALUE;
|
||||
y[0] = Integer.MAX_VALUE;
|
||||
x[1] = Integer.MIN_VALUE;
|
||||
y[1] = Integer.MIN_VALUE;
|
||||
for (int i: selectedRows) {
|
||||
int vi = i;
|
||||
Rectangle r = rowsTable.getCellRect(vi, 0, false);
|
||||
x[0] = Math.min((int) r.getMinX(), x[0]);
|
||||
y[0] = Math.min((int) r.getMinY(), y[0]);
|
||||
r = rowsTable.getCellRect(vi, rowsTable.getColumnCount() - 1, false);
|
||||
x[1] = Math.max((int) r.getMaxX(), x[1]);
|
||||
y[1] = Math.max((int) r.getMaxY(), y[1]);
|
||||
}
|
||||
x[0] = (int) Math.max(visRect.getMinX(), x[0]) + 1;
|
||||
y[0] = (int) Math.max(visRect.getMinY(), y[0]);
|
||||
x[1] = (int) Math.min(visRect.getMaxX(), x[1]) - 2;
|
||||
y[1] = (int) Math.min(visRect.getMaxY() - 1, y[1]);
|
||||
if (x[0] < x[1] && y[0] < y[1]) {
|
||||
g2d.setColor(UIUtil.BG_FLATMOUSEOVER);
|
||||
BasicStroke stroke = new BasicStroke();
|
||||
g2d.setStroke(stroke);
|
||||
g2d.drawRoundRect(x[0], y[0], x[1] - x[0], y[1] - y[0], 8, 8);
|
||||
g2d.setColor(new Color(0, 0, 200, 100));
|
||||
g2d.setStroke(new BasicStroke(stroke.getLineWidth(), stroke.getEndCap(), stroke.getLineJoin(), stroke.getMiterLimit(), new float[] { 11f, 5f }, (float) (System.currentTimeMillis() / 50.0 % 16)));
|
||||
g2d.drawRoundRect(x[0], y[0], x[1] - x[0], y[1] - y[0], 8, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1334,10 +1379,10 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
final Color BG2 = UIUtil.TABLE_BACKGROUND_COLOR_2;
|
||||
final Color BG1_EM = new Color(255, 242, 240);
|
||||
final Color BG2_EM = new Color(255, 236, 236);
|
||||
final Color BG3 = new Color(192, 236, 255);
|
||||
final Color BG3_2 = new Color(184, 226, 255);
|
||||
final Color BG4 = new Color(122, 210, 255, 200);
|
||||
final Color BG4_2 = new Color(120, 196, 255, 200);
|
||||
final Color BG3 = new Color(190, 230, 255);
|
||||
final Color BG3_2 = new Color(204, 240, 255);
|
||||
final Color BG4 = BG3; // new Color(122, 210, 255, 200);
|
||||
final Color BG4_2 = BG3_2; // = new Color(120, 196, 255, 200);
|
||||
final Color BG4_LIGHT = new Color(80, 200, 255, 200);
|
||||
final Color FG1 = UIUtil.FG_PK;
|
||||
final Color FG2 = UIUtil.FG_FK;
|
||||
@@ -6796,10 +6841,6 @@ public abstract class BrowserContentPane extends javax.swing.JPanel {
|
||||
return true;
|
||||
}
|
||||
|
||||
public interface RunnableWithPriority extends Runnable {
|
||||
int getPriority();
|
||||
}
|
||||
|
||||
protected abstract PriorityBlockingQueue<RunnableWithPriority> getRunnableQueue();
|
||||
|
||||
/**
|
||||
|
||||
@@ -1092,11 +1092,14 @@ public abstract class DBClosureView extends javax.swing.JDialog {
|
||||
closureTable, dataArray[line][i],
|
||||
false, false, line, i);
|
||||
width = Math.max(width, comp.getPreferredSize().width + 10);
|
||||
if (dataArray[line][i] != null && !"".equals(dataArray[line][i])) {
|
||||
if (dataArray[line][i] != null && !"".equals(dataArray[line][i])) {
|
||||
isEmpty = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
width += 20;
|
||||
}
|
||||
|
||||
column.setPreferredWidth(width);
|
||||
if (isEmpty) {
|
||||
if (lastNonEmptyI >= 0) {
|
||||
|
||||
@@ -4423,6 +4423,8 @@ public class DataBrowser extends javax.swing.JFrame {
|
||||
searchBarToggleButton.setToolTipText("<html>Open Search Sidebar<br>"
|
||||
+ "<b>Condition editor not supported for DBMS \"" + (newSession.dbms == null? null : newSession.dbms.getId()) + "\"</b></html>");
|
||||
}
|
||||
|
||||
JDBCMetaDataBasedModelElementFinder.resetCaches(newSession);
|
||||
|
||||
tablesPanel.removeAll();
|
||||
metaDataPanel = (MetaDataPanel) session.getSessionProperty(getClass(), "metaDataPanel");
|
||||
|
||||
@@ -107,7 +107,6 @@ import javax.swing.Timer;
|
||||
import javax.swing.WindowConstants;
|
||||
import javax.swing.event.InternalFrameEvent;
|
||||
import javax.swing.event.InternalFrameListener;
|
||||
import javax.swing.table.DefaultTableModel;
|
||||
|
||||
import net.sf.jailer.ExecutionContext;
|
||||
import net.sf.jailer.database.Session;
|
||||
@@ -122,7 +121,6 @@ import net.sf.jailer.ui.QueryBuilderDialog.Relationship;
|
||||
import net.sf.jailer.ui.UIUtil;
|
||||
import net.sf.jailer.ui.UIUtil.PLAF;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.RowsClosure;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.SqlStatementTable;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.UserAction;
|
||||
import net.sf.jailer.ui.databrowser.TreeLayoutOptimizer.Node;
|
||||
@@ -4071,6 +4069,10 @@ public abstract class Desktop extends JDesktopPane {
|
||||
}
|
||||
}
|
||||
|
||||
public interface RunnableWithPriority extends Runnable {
|
||||
int getPriority();
|
||||
}
|
||||
|
||||
/**
|
||||
* For concurrent reload of rows.
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="13" weightX="1.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="4" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="4" insetsRight="4" anchor="13" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
@@ -55,7 +55,7 @@
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="1" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="4" insetsRight="0" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
@@ -68,7 +68,7 @@
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="16" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="2" gridY="3" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="4" insetsRight="16" anchor="17" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
||||
@@ -29,6 +29,7 @@ import javax.swing.DefaultComboBoxModel;
|
||||
import net.sf.jailer.datamodel.DataModel;
|
||||
import net.sf.jailer.datamodel.Table;
|
||||
import net.sf.jailer.ui.AutoCompletion;
|
||||
import net.sf.jailer.ui.JComboBox2;
|
||||
import net.sf.jailer.ui.StringSearchPanel;
|
||||
import net.sf.jailer.ui.UIUtil;
|
||||
|
||||
@@ -119,7 +120,7 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
* always regenerated by the Form Editor.
|
||||
*/
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
jPanel1 = new javax.swing.JPanel();
|
||||
@@ -127,7 +128,7 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
analyzeButton = new javax.swing.JButton();
|
||||
restoreSessionButton = new javax.swing.JButton();
|
||||
jPanel2 = new javax.swing.JPanel();
|
||||
tableComboBox = new net.sf.jailer.ui.JComboBox2();
|
||||
tableComboBox = new JComboBox2();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||
@@ -137,8 +138,7 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
|
||||
okButton.setText(" Open Table ");
|
||||
okButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
okButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
@@ -147,12 +147,12 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 4);
|
||||
jPanel1.add(okButton, gridBagConstraints);
|
||||
|
||||
analyzeButton.setText(" Analyze Database ");
|
||||
analyzeButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
analyzeButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
@@ -160,12 +160,12 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
|
||||
jPanel1.add(analyzeButton, gridBagConstraints);
|
||||
|
||||
restoreSessionButton.setText(" Restore Layout ");
|
||||
restoreSessionButton.addActionListener(new java.awt.event.ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
restoreSessionButtonActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
@@ -173,7 +173,7 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
gridBagConstraints.gridx = 2;
|
||||
gridBagConstraints.gridy = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 16);
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 16);
|
||||
jPanel1.add(restoreSessionButton, gridBagConstraints);
|
||||
|
||||
jPanel2.setLayout(new java.awt.GridBagLayout());
|
||||
@@ -238,8 +238,7 @@ public abstract class NewTableBrowser extends javax.swing.JDialog {
|
||||
private javax.swing.JPanel jPanel2;
|
||||
private javax.swing.JButton okButton;
|
||||
private javax.swing.JButton restoreSessionButton;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private net.sf.jailer.ui.JComboBox2 tableComboBox;
|
||||
private JComboBox2 tableComboBox;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
||||
@@ -65,8 +65,7 @@ public class MDDatabase extends MDGeneric {
|
||||
@SuppressWarnings("deprecation")
|
||||
@Override
|
||||
public JComponent createRender(Session session, ExecutionContext executionContext) throws Exception {
|
||||
DatabaseMetaData md = getMetaDataSource().getSession().getMetaData();
|
||||
String[] names = new String[] {
|
||||
String[] names = new String[] {
|
||||
"getURL",
|
||||
"getUserName",
|
||||
"isReadOnly",
|
||||
@@ -200,15 +199,17 @@ public class MDDatabase extends MDGeneric {
|
||||
AtomicBoolean ready = new AtomicBoolean(false);
|
||||
|
||||
Thread thread = new Thread(() -> {
|
||||
for (String name : names) {
|
||||
try {
|
||||
Method m = md.getClass().getMethod(name);
|
||||
try {
|
||||
Session.setThreadSharesConnection();
|
||||
DatabaseMetaData md = getMetaDataSource().getSession().getMetaData();
|
||||
for (String name : names) {
|
||||
Method m = md.getClass().getMethod(name);
|
||||
String displayName = name.startsWith("get") ? name.substring(3) : name;
|
||||
displayName = displayName.substring(0, 1).toUpperCase() + displayName.substring(1);
|
||||
rowList.add(new Object[] { displayName, m.invoke(md) });
|
||||
} catch (Throwable t) {
|
||||
logger.info("error", t);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
logger.info("error", t);
|
||||
}
|
||||
ready.set(true);
|
||||
});
|
||||
@@ -216,7 +217,7 @@ public class MDDatabase extends MDGeneric {
|
||||
thread.start();
|
||||
|
||||
Thread.sleep(10);
|
||||
for (int i = 0; i < 20; ++i) {
|
||||
for (int i = 0; i < 25; ++i) {
|
||||
if (ready.get()) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -24,9 +24,11 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.TreeMap;
|
||||
import java.util.concurrent.BlockingQueue;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
@@ -156,8 +158,11 @@ public class MDSchema extends MDObject {
|
||||
synchronized (metaDataSource.getSession().getMetaData()) {
|
||||
ResultSet rs = metaDataSource.readTables(getName());
|
||||
Map<String, Runnable> loadJobs = new TreeMap<String, Runnable>();
|
||||
Set<String> ds1 = new HashSet<String>();
|
||||
while (rs.next()) {
|
||||
String tableName = metaDataSource.getQuoting().quote(rs.getString(3));
|
||||
final String name = rs.getString(3);
|
||||
String tableName = metaDataSource.getQuoting().quote(name);
|
||||
ds1.add(name);
|
||||
final MDTable table = new MDTable(tableName, this, "VIEW".equalsIgnoreCase(rs.getString(4)),
|
||||
"SYNONYM".equalsIgnoreCase(rs.getString(4))
|
||||
|| "ALIAS".equalsIgnoreCase(rs.getString(4)));
|
||||
|
||||
@@ -117,7 +117,7 @@ public class MDTable extends MDObject {
|
||||
* @return columns of table
|
||||
*/
|
||||
public List<String> getColumns(boolean cached) throws SQLException {
|
||||
readColumns(cached);
|
||||
readColumns(cached, null);
|
||||
return columns;
|
||||
}
|
||||
|
||||
@@ -132,24 +132,26 @@ public class MDTable extends MDObject {
|
||||
}
|
||||
UIUtil.setWaitCursor(waitCursorSubject);
|
||||
try {
|
||||
loading.set(true);
|
||||
queue.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
getColumns(false);
|
||||
} catch (SQLException e) {
|
||||
logger.info("error", e);
|
||||
}
|
||||
loading.set(false);
|
||||
}
|
||||
});
|
||||
while (loading.get() && System.currentTimeMillis() < timeOut) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
if (!loading.get()) {
|
||||
loading.set(true);
|
||||
queue.add(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
getColumns(false);
|
||||
} catch (SQLException e) {
|
||||
logger.info("error", e);
|
||||
}
|
||||
loading.set(false);
|
||||
}
|
||||
});
|
||||
while (loading.get() && System.currentTimeMillis() < timeOut) {
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
UIUtil.resetWaitCursor(waitCursorSubject);
|
||||
}
|
||||
@@ -174,24 +176,35 @@ public class MDTable extends MDObject {
|
||||
* @return primary key columns of table
|
||||
*/
|
||||
public List<String> getPrimaryKeyColumns(boolean cached) throws SQLException {
|
||||
readColumns(cached);
|
||||
readColumns(cached, null);
|
||||
return primaryKey;
|
||||
}
|
||||
|
||||
private boolean retryReading = false;
|
||||
|
||||
private synchronized void readColumns(boolean cached) throws SQLException {
|
||||
private synchronized void readColumns(boolean cached, Connection fallbackConnection) throws SQLException {
|
||||
if (columns == null || retryReading) {
|
||||
retryReading = false;
|
||||
columns = new ArrayList<String>();
|
||||
columnTypes = new ArrayList<Column>();
|
||||
primaryKey = new ArrayList<String>();
|
||||
try {
|
||||
Session session = getSchema().getMetaDataSource().getSession();
|
||||
try {
|
||||
MetaDataSource metaDataSource = getMetaDataSource();
|
||||
synchronized (metaDataSource.getSession().getMetaData()) {
|
||||
ResultSet resultSet = JDBCMetaDataBasedModelElementFinder.getColumns(getSchema().getMetaDataSource().getSession(), Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()), "%",
|
||||
synchronized (session.getMetaData()) {
|
||||
ResultSet resultSet;
|
||||
if (fallbackConnection != null) {
|
||||
DatabaseMetaData metaData = fallbackConnection.getMetaData();
|
||||
if (DBMS.MySQL.equals(session.dbms)) {
|
||||
resultSet = metaData.getColumns(Quoting.staticUnquote(getSchema().getName()), null, Quoting.staticUnquote(getName()), "%");
|
||||
} else {
|
||||
resultSet = metaData.getColumns(null, Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()), "%");
|
||||
}
|
||||
} else {
|
||||
resultSet = JDBCMetaDataBasedModelElementFinder.getColumns(session, Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()), "%",
|
||||
cached, false, isSynonym? "SYNONYM" : null);
|
||||
while (resultSet.next()) {
|
||||
}
|
||||
while (resultSet.next()) {
|
||||
String colName = metaDataSource.getQuoting().quote(resultSet.getString(4));
|
||||
columns.add(colName);
|
||||
int type = resultSet.getInt(5);
|
||||
@@ -227,13 +240,22 @@ public class MDTable extends MDObject {
|
||||
}
|
||||
resultSet.close();
|
||||
|
||||
resultSet = JDBCMetaDataBasedModelElementFinder.getPrimaryKeys(getSchema().getMetaDataSource().getSession(), Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()), false);
|
||||
if (fallbackConnection != null) {
|
||||
DatabaseMetaData metaData = fallbackConnection.getMetaData();
|
||||
if (DBMS.MySQL.equals(session.dbms)) {
|
||||
resultSet = metaData.getPrimaryKeys(Quoting.staticUnquote(getSchema().getName()), null, Quoting.staticUnquote(getName()));
|
||||
} else {
|
||||
resultSet = metaData.getPrimaryKeys(null, Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()));
|
||||
}
|
||||
} else {
|
||||
resultSet = JDBCMetaDataBasedModelElementFinder.getPrimaryKeys(session, Quoting.staticUnquote(getSchema().getName()), Quoting.staticUnquote(getName()), false);
|
||||
}
|
||||
Map<Integer, String> pk = new TreeMap<Integer, String>();
|
||||
int nextKeySeq = 0;
|
||||
while (resultSet.next()) {
|
||||
int keySeq = resultSet.getInt(5);
|
||||
pkConstraintName = resultSet.getString(6);
|
||||
if (DBMS.SQLITE.equals(getSchema().getMetaDataSource().getSession().dbms)) {
|
||||
if (DBMS.SQLITE.equals(session.dbms)) {
|
||||
// SQlite driver doesn't return the keySeq
|
||||
keySeq = nextKeySeq++;
|
||||
}
|
||||
@@ -258,20 +280,48 @@ public class MDTable extends MDObject {
|
||||
}
|
||||
resultSet.close();
|
||||
}
|
||||
loaded.set(true);
|
||||
} catch (Exception e) {
|
||||
retryReading = true;
|
||||
if (!warned && !getSchema().getMetaDataSource().getSession().isDown()) {
|
||||
if (!cached && fallbackConnection == null) {
|
||||
if (DBMS.MySQL.equals(session.dbms)) {
|
||||
Connection con = null;
|
||||
try {
|
||||
con = session.createNewConnection();
|
||||
readColumns(cached, con);
|
||||
if (!warnedFallback) {
|
||||
LogUtil.warn(new RuntimeException("OkWithFBCon: " + e.getMessage(), e));
|
||||
warnedFallback = true;
|
||||
}
|
||||
return;
|
||||
} catch (Exception e2) {
|
||||
if (!warned2 && !session.isDown()) {
|
||||
LogUtil.warn(new RuntimeException("NOkWithFBCon!: " + e.getMessage(), e2));
|
||||
warned2 = true;
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
if (con != null) {
|
||||
con.close();
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!warned && !session.isDown()) {
|
||||
LogUtil.warn(e);
|
||||
warned = true;
|
||||
}
|
||||
throw e;
|
||||
} finally {
|
||||
loaded.set(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static boolean warned = false;
|
||||
private static boolean warned2 = false;
|
||||
private static boolean warnedFallback = false;
|
||||
|
||||
/**
|
||||
* Compares data model table with this table.
|
||||
@@ -409,7 +459,7 @@ public class MDTable extends MDObject {
|
||||
ddl = new BasicFormatterImpl().format(ddl);
|
||||
}
|
||||
try {
|
||||
readColumns(true); // load primary key
|
||||
readColumns(true, null); // load primary key
|
||||
if (ddl == null) {
|
||||
ddl = createDDL();
|
||||
}
|
||||
|
||||
@@ -66,6 +66,7 @@ import net.sf.jailer.ui.databrowser.BrowserContentPane;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.LoadJob;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.FindClosureContext;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowBrowser;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.Reference;
|
||||
import net.sf.jailer.ui.databrowser.Row;
|
||||
import net.sf.jailer.ui.databrowser.sqlconsole.SQLConsole;
|
||||
|
||||
@@ -44,6 +44,7 @@ import net.sf.jailer.ui.databrowser.BrowserContentPane.RowsClosure;
|
||||
import net.sf.jailer.ui.databrowser.Desktop;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.FindClosureContext;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowBrowser;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.Row;
|
||||
import net.sf.jailer.ui.databrowser.sqlconsole.SQLConsole;
|
||||
import net.sf.jailer.util.Pair;
|
||||
|
||||
@@ -243,7 +243,8 @@ public class TableDetailsView extends javax.swing.JPanel {
|
||||
});
|
||||
}
|
||||
columnsPanel.removeAll();
|
||||
java.awt.Color bgDarker = UIUtil.TABLE_BACKGROUND_COLOR_2;
|
||||
java.awt.Color bgDarker = new Color(248, 255, 248);
|
||||
jPanel2.setBackground(UIUtil.TABLE_BACKGROUND_COLOR_2);
|
||||
boolean hasConstraints = false;
|
||||
for (Column column: columns) {
|
||||
hasConstraints = hasConstraints || !column.isNullable || column.isVirtual || column.isIdentityColumn;
|
||||
@@ -261,7 +262,7 @@ public class TableDetailsView extends javax.swing.JPanel {
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
rows.put(column.name, panel);
|
||||
if (y % 2 == 0) {
|
||||
if (y % 2 != 0) {
|
||||
panel.setOpaque(false);
|
||||
} else {
|
||||
panel.setBackground(bgDarker);
|
||||
@@ -343,7 +344,7 @@ public class TableDetailsView extends javax.swing.JPanel {
|
||||
label = new JLabel();
|
||||
label.setForeground(Color.gray);
|
||||
JPanel panelC = new JPanel();
|
||||
if (y % 2 == 0) {
|
||||
if (y % 2 != 0) {
|
||||
panelC.setOpaque(false);
|
||||
} else {
|
||||
panelC.setBackground(bgDarker);
|
||||
|
||||
@@ -42,10 +42,15 @@ import java.io.FileOutputStream;
|
||||
import java.io.FileReader;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.sql.Blob;
|
||||
import java.sql.CallableStatement;
|
||||
import java.sql.Connection;
|
||||
@@ -72,6 +77,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.GZIPInputStream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.ActionMap;
|
||||
@@ -147,6 +157,7 @@ import net.sf.jailer.ui.databrowser.DataBrowser;
|
||||
import net.sf.jailer.ui.databrowser.Desktop;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.FindClosureContext;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RowBrowser;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.FullTextSearchPanel;
|
||||
import net.sf.jailer.ui.databrowser.Reference;
|
||||
import net.sf.jailer.ui.databrowser.Row;
|
||||
@@ -3480,7 +3491,20 @@ public abstract class SQLConsole extends javax.swing.JPanel {
|
||||
public void loadFromFile(File file) throws IOException {
|
||||
this.file = file;
|
||||
if (file.exists()) {
|
||||
BufferedReader in = new BufferedReader(new FileReader(file));
|
||||
String path = file.getPath();
|
||||
Charset encoding = SqlUtil.retrieveEncoding(path);
|
||||
InputStream inputStream = new FileInputStream(file);
|
||||
BufferedReader in;
|
||||
if (path.toLowerCase(Locale.ENGLISH).endsWith(".gz")) {
|
||||
in = new BufferedReader(new InputStreamReader(new GZIPInputStream(inputStream), encoding));
|
||||
} else if (path.toLowerCase(Locale.ENGLISH).endsWith(".zip")){
|
||||
ZipInputStream zis = new ZipInputStream(inputStream);
|
||||
zis.getNextEntry();
|
||||
in = new BufferedReader(new InputStreamReader(zis, encoding));
|
||||
} else {
|
||||
in = new BufferedReader(new InputStreamReader(inputStream, encoding));
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
int c;
|
||||
while ((c = in.read()) != -1) {
|
||||
@@ -3520,7 +3544,34 @@ public abstract class SQLConsole extends javax.swing.JPanel {
|
||||
if (newFile != null) {
|
||||
file = newFile;
|
||||
}
|
||||
PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(file)));
|
||||
|
||||
Charset encoding = Charset.defaultCharset();
|
||||
Charset uTF8 = null;
|
||||
try {
|
||||
uTF8 = Charset.forName("UTF8");
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
if (uTF8 != null) {
|
||||
// retrieve encoding
|
||||
if (editorPane.getLineCount() > 0 && getLineContent(0).contains("encoding UTF-8")) {
|
||||
encoding = uTF8;
|
||||
}
|
||||
}
|
||||
|
||||
OutputStream outputStream = new FileOutputStream(file);
|
||||
if (file.getPath().toLowerCase(Locale.ENGLISH).endsWith(".zip")) {
|
||||
outputStream = new ZipOutputStream(outputStream);
|
||||
String zipFileName = file.getName();
|
||||
((ZipOutputStream)outputStream).putNextEntry(new ZipEntry(zipFileName.substring(0, zipFileName.length() - 4)));
|
||||
} else {
|
||||
if (file.getPath().toLowerCase(Locale.ENGLISH).endsWith(".gz")) {
|
||||
outputStream = new GZIPOutputStream(outputStream);
|
||||
}
|
||||
}
|
||||
|
||||
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream, encoding)));
|
||||
int lines = editorPane.getLineCount();
|
||||
for (int line = 0; line < lines; ++line) {
|
||||
out.print(getLineContent(line).replace("\r", "").replace("\n", ""));
|
||||
|
||||
@@ -807,7 +807,7 @@ public class WCTypeAnalyser {
|
||||
for (Entry<String, MDTable> e: fromClause.entrySet()) {
|
||||
if (e.getValue() != null) {
|
||||
try {
|
||||
for (String column: e.getValue().getColumns()) {
|
||||
for (String column: e.getValue().getColumns(false)) {
|
||||
if (idEquals(column, columnName, false)) {
|
||||
if (alias != null) {
|
||||
return null;
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="4" insetsLeft="4" insetsBottom="4" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="6" insetsLeft="4" insetsBottom="6" insetsRight="0" anchor="10" weightX="1.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
|
||||
+3
-3
@@ -96,9 +96,9 @@ import net.sf.jailer.ui.StringSearchPanel;
|
||||
import net.sf.jailer.ui.UIUtil;
|
||||
import net.sf.jailer.ui.UIUtil.PLAF;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentCellEditor;
|
||||
import net.sf.jailer.ui.databrowser.BrowserContentPane.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.databrowser.DBConditionEditor;
|
||||
import net.sf.jailer.ui.databrowser.Desktop;
|
||||
import net.sf.jailer.ui.databrowser.Desktop.RunnableWithPriority;
|
||||
import net.sf.jailer.ui.syntaxtextarea.BasicFormatterImpl;
|
||||
import net.sf.jailer.ui.syntaxtextarea.RSyntaxTextAreaWithSQLSyntaxStyle;
|
||||
import net.sf.jailer.ui.syntaxtextarea.SQLAutoCompletion;
|
||||
@@ -875,7 +875,7 @@ public abstract class WhereConditionEditorPanel extends javax.swing.JPanel {
|
||||
BiFunction<JComponent, Integer, JComponent> wrap = (c, y) -> {
|
||||
JPanel panel = new JPanel(new GridBagLayout());
|
||||
c.setForeground(Color.black);
|
||||
panel.setBackground(y % 2 != 0? UIUtil.TABLE_BACKGROUND_COLOR_1 : UIUtil.TABLE_BACKGROUND_COLOR_2);
|
||||
panel.setBackground(y % 2 == 0? UIUtil.TABLE_BACKGROUND_COLOR_1 : UIUtil.TABLE_BACKGROUND_COLOR_2);
|
||||
panel.setOpaque(true);
|
||||
GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
@@ -1345,7 +1345,7 @@ public abstract class WhereConditionEditorPanel extends javax.swing.JPanel {
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
|
||||
gridBagConstraints.weightx = 1.0;
|
||||
gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 0);
|
||||
gridBagConstraints.insets = new java.awt.Insets(6, 4, 6, 0);
|
||||
titlePanel.add(tableLabel, gridBagConstraints);
|
||||
|
||||
closeButtonContainerPanel.setOpaque(false);
|
||||
|
||||
@@ -157,7 +157,7 @@ public abstract class SQLCompletionProvider<SOURCE, SCHEMA, TABLE> extends Defau
|
||||
|
||||
private long timeOut;
|
||||
private JComponent waitCursorSubject;
|
||||
private final int COLUMN_LOADING_TIMEOUT = 7000;
|
||||
private final int COLUMN_LOADING_TIMEOUT = 5000;
|
||||
|
||||
private Quoting getQuoting() {
|
||||
if (llQuoting == null) {
|
||||
|
||||
Reference in New Issue
Block a user