1 | package com.jsql.view.swing.sql; | |
2 | ||
3 | import com.jsql.model.injection.vendor.model.Vendor; | |
4 | import com.jsql.model.injection.vendor.model.yaml.Method; | |
5 | import com.jsql.model.injection.vendor.model.yaml.ModelYaml; | |
6 | import com.jsql.util.I18nUtil; | |
7 | import com.jsql.view.swing.tab.TabbedPaneWheeled; | |
8 | import com.jsql.view.swing.text.listener.DocumentListenerEditing; | |
9 | import com.jsql.view.swing.util.I18nViewUtil; | |
10 | import com.jsql.view.swing.util.MediatorHelper; | |
11 | import com.jsql.view.swing.util.UiUtil; | |
12 | import org.apache.commons.lang3.StringUtils; | |
13 | import org.fife.ui.rsyntaxtextarea.RSyntaxDocument; | |
14 | import org.fife.ui.rsyntaxtextarea.SyntaxConstants; | |
15 | import org.fife.ui.rtextarea.RTextScrollPane; | |
16 | ||
17 | import javax.swing.*; | |
18 | import java.awt.*; | |
19 | import java.awt.event.MouseAdapter; | |
20 | import java.awt.event.MouseEvent; | |
21 | import java.util.AbstractMap.SimpleEntry; | |
22 | import java.util.ArrayList; | |
23 | import java.util.Arrays; | |
24 | import java.util.LinkedList; | |
25 | import java.util.List; | |
26 | import java.util.stream.Collectors; | |
27 | import java.util.stream.Stream; | |
28 | ||
29 | public class SqlEngine extends JPanel { | |
30 | ||
31 | private static ModelYaml modelYaml = MediatorHelper.model().getMediatorVendor().getVendor().instance().getModelYaml(); | |
32 | private static final JTabbedPane tabsError = new TabbedPaneWheeled(SwingConstants.RIGHT); | |
33 | private static final List<JSyntaxTextArea> listTextareasError = new ArrayList<>(); | |
34 | | |
35 | enum TextareaWithColor { | |
36 | | |
37 | // Default | |
38 | DATABASE_DEFAULT(new JSyntaxTextArea( | |
39 |
1
1. lambda$static$0 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setDatabase → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().setDatabase(v), |
40 |
1
1. lambda$static$1 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$1 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getDatabase() |
41 | )), | |
42 | TABLE_DEFAULT(new JSyntaxTextArea( | |
43 |
1
1. lambda$static$2 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setTable → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().setTable(v), |
44 |
1
1. lambda$static$3 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$3 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getTable() |
45 | )), | |
46 | COLUMN_DEFAULT(new JSyntaxTextArea( | |
47 |
1
1. lambda$static$4 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setColumn → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().setColumn(v), |
48 |
1
1. lambda$static$5 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$5 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getColumn() |
49 | )), | |
50 | QUERY_DEFAULT(new JSyntaxTextArea( | |
51 |
1
1. lambda$static$6 : removed call to com/jsql/model/injection/vendor/model/yaml/Row::setQuery → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().getRow().setQuery(v), |
52 |
1
1. lambda$static$7 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$7 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getRow().getQuery() |
53 | )), | |
54 | FIELD_DEFAULT(new JSyntaxTextArea( | |
55 |
1
1. lambda$static$8 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setField → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().getRow().getFields().setField(v), |
56 |
1
1. lambda$static$9 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$9 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getRow().getFields().getField() |
57 | )), | |
58 | CONCAT_DEFAULT(new JSyntaxTextArea( | |
59 |
1
1. lambda$static$10 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setConcat → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getSchema().getRow().getFields().setConcat(v), |
60 |
1
1. lambda$static$11 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$11 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getSchema().getRow().getFields().getConcat() |
61 | )), | |
62 | | |
63 | // Zip | |
64 | DATABASE_ZIP(new JSyntaxTextArea( | |
65 |
1
1. lambda$static$12 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setDatabase → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().setDatabase(v), |
66 |
1
1. lambda$static$13 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$13 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getDatabase() |
67 | )), | |
68 | TABLE_ZIP(new JSyntaxTextArea( | |
69 |
1
1. lambda$static$14 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setTable → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().setTable(v), |
70 |
1
1. lambda$static$15 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$15 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getTable() |
71 | )), | |
72 | COLUMN_ZIP(new JSyntaxTextArea( | |
73 |
1
1. lambda$static$16 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setColumn → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().setColumn(v), |
74 |
1
1. lambda$static$17 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$17 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getColumn() |
75 | )), | |
76 | QUERY_ZIP(new JSyntaxTextArea( | |
77 |
1
1. lambda$static$18 : removed call to com/jsql/model/injection/vendor/model/yaml/Row::setQuery → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().getRow().setQuery(v), |
78 |
1
1. lambda$static$19 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$19 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getRow().getQuery() |
79 | )), | |
80 | FIELD_ZIP(new JSyntaxTextArea( | |
81 |
1
1. lambda$static$20 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setField → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().getRow().getFields().setField(v), |
82 |
1
1. lambda$static$21 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$21 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getRow().getFields().getField() |
83 | )), | |
84 | CONCAT_ZIP(new JSyntaxTextArea( | |
85 |
1
1. lambda$static$22 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setConcat → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getZip().getRow().getFields().setConcat(v), |
86 |
1
1. lambda$static$23 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$23 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getZip().getRow().getFields().getConcat() |
87 | )), | |
88 | | |
89 | // Dios | |
90 | DATABASE_DIOS(new JSyntaxTextArea( | |
91 |
1
1. lambda$static$24 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setDatabase → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().setDatabase(v), |
92 |
1
1. lambda$static$25 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$25 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getDatabase() |
93 | )), | |
94 | TABLE_DIOS(new JSyntaxTextArea( | |
95 |
1
1. lambda$static$26 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setTable → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().setTable(v), |
96 |
1
1. lambda$static$27 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$27 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getTable() |
97 | )), | |
98 | COLUMN_DIOS(new JSyntaxTextArea( | |
99 |
1
1. lambda$static$28 : removed call to com/jsql/model/injection/vendor/model/yaml/Schema::setColumn → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().setColumn(v), |
100 |
1
1. lambda$static$29 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$29 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getColumn() |
101 | )), | |
102 | QUERY_DIOS(new JSyntaxTextArea( | |
103 |
1
1. lambda$static$30 : removed call to com/jsql/model/injection/vendor/model/yaml/Row::setQuery → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().getRow().setQuery(v), |
104 |
1
1. lambda$static$31 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$31 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getRow().getQuery() |
105 | )), | |
106 | FIELD_DIOS(new JSyntaxTextArea( | |
107 |
1
1. lambda$static$32 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setField → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().getRow().getFields().setField(v), |
108 |
1
1. lambda$static$33 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$33 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getRow().getFields().getField() |
109 | )), | |
110 | CONCAT_DIOS(new JSyntaxTextArea( | |
111 |
1
1. lambda$static$34 : removed call to com/jsql/model/injection/vendor/model/yaml/Fields::setConcat → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().getDios().getRow().getFields().setConcat(v), |
112 |
1
1. lambda$static$35 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$35 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getDios().getRow().getFields().getConcat() |
113 | )), | |
114 | | |
115 | INFO(new JSyntaxTextArea( | |
116 |
1
1. lambda$static$36 : removed call to com/jsql/model/injection/vendor/model/yaml/Resource::setInfo → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().setInfo(v), |
117 |
1
1. lambda$static$37 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$37 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getInfo() |
118 | )), | |
119 | ||
120 | // Configuration | |
121 | SLIDING_WINDOW(new JSyntaxTextArea( | |
122 |
1
1. lambda$static$38 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setSlidingWindow → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setSlidingWindow(v), |
123 |
1
1. lambda$static$39 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$39 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getSlidingWindow() |
124 | )), | |
125 | LIMIT(new JSyntaxTextArea( | |
126 |
1
1. lambda$static$40 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setLimit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setLimit(v), |
127 |
1
1. lambda$static$41 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$41 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getLimit() |
128 | )), | |
129 | FAILSAFE(new JSyntaxTextArea( | |
130 |
1
1. lambda$static$42 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setFailsafe → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setFailsafe(v), |
131 |
1
1. lambda$static$43 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$43 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFailsafe() |
132 | )), | |
133 | CALIBRATOR(new JSyntaxTextArea( | |
134 |
1
1. lambda$static$44 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setCalibrator → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setCalibrator(v), |
135 |
1
1. lambda$static$45 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$45 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getCalibrator() |
136 | )), | |
137 | ENDING_COMMENT(new JSyntaxTextArea( | |
138 |
1
1. lambda$static$46 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setEndingComment → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setEndingComment(v), |
139 |
1
1. lambda$static$47 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$47 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getEndingComment() |
140 | )), | |
141 | LIMIT_BOUNDARY(new JSyntaxTextArea( | |
142 |
1
1. lambda$static$48 : removed call to com/jsql/model/injection/vendor/model/yaml/Configuration::setLimitBoundary → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().setLimitBoundary(v), |
143 |
1
1. lambda$static$49 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$49 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getLimitBoundary() |
144 | )), | |
145 | | |
146 | // Union | |
147 | INDICES(new JSyntaxTextArea( | |
148 |
1
1. lambda$static$50 : removed call to com/jsql/model/injection/vendor/model/yaml/Union::setIndices → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getUnion().setIndices(v), |
149 |
1
1. lambda$static$51 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$51 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getUnion().getIndices() |
150 | )), | |
151 | CAPACITY(new JSyntaxTextArea( | |
152 |
1
1. lambda$static$52 : removed call to com/jsql/model/injection/vendor/model/yaml/Union::setCapacity → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getUnion().setCapacity(v), |
153 |
1
1. lambda$static$53 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$53 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getUnion().getCapacity() |
154 | )), | |
155 | ||
156 | STACK(new JSyntaxTextArea( | |
157 |
1
1. lambda$static$54 : removed call to com/jsql/model/injection/vendor/model/yaml/Strategy::setStack → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().setStack(v), |
158 |
1
1. lambda$static$55 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$55 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getStack() |
159 | )), | |
160 | ||
161 | // Boolean | |
162 | MODE_AND(new JSyntaxTextArea( | |
163 |
1
1. lambda$static$56 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setModeAnd → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setModeAnd(v), |
164 |
1
1. lambda$static$57 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$57 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getModeAnd() |
165 | )), | |
166 | MODE_OR(new JSyntaxTextArea( | |
167 |
1
1. lambda$static$58 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setModeOr → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setModeOr(v), |
168 |
1
1. lambda$static$59 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$59 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getModeOr() |
169 | )), | |
170 | MODE_STACK(new JSyntaxTextArea( | |
171 |
1
1. lambda$static$60 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setModeStack → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setModeStack(v), |
172 |
1
1. lambda$static$61 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$61 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getModeStack() |
173 | )), | |
174 | BLIND(new JSyntaxTextArea( | |
175 |
1
1. lambda$static$62 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setBlind → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setBlind(v), |
176 |
1
1. lambda$static$63 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$63 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getBlind() |
177 | )), | |
178 | TIME(new JSyntaxTextArea( | |
179 |
1
1. lambda$static$64 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setTime → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setTime(v), |
180 |
1
1. lambda$static$65 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$65 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTime() |
181 | )), | |
182 | MULTIBIT(new JSyntaxTextArea( | |
183 |
1
1. lambda$static$66 : removed call to com/jsql/model/injection/vendor/model/yaml/Binary::setMultibit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().setMultibit(v), |
184 |
1
1. lambda$static$67 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$67 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getMultibit() |
185 | )), | |
186 | TEST_BIT(new JSyntaxTextArea( | |
187 |
1
1. lambda$static$68 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setBit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setBit(v), |
188 |
1
1. lambda$static$69 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$69 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getBit() |
189 | )), | |
190 | TEST_BIN(new JSyntaxTextArea( | |
191 |
1
1. lambda$static$70 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setBin → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setBin(v), |
192 |
1
1. lambda$static$71 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$71 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getBin() |
193 | )), | |
194 | TRUTHY_BIN(new JSyntaxTextArea( | |
195 |
1
1. lambda$static$72 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setTruthyBin → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setTruthyBin(v), |
196 |
1
1. lambda$static$73 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$73 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getTruthyBinAsString() |
197 | )), | |
198 | FALSY_BIN(new JSyntaxTextArea( | |
199 |
1
1. lambda$static$74 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setFalsyBin → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setFalsyBin(v), |
200 |
1
1. lambda$static$75 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$75 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getFalsyBinAsString() |
201 | )), | |
202 | ||
203 | ||
204 | // Exploit | |
205 | EXPLOIT(new JSyntaxTextArea( | |
206 |
1
1. lambda$static$76 : removed call to com/jsql/model/injection/vendor/model/yaml/Resource::setExploit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getResource().setExploit(v), |
207 |
1
1. lambda$static$77 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$77 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getResource().getExploit() |
208 | )), | |
209 | ||
210 | // Fingerprint | |
211 | TRUTHY(new JSyntaxTextArea( | |
212 |
1
1. lambda$static$78 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setTruthyBit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setTruthyBit(v), |
213 |
1
1. lambda$static$79 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$79 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getTruthyBitAsString() |
214 | )), | |
215 | FALSY(new JSyntaxTextArea( | |
216 |
1
1. lambda$static$80 : removed call to com/jsql/model/injection/vendor/model/yaml/Test::setFalsyBit → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().setFalsyBit(v), |
217 |
1
1. lambda$static$81 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$81 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getBinary().getTest().getFalsyBitAsString() |
218 | )), | |
219 | INCORRECT_STRING_ERROR_MESSAGE(new JSyntaxTextArea( | |
220 |
1
1. lambda$static$82 : removed call to com/jsql/model/injection/vendor/model/yaml/Fingerprint::setErrorMessageAsString → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().setErrorMessageAsString(v), |
221 |
1
1. lambda$static$83 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$83 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().getErrorMessageAsString() |
222 | )), | |
223 | ORDER_BY_ERROR_MESSAGE(new JSyntaxTextArea( | |
224 |
1
1. lambda$static$84 : removed call to com/jsql/model/injection/vendor/model/yaml/Fingerprint::setOrderByErrorMessage → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().setOrderByErrorMessage(v), |
225 |
1
1. lambda$static$85 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$85 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().getOrderByErrorMessage() |
226 | )), | |
227 | ORDER_BY(new JSyntaxTextArea( | |
228 |
1
1. lambda$static$86 : removed call to com/jsql/model/injection/vendor/model/yaml/Union::setOrderBy → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getUnion().setOrderBy(v), |
229 |
1
1. lambda$static$87 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$87 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getUnion().getOrderBy() |
230 | )), | |
231 | VENDOR_SPECIFIC(new JSyntaxTextArea( | |
232 |
1
1. lambda$static$88 : removed call to com/jsql/model/injection/vendor/model/yaml/Fingerprint::setVendorSpecific → NO_COVERAGE |
v -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().setVendorSpecific(v), |
233 |
1
1. lambda$static$89 : replaced return value with "" for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::lambda$static$89 → NO_COVERAGE |
() -> SqlEngine.modelYaml.getStrategy().getConfiguration().getFingerprint().getVendorSpecific() |
234 | )), | |
235 | ; | |
236 | | |
237 | final JSyntaxTextArea textarea; | |
238 | ||
239 | public JSyntaxTextArea getTextArea() { | |
240 |
1
1. getTextArea : replaced return value with null for com/jsql/view/swing/sql/SqlEngine$TextareaWithColor::getTextArea → NO_COVERAGE |
return this.textarea; |
241 | } | |
242 | ||
243 | TextareaWithColor(JSyntaxTextArea textarea) { | |
244 | this.textarea = textarea; | |
245 | } | |
246 | } | |
247 | | |
248 | public SqlEngine() { | |
249 | // user can switch to another vendor then close, so restore current vendor | |
250 | SqlEngine.modelYaml = MediatorHelper.model().getMediatorVendor().getVendor().instance().getModelYaml(); | |
251 | ||
252 |
1
1. <init> : removed call to com/jsql/view/swing/sql/SqlEngine::initTextComponents → NO_COVERAGE |
SqlEngine.initTextComponents(); |
253 | ||
254 | JTabbedPane panelStructure = this.getPanelStructure(); | |
255 | RTextScrollPane panelFile = new RTextScrollPane(TextareaWithColor.EXPLOIT.getTextArea(), false); | |
256 | JTabbedPane panelStrategy = this.getPanelStrategy(); | |
257 | JTabbedPane panelConfiguration = this.getPanelConfiguration(); | |
258 | JTabbedPane panelFingerprinting = this.getPanelFingerprinting(); | |
259 | ||
260 | JTabbedPane tabsBottom = new TabbedPaneWheeled(SwingConstants.BOTTOM); | |
261 | | |
262 | Stream.of( | |
263 | new SimpleEntry<>("SQLENGINE_STRUCTURE", panelStructure), | |
264 | new SimpleEntry<>("SQLENGINE_STRATEGY", panelStrategy), | |
265 | new SimpleEntry<>("SQLENGINE_CONFIGURATION", panelConfiguration), | |
266 | new SimpleEntry<>("SQLENGINE_FINGERPRINTING", panelFingerprinting), | |
267 | new SimpleEntry<>("SQLENGINE_EXPLOIT", panelFile) | |
268 | ) | |
269 |
1
1. <init> : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
270 |
1
1. lambda$new$0 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabsBottom.addTab(I18nUtil.valueByKey(entry.getKey()), entry.getValue()); |
271 | var label = new JLabel(I18nUtil.valueByKey(entry.getKey())); | |
272 |
1
1. lambda$new$0 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabsBottom.setTabComponentAt( |
273 | tabsBottom.indexOfTab(I18nUtil.valueByKey(entry.getKey())), | |
274 | label | |
275 | ); | |
276 |
1
1. lambda$new$0 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(entry.getKey(), label); |
277 | }); | |
278 | ||
279 |
1
1. <init> : removed call to com/jsql/view/swing/sql/SqlEngine::setLayout → NO_COVERAGE |
this.setLayout(new BorderLayout()); |
280 | ||
281 | JPanel panelCombo = SqlEngine.initMenuVendor(); | |
282 |
1
1. <init> : removed call to javax/swing/JTabbedPane::putClientProperty → NO_COVERAGE |
tabsBottom.putClientProperty("JTabbedPane.trailingComponent", panelCombo); |
283 | this.add(tabsBottom); | |
284 | ||
285 |
1
1. <init> : removed call to javax/swing/SwingUtilities::invokeLater → NO_COVERAGE |
SwingUtilities.invokeLater(() -> { |
286 |
1
1. lambda$new$1 : removed call to com/jsql/view/swing/menubar/AppMenubar::switchLocale → NO_COVERAGE |
MediatorHelper.menubar().switchLocale(I18nUtil.getCurrentLocale()); // required for arabic |
287 |
1
1. lambda$new$1 : removed call to javax/swing/JTabbedPane::updateUI → NO_COVERAGE |
SqlEngine.tabsError.updateUI(); // required for theme switch when tabs closed |
288 | }); | |
289 | } | |
290 | ||
291 | private JTabbedPane getPanelStructure() { | |
292 | final var keyDatabases = "SQLENGINE_DATABASES"; | |
293 | final var keyTables = "SQLENGINE_TABLES"; | |
294 | final var keyColumns = "SQLENGINE_COLUMNS"; | |
295 | final var keyRows = "SQLENGINE_ROWS"; | |
296 | final var keyField = "SQLENGINE_FIELD"; | |
297 | final var keyFieldSeparator = "SQLENGINE_FIELDS_SEPARATOR"; | |
298 | ||
299 | JTabbedPane tabsDefault = new TabbedPaneWheeled(); | |
300 | Stream.of( | |
301 | new SimpleEntry<>(keyDatabases, TextareaWithColor.DATABASE_DEFAULT.getTextArea()), | |
302 | new SimpleEntry<>(keyTables, TextareaWithColor.TABLE_DEFAULT.getTextArea()), | |
303 | new SimpleEntry<>(keyColumns, TextareaWithColor.COLUMN_DEFAULT.getTextArea()), | |
304 | new SimpleEntry<>(keyRows, TextareaWithColor.QUERY_DEFAULT.getTextArea()), | |
305 | new SimpleEntry<>(keyField, TextareaWithColor.FIELD_DEFAULT.getTextArea()), | |
306 | new SimpleEntry<>(keyFieldSeparator, TextareaWithColor.CONCAT_DEFAULT.getTextArea()), | |
307 | new SimpleEntry<>("SQLENGINE_METADATA", TextareaWithColor.INFO.getTextArea()) | |
308 | ) | |
309 |
1
1. getPanelStructure : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
310 |
1
1. lambda$getPanelStructure$2 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabsDefault.addTab(I18nUtil.valueByKey(entry.getKey()), new RTextScrollPane(entry.getValue(), false)); |
311 | var label = new JLabel(I18nUtil.valueByKey(entry.getKey())); | |
312 |
1
1. lambda$getPanelStructure$2 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabsDefault.setTabComponentAt(tabsDefault.indexOfTab(I18nUtil.valueByKey(entry.getKey())), label); |
313 |
1
1. lambda$getPanelStructure$2 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(entry.getKey(), label); |
314 | }); | |
315 | | |
316 | JTabbedPane tabsZip = new TabbedPaneWheeled(); | |
317 | Stream.of( | |
318 | new SimpleEntry<>(keyDatabases, TextareaWithColor.DATABASE_ZIP.getTextArea()), | |
319 | new SimpleEntry<>(keyTables, TextareaWithColor.TABLE_ZIP.getTextArea()), | |
320 | new SimpleEntry<>(keyColumns, TextareaWithColor.COLUMN_ZIP.getTextArea()), | |
321 | new SimpleEntry<>(keyRows, TextareaWithColor.QUERY_ZIP.getTextArea()), | |
322 | new SimpleEntry<>(keyField, TextareaWithColor.FIELD_ZIP.getTextArea()), | |
323 | new SimpleEntry<>(keyFieldSeparator, TextareaWithColor.CONCAT_ZIP.getTextArea()) | |
324 | ) | |
325 |
1
1. getPanelStructure : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
326 |
1
1. lambda$getPanelStructure$3 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabsZip.addTab(I18nUtil.valueByKey(entry.getKey()), new RTextScrollPane(entry.getValue(), false)); |
327 | var label = new JLabel(I18nUtil.valueByKey(entry.getKey())); | |
328 |
1
1. lambda$getPanelStructure$3 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabsZip.setTabComponentAt(tabsZip.indexOfTab(I18nUtil.valueByKey(entry.getKey())), label); |
329 |
1
1. lambda$getPanelStructure$3 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(entry.getKey(), label); |
330 | }); | |
331 | | |
332 | JTabbedPane tabsDios = new TabbedPaneWheeled(); | |
333 | Stream.of( | |
334 | new SimpleEntry<>(keyDatabases, TextareaWithColor.DATABASE_DIOS.getTextArea()), | |
335 | new SimpleEntry<>(keyTables, TextareaWithColor.TABLE_DIOS.getTextArea()), | |
336 | new SimpleEntry<>(keyColumns, TextareaWithColor.COLUMN_DIOS.getTextArea()), | |
337 | new SimpleEntry<>(keyRows, TextareaWithColor.QUERY_DIOS.getTextArea()), | |
338 | new SimpleEntry<>(keyField, TextareaWithColor.FIELD_DIOS.getTextArea()), | |
339 | new SimpleEntry<>(keyFieldSeparator, TextareaWithColor.CONCAT_DIOS.getTextArea()) | |
340 | ) | |
341 |
1
1. getPanelStructure : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
342 |
1
1. lambda$getPanelStructure$4 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabsDios.addTab(I18nUtil.valueByKey(entry.getKey()), new RTextScrollPane(entry.getValue(), false)); |
343 | var label = new JLabel(I18nUtil.valueByKey(entry.getKey())); | |
344 |
1
1. lambda$getPanelStructure$4 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabsDios.setTabComponentAt(tabsDios.indexOfTab(I18nUtil.valueByKey(entry.getKey())), label); |
345 |
1
1. lambda$getPanelStructure$4 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(entry.getKey(), label); |
346 | }); | |
347 | ||
348 | JTabbedPane tabs = new TabbedPaneWheeled(SwingConstants.RIGHT); | |
349 | Stream.of( | |
350 | new SimpleEntry<>("SQLENGINE_STANDARD", tabsDefault), | |
351 | new SimpleEntry<>("SQLENGINE_ZIP", tabsZip), | |
352 | new SimpleEntry<>("SQLENGINE_DIOS", tabsDios) | |
353 | ) | |
354 |
1
1. getPanelStructure : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
355 |
1
1. lambda$getPanelStructure$5 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey(entry.getKey()), entry.getValue()); |
356 | var label = new JLabel(I18nUtil.valueByKey(entry.getKey())); | |
357 |
1
1. lambda$getPanelStructure$5 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabs.setTabComponentAt(tabs.indexOfTab(I18nUtil.valueByKey(entry.getKey())), label); |
358 |
1
1. lambda$getPanelStructure$5 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(entry.getKey(), label); |
359 | }); | |
360 |
1
1. getPanelStructure : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::getPanelStructure → NO_COVERAGE |
return tabs; |
361 | } | |
362 | ||
363 | private JTabbedPane getPanelStrategy() { | |
364 | JTabbedPane tabs = new TabbedPaneWheeled(); | |
365 |
1
1. getPanelStrategy : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_UNION"), new RTextScrollPane(TextareaWithColor.INDICES.getTextArea(), false)); |
366 |
1
1. getPanelStrategy : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_STACK"), new RTextScrollPane(TextareaWithColor.STACK.getTextArea(), false)); |
367 |
1
1. getPanelStrategy : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_ERROR"), SqlEngine.tabsError); |
368 | ||
369 | JTabbedPane tabsBoolean = new TabbedPaneWheeled(SwingConstants.RIGHT); | |
370 | Stream.of( | |
371 | new SimpleEntry<>("AND mode", TextareaWithColor.MODE_AND.getTextArea()), | |
372 | new SimpleEntry<>("OR mode", TextareaWithColor.MODE_OR.getTextArea()), | |
373 | new SimpleEntry<>("Stack mode", TextareaWithColor.MODE_STACK.getTextArea()), | |
374 | new SimpleEntry<>("Blind", TextareaWithColor.BLIND.getTextArea()), | |
375 | new SimpleEntry<>("Time", TextareaWithColor.TIME.getTextArea()), | |
376 | new SimpleEntry<>("Multibit", TextareaWithColor.MULTIBIT.getTextArea()), | |
377 | new SimpleEntry<>("Bit test", TextareaWithColor.TEST_BIT.getTextArea()), | |
378 | new SimpleEntry<>("Bin test", TextareaWithColor.TEST_BIN.getTextArea()), | |
379 | new SimpleEntry<>("Bin truthy", TextareaWithColor.TRUTHY_BIN.getTextArea()), | |
380 | new SimpleEntry<>("Bin falsy", TextareaWithColor.FALSY_BIN.getTextArea()) | |
381 | ) | |
382 |
1
1. getPanelStrategy : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(entry -> { |
383 |
1
1. lambda$getPanelStrategy$6 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabsBoolean.addTab(entry.getKey(), new RTextScrollPane(entry.getValue(), false)); |
384 |
1
1. lambda$getPanelStrategy$6 : removed call to javax/swing/JTabbedPane::setTitleAt → NO_COVERAGE |
tabsBoolean.setTitleAt( |
385 |
1
1. lambda$getPanelStrategy$6 : Replaced integer subtraction with addition → NO_COVERAGE |
tabsBoolean.getTabCount() - 1, |
386 | String.format( | |
387 | "<html><div style=\"text-align:left;width:60px;\">%s</div></html>", | |
388 | entry.getKey() | |
389 | ) | |
390 | ); | |
391 | }); | |
392 |
1
1. getPanelStrategy : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_BOOLEAN"), tabsBoolean); |
393 | ||
394 | Stream.of( | |
395 | "SQLENGINE_UNION", | |
396 | "SQLENGINE_STACK", | |
397 | "SQLENGINE_ERROR", | |
398 | "SQLENGINE_BOOLEAN" | |
399 | ) | |
400 |
1
1. getPanelStrategy : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(keyI18n -> { |
401 | var label = new JLabel(I18nUtil.valueByKey(keyI18n)); | |
402 |
1
1. lambda$getPanelStrategy$7 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabs.setTabComponentAt(tabs.indexOfTab(I18nUtil.valueByKey(keyI18n)), label); |
403 |
1
1. lambda$getPanelStrategy$7 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(keyI18n, label); |
404 | }); | |
405 |
1
1. getPanelStrategy : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::getPanelStrategy → NO_COVERAGE |
return tabs; |
406 | } | |
407 | ||
408 | private JTabbedPane getPanelConfiguration() { | |
409 | JTabbedPane tabs = new TabbedPaneWheeled(); | |
410 | Stream.of( | |
411 | new SimpleEntry<>("SQLENGINE_CHARACTERS_SLIDINGWINDOW", new RTextScrollPane(TextareaWithColor.SLIDING_WINDOW.getTextArea(), false)), | |
412 | new SimpleEntry<>("SQLENGINE_ROWS_SLIDINGWINDOW", new RTextScrollPane(TextareaWithColor.LIMIT.getTextArea(), false)), | |
413 | new SimpleEntry<>("SQLENGINE_LIMIT_START_INDEX", new RTextScrollPane(TextareaWithColor.LIMIT_BOUNDARY.getTextArea(), false)), | |
414 | new SimpleEntry<>("SQLENGINE_CAPACITY", new RTextScrollPane(TextareaWithColor.CAPACITY.getTextArea(), false)), | |
415 | new SimpleEntry<>("SQLENGINE_CALIBRATOR", new RTextScrollPane(TextareaWithColor.CALIBRATOR.getTextArea(), false)), | |
416 | new SimpleEntry<>("SQLENGINE_FAILSAFE", new RTextScrollPane(TextareaWithColor.FAILSAFE.getTextArea(), false)), | |
417 | new SimpleEntry<>("SQLENGINE_END_COMMENT", new RTextScrollPane(TextareaWithColor.ENDING_COMMENT.getTextArea(), false)) | |
418 | ) | |
419 |
1
1. getPanelConfiguration : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(keyI18n -> { |
420 |
1
1. lambda$getPanelConfiguration$8 : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey(keyI18n.getKey()), keyI18n.getValue()); |
421 | var label = new JLabel(I18nUtil.valueByKey(keyI18n.getKey())); | |
422 |
1
1. lambda$getPanelConfiguration$8 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabs.setTabComponentAt(tabs.indexOfTab(I18nUtil.valueByKey(keyI18n.getKey())), label); |
423 |
1
1. lambda$getPanelConfiguration$8 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(keyI18n.getKey(), label); |
424 | }); | |
425 |
1
1. getPanelConfiguration : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::getPanelConfiguration → NO_COVERAGE |
return tabs; |
426 | } | |
427 | | |
428 | private JTabbedPane getPanelFingerprinting() { | |
429 | JTabbedPane tabs = new TabbedPaneWheeled(); | |
430 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_ORDER_BY"), new RTextScrollPane(TextareaWithColor.ORDER_BY.getTextArea(), false)); |
431 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab("Order by error", new RTextScrollPane(TextareaWithColor.ORDER_BY_ERROR_MESSAGE.getTextArea(), false)); |
432 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab("String error", new RTextScrollPane(TextareaWithColor.INCORRECT_STRING_ERROR_MESSAGE.getTextArea(), false)); |
433 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab("Vendor specific", new RTextScrollPane(TextareaWithColor.VENDOR_SPECIFIC.getTextArea(), false)); |
434 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab("Truthy", new RTextScrollPane(TextareaWithColor.TRUTHY.getTextArea(), false)); |
435 |
1
1. getPanelFingerprinting : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
tabs.addTab("Falsy", new RTextScrollPane(TextareaWithColor.FALSY.getTextArea(), false)); |
436 | | |
437 |
1
1. getPanelFingerprinting : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
Stream.of("SQLENGINE_ORDER_BY").forEach(keyI18n -> { |
438 | var label = new JLabel(I18nUtil.valueByKey(keyI18n)); | |
439 |
1
1. lambda$getPanelFingerprinting$9 : removed call to javax/swing/JTabbedPane::setTabComponentAt → NO_COVERAGE |
tabs.setTabComponentAt(tabs.indexOfTab(I18nUtil.valueByKey(keyI18n)), label); |
440 |
1
1. lambda$getPanelFingerprinting$9 : removed call to com/jsql/view/swing/util/I18nViewUtil::addComponentForKey → NO_COVERAGE |
I18nViewUtil.addComponentForKey(keyI18n, label); |
441 | }); | |
442 |
1
1. getPanelFingerprinting : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::getPanelFingerprinting → NO_COVERAGE |
return tabs; |
443 | } | |
444 | ||
445 | private static JPanel initMenuVendor() { | |
446 | var panelMenuVendor = new JPanel(); // required for label on right | |
447 |
1
1. initMenuVendor : removed call to javax/swing/JPanel::setLayout → NO_COVERAGE |
panelMenuVendor.setLayout(new BorderLayout()); |
448 | ||
449 | JPopupMenu popupMenuVendors = new JPopupMenu(); | |
450 |
1
1. initMenuVendor : removed call to javax/swing/JPopupMenu::setLayout → NO_COVERAGE |
popupMenuVendors.setLayout(UiUtil.getColumnLayout(MediatorHelper.model().getMediatorVendor().getVendors().size())); |
451 | ||
452 | JLabel labelVendor = new JLabel(MediatorHelper.model().getMediatorVendor().getVendor().toString(), UiUtil.ARROW_DOWN.getIcon(), SwingConstants.LEFT); | |
453 |
1
1. initMenuVendor : removed call to javax/swing/JLabel::setBorder → NO_COVERAGE |
labelVendor.setBorder(UiUtil.BORDER_5PX); // required for padding |
454 |
1
1. initMenuVendor : removed call to javax/swing/JLabel::addMouseListener → NO_COVERAGE |
labelVendor.addMouseListener(new MouseAdapter() { |
455 | @Override | |
456 | public void mousePressed(MouseEvent e) { | |
457 |
2
1. lambda$mousePressed$0 : replaced return value with null for com/jsql/view/swing/sql/SqlEngine$1::lambda$mousePressed$0 → NO_COVERAGE 2. mousePressed : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
Arrays.stream(popupMenuVendors.getComponents()).map(a -> (JComponent) a).forEach(JComponent::updateUI); // required: incorrect when dark/light mode switch |
458 |
1
1. mousePressed : removed call to javax/swing/JPopupMenu::updateUI → NO_COVERAGE |
popupMenuVendors.updateUI(); // required: incorrect when dark/light mode switch |
459 |
2
1. mousePressed : removed call to javax/swing/JPopupMenu::show → NO_COVERAGE 2. mousePressed : Replaced integer addition with subtraction → NO_COVERAGE |
popupMenuVendors.show(e.getComponent(), e.getComponent().getX(),e.getComponent().getY() + e.getComponent().getHeight()); |
460 |
2
1. mousePressed : removed call to javax/swing/JPopupMenu::setLocation → NO_COVERAGE 2. mousePressed : Replaced integer addition with subtraction → NO_COVERAGE |
popupMenuVendors.setLocation(e.getComponent().getLocationOnScreen().x,e.getComponent().getLocationOnScreen().y + e.getComponent().getHeight()); |
461 | } | |
462 | }); | |
463 | ||
464 | List<Vendor> listVendors = new LinkedList<>(MediatorHelper.model().getMediatorVendor().getVendors()); | |
465 |
2
1. lambda$initMenuVendor$10 : replaced boolean return with true for com/jsql/view/swing/sql/SqlEngine::lambda$initMenuVendor$10 → NO_COVERAGE 2. lambda$initMenuVendor$10 : negated conditional → NO_COVERAGE |
listVendors.removeIf(vendor -> vendor == MediatorHelper.model().getMediatorVendor().getAuto()); |
466 | ||
467 | var groupVendor = new ButtonGroup(); | |
468 | for (final Vendor vendor: listVendors) { | |
469 | JMenuItem itemRadioVendor = new JRadioButtonMenuItem( | |
470 | vendor.toString(), | |
471 |
1
1. initMenuVendor : negated conditional → NO_COVERAGE |
vendor == MediatorHelper.model().getMediatorVendor().getVendor() |
472 | ); | |
473 | | |
474 |
1
1. initMenuVendor : removed call to javax/swing/JMenuItem::addActionListener → NO_COVERAGE |
itemRadioVendor.addActionListener(actionEvent -> { |
475 | SqlEngine.modelYaml = vendor.instance().getModelYaml(); | |
476 |
1
1. lambda$initMenuVendor$11 : removed call to com/jsql/view/swing/sql/SqlEngine::initTextComponents → NO_COVERAGE |
SqlEngine.initTextComponents(); |
477 |
1
1. lambda$initMenuVendor$11 : removed call to javax/swing/JLabel::setText → NO_COVERAGE |
labelVendor.setText(vendor.toString()); |
478 | }); | |
479 | | |
480 |
1
1. initMenuVendor : removed call to javax/swing/ButtonGroup::add → NO_COVERAGE |
groupVendor.add(itemRadioVendor); |
481 | popupMenuVendors.add(itemRadioVendor); | |
482 | } | |
483 | | |
484 |
1
1. initMenuVendor : removed call to javax/swing/JPanel::add → NO_COVERAGE |
panelMenuVendor.add(labelVendor, BorderLayout.LINE_END); // required to set on right |
485 |
1
1. initMenuVendor : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::initMenuVendor → NO_COVERAGE |
return panelMenuVendor; |
486 | } | |
487 | | |
488 | /** | |
489 | * Configure all text components with new coloring and new modelYaml setter. | |
490 | */ | |
491 | private static void initTextComponents() { | |
492 |
1
1. initTextComponents : removed call to java/util/List::forEach → NO_COVERAGE |
SqlEngine.getTextareas().forEach(SqlEngine::reset); |
493 |
2
1. initTextComponents : removed call to java/util/List::forEach → NO_COVERAGE 2. lambda$initTextComponents$12 : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setText → NO_COVERAGE |
SqlEngine.getTextareas().forEach(textPaneLexer -> textPaneLexer.setText(StringUtils.EMPTY)); |
494 | ||
495 | Stream.of(TextareaWithColor.values()) | |
496 |
1
1. lambda$initTextComponents$13 : replaced return value with null for com/jsql/view/swing/sql/SqlEngine::lambda$initTextComponents$13 → NO_COVERAGE |
.map(textareaWithColor -> textareaWithColor.textarea) |
497 |
1
1. initTextComponents : removed call to java/util/stream/Stream::forEach → NO_COVERAGE |
.forEach(textArea -> { |
498 |
1
1. lambda$initTextComponents$14 : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setText → NO_COVERAGE |
textArea.setText(textArea.getSupplierGetter().get().trim()); |
499 |
1
1. lambda$initTextComponents$14 : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setCaretPosition → NO_COVERAGE |
textArea.setCaretPosition(0); |
500 | }); | |
501 | ||
502 |
1
1. initTextComponents : removed call to com/jsql/view/swing/sql/SqlEngine::populateTabError → NO_COVERAGE |
SqlEngine.populateTabError(); |
503 |
1
1. initTextComponents : removed call to com/jsql/view/swing/sql/SqlEngine::applyTheme → NO_COVERAGE |
SqlEngine.applyTheme(); |
504 | } | |
505 | ||
506 | public static void applyTheme() { | |
507 |
1
1. applyTheme : removed call to java/util/List::forEach → NO_COVERAGE |
SqlEngine.getTextareas().forEach(UiUtil::applySyntaxTheme); |
508 | } | |
509 | ||
510 | /** | |
511 | * Dynamically add textPanes to Error tab for current vendor. | |
512 | */ | |
513 | private static void populateTabError() { | |
514 |
1
1. populateTabError : removed call to javax/swing/JTabbedPane::removeAll → NO_COVERAGE |
SqlEngine.tabsError.removeAll(); |
515 | ||
516 |
1
1. populateTabError : negated conditional → NO_COVERAGE |
if (SqlEngine.modelYaml.getStrategy().getError() == null) { |
517 | return; | |
518 | } | |
519 | | |
520 | for (Method methodError: SqlEngine.modelYaml.getStrategy().getError().getMethod()) { | |
521 | var panelError = new JPanel(new BorderLayout()); | |
522 | ||
523 | var textareaError = new JSyntaxTextArea(methodError::setQuery, methodError::getQuery); | |
524 |
1
1. populateTabError : removed call to com/jsql/view/swing/sql/SqlEngine::reset → NO_COVERAGE |
SqlEngine.reset(textareaError); |
525 |
1
1. populateTabError : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setText → NO_COVERAGE |
textareaError.setText(methodError.getQuery().trim()); |
526 |
1
1. populateTabError : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setCaretPosition → NO_COVERAGE |
textareaError.setCaretPosition(0); |
527 |
1
1. populateTabError : removed call to javax/swing/JPanel::add → NO_COVERAGE |
panelError.add(new RTextScrollPane(textareaError, false), BorderLayout.CENTER); |
528 | | |
529 | var panelLimit = new JPanel(); // TODO Integrate Error limit | |
530 |
1
1. populateTabError : removed call to javax/swing/JPanel::setLayout → NO_COVERAGE |
panelLimit.setLayout(new BoxLayout(panelLimit, BoxLayout.LINE_AXIS)); |
531 | panelLimit.add(new JLabel(" Overflow limit: ")); | |
532 | panelLimit.add(new JTextField(Integer.toString(methodError.getCapacity()))); | |
533 |
1
1. populateTabError : removed call to javax/swing/JPanel::add → NO_COVERAGE |
panelError.add(panelLimit, BorderLayout.SOUTH); |
534 | ||
535 |
1
1. populateTabError : removed call to javax/swing/JTabbedPane::addTab → NO_COVERAGE |
SqlEngine.tabsError.addTab(methodError.getName(), panelError); |
536 |
1
1. populateTabError : removed call to javax/swing/JTabbedPane::setTitleAt → NO_COVERAGE |
SqlEngine.tabsError.setTitleAt( |
537 |
1
1. populateTabError : Replaced integer subtraction with addition → NO_COVERAGE |
SqlEngine.tabsError.getTabCount() - 1, |
538 | String.format( | |
539 | "<html><div style=\"text-align:left;width:100px;\">%s</div></html>", | |
540 | methodError.getName() | |
541 | ) | |
542 | ); | |
543 | SqlEngine.listTextareasError.add(textareaError); | |
544 | } | |
545 | } | |
546 | | |
547 | /** | |
548 | * Reset the textarea colorer. | |
549 | * @param textarea which colorer will be reset. | |
550 | */ | |
551 | private static void reset(JSyntaxTextArea textarea) { | |
552 |
1
1. reset : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setDocument → NO_COVERAGE |
textarea.setDocument(new RSyntaxDocument(SyntaxConstants.SYNTAX_STYLE_SQL)); // required else empty on reopen |
553 |
1
1. reset : removed call to javax/swing/text/Document::addDocumentListener → NO_COVERAGE |
textarea.getDocument().addDocumentListener(new DocumentListenerEditing() { |
554 | @Override | |
555 | public void process() { | |
556 |
1
1. process : removed call to com/jsql/view/swing/sql/JSyntaxTextArea::setAttribute → NO_COVERAGE |
textarea.setAttribute(); |
557 | } | |
558 | }); | |
559 | } | |
560 | | |
561 | /** | |
562 | * Merge list of Error textPanes and list of other textAreas. | |
563 | * @return the merged list | |
564 | */ | |
565 | private static List<JSyntaxTextArea> getTextareas() { | |
566 |
1
1. getTextareas : replaced return value with Collections.emptyList for com/jsql/view/swing/sql/SqlEngine::getTextareas → NO_COVERAGE |
return Stream.concat( |
567 | SqlEngine.listTextareasError.stream(), | |
568 | Stream.of(TextareaWithColor.values()).map(TextareaWithColor::getTextArea) | |
569 | ) | |
570 | .collect(Collectors.toList()); | |
571 | } | |
572 | } | |
Mutations | ||
39 |
1.1 |
|
40 |
1.1 |
|
43 |
1.1 |
|
44 |
1.1 |
|
47 |
1.1 |
|
48 |
1.1 |
|
51 |
1.1 |
|
52 |
1.1 |
|
55 |
1.1 |
|
56 |
1.1 |
|
59 |
1.1 |
|
60 |
1.1 |
|
65 |
1.1 |
|
66 |
1.1 |
|
69 |
1.1 |
|
70 |
1.1 |
|
73 |
1.1 |
|
74 |
1.1 |
|
77 |
1.1 |
|
78 |
1.1 |
|
81 |
1.1 |
|
82 |
1.1 |
|
85 |
1.1 |
|
86 |
1.1 |
|
91 |
1.1 |
|
92 |
1.1 |
|
95 |
1.1 |
|
96 |
1.1 |
|
99 |
1.1 |
|
100 |
1.1 |
|
103 |
1.1 |
|
104 |
1.1 |
|
107 |
1.1 |
|
108 |
1.1 |
|
111 |
1.1 |
|
112 |
1.1 |
|
116 |
1.1 |
|
117 |
1.1 |
|
122 |
1.1 |
|
123 |
1.1 |
|
126 |
1.1 |
|
127 |
1.1 |
|
130 |
1.1 |
|
131 |
1.1 |
|
134 |
1.1 |
|
135 |
1.1 |
|
138 |
1.1 |
|
139 |
1.1 |
|
142 |
1.1 |
|
143 |
1.1 |
|
148 |
1.1 |
|
149 |
1.1 |
|
152 |
1.1 |
|
153 |
1.1 |
|
157 |
1.1 |
|
158 |
1.1 |
|
163 |
1.1 |
|
164 |
1.1 |
|
167 |
1.1 |
|
168 |
1.1 |
|
171 |
1.1 |
|
172 |
1.1 |
|
175 |
1.1 |
|
176 |
1.1 |
|
179 |
1.1 |
|
180 |
1.1 |
|
183 |
1.1 |
|
184 |
1.1 |
|
187 |
1.1 |
|
188 |
1.1 |
|
191 |
1.1 |
|
192 |
1.1 |
|
195 |
1.1 |
|
196 |
1.1 |
|
199 |
1.1 |
|
200 |
1.1 |
|
206 |
1.1 |
|
207 |
1.1 |
|
212 |
1.1 |
|
213 |
1.1 |
|
216 |
1.1 |
|
217 |
1.1 |
|
220 |
1.1 |
|
221 |
1.1 |
|
224 |
1.1 |
|
225 |
1.1 |
|
228 |
1.1 |
|
229 |
1.1 |
|
232 |
1.1 |
|
233 |
1.1 |
|
240 |
1.1 |
|
252 |
1.1 |
|
269 |
1.1 |
|
270 |
1.1 |
|
272 |
1.1 |
|
276 |
1.1 |
|
279 |
1.1 |
|
282 |
1.1 |
|
285 |
1.1 |
|
286 |
1.1 |
|
287 |
1.1 |
|
309 |
1.1 |
|
310 |
1.1 |
|
312 |
1.1 |
|
313 |
1.1 |
|
325 |
1.1 |
|
326 |
1.1 |
|
328 |
1.1 |
|
329 |
1.1 |
|
341 |
1.1 |
|
342 |
1.1 |
|
344 |
1.1 |
|
345 |
1.1 |
|
354 |
1.1 |
|
355 |
1.1 |
|
357 |
1.1 |
|
358 |
1.1 |
|
360 |
1.1 |
|
365 |
1.1 |
|
366 |
1.1 |
|
367 |
1.1 |
|
382 |
1.1 |
|
383 |
1.1 |
|
384 |
1.1 |
|
385 |
1.1 |
|
392 |
1.1 |
|
400 |
1.1 |
|
402 |
1.1 |
|
403 |
1.1 |
|
405 |
1.1 |
|
419 |
1.1 |
|
420 |
1.1 |
|
422 |
1.1 |
|
423 |
1.1 |
|
425 |
1.1 |
|
430 |
1.1 |
|
431 |
1.1 |
|
432 |
1.1 |
|
433 |
1.1 |
|
434 |
1.1 |
|
435 |
1.1 |
|
437 |
1.1 |
|
439 |
1.1 |
|
440 |
1.1 |
|
442 |
1.1 |
|
447 |
1.1 |
|
450 |
1.1 |
|
453 |
1.1 |
|
454 |
1.1 |
|
457 |
1.1 2.2 |
|
458 |
1.1 |
|
459 |
1.1 2.2 |
|
460 |
1.1 2.2 |
|
465 |
1.1 2.2 |
|
471 |
1.1 |
|
474 |
1.1 |
|
476 |
1.1 |
|
477 |
1.1 |
|
480 |
1.1 |
|
484 |
1.1 |
|
485 |
1.1 |
|
492 |
1.1 |
|
493 |
1.1 2.2 |
|
496 |
1.1 |
|
497 |
1.1 |
|
498 |
1.1 |
|
499 |
1.1 |
|
502 |
1.1 |
|
503 |
1.1 |
|
507 |
1.1 |
|
514 |
1.1 |
|
516 |
1.1 |
|
524 |
1.1 |
|
525 |
1.1 |
|
526 |
1.1 |
|
527 |
1.1 |
|
530 |
1.1 |
|
533 |
1.1 |
|
535 |
1.1 |
|
536 |
1.1 |
|
537 |
1.1 |
|
552 |
1.1 |
|
553 |
1.1 |
|
556 |
1.1 |
|
566 |
1.1 |