EditorConfig documentation test
[idea/community.git] / java / java-impl / src / com / intellij / refactoring / JavaRefactoringSettings.java
1 // Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
2 package com.intellij.refactoring;
3
4 import com.intellij.openapi.components.PersistentStateComponent;
5 import com.intellij.openapi.components.ServiceManager;
6 import com.intellij.openapi.components.State;
7 import com.intellij.openapi.components.Storage;
8 import com.intellij.util.xmlb.XmlSerializerUtil;
9 import org.jetbrains.annotations.NotNull;
10
11 @State(name = "RefactoringSettings", storages = {
12   @Storage("baseRefactoring.xml"),
13   @Storage(value = "other.xml", deprecated = true),
14 })
15 public class JavaRefactoringSettings implements PersistentStateComponent<JavaRefactoringSettings> {
16   // properties should be public in order to get saved by DefaultExternalizable implementation
17
18   //public boolean RENAME_PREVIEW_USAGES = true;
19   public boolean RENAME_SEARCH_IN_COMMENTS_FOR_PACKAGE = false;
20   public boolean RENAME_SEARCH_IN_COMMENTS_FOR_CLASS = false;
21   public boolean RENAME_SEARCH_IN_COMMENTS_FOR_METHOD = false;
22   public boolean RENAME_SEARCH_IN_COMMENTS_FOR_FIELD = false;
23   public boolean RENAME_SEARCH_IN_COMMENTS_FOR_VARIABLE = true;
24
25   public boolean RENAME_SEARCH_FOR_TEXT_FOR_PACKAGE = true;
26   public boolean RENAME_SEARCH_FOR_TEXT_FOR_CLASS = true;
27   public boolean RENAME_SEARCH_FOR_TEXT_FOR_METHOD = false;
28   public boolean RENAME_SEARCH_FOR_TEXT_FOR_FIELD = false;
29   public boolean RENAME_SEARCH_FOR_TEXT_FOR_VARIABLE = true;
30
31   //public boolean ENCAPSULATE_FIELDS_PREVIEW_USAGES = true;
32   public boolean ENCAPSULATE_FIELDS_USE_ACCESSORS_WHEN_ACCESSIBLE = true;
33
34   public boolean EXTRACT_INTERFACE_PREVIEW_USAGES = true;
35
36   public boolean MOVE_PREVIEW_USAGES = true;
37   public boolean MOVE_SEARCH_IN_COMMENTS = true;
38   public boolean MOVE_SEARCH_FOR_TEXT = true;
39
40
41   //public boolean INLINE_METHOD_PREVIEW_USAGES = true;
42   //public boolean INLINE_FIELD_PREVIEW_USAGES = true;
43
44   //public boolean CHANGE_SIGNATURE_PREVIEW_USAGES = true;
45   public boolean CHANGE_CLASS_SIGNATURE_PREVIEW_USAGES = true;
46
47   public boolean MOVE_INNER_PREVIEW_USAGES = true;
48
49   //public boolean TYPE_COOK_PREVIEW_USAGES = true;
50   public boolean TYPE_COOK_DROP_CASTS = true;
51   public boolean TYPE_COOK_PRESERVE_RAW_ARRAYS = true;
52   public boolean TYPE_COOK_LEAVE_OBJECT_PARAMETERIZED_TYPES_RAW = true;
53   public boolean TYPE_COOK_EXHAUSTIVE;
54   public boolean TYPE_COOK_COOK_OBJECTS;
55   public boolean TYPE_COOK_PRODUCE_WILDCARDS;
56
57   public boolean TYPE_MIGRATION_PREVIEW_USAGES = true;
58
59   //public boolean MAKE_METHOD_STATIC_PREVIEW_USAGES;
60   //public boolean INTRODUCE_PARAMETER_PREVIEW_USAGES;
61   public int INTRODUCE_PARAMETER_REPLACE_FIELDS_WITH_GETTERS;
62   public int EXTRACT_INTERFACE_JAVADOC;
63   public int EXTRACT_SUPERCLASS_JAVADOC;
64   public boolean TURN_REFS_TO_SUPER_PREVIEW_USAGES;
65   public boolean INTRODUCE_PARAMETER_DELETE_LOCAL_VARIABLE;
66   public boolean INTRODUCE_PARAMETER_USE_INITIALIZER;
67   public String INTRODUCE_FIELD_VISIBILITY;
68   public int PULL_UP_MEMBERS_JAVADOC;
69   public boolean PUSH_DOWN_PREVIEW_USAGES;
70   public boolean INLINE_METHOD_THIS;
71   public boolean INLINE_SUPER_CLASS_THIS;
72   public boolean INLINE_FIELD_THIS;
73   public boolean INLINE_LOCAL_THIS;
74   //public boolean INHERITANCE_TO_DELEGATION_PREVIEW_USAGES;
75   public boolean INHERITANCE_TO_DELEGATION_DELEGATE_OTHER;
76   //public boolean REPLACE_CONSTRUCTOR_WITH_FACTORY_PREVIEW_USAGES;
77   public String INTRODUCE_CONSTANT_VISIBILITY;
78   public boolean INTRODUCE_CONSTANT_MOVE_TO_ANOTHER_CLASS;
79   public boolean CONVERT_TO_INSTANCE_METHOD_PREVIEW_USAGES = true;
80
81   public Boolean INTRODUCE_LOCAL_CREATE_FINALS;
82   public Boolean INTRODUCE_LOCAL_CREATE_VAR_TYPE = false;
83   public Boolean INTRODUCE_PARAMETER_CREATE_FINALS;
84
85   public boolean INLINE_CLASS_SEARCH_IN_COMMENTS = true;
86   public boolean INLINE_CLASS_SEARCH_IN_NON_JAVA = true;
87
88   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_INHERITORS = true;
89   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_PARAMETER_IN_HIERARCHY = true;
90   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_VARIABLES = true;
91   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_TESTS = true;
92   @SuppressWarnings({"WeakerAccess"}) public boolean RENAME_OVERLOADS = true;
93
94   public static JavaRefactoringSettings getInstance() {
95     return ServiceManager.getService(JavaRefactoringSettings.class);
96   }
97
98   public boolean isToRenameInheritors() {
99     return RENAME_INHERITORS;
100   }
101
102   public boolean isToRenameVariables() {
103     return RENAME_VARIABLES;
104   }
105
106   public void setRenameInheritors(final boolean RENAME_INHERITORS) {
107     this.RENAME_INHERITORS = RENAME_INHERITORS;
108   }
109
110   public void setRenameVariables(final boolean RENAME_VARIABLES) {
111     this.RENAME_VARIABLES = RENAME_VARIABLES;
112   }
113
114   public boolean isRenameParameterInHierarchy() {
115     return RENAME_PARAMETER_IN_HIERARCHY;
116   }
117
118   public void setRenameParameterInHierarchy(boolean rename) {
119     this.RENAME_PARAMETER_IN_HIERARCHY = rename;
120   }
121
122   @Override
123   public JavaRefactoringSettings getState() {
124     return this;
125   }
126
127   @Override
128   public void loadState(@NotNull JavaRefactoringSettings state) {
129     XmlSerializerUtil.copyBean(state, this);
130   }
131
132   public boolean isToRenameTests() {
133     return RENAME_TESTS;
134   }
135
136   public void setRenameTests(boolean renameTests) {
137     this.RENAME_TESTS = renameTests;
138   }
139
140   public void setRenameOverloads(boolean renameOverloads) {
141     RENAME_OVERLOADS = renameOverloads;
142   }
143
144   public boolean isRenameOverloads() {
145     return RENAME_OVERLOADS;
146   }
147 }