Class OperationsHelper


  • public class OperationsHelper
    extends Object
    Helper for various operations
    • Constructor Detail

      • OperationsHelper

        public OperationsHelper()
    • Method Detail

      • addToGroup

        public static void addToGroup​(SheetAccessor sheet,
                                      org.eclipse.core.commands.operations.IUndoContext undoContext,
                                      org.eclipse.core.commands.operations.IOperationHistory history,
                                      int begin,
                                      int end,
                                      Columns columns)
        Add range of rows/columns to group
        Parameters:
        sheet - - SheetAccessor
        undoContext - - undo context
        history - - operations history
        begin - - begin row\column index
        end - - end row\column index
        columns - - columns type
      • removeFromGroup

        public static void removeFromGroup​(SheetAccessor sheet,
                                           org.eclipse.core.commands.operations.IUndoContext undoContext,
                                           org.eclipse.core.commands.operations.IOperationHistory history,
                                           int begin,
                                           int end,
                                           Columns columns)
        Remove range of rows/columns from group
        Parameters:
        sheet - - SheetAccessor
        undoContext - - undo context
        history - - operations history
        begin - - begin row\column index
        end - - end row\column index
        columns - - columns type
      • renameSelectionInteractive

        public static void renameSelectionInteractive​(MoxelControl control,
                                                      Selection selection)
        Запросить переименование выделения.
      • renameSelection

        public static void renameSelection​(MoxelControl control,
                                           Selection selection,
                                           String newName,
                                           String oldName)
        Rename selection
        Parameters:
        control - - MoxelControl
        selection - - selection
        newName - - new name for selection
        oldName - - old selection name
      • renameDrawingInteractive

        public static void renameDrawingInteractive​(MoxelControl control,
                                                    Drawing drawing)
      • setColumnsWidth__8_3_10

        public static void setColumnsWidth__8_3_10​(MoxelControl control,
                                                   int beginColumnIndex,
                                                   int endColumnIndex,
                                                   int changeRow,
                                                   int width)
        Set column width for range of columns, taking automatic width calculation mode into account.
        Parameters:
        control - MoxelControl, must not be null
        beginColumnIndex - begin column index
        endColumnIndex - end column index
        changeRow - row index, which columns are being resized
        width - desired width in char units
      • setColumnsWidth

        public static void setColumnsWidth​(MoxelControl control,
                                           int resizedColumn,
                                           Columns activeColumns,
                                           boolean autoWidth,
                                           Integer widthCharUnits)
        Изменить ширину колонок.
        Parameters:
        resizedColumn - - номер колонки, ширину которой нужно изменить. -1 - нужно изменить ширину всех колонок выделения.
        autoWidth - - нужно рассчиать автоматическую щирину.
        widthCharUnits - - ширина, которую нужно установить.
      • setRowHeight

        public static void setRowHeight​(MoxelControl control,
                                        int resizeRowIndex,
                                        Integer heightUnit)
        Set up row height.
        Parameters:
        control - MoxelControl, must not be null
        resizeRowIndex - row index
        heightUnit - row height in units.
        • In case of non-negative value the concrete row height will be set up.
        • In case on negative value row will have automatically-calculated height, maximum row height will be set up.
        • In case of null value row height will be unset.
      • showHideRowsColumns

        public static void showHideRowsColumns​(MoxelControl control,
                                               boolean show)
        Отобразить/скрыть строки/колонки.
      • clear

        public static void clear​(MoxelControl control,
                                 boolean clearBorders,
                                 boolean clearFormat,
                                 boolean clearContent)
        Очистить область.
      • applyFormatting

        public static void applyFormatting​(MoxelControl control,
                                           String operationName,
                                           ReadOnlyFormat format,
                                           long properties,
                                           Cell cellToApply,
                                           int cellProperties)
      • applyDrawFormatting

        public static void applyDrawFormatting​(MoxelControl control,
                                               String operationName,
                                               ReadOnlyFormat format,
                                               long properties)
        Apply formatting to drawing
        Parameters:
        control - MoxelControl
        operationName - operation name
        format - ReadOnlyFormat
        properties - properties to apply
      • setColor

        public static void setColor​(MoxelControl control,
                                    Color color,
                                    long property)
        Установить цвет.
      • setText

        public static void setText​(MoxelControl control,
                                   String text)
        Установить текст ячейке.
      • mergeOrUnmergeCells

        public static void mergeOrUnmergeCells​(MoxelControl control)
        Объединить ячейки или снять объединение с ячеек.
      • resizeSelectedDrawings

        public static void resizeSelectedDrawings​(MoxelControl control,
                                                  ViewPort viewPort,
                                                  int resizeX,
                                                  int resizeY,
                                                  DrawingResizeHandle resizeHandle)
        Изменить размеры рисунков.
      • moveSelectedDrawings

        public static void moveSelectedDrawings​(MoxelControl control,
                                                ViewPort viewPort,
                                                int horizontalShift,
                                                int verticalShift)
        Сдвинуть рисунки на указанную позицию.
      • deleteSelectedDrawings

        public static void deleteSelectedDrawings​(MoxelControl control)
        Удалить выделенные рисунки.
      • changeSelectedDrawginsZOrder

        public static void changeSelectedDrawginsZOrder​(MoxelControl control,
                                                        int shift)
        Сдвинуть рисунки на указанное смещение.
      • groupDrawings

        public static void groupDrawings​(MoxelControl control)
        Group drawings
        Parameters:
        control - - MoxelControl
      • ungroupDrawings

        public static void ungroupDrawings​(MoxelControl control)
        Ungroup drawings
        Parameters:
        control - - MoxelControl
      • addDrawing

        public static void addDrawing​(MoxelControl control,
                                      Drawing drawingToInsert)
        Add drawing
        Parameters:
        control - - MoxelControl
        drawingToInsert - - drawing to insert
      • changeHeaderFooter

        public static void changeHeaderFooter​(MoxelControl control)
        Change header/footer
        Parameters:
        control - - MoxelControl
      • setPrintArea

        public static void setPrintArea​(MoxelControl control)
        Set printing area, absed on current selection
        Parameters:
        control - - MoxelControl
      • removePrintArea

        public static void removePrintArea​(MoxelControl control)
        Remove printing area
        Parameters:
        control - - MoxelControl
      • setRepeatArea

        public static void setRepeatArea​(MoxelControl control)
        Set repeated area for printing
        Parameters:
        control - - MoxelControl
      • removeRepeatArea

        public static void removeRepeatArea​(MoxelControl control)
        Удалить область повторения печати.
      • addRemovePageBreak

        public static void addRemovePageBreak​(MoxelControl control,
                                              boolean add)
        Добавить / удалить разделитель страниц.
      • addPageBreak

        public static void addPageBreak​(MoxelControl control)
        Добавить разделитель страниц.
      • removePageBreak

        public static void removePageBreak​(MoxelControl control)
        Удалить разрыв страницы.
      • applyParagraphProperty

        public static void applyParagraphProperty​(MoxelControl control,
                                                  String operation_ChangeProperty,
                                                  int paragraphProperty,
                                                  int paragraphPropertyValue)
        Применить свойства параграфа к текущему выделению.
      • removeComments

        public static void removeComments​(MoxelControl control)
        Удалить примечания из выделенной области.
      • createComment

        public static void createComment​(MoxelControl control,
                                         int y,
                                         int x)
        Создать примечание в ячейке.
      • changeBooleanFontProperty

        public static void changeBooleanFontProperty​(MoxelControl moxelControl,
                                                     int fontProperty,
                                                     boolean value)
        Change boolean font property
        Parameters:
        moxelControl - MoxelControl
        fontProperty - font property
        value - property value to be set
      • applyFontFormatting

        public static void applyFontFormatting​(MoxelControl control,
                                               String operationName,
                                               Font fontToApply,
                                               int propertiesToApply)
        Apply font formatting
        Parameters:
        control - MoxelControl
        operationName - operation name
        fontToApply -
        propertiesToApply -
      • applyDrawFontFormatting

        public static void applyDrawFontFormatting​(MoxelControl control,
                                                   String operationName,
                                                   Font fontToApply,
                                                   int propertiesToApply)
        Apply drawing font property
        Parameters:
        control - MoxelControl
        operationName - operation name
        fontToApply -
        propertiesToApply - properties to apply