Class MoxelUtil

java.lang.Object
com._1c.g5.v8.dt.moxel.util.MoxelUtil

public final class MoxelUtil extends Object
Утилиты табличного документа.
  • Field Details

    • DEFAULT_MARGIN_LEFT

      public static final int DEFAULT_MARGIN_LEFT
      Default margins
      See Also:
    • DEFAULT_MARGIN_TOP

      public static final int DEFAULT_MARGIN_TOP
      See Also:
    • DEFAULT_MARGIN_RIGHT

      public static final int DEFAULT_MARGIN_RIGHT
      See Also:
    • DEFAULT_MARGIN_BOTTOM

      public static final int DEFAULT_MARGIN_BOTTOM
      See Also:
    • DEFAULT_HEADER_SIZE

      public static final int DEFAULT_HEADER_SIZE
      Default header and footer size
      See Also:
  • Constructor Details

    • MoxelUtil

      public MoxelUtil()
  • Method Details

    • applyFormat

      public static void applyFormat(ReadOnlyFormat src, Format dst)
      Применить формат формату. При этом из источника в приемник копируются только те свойства, которые установлены в источнике.
      Parameters:
      src - - формат - источник.
      dst - - формат - приемник.
    • applyFormatByMask

      public static void applyFormatByMask(ReadOnlyFormat src, long propertiesMask, Format dst)
      Apply format properties by properties mask
      Parameters:
      src - - ReadOnlyFormat - source format
      propertiesMask - - properties mask
      dst - - Format - destination format
    • compareFormats

      public static long compareFormats(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask)
      Сравнить форматы.
      Parameters:
      propertiesMask - - свойства, которые нужно сравнивать.
      Returns:
      маска, каждый бит в которой указывает одинаковые значения. Единица в бите означает, что свойства одинаковые.
    • compareLocalStrings

      public static boolean compareLocalStrings(LocalString string1, LocalString string2)
      Compare two instances of LocalString.
      Parameters:
      string1 - first string to compare. Must not be null.
      string2 - second string to compare. Must not be null.
      Returns:
      true if strings are equal, false otherwise.
    • getCell

      public static Cell getCell(SpreadsheetDocument document, int rowIndex, int columnIndex)
      Get document cell. If cell does not exist, create it.
      Parameters:
      document - SpreadsheetDocument, must not be null
      rowIndex - row index
      columnIndex - column index
      Returns:
      Cell, never null
    • getFormatByKey

      public static ReadOnlyFormat getFormatByKey(SpreadsheetDocument document, int formatIndex)
      Get format by key.
      Parameters:
      document - SpreadsheetDocument, must not be null
      formatIndex - format key
      Returns:
      ReadOnlyFormat, never null
    • getHorizontalSize

      public static int getHorizontalSize(SpreadsheetDocument document, int rowIndex)
      Get document horizontal size for specified row.
      Parameters:
      document - SpreadsheetDocument, must not be null
      rowIndex - row index
      Returns:
      document horizontal size for specified row
    • getPictureIndex

      public static int getPictureIndex(SpreadsheetDocument sheet, Picture picture)
      Get picture index
      Parameters:
      sheet - - SpreadsheetDocument
      picture - - Picture
    • getRowColumns

      public static Columns getRowColumns(SpreadsheetDocument document, int rowIndex)
      Get row columns.
      Parameters:
      document - SpreadsheetDocument, must not be null
      rowIndex - row index
      Returns:
      Columns, never null
    • getRowColumns

      public static Columns getRowColumns(SpreadsheetDocument document, Row row)
      Get row columns or default document columns.
      Parameters:
      document - the document, cannot be null
      row - the row, cannot be null
      Returns:
      the columns, cannot be null
    • getRowContent

      public static Row getRowContent(SpreadsheetDocument document, int rowIndex)
      Get row content. If row does not exist, create it.
      Parameters:
      document - SpreadsheetDocument, must not be null
      rowIndex - row index
      Returns:
      Row, never null
    • getShiftedCommentDrawingPosition

      public static SpreadsheetRect getShiftedCommentDrawingPosition(CommentDrawing commentDrawing)
      Получить позицию рисунка примечания.
    • isCellWithoutProperties

      public static boolean isCellWithoutProperties(Cell cell)
      Убедиться, что ячейка не содержит свойств.
    • isEmbedded

      public static boolean isEmbedded(SpreadsheetDocument document)
      Проверить, является ли документ встроенным.
    • isEmptyFormat

      public static boolean isEmptyFormat(Format format)
      Проверить, пустой ли формат.
    • isEmptyFormat

      public static boolean isEmptyFormat(ReadOnlyFormat format)
      Проверить, пустой ли формат.
    • isEmptyString

      public static boolean isEmptyString(LocalString string)
      Check if LocalString is empty.
      Parameters:
      string - LocalString, may be null
      Returns:
      true if local string is empty, false otherwise
    • normalizeFormattedString

      public static LocalString normalizeFormattedString(LocalString formattedString)
      Normalizes formatted string.
      Parameters:
      formattedString - the source formatted string, can be null
      Returns:
      the normalizes formatted string, can be null if source null
    • normalizeLocalString

      public static LocalString normalizeLocalString(LocalString localString)
      Normalizes local string to pure data.
      Parameters:
      localString - the source local string, can be null
      Returns:
      the normalizes local string, can be null if source null
    • getRuntimeVersion

      public static Version getRuntimeVersion(IDtProject dtProject)
      Returns dt-project runtime version or latest.
      Parameters:
      dtProject - the dt-project, cannot be null
      Returns:
      the dt-project runtime version or latest, never null
    • haveFormattedText

      public static boolean haveFormattedText(Cell cell)
      Normalizes local string to pure data.
      Parameters:
      localString - the source local string, can be null
      Returns:
      the normalizes local string, can be null if source null
    • getColorProvider

      public static IColorProvider getColorProvider()
      Gets actual service IColorProvider.
      Returns:
      actual service IColorProvider, cannot be null
    • getFontProvider

      public static IFontProvider getFontProvider()
      Gets actual service IFontProvider.
      Returns:
      actual service IFontProvider, cannot be null
    • getPresentationService

      public static IPresentationService getPresentationService()
      Returns presentation service.
      Returns:
      actual service IPresentationService, cannot be null
    • getRegistryColor

      public static Color getRegistryColor(ColorKind colorKind, String fqn, IDtProject dtProject)
      Returns registry color by kind and fq name.
      Parameters:
      colorKind - the color kind
      fqn - the color fq name, cannot be null
      dtProject - the dt-project, cannot be null
      Returns:
      the color, can be null
    • getRegistryColorByCompositeId

      public static Color getRegistryColorByCompositeId(ColorKind colorKind, CompositeId compositeId, IDtProject dtProject)
      Returns registry color by kind and fq name.
      Parameters:
      colorKind - the color kind
      fqn - the color fq name, cannot be null
      dtProject - the dt-project, cannot be null
      Returns:
      the color, can be null
    • getRegistryFont

      public static Font getRegistryFont(FontKind fontKind, String fqn, IDtProject dtProject)
      Returns registry font by kind and fq name.
      Parameters:
      fontKind - the font kind
      fqn - the font fq name, cannot be null
      dtProject - the dt-project, cannot be null
      Returns:
      the font, can be null
    • getRegistryFontByCompositeId

      public static Font getRegistryFontByCompositeId(FontKind fontKind, CompositeId fontId, IDtProject dtProject)
      Returns registry font by kind and composite id.
      Parameters:
      fontKind - the font kind
      fontId - the font id, cannot be null
      dtProject - the dt-project, cannot be null
      Returns:
      the font, can be null
    • getRegistryPictureByCompositeId

      public static Picture getRegistryPictureByCompositeId(CompositeId picId, IDtProject dtProject)
      Returns registry picture by composite id.
      Parameters:
      picId - the picture composite id, cannot be null
      dtProject - the dt-project, cannot be null
      Returns:
      the registry picture or null if nod founded