[]
        
(Showing Draft Content)

IWorkbookView

Interface IWorkbookView


public interface IWorkbookView
Represents the view settings of this workbook.

Use this interface to customize workbook-level display settings such as scroll bars, workbook tabs, and the tab area ratio. Obtain an IWorkbookView instance from Workbook.getBookView().


 IWorkbookView bookView = workbook.getBookView();
 bookView.setDisplayVerticalScrollBar(false);
 bookView.setDisplayWorkbookTabs(true);
 bookView.setTabRatio(0.5);
 
  • Method Details

    • getDisplayHorizontalScrollBar

      boolean getDisplayHorizontalScrollBar()
      Gets whether the horizontal scroll bar is displayed.

      This property applies to the workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayHorizontalScrollBar(true);
       boolean displayHorizontalScrollBar = bookView.getDisplayHorizontalScrollBar();
       
      Returns:
      true if the horizontal scroll bar is displayed; otherwise, false.
    • setDisplayHorizontalScrollBar

      void setDisplayHorizontalScrollBar(boolean value)
      Sets whether the horizontal scroll bar is displayed.

      This property applies to the workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayHorizontalScrollBar(true);
       
      Parameters:
      value - true if the horizontal scroll bar is displayed; otherwise, false.
    • getDisplayVerticalScrollBar

      boolean getDisplayVerticalScrollBar()
      Gets whether the vertical scroll bar is displayed.

      This property indicates whether the workbook view shows the vertical scroll bar.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayVerticalScrollBar(false);
       boolean displayVerticalScrollBar = bookView.getDisplayVerticalScrollBar();
       
      Returns:
      true if the vertical scroll bar is displayed; otherwise, false.
    • setDisplayVerticalScrollBar

      void setDisplayVerticalScrollBar(boolean value)
      Sets whether the vertical scroll bar is displayed.

      This property indicates whether the workbook view shows the vertical scroll bar.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayVerticalScrollBar(false);
       
      Parameters:
      value - true if the vertical scroll bar is displayed; otherwise, false.
    • getTabRatio

      double getTabRatio()
      Gets the ratio of the width of the workbook tab area to the width of the window's horizontal scroll bar.

      The returned value is a number between 0 and 1. The default value is 0.6.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabRatio(0.5);
       double tabRatio = bookView.getTabRatio();
       
      Returns:
      The ratio of the workbook tab area width to the horizontal scroll bar width.
    • setTabRatio

      void setTabRatio(double value)
      Sets the ratio of the width of the workbook tab area to the width of the window's horizontal scroll bar.

      This value is a number between 0 and 1. The default value is 0.6.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabRatio(0.5);
       
      Parameters:
      value - The ratio of the workbook tab area width to the horizontal scroll bar width.
    • getDisplayWorkbookTabs

      boolean getDisplayWorkbookTabs()
      Gets whether the workbook tabs are displayed.

      This property indicates whether the sheet tab strip is visible in the workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayWorkbookTabs(true);
       boolean displayWorkbookTabs = bookView.getDisplayWorkbookTabs();
       
      Returns:
      true if the workbook tabs are displayed; otherwise, false.
    • setDisplayWorkbookTabs

      void setDisplayWorkbookTabs(boolean value)
      Sets whether the workbook tabs are displayed.

      This property indicates whether the sheet tab strip is visible in the workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setDisplayWorkbookTabs(true);
       
      Parameters:
      value - true if the workbook tabs are displayed; otherwise, false.
    • getBackColor

      Color getBackColor()
      Gets the background color of all worksheets.

      This property applies to SpreadJS only. It returns the workbook view background color that is applied across worksheets.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setBackColor(Color.GetLightGray());
       Color backColor = bookView.getBackColor();
       
      Returns:
      The background color of all worksheets.
    • setBackColor

      void setBackColor(Color color)
      Sets the background color of all worksheets.

      This property applies to SpreadJS only. Use this method to set the workbook view background color that is applied across worksheets.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setBackColor(Color.GetLightGray());
       Color backColor = bookView.getBackColor();
       
      Parameters:
      color - The background color to apply to all worksheets. Must not be null.
      Throws:
      NullPointerException - if color is null.
    • getGrayAreaBackColor

      Color getGrayAreaBackColor()
      Gets the background color of the workbook gray area.

      This property applies to the gray area displayed around worksheets in a SpreadJS workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setGrayAreaBackColor(Color.GetBlue());
       Color grayAreaBackColor = bookView.getGrayAreaBackColor();
       
      Returns:
      The background color of the workbook's gray area.
    • setGrayAreaBackColor

      void setGrayAreaBackColor(Color color)
      Sets the background color of the workbook gray area.

      This property applies to the gray area displayed around worksheets in a SpreadJS workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setGrayAreaBackColor(Color.GetBlue());
       
      Parameters:
      color - The background color of the workbook's gray area.
    • getTabNavigationVisible

      boolean getTabNavigationVisible()
      Gets whether to display navigation buttons in the workbook. SpreadJS only.

      This property indicates whether the tab navigation buttons are visible in the workbook view.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabNavigationVisible(true);
       boolean tabNavigationVisible = bookView.getTabNavigationVisible();
       
      Returns:
      true if the navigation buttons are displayed; otherwise, false.
    • setTabNavigationVisible

      void setTabNavigationVisible(boolean value)
      Sets whether to display the tab navigation buttons in the workbook view.

      This property applies to SpreadJS only.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabNavigationVisible(true);
       
      Parameters:
      value - true to display the tab navigation buttons; otherwise, false.
    • getTabEditable

      boolean getTabEditable()
      Gets whether editing worksheet tab names is allowed.

      This property applies to SpreadJS only.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabEditable(true);
       boolean tabEditable = bookView.getTabEditable();
       
      Returns:
      true if editing worksheet tab names is allowed; otherwise, false.
    • setTabEditable

      void setTabEditable(boolean value)
      Sets whether editing worksheet tab names is allowed.

      This property applies to SpreadJS only.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabEditable(true);
       
      Parameters:
      value - true if editing worksheet tab names is allowed; otherwise, false.
    • getAllowSheetReorder

      boolean getAllowSheetReorder()
      Gets whether worksheet tabs can be reordered.

      This property applies to SpreadJS workbook tabs.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setAllowSheetReorder(true);
       boolean allowSheetReorder = bookView.getAllowSheetReorder();
       
      Returns:
      true if worksheet tabs can be reordered; otherwise, false.
    • setAllowSheetReorder

      void setAllowSheetReorder(boolean value)
      Sets whether worksheet tabs can be reordered.

      This property applies to SpreadJS workbook tabs.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setAllowSheetReorder(true);
       
      Parameters:
      value - true if worksheet tabs can be reordered; otherwise, false.
    • getNewTabVisible

      boolean getNewTabVisible()
      Gets whether the New Tab button is visible.

      This property applies to the SpreadJS workbook tab strip.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setNewTabVisible(false);
       boolean newTabVisible = bookView.getNewTabVisible();
       
      Returns:
      true if the New Tab button is visible; otherwise, false.
    • setNewTabVisible

      void setNewTabVisible(boolean value)
      Sets whether the New Tab button is visible.

      This property applies to the SpreadJS workbook tab strip.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setNewTabVisible(false);
       
      Parameters:
      value - true if the New Tab button is visible; otherwise, false.
    • getTabStripPosition

      SpreadJSTabStripPosition getTabStripPosition()
      Gets the position of the tab strip relative to the workbook.

      This property applies to the SpreadJS workbook tab strip and returns where the tab strip is displayed around the workbook.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabStripPosition(SpreadJSTabStripPosition.Top);
       SpreadJSTabStripPosition tabStripPosition = bookView.getTabStripPosition();
       
      Returns:
      A SpreadJSTabStripPosition value that indicates whether the tab strip is displayed at the top, bottom, left, or right side of the workbook.
    • setTabStripPosition

      void setTabStripPosition(SpreadJSTabStripPosition value)
      Sets the position of the tab strip relative to the workbook.

      This property applies to the SpreadJS workbook tab strip and determines whether the tab strip is displayed at the top, bottom, left, or right side of the workbook.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabStripPosition(SpreadJSTabStripPosition.Top);
       
      Parameters:
      value - A SpreadJSTabStripPosition value that specifies where the tab strip is displayed. Must not be null.
    • getTabStripWidth

      int getTabStripWidth()
      Gets the width of the tab strip, in pixels. The value must be 80 or greater.

      This property applies to the SpreadJS workbook tab strip.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabStripWidth(120);
       int tabStripWidth = bookView.getTabStripWidth();
       
      Returns:
      The width of the tab strip, in pixels.
    • setTabStripWidth

      void setTabStripWidth(int value)
      Sets the width of the tab strip, in pixels. The value must be 80 or greater.

      This property applies to SpreadJS only.

      
       IWorkbookView bookView = workbook.getBookView();
       bookView.setTabStripWidth(120);
       
      Parameters:
      value - The width of the tab strip, in pixels. Must be 80 or greater.
    • getNumbersFitMode

      NumbersFitMode getNumbersFitMode()
      Gets the display mode used when date or number content is wider than the column.

      This property applies to SpreadJS only. The returned NumbersFitMode specifies whether overflowing date or number content is displayed as ### or allowed to overflow into an adjacent empty cell as text.

      
       IWorkbookView bookView = workbook.getBookView();
       worksheet.getRange("A1").setValue(123456789);
       bookView.setNumbersFitMode(NumbersFitMode.Overflow);
       NumbersFitMode numbersFitMode = bookView.getNumbersFitMode();
       
      Returns:
      The NumbersFitMode that specifies how date or number content is displayed when it exceeds the column width.
    • setNumbersFitMode

      void setNumbersFitMode(NumbersFitMode value)
      Sets the display mode used when date or number content is wider than the column.

      This property applies to SpreadJS only. Use NumbersFitMode.Mask to display overflowing date or number content as ###, or NumbersFitMode.Overflow to display the content as text and allow it to overflow into an adjacent empty cell.

      
       IWorkbookView bookView = workbook.getBookView();
       worksheet.getRange("A1").setValue(123456789);
       bookView.setNumbersFitMode(NumbersFitMode.Overflow);
       
      Parameters:
      value - The NumbersFitMode value that specifies how date or number content is displayed when it exceeds the column width. Must not be null.