public abstract class CodeStyleFacade
extends java.lang.Object
Constructor and Description |
---|
CodeStyleFacade() |
Modifier and Type | Method and Description |
---|---|
abstract int |
getIndentSize(FileType fileType)
Deprecated.
Use
CodeStyle.getIndentSize(com.intellij.psi.PsiFile) instead. |
static CodeStyleFacade |
getInstance() |
static CodeStyleFacade |
getInstance(Project project) |
abstract int |
getJoinedLinesSpacing(Editor editor,
Language language,
int offset,
boolean allowDocCommit)
Calculates the spacing (in columns) for joined lines at given offset after join lines or smart backspace actions.
|
abstract java.lang.String |
getLineIndent(Document document,
int offset)
Deprecated.
Use
getLineIndent(Editor, Language, int, boolean) instead. |
java.lang.String |
getLineIndent(Editor editor,
Language language,
int offset,
boolean allowDocCommit)
Calculates the indent that should be used for the line at specified offset in the specified
editor.
|
abstract java.lang.String |
getLineSeparator()
Deprecated.
Use
getLineSeparator() method of CodeStyle.getSettings(PsiFile) or
CodeStyle.getSettings(Project) if there is no PsiFile |
abstract int |
getTabSize(FileType fileType)
Deprecated.
Use
CodeStyle.getIndentOptions(PsiFile).TAB_SIZE . See CodeStyle for more information |
abstract boolean |
useSpaceAfterComma(PsiFile psiFile,
Language language)
Determines whether a comma after space is needed for given
PsiFile in given Language context. |
abstract boolean |
useSpaceAroundAssignmentOperators(PsiFile psiFile,
Language language)
Determines whether assignment operator should be surrounded with spaces for given
PsiFile in given Language context. |
abstract boolean |
useSpaceBeforeComma(PsiFile psiFile,
Language language)
Determines whether a comma before space is needed for given
PsiFile in given Language context. |
abstract boolean |
useTabCharacter(FileType fileType)
Deprecated.
Use
CodeStyle.getIndentOptions(PsiFile).USE_TAB_CHARACTER . See CodeStyle for more information |
public static CodeStyleFacade getInstance()
public static CodeStyleFacade getInstance(Project project)
@Deprecated public abstract java.lang.String getLineIndent(Document document, int offset)
getLineIndent(Editor, Language, int, boolean)
instead.document
- the document for which the indent should be calculated.offset
- the caret offset in the editor.public java.lang.String getLineIndent(Editor editor, Language language, int offset, boolean allowDocCommit)
LineIndentProvider
for the language, it will be used to calculate the indent. Otherwise, if
allowDocCommit
flag is true, the method will use formatter on committed document.editor
- The editor for which the indent must be returned.language
- Context languageoffset
- The caret offset in the editor.allowDocCommit
- Allow calculation using committed document.
NOTE: Committing the document may be slow an cause performance issues on large files.
@Deprecated public abstract int getIndentSize(FileType fileType)
CodeStyle.getIndentSize(com.intellij.psi.PsiFile)
instead.public abstract int getJoinedLinesSpacing(Editor editor, Language language, int offset, boolean allowDocCommit)
LineIndentProvider
for the language,
it will be used to calculate the spacing. Otherwise, if
allowDocCommit
flag is true, the method will use formatter on committed document.editor
- The editor for which the spacing must be returned.language
- Context languageoffset
- Offset in the editor after the indent in the second joining line.allowDocCommit
- Allow calculation using committed document.
NOTE: Committing the document may be slow an cause performance issues on large files.
@Deprecated public abstract int getTabSize(FileType fileType)
CodeStyle.getIndentOptions(PsiFile).TAB_SIZE
. See CodeStyle for more information
@Deprecated public abstract boolean useTabCharacter(FileType fileType)
CodeStyle.getIndentOptions(PsiFile).USE_TAB_CHARACTER
. See CodeStyle for more information
@Deprecated public abstract java.lang.String getLineSeparator()
getLineSeparator()
method of CodeStyle.getSettings(PsiFile)
or
CodeStyle.getSettings(Project)
if there is no PsiFile
public abstract boolean useSpaceBeforeComma(PsiFile psiFile, Language language)
PsiFile
in given Language
context.psiFile
- File to determine settingslanguage
- Context languagepublic abstract boolean useSpaceAfterComma(PsiFile psiFile, Language language)
PsiFile
in given Language
context.psiFile
- File to determine settingslanguage
- Context languagepublic abstract boolean useSpaceAroundAssignmentOperators(PsiFile psiFile, Language language)
PsiFile
in given Language
context.psiFile
- File to determine settingslanguage
- Context language