package com.dubreuia.model;

import java.util.Arrays;
import java.util.Set;

import static java.util.stream.Collectors.toSet;

public enum Action {

    // Activation

    activate("Activate save actions on save (before saving each file, performs the configured actions below)", true),

    activateOnShortcut("Activate save actions on shortcut (default \"CTRL + SHIFT + S\")", false),

    noActionIfCompileErrors("No action if compile errors", false),

    // Global

    organizeImports("Optimize imports", true),

    reformat("Reformat file", true),

    reformatChangedCode("Reformat only changed code (only if VCS configured)", false),

    rearrange("Rearrange fields and methods (configured in \"Editor > Code Style > (...) > Arrangement\")", false),

    // Build

    compile("Compile file", false),

    // Java fixes

    fieldCanBeFinal("Add final to field", false),

    localCanBeFinal("Add final to local variable", false),

    methodMayBeStatic("Add static to method", false),

    unqualifiedFieldAccess("Add this to field access", false),

    unqualifiedMethodAccess("Add this to method access", false),

    unqualifiedStaticMemberAccess("Add class qualifier to static member access", false),

    customUnqualifiedStaticMemberAccess("Add class qualifier to static member access outside declaring class only", false),

    missingOverrideAnnotation("Add missing @Override annotations", false),

    useBlocks("Add blocks in if/while/for statements", false),

    generateSerialVersionUID("Add a serialVersionUID field for Serializable classes", false),

    unnecessaryThis("Remove unnecessary this", false),

    finalPrivateMethod("Remove final from private method", false),

    unnecessaryFinalOnLocalVariableOrParameter("Remove unnecessary final to local variable or parameter", false),

    explicitTypeCanBeDiamond("Remove explicit generic type for diamond", false),

    suppressAnnotation("Remove unused suppress warning annotation", false),

    unnecessarySemicolon("Remove unnecessary semicolon", false),

    accessCanBeTightened("Change visibility of field or method to lower access", false),

    //
    ;

    private final String text;

    private final boolean defaultValue;

    Action(String text, boolean defaultValue) {
        this.text = text;
        this.defaultValue = defaultValue;
    }

    public boolean isDefaultValue() {
        return defaultValue;
    }

    public String getText() {
        return text;
    }

    public static Set<Action> getDefaults() {
        return Arrays.stream(Action.values())
                .filter(Action::isDefaultValue)
                .collect(toSet());
    }
}
@@ -855,16 +855,25 @@
 d final 
+modifier 
 to field
@@ -911,24 +911,33 @@
 (%22Add final 
+modifier 
 to local var
@@ -941,16 +941,29 @@
 variable
+ or parameter
 %22, false
@@ -1000,16 +1000,25 @@
  static 
+modifier 
 to metho
@@ -1014,24 +1014,25 @@
 er to method
+s
 %22, false),%0A%0A
@@ -1478,18 +1478,18 @@
  blocks 
-in
+to
  if/whil
@@ -1655,16 +1655,36 @@
 ary this
+ to field and method
 %22, false

Update UI test for java fixes