Class BslStringLiteralUtil

java.lang.Object
com._1c.g5.v8.dt.bsl.ui.BslStringLiteralUtil

public final class BslStringLiteralUtil extends Object
This class contains useful method for formatting content of the StringLiteral.
Restriction:
This class is not intended to be extended by clients.
  • Field Details

    • STRING_LITERAL_REFERENCE_OFFSET_SHIFT

      public static final int STRING_LITERAL_REFERENCE_OFFSET_SHIFT
      This number determinates that IReferenceDescription.getIndexInList() contains offset of the reference in StringLiteral. If IReferenceDescription.getIndexInList() less than this constant that means IReferenceDescription.getIndexInList() is number part of content of literal divided by dot. If IReferenceDescription.getIndexInList() more than this constant that means IReferenceDescription.getIndexInList() is offset of reference. Offset from beginning of Module: offset = IReferenceDescription.getIndexInList() - STRING_LITERAL_REFERENCE_OFFSET_SHIFT
      See Also:
  • Method Details

    • formatForStringLiteral

      public static String formatForStringLiteral(String content, int offset, org.eclipse.jface.text.IDocument doc, String lineSeparator)
      Transform text to the StringLiteral content in Bsl module
      Parameters:
      content - transforming content, can't be null
      offset - beginning position of the tranforming text in IDocument
      doc - IDocument of the transforming StringLiteral content, can't be null
      lineSeparator - line separator to use, can't be null
      Returns:
      text of the StringLiteral with service symbols "|", never null
    • getStringLiteralContent

      public static String getStringLiteralContent(String text)
      Gets content of the StringLiteral without "|"
      Parameters:
      text - text of StringLiteral, can't be null
      Returns:
      content of the StringLiteral without "|", never null
    • getStringLiteralContent

      public static String getStringLiteralContent(Collection<String> lines)
      Gets content of the StringLiteral without "|"
      Parameters:
      lines - - string lines of the StringLiteral, can't be null
      Returns:
      content of the StringLiteral without "|", never null