diff --git a/src/org/openstreetmap/josm/actions/ValidateAction.java b/src/org/openstreetmap/josm/actions/ValidateAction.java
index 12febf6..4f2851f 100644
a
|
b
|
public class ValidateAction extends JosmAction {
|
168 | 168 | errors.addAll(test.getErrors()); |
169 | 169 | } |
170 | 170 | tests = null; |
171 | | if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { |
| 171 | if (ValidatorPreference.PREF_USE_IGNORE.get()) { |
172 | 172 | getProgressMonitor().subTask(tr("Updating ignored errors ...")); |
173 | 173 | for (TestError error : errors) { |
174 | 174 | if (canceled) return; |
diff --git a/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java b/src/org/openstreetmap/josm/actions/upload/ValidateUploadHook.java
index 2704956..6d32ccf 100644
a
|
b
|
public class ValidateUploadHook implements UploadHook {
|
60 | 60 | test.startTest(null); |
61 | 61 | test.visit(selection); |
62 | 62 | test.endTest(); |
63 | | if (ValidatorPreference.PREF_OTHER.get() && |
64 | | Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false)) { |
| 63 | if (ValidatorPreference.PREF_OTHER.get() && ValidatorPreference.PREF_OTHER_UPLOAD.get()) { |
65 | 64 | errors.addAll(test.getErrors()); |
66 | 65 | } else { |
67 | 66 | for (TestError e : test.getErrors()) { |
… |
… |
public class ValidateUploadHook implements UploadHook {
|
82 | 81 | if (errors.isEmpty()) |
83 | 82 | return true; |
84 | 83 | |
85 | | if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { |
| 84 | if (ValidatorPreference.PREF_USE_IGNORE.get()) { |
86 | 85 | int nume = 0; |
87 | 86 | for (TestError error : errors) { |
88 | 87 | List<String> s = new ArrayList<>(); |
diff --git a/src/org/openstreetmap/josm/data/validation/OsmValidator.java b/src/org/openstreetmap/josm/data/validation/OsmValidator.java
index fc4da6b..a25960d 100644
a
|
b
|
public final class OsmValidator {
|
182 | 182 | |
183 | 183 | private static void loadIgnoredErrors() { |
184 | 184 | ignoredErrors.clear(); |
185 | | if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { |
| 185 | if (ValidatorPreference.PREF_USE_IGNORE.get()) { |
186 | 186 | Path path = Paths.get(getValidatorDir()).resolve("ignorederrors"); |
187 | 187 | if (Files.exists(path)) { |
188 | 188 | try { |
… |
… |
public final class OsmValidator {
|
216 | 216 | } |
217 | 217 | |
218 | 218 | public static synchronized void initializeErrorLayer() { |
219 | | if (!Main.pref.getBoolean(ValidatorPreference.PREF_LAYER, true)) |
| 219 | if (!ValidatorPreference.PREF_LAYER.get()) |
220 | 220 | return; |
221 | 221 | if (errorLayer == null) { |
222 | 222 | errorLayer = new ValidatorLayer(); |
diff --git a/src/org/openstreetmap/josm/data/validation/TestError.java b/src/org/openstreetmap/josm/data/validation/TestError.java
index d9d86a7..9379629 100644
a
|
b
|
public class TestError implements Comparable<TestError>, DataSetListener {
|
268 | 268 | return tester; |
269 | 269 | } |
270 | 270 | |
| 271 | /** |
| 272 | * Set the tester that raised the error. |
| 273 | * @param tester te tester |
| 274 | */ |
271 | 275 | public void setTester(Test tester) { |
272 | 276 | this.tester = tester; |
273 | 277 | } |
diff --git a/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java b/src/org/openstreetmap/josm/gui/dialogs/ValidatorDialog.java
index a3e121a..7ae55df 100644
a
|
b
|
public class ValidatorDialog extends ToggleDialog implements SelectionChangedLis
|
150 | 150 | fixButton.setEnabled(false); |
151 | 151 | buttons.add(fixButton); |
152 | 152 | |
153 | | if (Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)) { |
| 153 | if (ValidatorPreference.PREF_USE_IGNORE.get()) { |
154 | 154 | ignoreButton = new SideButton(new AbstractAction() { |
155 | 155 | { |
156 | 156 | putValue(NAME, tr("Ignore")); |
… |
… |
public class ValidatorDialog extends ToggleDialog implements SelectionChangedLis
|
192 | 192 | tree.setVisible(v); |
193 | 193 | } |
194 | 194 | super.setVisible(v); |
195 | | Main.map.repaint(); |
196 | 195 | } |
197 | 196 | |
198 | 197 | /** |
diff --git a/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java b/src/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanel.java
index fd212c8..a399bdf 100644
a
|
b
|
import java.util.Collection;
|
10 | 10 | import java.util.Collections; |
11 | 11 | import java.util.EnumMap; |
12 | 12 | import java.util.Enumeration; |
13 | | import java.util.HashMap; |
14 | 13 | import java.util.HashSet; |
15 | 14 | import java.util.List; |
16 | 15 | import java.util.Map; |
17 | 16 | import java.util.Map.Entry; |
18 | 17 | import java.util.Set; |
19 | 18 | import java.util.function.Predicate; |
| 19 | import java.util.stream.Collectors; |
20 | 20 | |
21 | 21 | import javax.swing.JTree; |
22 | 22 | import javax.swing.ToolTipManager; |
… |
… |
import org.openstreetmap.josm.data.validation.util.MultipleNameVisitor;
|
35 | 35 | import org.openstreetmap.josm.gui.preferences.validator.ValidatorPreference; |
36 | 36 | import org.openstreetmap.josm.gui.util.GuiHelper; |
37 | 37 | import org.openstreetmap.josm.tools.Destroyable; |
38 | | import org.openstreetmap.josm.tools.MultiMap; |
| 38 | import org.openstreetmap.josm.tools.ListenerList; |
39 | 39 | |
40 | 40 | /** |
41 | 41 | * A panel that displays the error tree. The selection manager |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
72 | 72 | */ |
73 | 73 | private transient Set<? extends OsmPrimitive> filter; |
74 | 74 | |
75 | | /** a counter to check if tree has been rebuild */ |
76 | | private int updateCount; |
| 75 | private final ListenerList<Runnable> invalidationListeners = ListenerList.create(); |
77 | 76 | |
78 | 77 | /** |
79 | 78 | * Constructor |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
134 | 133 | valTreeModel.setRoot(new DefaultMutableTreeNode()); |
135 | 134 | } |
136 | 135 | super.setVisible(v); |
| 136 | invalidationListeners.fireEvent(Runnable::run); |
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
140 | 140 | * Builds the errors tree |
141 | 141 | */ |
142 | 142 | public void buildTree() { |
143 | | updateCount++; |
144 | 143 | final DefaultMutableTreeNode rootNode = new DefaultMutableTreeNode(); |
145 | 144 | |
146 | 145 | if (errors == null || errors.isEmpty()) { |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
171 | 170 | } |
172 | 171 | } |
173 | 172 | |
174 | | Map<Severity, MultiMap<String, TestError>> errorTree = new EnumMap<>(Severity.class); |
175 | | Map<Severity, HashMap<String, MultiMap<String, TestError>>> errorTreeDeep = new EnumMap<>(Severity.class); |
176 | | for (Severity s : Severity.values()) { |
177 | | errorTree.put(s, new MultiMap<String, TestError>(20)); |
178 | | errorTreeDeep.put(s, new HashMap<String, MultiMap<String, TestError>>()); |
| 173 | Predicate<TestError> filterToUse = e -> !e.isIgnored(); |
| 174 | if (!ValidatorPreference.PREF_OTHER.get()) { |
| 175 | filterToUse = filterToUse.and(e -> e.getSeverity() != Severity.OTHER); |
179 | 176 | } |
180 | | |
181 | | final Boolean other = ValidatorPreference.PREF_OTHER.get(); |
182 | | for (TestError e : errors) { |
183 | | if (e.isIgnored()) { |
184 | | continue; |
185 | | } |
186 | | Severity s = e.getSeverity(); |
187 | | if (!other && s == Severity.OTHER) { |
188 | | continue; |
189 | | } |
190 | | String d = e.getDescription(); |
191 | | String m = e.getMessage(); |
192 | | if (filter != null) { |
193 | | boolean found = false; |
194 | | for (OsmPrimitive p : e.getPrimitives()) { |
195 | | if (filter.contains(p)) { |
196 | | found = true; |
197 | | break; |
198 | | } |
199 | | } |
200 | | if (!found) { |
201 | | continue; |
202 | | } |
203 | | } |
204 | | if (d != null) { |
205 | | MultiMap<String, TestError> b = errorTreeDeep.get(s).get(m); |
206 | | if (b == null) { |
207 | | b = new MultiMap<>(20); |
208 | | errorTreeDeep.get(s).put(m, b); |
209 | | } |
210 | | b.put(d, e); |
211 | | } else { |
212 | | errorTree.get(s).put(m, e); |
213 | | } |
| 177 | if (filter != null) { |
| 178 | filterToUse = filterToUse.and(e -> e.getPrimitives().stream().anyMatch(filter::contains)); |
214 | 179 | } |
| 180 | Map<Severity, Map<String, Map<String, List<TestError>>>> errorTreeDeep |
| 181 | = errors.stream().filter(filterToUse).collect( |
| 182 | Collectors.groupingBy(e -> e.getSeverity(), () -> new EnumMap<>(Severity.class), |
| 183 | Collectors.groupingBy(e -> e.getDescription() == null ? "" : e.getDescription(), |
| 184 | Collectors.groupingBy(e -> e.getMessage())))); |
215 | 185 | |
216 | 186 | List<TreePath> expandedPaths = new ArrayList<>(); |
217 | | for (Severity s : Severity.values()) { |
218 | | MultiMap<String, TestError> severityErrors = errorTree.get(s); |
219 | | Map<String, MultiMap<String, TestError>> severityErrorsDeep = errorTreeDeep.get(s); |
220 | | if (severityErrors.isEmpty() && severityErrorsDeep.isEmpty()) { |
221 | | continue; |
222 | | } |
223 | | |
| 187 | errorTreeDeep.forEach((s, severityErrorsDeep) -> { |
224 | 188 | // Severity node |
225 | 189 | DefaultMutableTreeNode severityNode = new GroupTreeNode(s); |
226 | 190 | rootNode.add(severityNode); |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
229 | 193 | expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode})); |
230 | 194 | } |
231 | 195 | |
232 | | for (Entry<String, Set<TestError>> msgErrors : severityErrors.entrySet()) { |
233 | | // Message node |
234 | | Set<TestError> errs = msgErrors.getValue(); |
235 | | String msg = tr("{0} ({1})", msgErrors.getKey(), errs.size()); |
236 | | DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg); |
237 | | severityNode.add(messageNode); |
| 196 | Map<String, List<TestError>> severityErrors = severityErrorsDeep.get(""); |
| 197 | if (severityErrors != null) { |
| 198 | for (Entry<String, List<TestError>> msgErrors : severityErrors.entrySet()) { |
| 199 | // Message node |
| 200 | List<TestError> errs = msgErrors.getValue(); |
| 201 | String msg = tr("{0} ({1})", msgErrors.getKey(), errs.size()); |
| 202 | DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg); |
| 203 | severityNode.add(messageNode); |
238 | 204 | |
239 | | if (oldSelectedRows.contains(msgErrors.getKey())) { |
240 | | expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, messageNode})); |
241 | | } |
| 205 | if (oldSelectedRows.contains(msgErrors.getKey())) { |
| 206 | expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, messageNode})); |
| 207 | } |
242 | 208 | |
243 | | for (TestError error : errs) { |
244 | | // Error node |
245 | | DefaultMutableTreeNode errorNode = new DefaultMutableTreeNode(error); |
246 | | messageNode.add(errorNode); |
| 209 | errs.stream().map(DefaultMutableTreeNode::new).forEach(messageNode::add); |
247 | 210 | } |
248 | 211 | } |
249 | | for (Entry<String, MultiMap<String, TestError>> bag : severityErrorsDeep.entrySet()) { |
| 212 | |
| 213 | severityErrorsDeep.forEach((description, errorlist) -> { |
| 214 | if (description.isEmpty()) { |
| 215 | return; |
| 216 | } |
250 | 217 | // Group node |
251 | | MultiMap<String, TestError> errorlist = bag.getValue(); |
252 | | DefaultMutableTreeNode groupNode = null; |
| 218 | DefaultMutableTreeNode groupNode; |
253 | 219 | if (errorlist.size() > 1) { |
254 | | groupNode = new GroupTreeNode(bag.getKey()); |
| 220 | groupNode = new GroupTreeNode(description); |
255 | 221 | severityNode.add(groupNode); |
256 | | if (oldSelectedRows.contains(bag.getKey())) { |
| 222 | if (oldSelectedRows.contains(description)) { |
257 | 223 | expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, groupNode})); |
258 | 224 | } |
| 225 | } else { |
| 226 | groupNode = null; |
259 | 227 | } |
260 | 228 | |
261 | | for (Entry<String, Set<TestError>> msgErrors : errorlist.entrySet()) { |
| 229 | errorlist.forEach((message, errs) -> { |
262 | 230 | // Message node |
263 | | Set<TestError> errs = msgErrors.getValue(); |
264 | 231 | String msg; |
265 | 232 | if (groupNode != null) { |
266 | | msg = tr("{0} ({1})", msgErrors.getKey(), errs.size()); |
| 233 | msg = tr("{0} ({1})", message, errs.size()); |
267 | 234 | } else { |
268 | | msg = tr("{0} - {1} ({2})", msgErrors.getKey(), bag.getKey(), errs.size()); |
| 235 | msg = tr("{0} - {1} ({2})", message, description, errs.size()); |
269 | 236 | } |
270 | 237 | DefaultMutableTreeNode messageNode = new DefaultMutableTreeNode(msg); |
271 | 238 | if (groupNode != null) { |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
274 | 241 | severityNode.add(messageNode); |
275 | 242 | } |
276 | 243 | |
277 | | if (oldSelectedRows.contains(msgErrors.getKey())) { |
| 244 | if (oldSelectedRows.contains(message)) { |
278 | 245 | if (groupNode != null) { |
279 | 246 | expandedPaths.add(new TreePath(new Object[] {rootNode, severityNode, groupNode, messageNode})); |
280 | 247 | } else { |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
282 | 249 | } |
283 | 250 | } |
284 | 251 | |
285 | | for (TestError error : errs) { |
286 | | // Error node |
287 | | DefaultMutableTreeNode errorNode = new DefaultMutableTreeNode(error); |
288 | | messageNode.add(errorNode); |
289 | | } |
290 | | } |
291 | | } |
292 | | } |
| 252 | errs.stream().map(DefaultMutableTreeNode::new).forEach(messageNode::add); |
| 253 | }); |
| 254 | }); |
| 255 | }); |
293 | 256 | |
294 | 257 | valTreeModel.setRoot(rootNode); |
295 | 258 | for (TreePath path : expandedPaths) { |
296 | 259 | this.expandPath(path); |
297 | 260 | } |
| 261 | |
| 262 | invalidationListeners.fireEvent(Runnable::run); |
| 263 | } |
| 264 | |
| 265 | /** |
| 266 | * Add a new invalidation listener |
| 267 | * @param listener The listener |
| 268 | */ |
| 269 | public void addInvalidationListener(Runnable listener) { |
| 270 | invalidationListeners.addListener(listener); |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Remove an invalidation listener |
| 275 | * @param listener The listener |
| 276 | */ |
| 277 | public void removeInvalidationListener(Runnable listener) { |
| 278 | invalidationListeners.removeListener(listener); |
298 | 279 | } |
299 | 280 | |
300 | 281 | /** |
… |
… |
public class ValidatorTreePanel extends JTree implements Destroyable {
|
425 | 406 | return (DefaultMutableTreeNode) valTreeModel.getRoot(); |
426 | 407 | } |
427 | 408 | |
428 | | /** |
429 | | * Returns a value to check if tree has been rebuild |
430 | | * @return the current counter |
431 | | */ |
432 | | public int getUpdateCount() { |
433 | | return updateCount; |
434 | | } |
435 | | |
436 | 409 | private void clearErrors() { |
437 | 410 | if (errors != null) { |
438 | 411 | DataSet ds = Main.getLayerManager().getEditDataSet(); |
diff --git a/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java b/src/org/openstreetmap/josm/gui/layer/ValidatorLayer.java
index 4044d99..cc52120 100644
a
|
b
|
import org.openstreetmap.josm.tools.MultiMap;
|
40 | 40 | * @since 10386 (new LayerChangeListener interface) |
41 | 41 | */ |
42 | 42 | public class ValidatorLayer extends Layer implements LayerChangeListener { |
43 | | |
44 | | private int updateCount = -1; |
| 43 | private final Runnable invalidator = this::invalidate; |
45 | 44 | |
46 | 45 | /** |
47 | 46 | * Constructs a new Validator layer |
… |
… |
public class ValidatorLayer extends Layer implements LayerChangeListener {
|
49 | 48 | public ValidatorLayer() { |
50 | 49 | super(tr("Validation errors")); |
51 | 50 | Main.getLayerManager().addLayerChangeListener(this); |
| 51 | Main.map.validatorDialog.tree.addInvalidationListener(invalidator); |
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
… |
… |
public class ValidatorLayer extends Layer implements LayerChangeListener {
|
67 | 67 | @SuppressWarnings("unchecked") |
68 | 68 | @Override |
69 | 69 | public void paint(final Graphics2D g, final MapView mv, Bounds bounds) { |
70 | | updateCount = Main.map.validatorDialog.tree.getUpdateCount(); |
71 | 70 | DefaultMutableTreeNode root = Main.map.validatorDialog.tree.getRoot(); |
72 | 71 | if (root == null || root.getChildCount() == 0) |
73 | 72 | return; |
… |
… |
public class ValidatorLayer extends Layer implements LayerChangeListener {
|
123 | 122 | } |
124 | 123 | |
125 | 124 | @Override |
126 | | public boolean isChanged() { |
127 | | return updateCount != Main.map.validatorDialog.tree.getUpdateCount(); |
128 | | } |
129 | | |
130 | | @Override |
131 | 125 | public void visitBoundingBox(BoundingXYVisitor v) { |
132 | 126 | // Do nothing |
133 | 127 | } |
… |
… |
public class ValidatorLayer extends Layer implements LayerChangeListener {
|
167 | 161 | if (e.getRemovedLayer() instanceof OsmDataLayer && e.getSource().getLayersOfType(OsmDataLayer.class).size() <= 1) { |
168 | 162 | e.scheduleRemoval(Collections.singleton(this)); |
169 | 163 | } else if (e.getRemovedLayer() == this) { |
170 | | Main.getLayerManager().removeLayerChangeListener(this); |
171 | 164 | OsmValidator.errorLayer = null; |
172 | 165 | } |
173 | 166 | } |
… |
… |
public class ValidatorLayer extends Layer implements LayerChangeListener {
|
176 | 169 | public LayerPositionStrategy getDefaultLayerPosition() { |
177 | 170 | return LayerPositionStrategy.IN_FRONT; |
178 | 171 | } |
| 172 | |
| 173 | @Override |
| 174 | public void destroy() { |
| 175 | Main.map.validatorDialog.tree.removeInvalidationListener(invalidator); |
| 176 | Main.getLayerManager().removeLayerChangeListener(this); |
| 177 | super.destroy(); |
| 178 | } |
179 | 179 | } |
diff --git a/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java b/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorPreference.java
index f647d56..24ec975 100644
a
|
b
|
public final class ValidatorPreference extends DefaultTabPreferenceSetting {
|
39 | 39 | public static final String PREFIX = "validator"; |
40 | 40 | |
41 | 41 | /** The preferences key for error layer */ |
42 | | public static final String PREF_LAYER = PREFIX + ".layer"; |
| 42 | public static final BooleanProperty PREF_LAYER = new BooleanProperty(PREFIX + ".layer", true); |
43 | 43 | |
44 | 44 | /** The preferences key for enabled tests */ |
45 | 45 | public static final String PREF_SKIP_TESTS = PREFIX + ".skip"; |
46 | 46 | |
47 | 47 | /** The preferences key for enabled tests */ |
48 | | public static final String PREF_USE_IGNORE = PREFIX + ".ignore"; |
| 48 | public static final BooleanProperty PREF_USE_IGNORE = new BooleanProperty(PREFIX + ".ignore", true); |
49 | 49 | |
50 | 50 | /** The preferences key for enabled tests before upload*/ |
51 | 51 | public static final String PREF_SKIP_TESTS_BEFORE_UPLOAD = PREFIX + ".skipBeforeUpload"; |
52 | 52 | |
53 | 53 | /** The preferences key for ignored severity other on upload */ |
54 | | public static final String PREF_OTHER_UPLOAD = PREFIX + ".otherUpload"; |
| 54 | public static final BooleanProperty PREF_OTHER_UPLOAD = new BooleanProperty(PREFIX + ".otherUpload", false); |
55 | 55 | |
56 | 56 | /** The preferences for ignored severity other */ |
57 | 57 | public static final BooleanProperty PREF_OTHER = new BooleanProperty(PREFIX + ".other", false); |
diff --git a/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java b/src/org/openstreetmap/josm/gui/preferences/validator/ValidatorTestsPreference.java
index 67b1a7e..3a4128a 100644
a
|
b
|
public class ValidatorTestsPreference implements SubPreferenceSetting {
|
57 | 57 | JPanel testPanel = new VerticallyScrollablePanel(new GridBagLayout()); |
58 | 58 | testPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
59 | 59 | |
60 | | prefUseIgnore = new JCheckBox(tr("Use ignore list."), Main.pref.getBoolean(ValidatorPreference.PREF_USE_IGNORE, true)); |
| 60 | prefUseIgnore = new JCheckBox(tr("Use ignore list."), ValidatorPreference.PREF_USE_IGNORE.get()); |
61 | 61 | prefUseIgnore.setToolTipText(tr("Use the ignore list to suppress warnings.")); |
62 | 62 | testPanel.add(prefUseIgnore, GBC.eol()); |
63 | 63 | |
64 | | prefUseLayer = new JCheckBox(tr("Use error layer."), Main.pref.getBoolean(ValidatorPreference.PREF_LAYER, true)); |
| 64 | prefUseLayer = new JCheckBox(tr("Use error layer."), ValidatorPreference.PREF_LAYER.get()); |
65 | 65 | prefUseLayer.setToolTipText(tr("Use the error layer to display problematic elements.")); |
66 | 66 | testPanel.add(prefUseLayer, GBC.eol()); |
67 | 67 | |
… |
… |
public class ValidatorTestsPreference implements SubPreferenceSetting {
|
70 | 70 | testPanel.add(prefOther, GBC.eol()); |
71 | 71 | |
72 | 72 | prefOtherUpload = new JCheckBox(tr("Show informational level on upload."), |
73 | | Main.pref.getBoolean(ValidatorPreference.PREF_OTHER_UPLOAD, false)); |
| 73 | ValidatorPreference.PREF_OTHER_UPLOAD.get()); |
74 | 74 | prefOtherUpload.setToolTipText(tr("Show the informational tests in the upload check windows.")); |
75 | 75 | testPanel.add(prefOtherUpload, GBC.eol()); |
76 | 76 | |
… |
… |
public class ValidatorTestsPreference implements SubPreferenceSetting {
|
116 | 116 | |
117 | 117 | Main.pref.putCollection(ValidatorPreference.PREF_SKIP_TESTS, tests); |
118 | 118 | Main.pref.putCollection(ValidatorPreference.PREF_SKIP_TESTS_BEFORE_UPLOAD, testsBeforeUpload); |
119 | | Main.pref.put(ValidatorPreference.PREF_USE_IGNORE, prefUseIgnore.isSelected()); |
| 119 | ValidatorPreference.PREF_USE_IGNORE.put(prefUseIgnore.isSelected()); |
120 | 120 | ValidatorPreference.PREF_OTHER.put(prefOther.isSelected()); |
121 | | Main.pref.put(ValidatorPreference.PREF_OTHER_UPLOAD, prefOtherUpload.isSelected()); |
122 | | Main.pref.put(ValidatorPreference.PREF_LAYER, prefUseLayer.isSelected()); |
| 121 | ValidatorPreference.PREF_OTHER_UPLOAD.put(prefOtherUpload.isSelected()); |
| 122 | ValidatorPreference.PREF_LAYER.put(prefUseLayer.isSelected()); |
123 | 123 | return false; |
124 | 124 | } |
125 | 125 | |
diff --git a/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java b/test/unit/org/openstreetmap/josm/gui/dialogs/validator/ValidatorTreePanelTest.java
index 58fc137..abf7c21 100644
a
|
b
|
public class ValidatorTreePanelTest {
|
43 | 43 | new TestError(null, Severity.ERROR, "err", 0, new Node(1)), |
44 | 44 | new TestError(null, Severity.WARNING, "warn", 0, new Node(2))))); |
45 | 45 | assertNotNull(vtp); |
46 | | assertEquals(1, vtp.getUpdateCount()); |
47 | 46 | assertEquals(2, vtp.getErrors().size()); |
48 | 47 | vtp.setVisible(true); |
49 | 48 | vtp.setVisible(false); |