Class MergeUtil
- java.lang.Object
-
- com._1c.g5.v8.dt.moxel.ui.extension.diff.MergeUtil
-
public class MergeUtil extends Object
Spreadsheet merge utils.
-
-
Constructor Summary
Constructors Constructor Description MergeUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<com._1c.g5.v8.dt.moxel.ui.extension.diff.CellElement>
convertRowToCellElements(SpreadsheetDocument sheet, int rowIndex)
Convert row to the sequence of cell elements.static boolean
convertSheetToSubsheets(SpreadsheetDocument sheet, List<com._1c.g5.v8.dt.moxel.ui.extension.diff.SubsheetElement> subsheets)
Convert sheet to list of subsheets.static List<ColumnElement>
convertSubsheetToColumnEelements(SpreadsheetDocument sheet, Columns columns)
Convert subsheet to the sequence of column elements.static List<com._1c.g5.v8.dt.moxel.ui.extension.diff.RowElement>
convertSubsheetToRowElements(SpreadsheetDocument sheet, RowsArea subsheetRowsArea)
Convert subsheet to the sequence of row elements.static RowsArea
getAreaBetweenNamedRows(SpreadsheetDocument document, String nameOfTopArea, String nameOfBottomArea)
Get area between 2 named rows areas.static RowsArea
getAreaOfNamedArea(SpreadsheetDocument document, String name)
Get area of named rows area.static RowsArea
getCenterArea(SpreadsheetDocument sheet)
Get area between first named rows area and last named rows area.static RowsArea
getCenterArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get area between first named rows area and last named rows area.static RowsArea
getFooterArea(SpreadsheetDocument sheet)
Get spreadsheet area below all named rows.static RowsArea
getFooterArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get spreadsheet area below all named rows.static RowsArea
getHeaderArea(SpreadsheetDocument sheet)
Get spreadsheet area above all named rows.static RowsArea
getHeaderArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get spreadsheet area above all named rows.static List<NamedItemInfo>
getNamedColumnsSorted(SpreadsheetDocument sheet)
Get named column areas sorted by left column.static List<NamedItemInfo>
getNamedRowsSorted(SpreadsheetDocument sheet)
Get named row areas sorted by top row.
-
-
-
Method Detail
-
convertSheetToSubsheets
public static boolean convertSheetToSubsheets(SpreadsheetDocument sheet, List<com._1c.g5.v8.dt.moxel.ui.extension.diff.SubsheetElement> subsheets)
Convert sheet to list of subsheets.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
subsheets
- collection the result subsheets area placed to, must not benull
- Returns:
true
in case of successful conversion,false
otherwise.
-
convertSubsheetToRowElements
public static List<com._1c.g5.v8.dt.moxel.ui.extension.diff.RowElement> convertSubsheetToRowElements(SpreadsheetDocument sheet, RowsArea subsheetRowsArea)
Convert subsheet to the sequence of row elements.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
subsheetRowsArea
-RowsArea
of spreadsheet, must not benull
- Returns:
- list of
RowElement
instances, nevernull
-
convertSubsheetToColumnEelements
public static List<ColumnElement> convertSubsheetToColumnEelements(SpreadsheetDocument sheet, Columns columns)
Convert subsheet to the sequence of column elements.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
columns
-Columns
, must not benull
- Returns:
- list of
ColumnElement
instances, nevernull
-
convertRowToCellElements
public static List<com._1c.g5.v8.dt.moxel.ui.extension.diff.CellElement> convertRowToCellElements(SpreadsheetDocument sheet, int rowIndex)
Convert row to the sequence of cell elements.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
rowIndex
- row index- Returns:
- list of
CellElement
instances, nevernull
-
getHeaderArea
public static RowsArea getHeaderArea(SpreadsheetDocument sheet)
Get spreadsheet area above all named rows.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
- Returns:
RowsArea
which represents rows area above all named rows, nevernull
-
getHeaderArea
public static RowsArea getHeaderArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get spreadsheet area above all named rows.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
namedItemRows
- list ofNamedItemInfo
, must not benull
- Returns:
RowsArea
which represents rows area above all named rows, nevernull
-
getCenterArea
public static RowsArea getCenterArea(SpreadsheetDocument sheet)
Get area between first named rows area and last named rows area.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
- Returns:
RowsArea
which represents area between first named rows area and last named rows area, nevernull
-
getCenterArea
public static RowsArea getCenterArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get area between first named rows area and last named rows area.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
namedItemRows
- list ofNamedItemInfo
, must not benull
- Returns:
RowsArea
which represents area between first named rows area and last named rows area, nevernull
-
getFooterArea
public static RowsArea getFooterArea(SpreadsheetDocument sheet)
Get spreadsheet area below all named rows.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
- Returns:
RowsArea
which represents rows area below all named rows, nevernull
-
getFooterArea
public static RowsArea getFooterArea(SpreadsheetDocument sheet, List<NamedItemInfo> namedItemRows)
Get spreadsheet area below all named rows.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
namedItemRows
- list ofNamedItemInfo
, must not benull
- Returns:
RowsArea
which represents rows area below all named rows, nevernull
-
getNamedRowsSorted
public static List<NamedItemInfo> getNamedRowsSorted(SpreadsheetDocument sheet)
Get named row areas sorted by top row.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
- Returns:
- list of
NamedItemInfo
, nevernull
-
getNamedColumnsSorted
public static List<NamedItemInfo> getNamedColumnsSorted(SpreadsheetDocument sheet)
Get named column areas sorted by left column.- Parameters:
sheet
-SpreadsheetDocument
, must not benull
- Returns:
- list of
NamedItemInfo
, nevernull
-
getAreaOfNamedArea
public static RowsArea getAreaOfNamedArea(SpreadsheetDocument document, String name)
Get area of named rows area.- Parameters:
document
-SpreadsheetDocument
, must not benull
name
- named area name, must not benull
- Returns:
RowsArea
, nevernull
-
getAreaBetweenNamedRows
public static RowsArea getAreaBetweenNamedRows(SpreadsheetDocument document, String nameOfTopArea, String nameOfBottomArea)
Get area between 2 named rows areas.- Parameters:
document
-SpreadsheetDocument
, must not benull
nameOfTopArea
- name of first named area, must not benull
nameOfBottomArea
- name of second named area, must not benull
- Returns:
RowsArea
, nevernull
-
-