Class BslCommentUiUtils
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.ui.contentassist.BslCommentUiUtils
-
public final class BslCommentUiUtils extends Object
Contains method for working with comment template in BSL- Restriction:
- This class is not intended to be sub-classed by clients.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBslCommentUiUtils.TemplateDescriptionContains information about created templates for comment in BSL
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.eclipse.xtext.util.Triple<Integer,Integer,String>computeCommentLocalPosition(org.eclipse.jface.text.IDocument document, int globalOffSet, org.eclipse.xtext.nodemodel.INode commentStartNode)Computes local offset on the comment line by global offset and start comment nodestatic BslCommentUiUtils.TemplateDescriptioncreateEmptyTemplate(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, boolean isFunc, String lineFormatter, String indent, ScriptVariant lang, IV8ProjectManager v8projectManager, boolean oldFormat)Create comment template for method in BSL.static BslCommentUiUtils.TemplateDescriptioncreateOrUpdateTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)Creates or update template based onMethod.static BslCommentUiUtils.TemplateDescriptioncreateTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)Creates template based onMethod.static StringcreateTemplateTextForMethod(Method method, String descr, String lineFormatter, String indent, TypesComputer typesComputer, IV8ProjectManager v8projectManager, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, boolean isRussian)Creates template based onMethodstatic BslDocumentationProvider.DocumentContentparseTemplateComment(List<String> template, Method method, BslDocumentationProvider documentation, boolean oldFormat)Parses comment for method.
-
-
-
Method Detail
-
createEmptyTemplate
public static BslCommentUiUtils.TemplateDescription createEmptyTemplate(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, boolean isFunc, String lineFormatter, String indent, ScriptVariant lang, IV8ProjectManager v8projectManager, boolean oldFormat)
Create comment template for method in BSL.- Parameters:
doc- needs to createLinkedPosition, can't benullposInsert- supposed position of the template insertingmethod- method in BSL, may benullisFunc- true, if need template for function, false - for procedurelineFormatter- actual format string, can't benullindent- actual text editor indent, can't benulllang- actual script variant, can't benullv8projectManager- theIV8ProjectManager, can't benulloldFormat-trueif comment should be in old format,falsein new format- Returns:
- description of created template
BslCommentUiUtils.TemplateDescription, nevernull
-
createTemplateForMethod
public static BslCommentUiUtils.TemplateDescription createTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)
Creates template based onMethod.- Parameters:
doc- needs to createLinkedPosition, can't benullposInsert- supposed position of the template insertingmethod- method in BSL, can't benulllineFormatter- actual format string, can't benullindent- actual text editor indent, can't benulltypesComputer- actualTypesComputer, cannot benullcommentProvider- actualBslMultiLineCommentDocumentationProvider, can't benullv8projectManager-IV8ProjectManager, can't benulloldFormat-trueif comment should be in old format,falsein new format- Returns:
- description of created template
BslCommentUiUtils.TemplateDescription, nevernull
-
createOrUpdateTemplateForMethod
public static BslCommentUiUtils.TemplateDescription createOrUpdateTemplateForMethod(org.eclipse.jface.text.IDocument doc, int posInsert, Method method, String lineFormatter, String indent, TypesComputer typesComputer, BslMultiLineCommentDocumentationProvider commentProvider, IV8ProjectManager v8projectManager, boolean oldFormat)
Creates or update template based onMethod.- Parameters:
doc- needs to createLinkedPosition, can't benullposInsert- supposed position of the template insertingmethod- method in BSL, can't benulllineFormatter- actual format string, can't benullindent- actual text editor indent, can't benulltypesComputer- actualTypesComputer, cannot benullcommentProvider- actualBslMultiLineCommentDocumentationProvider, can't benullv8projectManager-IV8ProjectManager, can't benulloldFormat-trueif comment should be in old format,falsein new format- Returns:
- description of created template
BslCommentUiUtils.TemplateDescription, nevernull
-
createTemplateTextForMethod
public static String createTemplateTextForMethod(Method method, String descr, String lineFormatter, String indent, TypesComputer typesComputer, IV8ProjectManager v8projectManager, BslMultiLineCommentDocumentationProvider commentProvider, boolean oldFormat, boolean isRussian)
Creates template based onMethod- Parameters:
method- method in BSL, can't benulldescr- comment main description? cannot benulllineFormatter- actual format string, can't benullindent- actual text editor indent, can't benulltypesComputer- actualTypesComputer, cannot benullv8projectManager-IV8ProjectManager, can't benulloldFormat-trueif comment should be in old format,falsein new formatisRussian-trueif keywords in comment should be in Russian language,falsein English- Returns:
- string content of the created comment, never
null
-
parseTemplateComment
public static BslDocumentationProvider.DocumentContent parseTemplateComment(List<String> template, Method method, BslDocumentationProvider documentation, boolean oldFormat)
Parses comment for method.- Parameters:
template- comment content by lines, cannot benullmethod- corresponding Bsl method, cannot benulldocumentation- needs for getting English name ofTypes, cannot benulloldFormat-trueif comment should be in old format,falsein new format- Returns:
- content of the comment, never
null
-
computeCommentLocalPosition
public static org.eclipse.xtext.util.Triple<Integer,Integer,String> computeCommentLocalPosition(org.eclipse.jface.text.IDocument document, int globalOffSet, org.eclipse.xtext.nodemodel.INode commentStartNode)
Computes local offset on the comment line by global offset and start comment node- Parameters:
document- actual document, cannot benullglobalOffSet- global offset of the position comment part in documentfirstDocumentNode- first node of the comment content, cannot benull- Returns:
- line number - current line number from the beginin comment content
- local offset - offset on the line in comment
- line content - whole line comment content
nullin caseglobalOffSetor position ofcommentStartNodeis a non-existing position for document
-
-