[]
        
(Showing Draft Content)

IOutlineColumn

Interface IOutlineColumn


public interface IOutlineColumn
Represents the outline column for a worksheet.

An outline column displays hierarchical row data in a tree view. Use IWorksheet.getOutlineColumn() to access the outline column, then configure the column index, visibility options, and level settings for the hierarchy display.


 worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
 worksheet.getRange("A2").setIndentLevel(1);
 IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
 outlineColumn.setColumnIndex(0);
 outlineColumn.setShowImage(true);
 
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    getCheckStatus(int row)
    Gets the check status of the row.
    boolean
    getCollapsed(int row)
    Gets whether the specified row is collapsed in the outline column.
    Gets the image used as the collapse indicator in the outline column.
    int
    Gets the zero-based index of the column displayed as the outline column.
    Gets the image used as the expand indicator in the outline column.
    Gets the images used for each outline level.
    int
    Gets the maximum row outline level for the outline column.
    boolean
    Gets whether check boxes are displayed in the outline column.
    boolean
    Gets whether images are displayed in the outline column.
    boolean
    Gets whether the outline indicator is displayed in the outline column.
    void
    Refreshes the outline column.
    void
    setCheckStatus(int row, boolean checkStatus)
    Sets the check status of the specified row in the outline column.
    void
    setCollapsed(int row, boolean collapsed)
    Sets whether the specified row is collapsed in the outline column.
    void
    Sets the image used as the collapse indicator in the outline column.
    void
    setColumnIndex(int value)
    Sets the column index for the outline column.
    void
    Sets the image used as the expand indicator in the outline column.
    void
    setMaxLevel(int value)
    Sets the maximum row outline level for the outline column.
    void
    setShowCheckBox(boolean value)
    Sets whether check boxes are displayed in the outline column.
    void
    setShowImage(boolean value)
    Sets whether images are displayed in the outline column.
    void
    setShowIndicator(boolean value)
    Sets whether to display the outline indicator in the outline column.
  • Method Details

    • getColumnIndex

      int getColumnIndex()
      Gets the zero-based index of the column displayed as the outline column.

      The outline column displays hierarchical rows as a tree structure based on the indent levels in the worksheet.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       int columnIndex = outlineColumn.getColumnIndex();
       
      Returns:
      The zero-based index of the column displayed as the outline column.
    • setColumnIndex

      void setColumnIndex(int value)
      Sets the column index for the outline column.

      The specified column is displayed as a tree structure for hierarchical rows.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       
      Parameters:
      value - The zero-based index of the column to display as the outline column.
    • getShowImage

      boolean getShowImage()
      Gets whether images are displayed in the outline column.

      When this property is enabled, the outline column can show the level images configured through getImages() for hierarchical rows.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowImage(true);
       boolean showImage = outlineColumn.getShowImage();
       
      Returns:
      true if images are displayed in the outline column; otherwise, false.
    • setShowImage

      void setShowImage(boolean value)
      Sets whether images are displayed in the outline column.

      When this property is enabled, the outline column can show the level images configured through getImages() for hierarchical rows.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowImage(true);
       
      Parameters:
      value - true to display images in the outline column; otherwise, false.
    • getShowCheckBox

      boolean getShowCheckBox()
      Gets whether check boxes are displayed in the outline column.

      When this property is enabled, the outline column shows a check box for rows in the hierarchical display.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       boolean showCheckBox = outlineColumn.getShowCheckBox();
       
      Returns:
      true if check boxes are displayed in the outline column; otherwise, false.
    • setShowCheckBox

      void setShowCheckBox(boolean value)
      Sets whether check boxes are displayed in the outline column.

      When this property is enabled, the outline column shows a check box for rows in the hierarchical display.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowCheckBox(true);
       
      Parameters:
      value - true to display check boxes in the outline column; otherwise, false.
    • getShowIndicator

      boolean getShowIndicator()
      Gets whether the outline indicator is displayed in the outline column.

      The outline indicator shows the expand or collapse state for hierarchical rows displayed in the outline column.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowIndicator(true);
       boolean showIndicator = outlineColumn.getShowIndicator();
       
      Returns:
      true if the outline indicator is displayed in the outline column; otherwise, false.
    • setShowIndicator

      void setShowIndicator(boolean value)
      Sets whether to display the outline indicator in the outline column.

      The indicator is used to show the expand or collapse state for hierarchical rows displayed in the outline column.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowIndicator(true);
       
      Parameters:
      value - true to display the outline indicator; otherwise, false.
    • getMaxLevel

      int getMaxLevel()
      Gets the maximum row outline level for the outline column.

      The maximum level determines how many hierarchical row levels the outline column supports. The default value is 10.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 1.1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       worksheet.getRange("A4").setIndentLevel(2);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setMaxLevel(3);
       int maxLevel = outlineColumn.getMaxLevel();
       
      Returns:
      The maximum row outline level for the outline column.
    • setMaxLevel

      void setMaxLevel(int value)
      Sets the maximum row outline level for the outline column.

      The maximum level determines how many hierarchical row levels the outline column supports.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 1.1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       worksheet.getRange("A4").setIndentLevel(2);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setMaxLevel(3);
       
      Parameters:
      value - The maximum row outline level.
    • getImages

      List<ImageSource> getImages()
      Gets the images used for each outline level.

      Use this method to access the image collection for the outline column. Each item in the returned list represents the image displayed for a specific outline level when images are enabled.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowImage(true);
       outlineColumn.getImages().add(new ImageSource(new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}), ImageType.PNG));
       java.util.List<ImageSource> images = outlineColumn.getImages();
       
      Returns:
      The images used for each outline level.
    • getExpandIndicator

      ImageSource getExpandIndicator()
      Gets the image used as the expand indicator in the outline column.

      This image is displayed for expandable rows when the outline column shows hierarchy indicators.

      
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setExpandIndicator(new ImageSource(
           new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
           ImageType.PNG));
       ImageSource indicator = outlineColumn.getExpandIndicator();
       
      Returns:
      The image used as the expand indicator in the outline column.
    • setExpandIndicator

      void setExpandIndicator(ImageSource value)
      Sets the image used as the expand indicator in the outline column.

      This image is displayed for expandable rows when the outline column shows hierarchy indicators.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setExpandIndicator(new ImageSource(
           new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
           ImageType.PNG));
       
      Parameters:
      value - The image source for the expand indicator. Must not be null.
    • getCollapseIndicator

      ImageSource getCollapseIndicator()
      Gets the image used as the collapse indicator in the outline column.

      This image is displayed for grouped rows when the outline column shows a collapse indicator for the current outline level.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setCollapseIndicator(new ImageSource(
           new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
           ImageType.PNG));
       ImageSource indicator = outlineColumn.getCollapseIndicator();
       
      Returns:
      The image used as the collapse indicator in the outline column.
    • setCollapseIndicator

      void setCollapseIndicator(ImageSource value)
      Sets the image used as the collapse indicator in the outline column.

      This image is displayed for collapsible rows when the outline column shows hierarchy indicators.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setCollapseIndicator(new ImageSource(
           new java.io.ByteArrayInputStream(new byte[] {(byte) 137, 80, 78, 71, 13, 10, 26, 10}),
           ImageType.PNG));
       
      Parameters:
      value - The image source for the collapse indicator. null is not supported.
    • setCheckStatus

      void setCheckStatus(int row, boolean checkStatus)
      Sets the check status of the specified row in the outline column.

      Use this method to set whether a row is currently marked as checked when the outline column displays check boxes.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowCheckBox(true);
       outlineColumn.setCheckStatus(1, true);
       
      Parameters:
      row - The index of the row whose check status is to be changed.
      checkStatus - Whether the specified row is checked.
    • getCheckStatus

      boolean getCheckStatus(int row)
      Gets the check status of the row.

      Use this method after enabling check boxes to determine whether the specified outline row is checked.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.setShowCheckBox(true);
       outlineColumn.setCheckStatus(1, true);
       boolean checked = outlineColumn.getCheckStatus(1);
       
      Parameters:
      row - The index of the row.
      Returns:
      Whether the specified row is checked.
    • setCollapsed

      void setCollapsed(int row, boolean collapsed)
      Sets whether the specified row is collapsed in the outline column.

      Use this method to set whether a row in the outline hierarchy is displayed in a collapsed state.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       worksheet.getOutline().setSummaryRow(SummaryRow.Above);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.refresh();
       outlineColumn.setCollapsed(1, true);
       boolean collapsed = outlineColumn.getCollapsed(1);
       
      Parameters:
      row - The index of the row whose collapsed state is to be set.
      collapsed - true to display the specified row in a collapsed state; otherwise, false.
    • getCollapsed

      boolean getCollapsed(int row)
      Gets whether the specified row is collapsed in the outline column.

      Use this method to read the collapsed state of a row in the outline hierarchy.

      
       worksheet.getRange("A1:A3").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}});
       worksheet.getRange("A3").setIndentLevel(1);
       worksheet.getOutline().setSummaryRow(SummaryRow.Above);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       outlineColumn.refresh();
       outlineColumn.setCollapsed(1, true);
       boolean collapsed = outlineColumn.getCollapsed(1);
       
      Parameters:
      row - The index of the row to get collapsed.
      Returns:
      Whether the specified row is collapsed.
    • refresh

      void refresh()
      Refreshes the outline column.

      Rebuilds the row outline hierarchy for the current outline column based on the current indent levels in the worksheet. Use this method after changing the hierarchical data or updating indent levels to apply the latest outline structure.

      
       worksheet.getRange("A1:A4").setValue(new Object[][] {{"Name"}, {"Node 1"}, {"Node 1.1"}, {"Node 2"}});
       worksheet.getRange("A3").setIndentLevel(1);
       IOutlineColumn outlineColumn = worksheet.getOutlineColumn();
       outlineColumn.setColumnIndex(0);
       worksheet.getRange("A4").setIndentLevel(1);
       outlineColumn.refresh();