Skip to content

Commit

Permalink
Modify feature settings changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mkacct committed May 14, 2024
1 parent 4491613 commit 49534cb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
6 changes: 1 addition & 5 deletions src/main/java/datasource/configspec/ConfigSpec.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Setting> settings;
private final String desc;

public Section(String title, String checkName, String desc, String entityTypeOverride, List<Setting> settings) {
if (title == null) {throw new NullPointerException("title");}
Expand All @@ -60,10 +60,6 @@ public String getCheckName() {
return this.checkName;
}

public String getDesc() {
return this.desc;
}

public String getEntityType() {
this.validateRepresentsCheck();
return this.entityType;
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/gui/SettingsWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
26 changes: 13 additions & 13 deletions src/main/resources/config-spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}
Expand Down

0 comments on commit 49534cb

Please sign in to comment.