1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui.preferences.validator;
|
---|
3 |
|
---|
4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
---|
5 |
|
---|
6 | import javax.swing.JTabbedPane;
|
---|
7 |
|
---|
8 | import org.openstreetmap.josm.data.preferences.BooleanProperty;
|
---|
9 | import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
|
---|
10 | import org.openstreetmap.josm.gui.preferences.PreferenceSetting;
|
---|
11 | import org.openstreetmap.josm.gui.preferences.PreferenceSettingFactory;
|
---|
12 | import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
|
---|
13 | import org.openstreetmap.josm.tools.GBC;
|
---|
14 |
|
---|
15 | /**
|
---|
16 | * Preference settings for the validator.
|
---|
17 | *
|
---|
18 | * @author frsantos
|
---|
19 | */
|
---|
20 | public final class ValidatorPreference extends DefaultTabPreferenceSetting {
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Factory used to create a new {@code ValidatorPreference}.
|
---|
24 | */
|
---|
25 | public static class Factory implements PreferenceSettingFactory {
|
---|
26 | @Override
|
---|
27 | public PreferenceSetting createPreferenceSetting() {
|
---|
28 | return new ValidatorPreference();
|
---|
29 | }
|
---|
30 | }
|
---|
31 |
|
---|
32 | private ValidatorPreference() {
|
---|
33 | super(/* ICON(preferences/) */ "validator", tr("Data validator"),
|
---|
34 | tr("An OSM data validator that checks for common errors made by users and editor programs."),
|
---|
35 | false, new JTabbedPane());
|
---|
36 | }
|
---|
37 |
|
---|
38 | /** The preferences prefix */
|
---|
39 | public static final String PREFIX = "validator";
|
---|
40 |
|
---|
41 | /** The preferences key for error layer */
|
---|
42 | public static final BooleanProperty PREF_LAYER = new BooleanProperty(PREFIX + ".layer", true);
|
---|
43 |
|
---|
44 | /** The preferences key for enabled tests */
|
---|
45 | public static final String PREF_SKIP_TESTS = PREFIX + ".skip";
|
---|
46 |
|
---|
47 | /** The preferences key for enabled tests */
|
---|
48 | public static final BooleanProperty PREF_USE_IGNORE = new BooleanProperty(PREFIX + ".ignore", true);
|
---|
49 |
|
---|
50 | /** The preferences key for enabled tests before upload*/
|
---|
51 | public static final String PREF_SKIP_TESTS_BEFORE_UPLOAD = PREFIX + ".skipBeforeUpload";
|
---|
52 |
|
---|
53 | /** The preferences key for ignored severity other on upload */
|
---|
54 | public static final BooleanProperty PREF_OTHER_UPLOAD = new BooleanProperty(PREFIX + ".otherUpload", false);
|
---|
55 |
|
---|
56 | /** The preferences for ignored severity other */
|
---|
57 | public static final BooleanProperty PREF_OTHER = new BooleanProperty(PREFIX + ".other", false);
|
---|
58 |
|
---|
59 | /**
|
---|
60 | * The preferences key for enabling the permanent filtering
|
---|
61 | * of the displayed errors in the tree regarding the current selection
|
---|
62 | */
|
---|
63 | public static final String PREF_FILTER_BY_SELECTION = PREFIX + ".selectionFilter";
|
---|
64 |
|
---|
65 | @Override
|
---|
66 | public void addGui(PreferenceTabbedPane gui) {
|
---|
67 | gui.createPreferenceTab(this).add(getTabPane(), GBC.eol().fill(GBC.BOTH));
|
---|
68 | }
|
---|
69 |
|
---|
70 | @Override
|
---|
71 | public boolean ok() {
|
---|
72 | return false;
|
---|
73 | }
|
---|
74 | }
|
---|