1 package com
.intellij
.codeInsight
;
3 import com
.intellij
.openapi
.application
.ApplicationManager
;
4 import com
.intellij
.openapi
.application
.PathManager
;
5 import com
.intellij
.openapi
.components
.ExportableApplicationComponent
;
6 import com
.intellij
.openapi
.util
.DefaultJDOMExternalizer
;
7 import com
.intellij
.openapi
.util
.InvalidDataException
;
8 import com
.intellij
.openapi
.util
.NamedJDOMExternalizable
;
9 import com
.intellij
.openapi
.util
.WriteExternalException
;
10 import com
.intellij
.util
.xmlb
.annotations
.AbstractCollection
;
11 import com
.intellij
.util
.xmlb
.annotations
.Property
;
12 import org
.jdom
.Element
;
13 import org
.jetbrains
.annotations
.NonNls
;
14 import org
.jetbrains
.annotations
.NotNull
;
15 import org
.jetbrains
.annotations
.Nullable
;
18 import java
.util
.List
;
20 public class CodeInsightSettings
implements NamedJDOMExternalizable
, Cloneable
, ExportableApplicationComponent
{
21 @NonNls private static final String EXCLUDED_PACKAGE
= "EXCLUDED_PACKAGE";
22 @NonNls private static final String ATTRIBUTE_NAME
= "NAME";
23 @NonNls public static final String EXTERNAL_FILE_NAME
= "editor.codeinsight";
25 public static CodeInsightSettings
getInstance() {
26 return ApplicationManager
.getApplication().getComponent(CodeInsightSettings
.class);
30 public String
getComponentName() {
31 return "CodeInsightSettings";
34 public String
getExternalFileName() {
35 return EXTERNAL_FILE_NAME
;
39 public File
[] getExportFiles() {
40 return new File
[]{PathManager
.getOptionsFile(this)};
44 public String
getPresentableName() {
45 return CodeInsightBundle
.message("codeinsight.settings");
49 public CodeInsightSettings
clone() {
51 return (CodeInsightSettings
)super.clone();
53 catch (CloneNotSupportedException e
) {
58 public boolean AUTO_POPUP_MEMBER_LOOKUP
= true;
59 public int MEMBER_LOOKUP_DELAY
= 1000;
60 public boolean AUTO_POPUP_XML_LOOKUP
= true;
61 public int XML_LOOKUP_DELAY
= 0;
62 public boolean AUTO_POPUP_PARAMETER_INFO
= true;
63 public int PARAMETER_INFO_DELAY
= 1000;
64 public boolean AUTO_POPUP_JAVADOC_INFO
= false;
65 public int JAVADOC_INFO_DELAY
= 1000;
66 public boolean AUTO_POPUP_JAVADOC_LOOKUP
= true;
67 public int JAVADOC_LOOKUP_DELAY
= 1000;
69 public int COMPLETION_CASE_SENSITIVE
= FIRST_LETTER
; // ALL, NONE or FIRST_LETTER
70 public static final int ALL
= 1;
71 public static final int NONE
= 2;
72 public static final int FIRST_LETTER
= 3;
74 public boolean AUTOCOMPLETE_ON_CODE_COMPLETION
= true;
75 public boolean AUTOCOMPLETE_ON_SMART_TYPE_COMPLETION
= true;
76 public boolean AUTOCOMPLETE_ON_CLASS_NAME_COMPLETION
= false;
77 public boolean AUTOCOMPLETE_COMMON_PREFIX
= true;
78 public boolean INSERT_SINGLE_PARENTH
= false;
79 public boolean INSERT_DOUBLE_PARENTH_WHEN_NO_ARGS
= false;
80 public boolean SHOW_STATIC_AFTER_INSTANCE
= false;
82 public boolean SHOW_SIGNATURES_IN_LOOKUPS
= true;
83 public int LOOKUP_HEIGHT
= 11;
85 public boolean SHOW_FULL_SIGNATURES_IN_PARAMETER_INFO
= false;
87 public boolean SMART_INDENT_ON_ENTER
= true;
88 public boolean INSERT_BRACE_ON_ENTER
= true;
89 public boolean INSERT_SCRIPTLET_END_ON_ENTER
= true;
90 public boolean JAVADOC_STUB_ON_ENTER
= true;
92 public boolean SMART_END_ACTION
= true;
94 public boolean AUTOINSERT_PAIR_BRACKET
= true;
95 public boolean AUTOINSERT_PAIR_QUOTE
= true;
97 public int REFORMAT_ON_PASTE
= INDENT_BLOCK
;
98 public static final int NO_REFORMAT
= 1;
99 public static final int INDENT_BLOCK
= 2;
100 public static final int INDENT_EACH_LINE
= 3;
101 public static final int REFORMAT_BLOCK
= 4;
103 public int ADD_IMPORTS_ON_PASTE
= ASK
; // YES, NO or ASK
104 public static final int YES
= 1;
105 public static final int NO
= 2;
106 public static final int ASK
= 3;
108 public boolean HIGHLIGHT_BRACES
= true;
109 public boolean HIGHLIGHT_SCOPE
= false;
111 public boolean USE_INSTANCEOF_ON_EQUALS_PARAMETER
= false;
113 @Property(surroundWithTag
= false)
115 surroundWithTag
= false,
116 elementTag
= "EXCLUDED_PACKAGE",
117 elementValueAttribute
= "NAME"
119 public String
[] EXCLUDED_PACKAGES
= new String
[0];
121 public CodeInsightSettings() {
124 public void initComponent() { }
126 public void disposeComponent() {
129 public void readExternal(Element element
) throws InvalidDataException
{
130 DefaultJDOMExternalizer
.readExternal(this, element
);
131 final List list
= element
.getChildren(EXCLUDED_PACKAGE
);
132 EXCLUDED_PACKAGES
= new String
[list
.size()];
133 for(int i
=0; i
<list
.size(); i
++) {
134 EXCLUDED_PACKAGES
[i
] = ((Element
) list
.get(i
)).getAttributeValue(ATTRIBUTE_NAME
);
138 public void writeExternal(Element element
) throws WriteExternalException
{
139 DefaultJDOMExternalizer
.writeExternal(this, element
);
140 for(String s
: EXCLUDED_PACKAGES
) {
141 final Element child
= new Element(EXCLUDED_PACKAGE
);
142 child
.setAttribute(ATTRIBUTE_NAME
, s
);
143 element
.addContent(child
);