Class ClipboardPasteUtil


  • public final class ClipboardPasteUtil
    extends Object
    Utils for pasting from the clipboard
    • Method Detail

      • getSelectionHeight

        public static int getSelectionHeight​(Selection selection,
                                             SheetAccessor sheet)
        Get height of specified selection
        Parameters:
        selection -
        sheet -
        Returns:
      • getSelectionWidth

        public static int getSelectionWidth​(Selection selection,
                                            SheetAccessor sheet)
        Get width of specified selection
        Parameters:
        selection -
        sheet -
        Returns:
      • getNormalizedSelection

        public static Selection getNormalizedSelection​(SheetAccessor sheet,
                                                       Selection selection,
                                                       UUID id,
                                                       int sizeX,
                                                       int sizeY)
        Get normalized selection
        Parameters:
        sheet -
        selection -
        id -
        sizeX -
        sizeY -
        Returns:
      • getNormalizedSelectionToPaste

        public static List<Selection> getNormalizedSelectionToPaste​(SheetAccessor sheet,
                                                                    List<Selection> selections,
                                                                    UUID id,
                                                                    int sizeX,
                                                                    int sizeY)
        Get list of normalized selections for pasting
        Parameters:
        sheet -
        selections -
        id -
        sizeX -
        sizeY -
        Returns:
      • getClipboardSheetSelection

        public static Area getClipboardSheetSelection​(MoxelDescriptor descriptor)
        Get selection area of clipboard sheet, specified by descriptor
        Parameters:
        descriptor -
        Returns:
      • makeSelectionCopy

        public static Selection makeSelectionCopy​(Selection selection)
        Make copy of specified selection
        Parameters:
        selection -
        Returns:
      • isSelectionAcceptableToFill

        public static boolean isSelectionAcceptableToFill​(Area area,
                                                          Selection selection)
        Check if it's possible to fill the selection with specified area
        Parameters:
        area -
        selection -
        Returns:
      • isSelectionsAcceptableToFill

        public static boolean isSelectionsAcceptableToFill​(Area sel,
                                                           List<Selection> selections)
        Check if all of the listed selections are acceptable to fill
        Parameters:
        sel -
        selections -
        Returns:
      • pasteSheetCells

        public static void pasteSheetCells​(PasteSpecialOptions pasteOptions,
                                           boolean oneLocale,
                                           int sizeX,
                                           int sizeY,
                                           Selection selection,
                                           SheetAccessor srcSheet,
                                           SheetAccessor dstSheet)
        Paste sheet into specified selection.
        Parameters:
        pasteOptions - PasteSpecialOptions, must not be null
        oneLocale - true in case of using single language, false otherwise
        sizeX - horizontal size of document being pasted
        sizeY - vertical size of document being pasted
        selection - paste area, must not be null
        srcSheet - source sheet, must not be null
        dstSheet - destination sheet, must not be null
      • getDrawingsSelectionRect

        public static SpreadsheetRect getDrawingsSelectionRect​(List<Drawing> drawings)
        Get total rect, containing all of the drawings' position rects
        Parameters:
        drawings -
        Returns:
      • unmergeSelection

        public static void unmergeSelection​(Selection selection,
                                            SheetAccessor sheet)
        Make correct unmerges into specified selection
        Parameters:
        selection -
        sheet -
      • copyDrawingFromClipboard

        public static Drawing copyDrawingFromClipboard​(Drawing drawing,
                                                       SheetAccessor document,
                                                       SheetAccessor sheet,
                                                       long mask,
                                                       int nFirstCol,
                                                       int nFirstRow,
                                                       boolean calcParameters,
                                                       boolean oneLocale)
      • postUpdateCellsValues

        public static void postUpdateCellsValues​(SheetAccessor sheet,
                                                 Selection selection)
        Post update values of cells in specified selection
        Parameters:
        sheet - SheetAccessor
        selection - Selection