From 49534cbae4c8ffc6b9295c9b8555dc2681d3b202 Mon Sep 17 00:00:00 2001 From: Madeline Kahn Date: Tue, 14 May 2024 16:20:01 -0400 Subject: [PATCH] Modify feature settings changes --- .../datasource/configspec/ConfigSpec.java | 6 +---- src/main/java/gui/SettingsWindow.java | 6 +++-- src/main/resources/config-spec.json | 26 +++++++++---------- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/src/main/java/datasource/configspec/ConfigSpec.java b/src/main/java/datasource/configspec/ConfigSpec.java index 96f6f34..1e4b177 100644 --- a/src/main/java/datasource/configspec/ConfigSpec.java +++ b/src/main/java/datasource/configspec/ConfigSpec.java @@ -38,11 +38,11 @@ public static final class Section { private static final String DEFAULT_ENTITY_TYPE = "check"; public final String title; + public final String desc; private final String checkName; private final String entityType; private final List settings; - private final String desc; public Section(String title, String checkName, String desc, String entityTypeOverride, List settings) { if (title == null) {throw new NullPointerException("title");} @@ -60,10 +60,6 @@ public String getCheckName() { return this.checkName; } - public String getDesc() { - return this.desc; - } - public String getEntityType() { this.validateRepresentsCheck(); return this.entityType; diff --git a/src/main/java/gui/SettingsWindow.java b/src/main/java/gui/SettingsWindow.java index 893ebb1..195854a 100644 --- a/src/main/java/gui/SettingsWindow.java +++ b/src/main/java/gui/SettingsWindow.java @@ -203,9 +203,11 @@ private JPanel initInnerPanel() { private JLabel initTitleLabel(JPanel innerPanel, ConfigSpec.Section section) { JLabel titleLabel = GuiUtil.createHeading(section.title); - JLabel descLabel = new JLabel(section.getDesc()); innerPanel.add(titleLabel); - innerPanel.add(descLabel); + if (section.desc != null) { + JLabel descLabel = new JLabel(section.desc); + innerPanel.add(descLabel); + } innerPanel.add(Box.createVerticalStrut(GuiUtil.PAD)); return titleLabel; } diff --git a/src/main/resources/config-spec.json b/src/main/resources/config-spec.json index 8a99a84..f0291ff 100644 --- a/src/main/resources/config-spec.json +++ b/src/main/resources/config-spec.json @@ -25,67 +25,67 @@ "checkName": "namingConventions", "settings": [ { - "name": "Package", + "name": "convPackage", "type": "String", "select": "namingConvention" }, { - "name": "Class", + "name": "convClass", "type": "String", "select": "namingConvention" }, { - "name": "Interface", + "name": "convInterface", "type": "String", "select": "namingConvention" }, { - "name": "Abstract", + "name": "convAbstract", "type": "String", "select": "namingConvention" }, { - "name": "Enum", + "name": "convEnum", "type": "String", "select": "namingConvention" }, { - "name": "Field", + "name": "convField", "type": "String", "select": "namingConvention" }, { - "name": "Method", + "name": "convMethod", "type": "String", "select": "namingConvention" }, { - "name": "Constant", + "name": "convConstant", "type": "String", "select": "namingConvention" }, { - "name": "EnumConstant", + "name": "convEnumConstant", "type": "String", "select": "namingConvention" }, { - "name": "LocalVar", + "name": "convLocalVar", "type": "String", "select": "namingConvention" }, { - "name": "MethodParam", + "name": "convMethodParam", "type": "String", "select": "namingConvention" }, { - "name": "AllowEmptyPackage", + "name": "convAllowEmptyPackage", "type": "boolean", "desc": "Whether to allow empty package names, i.e. \"\". Defaults to false." }, { - "name": "MaxLength", + "name": "convMaxLength", "type": "int", "desc": "Maximum length. Default is no max." }