Column and Row Access

From Apache OpenOffice Wiki
Jump to: navigation, search



The cell range interface com.sun.star.table.XColumnRowRange accesses the column and row ranges in the current cell range. A column or row range contains all the cells in the selected column or row. This type of range has additional properties, such as, visibility, and width or height. For more information, see Columns and Rows.

  // --- Column properties. ---
  com.sun.star.table.XColumnRowRange xColRowRange = (com.sun.star.table.XColumnRowRange)
      UnoRuntime.queryInterface(com.sun.star.table.XColumnRowRange.class, xCellRange);
  com.sun.star.table.XTableColumns xColumns = xColRowRange.getColumns();
 
  Object aColumnObj = xColumns.getByIndex(0);
  xPropSet = (com.sun.star.beans.XPropertySet) UnoRuntime.queryInterface(
      com.sun.star.beans.XPropertySet.class, aColumnObj);
  xPropSet.setPropertyValue( "Width", new Integer( 6000 ) );
 
  com.sun.star.container.XNamed xNamed = (com.sun.star.container.XNamed)
      UnoRuntime.queryInterface(com.sun.star.container.XNamed.class, aColumnObj);
  System.out.println("The name of the wide column is " + xNamed.getName() + ".");
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages