|
|
@ -167,23 +167,10 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { |
|
|
|
parameterMap.put(parameter.getName(), parameter.getValue()); |
|
|
|
parameterMap.put(parameter.getName(), parameter.getValue()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
boolean showOriginSql = true; |
|
|
|
|
|
|
|
for (ParameterProvider parameter : DataOperator.getInstance().getTableDataParameters(tableData)) { |
|
|
|
|
|
|
|
if (parameterMap.containsKey(parameter.getName())) { |
|
|
|
|
|
|
|
Object value = parameterMap.get(parameter.getName()); |
|
|
|
|
|
|
|
if (value != null && !StringUtils.EMPTY.equals(value)) { |
|
|
|
|
|
|
|
showOriginSql = false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
parameter.setValue(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
String sql; |
|
|
|
String sql; |
|
|
|
// 计算高亮文本位置
|
|
|
|
// 计算高亮文本位置
|
|
|
|
List<int[]> specialCharParamIndex = null; |
|
|
|
List<int[]> specialCharParamIndex = null; |
|
|
|
boolean highlight = true; |
|
|
|
boolean highlight = true; |
|
|
|
if (showOriginSql) { |
|
|
|
|
|
|
|
sql = tableData.getQuery(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
NameSpace ns = ParameterMapNameSpace.create(parameterMap); |
|
|
|
NameSpace ns = ParameterMapNameSpace.create(parameterMap); |
|
|
|
calculator.pushNameSpace(ns); |
|
|
|
calculator.pushNameSpace(ns); |
|
|
|
Parameter[] paras = processParameters(tableData, calculator); |
|
|
|
Parameter[] paras = processParameters(tableData, calculator); |
|
|
@ -203,7 +190,6 @@ public class PreviewPerformedSqlPane extends JDialog implements ActionListener { |
|
|
|
if (!StringUtils.equals(oldSql, sql)) { |
|
|
|
if (!StringUtils.equals(oldSql, sql)) { |
|
|
|
highlight = false; |
|
|
|
highlight = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// sql内容复制到剪切板
|
|
|
|
// sql内容复制到剪切板
|
|
|
|
StringSelection selection = new StringSelection(sql); |
|
|
|
StringSelection selection = new StringSelection(sql); |
|
|
|
java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection); |
|
|
|
java.awt.Toolkit.getDefaultToolkit().getSystemClipboard().setContents(selection, selection); |
|
|
|