2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.codeInsight
.folding
.impl
;
18 import com
.intellij
.codeInsight
.folding
.CodeFoldingSettings
;
19 import com
.intellij
.codeInsight
.folding
.JavaCodeFoldingSettings
;
20 import com
.intellij
.ide
.IdeBundle
;
21 import com
.intellij
.openapi
.application
.PathManager
;
22 import com
.intellij
.openapi
.components
.ExportableComponent
;
23 import com
.intellij
.openapi
.components
.PersistentStateComponent
;
24 import com
.intellij
.openapi
.components
.State
;
25 import com
.intellij
.openapi
.components
.Storage
;
26 import com
.intellij
.util
.xmlb
.XmlSerializerUtil
;
27 import org
.jetbrains
.annotations
.NotNull
;
32 name
="JavaCodeFoldingSettings",
36 file
= "$APP_CONFIG$/editor.codeinsight.xml"
39 public class JavaCodeFoldingSettingsImpl
extends JavaCodeFoldingSettings
implements PersistentStateComponent
<JavaCodeFoldingSettingsImpl
>,
41 public boolean isCollapseImports() {
42 return CodeFoldingSettings
.getInstance().COLLAPSE_IMPORTS
;
45 public void setCollapseImports(boolean value
) {
46 CodeFoldingSettings
.getInstance().COLLAPSE_IMPORTS
= value
;
50 public boolean isCollapseLambdas() {
51 return COLLAPSE_CLOSURES
;
54 public void setCollapseLambdas(boolean value
) {
55 COLLAPSE_CLOSURES
= value
;
58 public boolean isCollapseConstructorGenericParameters() {
59 return COLLAPSE_CONSTRUCTOR_GENERIC_PARAMETERS
;
62 public void setCollapseConstructorGenericParameters(boolean value
) {
63 COLLAPSE_CONSTRUCTOR_GENERIC_PARAMETERS
= value
;
66 public boolean isCollapseMethods() {
67 return CodeFoldingSettings
.getInstance().COLLAPSE_METHODS
;
70 public void setCollapseMethods(boolean value
) {
71 CodeFoldingSettings
.getInstance().COLLAPSE_METHODS
= value
;
74 public boolean isCollapseAccessors() {
75 return COLLAPSE_ACCESSORS
;
78 public void setCollapseAccessors(boolean value
) {
79 COLLAPSE_ACCESSORS
= value
;
82 public boolean isCollapseInnerClasses() {
83 return COLLAPSE_INNER_CLASSES
;
86 public void setCollapseInnerClasses(boolean value
) {
87 COLLAPSE_INNER_CLASSES
= value
;
90 public boolean isCollapseJavadocs() {
91 return CodeFoldingSettings
.getInstance().COLLAPSE_DOC_COMMENTS
;
94 public void setCollapseJavadocs(boolean value
) {
95 CodeFoldingSettings
.getInstance().COLLAPSE_DOC_COMMENTS
= value
;
98 public boolean isCollapseFileHeader() {
99 return CodeFoldingSettings
.getInstance().COLLAPSE_FILE_HEADER
;
102 public void setCollapseFileHeader(boolean value
) {
103 CodeFoldingSettings
.getInstance().COLLAPSE_FILE_HEADER
= value
;
106 public boolean isCollapseAnonymousClasses() {
107 return COLLAPSE_ANONYMOUS_CLASSES
;
110 public void setCollapseAnonymousClasses(boolean value
) {
111 COLLAPSE_ANONYMOUS_CLASSES
= value
;
115 public boolean isCollapseAnnotations() {
116 return COLLAPSE_ANNOTATIONS
;
119 public void setCollapseAnnotations(boolean value
) {
120 COLLAPSE_ANNOTATIONS
= value
;
123 public boolean isCollapseI18nMessages() {
124 return COLLAPSE_I18N_MESSAGES
;
127 public void setCollapseI18nMessages(boolean value
) {
128 COLLAPSE_I18N_MESSAGES
= value
;
131 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ACCESSORS
= false;
132 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_INNER_CLASSES
= false;
133 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANONYMOUS_CLASSES
= false;
134 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_ANNOTATIONS
= false;
135 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_CLOSURES
= false;
136 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_CONSTRUCTOR_GENERIC_PARAMETERS
= true;
137 @SuppressWarnings({"WeakerAccess"}) public boolean COLLAPSE_I18N_MESSAGES
= true;
140 public File
[] getExportFiles() {
141 return new File
[]{PathManager
.getOptionsFile("editor.codeinsight")};
145 public String
getPresentableName() {
146 return IdeBundle
.message("code.folding.settings");
149 public JavaCodeFoldingSettingsImpl
getState() {
153 public void loadState(final JavaCodeFoldingSettingsImpl state
) {
154 XmlSerializerUtil
.copyBean(state
, this);