Package com._1c.g5.v8.dt.moxel.util
Class MoxelUtil
java.lang.Object
com._1c.g5.v8.dt.moxel.util.MoxelUtil
Утилиты табличного документа.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
Default header and footer sizestatic final int
static final int
Default marginsstatic final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
applyFormat
(ReadOnlyFormat src, Format dst) Применить формат формату.static void
applyFormatByMask
(ReadOnlyFormat src, long propertiesMask, Format dst) Apply format properties by properties maskstatic long
compareFormats
(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask) Сравнить форматы.static boolean
compareLocalStrings
(LocalString string1, LocalString string2) Compare two instances ofLocalString
.static Cell
getCell
(SpreadsheetDocument document, int rowIndex, int columnIndex) Get document cell.static IColorProvider
Gets actual serviceIColorProvider
.static IFontProvider
Gets actual serviceIFontProvider
.static ReadOnlyFormat
getFormatByKey
(SpreadsheetDocument document, int formatIndex) Get format by key.static int
getHorizontalSize
(SpreadsheetDocument document, int rowIndex) Get document horizontal size for specified row.static int
getPictureIndex
(SpreadsheetDocument sheet, Picture picture) Get picture indexstatic IPresentationService
Returns presentation service.static Color
getRegistryColor
(ColorKind colorKind, String fqn, IDtProject dtProject) Returns registry color by kind and fq name.static Color
getRegistryColorByCompositeId
(ColorKind colorKind, CompositeId compositeId, IDtProject dtProject) Returns registry color by kind and fq name.static Font
getRegistryFont
(FontKind fontKind, String fqn, IDtProject dtProject) Returns registry font by kind and fq name.static Font
getRegistryFontByCompositeId
(FontKind fontKind, CompositeId fontId, IDtProject dtProject) Returns registry font by kind and composite id.static Picture
getRegistryPictureByCompositeId
(CompositeId picId, IDtProject dtProject) Returns registry picture by composite id.static Columns
getRowColumns
(SpreadsheetDocument document, int rowIndex) Get row columns.static Columns
getRowColumns
(SpreadsheetDocument document, Row row) Get row columns or default document columns.static Row
getRowContent
(SpreadsheetDocument document, int rowIndex) Get row content.static Version
getRuntimeVersion
(IDtProject dtProject) Returns dt-project runtime version or latest.static SpreadsheetRect
getShiftedCommentDrawingPosition
(CommentDrawing commentDrawing) Получить позицию рисунка примечания.static boolean
haveFormattedText
(Cell cell) Normalizes local string to pure data.static boolean
isCellWithoutProperties
(Cell cell) Убедиться, что ячейка не содержит свойств.static boolean
isEmbedded
(SpreadsheetDocument document) Проверить, является ли документ встроенным.static boolean
isEmptyFormat
(Format format) Проверить, пустой ли формат.static boolean
isEmptyFormat
(ReadOnlyFormat format) Проверить, пустой ли формат.static boolean
isEmptyString
(LocalString string) Check ifLocalString
is empty.static LocalString
normalizeFormattedString
(LocalString formattedString) Normalizes formatted string.static LocalString
normalizeLocalString
(LocalString localString) Normalizes local string to pure data.
-
Field Details
-
DEFAULT_MARGIN_LEFT
public static final int DEFAULT_MARGIN_LEFTDefault 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_SIZEDefault header and footer size- See Also:
-
DEFAULT_FOOTER_SIZE
public static final int DEFAULT_FOOTER_SIZE- See Also:
-
-
Constructor Details
-
MoxelUtil
public MoxelUtil()
-
-
Method Details
-
applyFormat
Применить формат формату. При этом из источника в приемник копируются только те свойства, которые установлены в источнике.- Parameters:
src
- - формат - источник.dst
- - формат - приемник.
-
applyFormatByMask
Apply format properties by properties mask- Parameters:
src
- -ReadOnlyFormat
- source formatpropertiesMask
- - properties maskdst
- -Format
- destination format
-
compareFormats
public static long compareFormats(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask) Сравнить форматы.- Parameters:
propertiesMask
- - свойства, которые нужно сравнивать.- Returns:
- маска, каждый бит в которой указывает одинаковые значения. Единица в бите означает, что свойства одинаковые.
-
compareLocalStrings
Compare two instances ofLocalString
.- Parameters:
string1
- first string to compare. Must not benull
.string2
- second string to compare. Must not benull
.- Returns:
true
if strings are equal,false
otherwise.
-
getCell
Get document cell. If cell does not exist, create it.- Parameters:
document
-SpreadsheetDocument
, must not benull
rowIndex
- row indexcolumnIndex
- column index- Returns:
Cell
, nevernull
-
getFormatByKey
Get format by key.- Parameters:
document
-SpreadsheetDocument
, must not benull
formatIndex
- format key- Returns:
ReadOnlyFormat
, nevernull
-
getHorizontalSize
Get document horizontal size for specified row.- Parameters:
document
-SpreadsheetDocument
, must not benull
rowIndex
- row index- Returns:
- document horizontal size for specified row
-
getPictureIndex
Get picture index- Parameters:
sheet
- -SpreadsheetDocument
picture
- -Picture
-
getRowColumns
Get row columns.- Parameters:
document
-SpreadsheetDocument
, must not benull
rowIndex
- row index- Returns:
Columns
, nevernull
-
getRowColumns
Get row columns or default document columns.- Parameters:
document
- the document, cannot benull
row
- the row, cannot benull
- Returns:
- the columns, cannot be
null
-
getRowContent
Get row content. If row does not exist, create it.- Parameters:
document
-SpreadsheetDocument
, must not benull
rowIndex
- row index- Returns:
Row
, nevernull
-
getShiftedCommentDrawingPosition
Получить позицию рисунка примечания. -
isCellWithoutProperties
Убедиться, что ячейка не содержит свойств. -
isEmbedded
Проверить, является ли документ встроенным. -
isEmptyFormat
Проверить, пустой ли формат. -
isEmptyFormat
Проверить, пустой ли формат. -
isEmptyString
Check ifLocalString
is empty.- Parameters:
string
-LocalString
, may benull
- Returns:
true
if local string is empty,false
otherwise
-
normalizeFormattedString
Normalizes formatted string.- Parameters:
formattedString
- the source formatted string, can benull
- Returns:
- the normalizes formatted string, can be null if source
null
-
normalizeLocalString
Normalizes local string to pure data.- Parameters:
localString
- the source local string, can benull
- Returns:
- the normalizes local string, can be null if source
null
-
getRuntimeVersion
Returns dt-project runtime version or latest.- Parameters:
dtProject
- the dt-project, cannot benull
- Returns:
- the dt-project runtime version or latest, never
null
-
haveFormattedText
Normalizes local string to pure data.- Parameters:
localString
- the source local string, can benull
- Returns:
- the normalizes local string, can be null if source
null
-
getColorProvider
Gets actual serviceIColorProvider
.- Returns:
- actual service
IColorProvider
, cannot benull
-
getFontProvider
Gets actual serviceIFontProvider
.- Returns:
- actual service
IFontProvider
, cannot benull
-
getPresentationService
Returns presentation service.- Returns:
- actual service
IPresentationService
, cannot benull
-
getRegistryColor
Returns registry color by kind and fq name.- Parameters:
colorKind
- the color kindfqn
- the color fq name, cannot benull
dtProject
- the dt-project, cannot benull
- 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 kindfqn
- the color fq name, cannot benull
dtProject
- the dt-project, cannot benull
- Returns:
- the color, can be
null
-
getRegistryFont
Returns registry font by kind and fq name.- Parameters:
fontKind
- the font kindfqn
- the font fq name, cannot benull
dtProject
- the dt-project, cannot benull
- 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 kindfontId
- the font id, cannot benull
dtProject
- the dt-project, cannot benull
- Returns:
- the font, can be
null
-
getRegistryPictureByCompositeId
Returns registry picture by composite id.- Parameters:
picId
- the picture composite id, cannot benull
dtProject
- the dt-project, cannot benull
- Returns:
- the registry picture or
null
if nod founded
-