[]
        
(Showing Draft Content)

IGroupInfo

Interface IGroupInfo


public interface IGroupInfo
Represents information about a worksheet outline group.

An IGroupInfo object describes a grouped row or column range in a worksheet outline. After obtaining a group from IOutline.getRowGroupInfo() or IOutline.getColumnGroupInfo(), use it to inspect the group's boundaries and hierarchy, or to expand and collapse the group.


 worksheet.getRange("1:4").group();
 IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
 int startIndex = group.getStartIndex();
 int endIndex = group.getEndIndex();
 group.collapse();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Collapses current group.
    void
    Expands current group.
    Gets the child groups of the current group.
    int
    Gets the end index of current group.
    boolean
    Gets whether the current group is collapsed.
    int
    Gets the outline level of the current group.
    Gets the parent of current group.
    int
    Gets the start index of current group.
  • Method Details

    • expand

      void expand()
      Expands current group.

      Shows the rows or columns in the current outline group again after the group has been collapsed. If the group has a collapsed parent group, this method clears the current group's collapsed state, but the grouped rows or columns remain hidden until the parent group is expanded.

      
       worksheet.getRange("2:5").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       group.collapse();
       group.expand();
       
    • collapse

      void collapse()
      Collapses current group.

      This method hides the rows or columns in the current outline group and marks the group as collapsed. If the group is already collapsed, this method does nothing. Use getIsCollapsed() to determine the current collapse state, or expand() to show the grouped rows or columns again.

      
       worksheet.getRange("2:5").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       group.collapse();
       
    • getStartIndex

      int getStartIndex()
      Gets the start index of current group.

      Use this method together with getEndIndex() to determine the row or column span covered by the group.

      
       worksheet.getRange("2:5").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       int startIndex = group.getStartIndex();
       
      Returns:
      The start index of the current group.
    • getEndIndex

      int getEndIndex()
      Gets the end index of current group.

      The returned value identifies the last row or column index included in this group, depending on whether the group belongs to row or column outline information.

      
       worksheet.getRange("2:5").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       int endIndex = group.getEndIndex();
       
      Returns:
      The end index of the current group.
    • getLevel

      int getLevel()
      Gets the outline level of the current group.

      The returned value indicates the nesting depth of the group within the worksheet outline. Larger values represent groups that are nested deeper inside parent groups.

      
       worksheet.getRange("1:4").group();
       worksheet.getRange("2:3").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       int level = group.getLevel();
       
      Returns:
      The outline level of the current group.
    • getIsCollapsed

      boolean getIsCollapsed()
      Gets whether the current group is collapsed.

      Use this property to determine whether the rows or columns in the group are currently hidden because the group has been collapsed.

      
       worksheet.getRange("2:5").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       group.collapse();
       boolean isCollapsed = group.getIsCollapsed();
       
      Returns:
      true if the current group is collapsed; otherwise, false.
    • getParent

      IGroupInfo getParent()
      Gets the parent of current group.

      Use this method to navigate from a nested group to the group that contains it.

      
       worksheet.getRange("2:8").group();
       worksheet.getRange("3:5").group();
       IGroupInfo parentGroup = worksheet.getOutline().getRowGroupInfo().get(0);
       IGroupInfo childGroup = parentGroup.getChildren().get(0);
       IGroupInfo group = childGroup.getParent();
       
      Returns:
      The parent group.
    • getChildren

      List<IGroupInfo> getChildren()
      Gets the child groups of the current group.

      Child groups are nested outline groups whose range is contained within the current group. Use this method to traverse the outline hierarchy after retrieving a group from IOutline.getRowGroupInfo() or IOutline.getColumnGroupInfo().

      
       worksheet.getRange("1:4").group();
       worksheet.getRange("2:3").group();
       IGroupInfo group = worksheet.getOutline().getRowGroupInfo().get(0);
       List<IGroupInfo> children = group.getChildren();
       
      Returns:
      A list that contains the child groups of the current group. Returns null if the current group has no child groups.