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 intstatic final intDefault header and footer sizestatic final intstatic final intDefault marginsstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyFormat(ReadOnlyFormat src, Format dst) Применить формат формату.static voidapplyFormatByMask(ReadOnlyFormat src, long propertiesMask, Format dst) Apply format properties by properties maskstatic longcompareFormats(ReadOnlyFormat format1, ReadOnlyFormat format2, long propertiesMask) Сравнить форматы.static booleancompareLocalStrings(LocalString string1, LocalString string2) Compare two instances ofLocalString.static CellgetCell(SpreadsheetDocument document, int rowIndex, int columnIndex) Get document cell.static IColorProviderGets actual serviceIColorProvider.static IFontProviderGets actual serviceIFontProvider.static ReadOnlyFormatgetFormatByKey(SpreadsheetDocument document, int formatIndex) Get format by key.static intgetHorizontalSize(SpreadsheetDocument document, int rowIndex) Get document horizontal size for specified row.static intgetPictureIndex(SpreadsheetDocument sheet, Picture picture) Get picture indexstatic IPresentationServiceReturns presentation service.static ColorgetRegistryColor(ColorKind colorKind, String fqn, IDtProject dtProject) Returns registry color by kind and fq name.static ColorgetRegistryColorByCompositeId(ColorKind colorKind, CompositeId compositeId, IDtProject dtProject) Returns registry color by kind and fq name.static FontgetRegistryFont(FontKind fontKind, String fqn, IDtProject dtProject) Returns registry font by kind and fq name.static FontgetRegistryFontByCompositeId(FontKind fontKind, CompositeId fontId, IDtProject dtProject) Returns registry font by kind and composite id.static PicturegetRegistryPictureByCompositeId(CompositeId picId, IDtProject dtProject) Returns registry picture by composite id.static ColumnsgetRowColumns(SpreadsheetDocument document, int rowIndex) Get row columns.static ColumnsgetRowColumns(SpreadsheetDocument document, Row row) Get row columns or default document columns.static RowgetRowContent(SpreadsheetDocument document, int rowIndex) Get row content.static VersiongetRuntimeVersion(IDtProject dtProject) Returns dt-project runtime version or latest.static SpreadsheetRectgetShiftedCommentDrawingPosition(CommentDrawing commentDrawing) Получить позицию рисунка примечания.static booleanhaveFormattedText(Cell cell) Normalizes local string to pure data.static booleanisCellWithoutProperties(Cell cell) Убедиться, что ячейка не содержит свойств.static booleanisEmbedded(SpreadsheetDocument document) Проверить, является ли документ встроенным.static booleanisEmptyFormat(Format format) Проверить, пустой ли формат.static booleanisEmptyFormat(ReadOnlyFormat format) Проверить, пустой ли формат.static booleanisEmptyString(LocalString string) Check ifLocalStringis empty.static LocalStringnormalizeFormattedString(LocalString formattedString) Normalizes formatted string.static LocalStringnormalizeLocalString(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:
trueif strings are equal,falseotherwise.
-
getCell
Get document cell. If cell does not exist, create it.- Parameters:
document-SpreadsheetDocument, must not benullrowIndex- row indexcolumnIndex- column index- Returns:
Cell, nevernull
-
getFormatByKey
Get format by key.- Parameters:
document-SpreadsheetDocument, must not benullformatIndex- format key- Returns:
ReadOnlyFormat, nevernull
-
getHorizontalSize
Get document horizontal size for specified row.- Parameters:
document-SpreadsheetDocument, must not benullrowIndex- row index- Returns:
- document horizontal size for specified row
-
getPictureIndex
Get picture index- Parameters:
sheet- -SpreadsheetDocumentpicture- -Picture
-
getRowColumns
Get row columns.- Parameters:
document-SpreadsheetDocument, must not benullrowIndex- row index- Returns:
Columns, nevernull
-
getRowColumns
Get row columns or default document columns.- Parameters:
document- the document, cannot benullrow- 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 benullrowIndex- row index- Returns:
Row, nevernull
-
getShiftedCommentDrawingPosition
Получить позицию рисунка примечания. -
isCellWithoutProperties
Убедиться, что ячейка не содержит свойств. -
isEmbedded
Проверить, является ли документ встроенным. -
isEmptyFormat
Проверить, пустой ли формат. -
isEmptyFormat
Проверить, пустой ли формат. -
isEmptyString
Check ifLocalStringis empty.- Parameters:
string-LocalString, may benull- Returns:
trueif local string is empty,falseotherwise
-
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 benulldtProject- 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 benulldtProject- 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 benulldtProject- 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 benulldtProject- 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 benulldtProject- the dt-project, cannot benull- Returns:
- the registry picture or
nullif nod founded
-