public boolean isCollapsedByDefault(@NotNull ASTNode node) { CodeFoldingSettings settings = CodeFoldingSettings.getInstance(); final PsiElement element = SourceTreeToPsiMap.treeElementToPsi(node); if (element instanceof PsiComment) { // find out if file header final ASTNode parent = node.getTreeParent(); ASTNode treePrev = node.getTreePrev(); if (parent.getElementType() == CfmlElementTypes.CFML_FILE && treePrev == null) { return CodeFoldingSettings.getInstance().COLLAPSE_FILE_HEADER; } else { return CodeFoldingSettings.getInstance().COLLAPSE_DOC_COMMENTS; } } else if (element instanceof CfmlFunction || node.getElementType() == CfmlElementTypes.FUNCTIONBODY) { return settings.COLLAPSE_METHODS; } /* else if (element instanceof CfmlComponent) { return settings.isCollapseClasses(); }*/ return false; }
@Override public void setCollapseMethods(boolean value) { CodeFoldingSettings.getInstance().COLLAPSE_METHODS = value; }
@Override public void setCollapseImports(boolean value) { CodeFoldingSettings.getInstance().COLLAPSE_IMPORTS = value; }
@Override public boolean isCollapseMethods() { return CodeFoldingSettings.getInstance().COLLAPSE_METHODS; }
@Override public boolean isCollapseImports() { return CodeFoldingSettings.getInstance().COLLAPSE_IMPORTS; }
@Override public void setCollapseFileHeader(boolean value) { CodeFoldingSettings.getInstance().COLLAPSE_FILE_HEADER = value; }
@Override public boolean isCollapseFileHeader() { return CodeFoldingSettings.getInstance().COLLAPSE_FILE_HEADER; }
@Override public void setCollapseJavadocs(boolean value) { CodeFoldingSettings.getInstance().COLLAPSE_DOC_COMMENTS = value; }
@Override public boolean isCollapseJavadocs() { return CodeFoldingSettings.getInstance().COLLAPSE_DOC_COMMENTS; }