View | Details | Raw Unified | Return to bug 33736
Collapse All | Expand All

(-)src/java/org/apache/poi/hssf/model/Sheet.java (+45 lines)
Lines 47-52 Link Here
47
 * @author  Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, and PrintSetup
47
 * @author  Shawn Laubach (slaubach at apache dot org) Gridlines, Headers, Footers, and PrintSetup
48
 * @author Jason Height (jheight at chariot dot net dot au) Clone support. DBCell & Index Record writing support
48
 * @author Jason Height (jheight at chariot dot net dot au) Clone support. DBCell & Index Record writing support
49
 * @author  Brian Sanders (kestrel at burdell dot org) Active Cell support
49
 * @author  Brian Sanders (kestrel at burdell dot org) Active Cell support
50
 * @author  Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little)
50
 *
51
 *
51
 * @see org.apache.poi.hssf.model.Workbook
52
 * @see org.apache.poi.hssf.model.Workbook
52
 * @see org.apache.poi.hssf.usermodel.HSSFSheet
53
 * @see org.apache.poi.hssf.usermodel.HSSFSheet
Lines 1814-1819 Link Here
1814
        setColumn( column, new Short(width), null, null, null);
1815
        setColumn( column, new Short(width), null, null, null);
1815
    }
1816
    }
1816
1817
1818
    /**
1819
     * Get the hidden property for a given column.
1820
     * @param column index
1821
     * @see org.apache.poi.hssf.record.DefaultColWidthRecord
1822
     * @see org.apache.poi.hssf.record.ColumnInfoRecord
1823
     * @see #setColumnHidden(short,boolean)
1824
     * @return whether the column is hidden or not.
1825
     */
1826
1827
    public boolean isColumnHidden(short column)
1828
    {
1829
        boolean          retval = false;
1830
        ColumnInfoRecord ci     = null;
1831
1832
        if (columns != null)
1833
        {
1834
            for ( Iterator iterator = columns.getIterator(); iterator.hasNext(); )
1835
            {
1836
                ci = ( ColumnInfoRecord ) iterator.next();
1837
                if ((ci.getFirstColumn() <= column)
1838
                        && (column <= ci.getLastColumn()))
1839
                {
1840
                    break;
1841
                }
1842
                ci = null;
1843
            }
1844
        }
1845
        if (ci != null)
1846
        {
1847
            retval = ci.getHidden();
1848
        }
1849
        return retval;
1850
    }
1851
1852
    /**
1853
     * Get the hidden property for a given column.
1854
     * @param column - the column number
1855
     * @param hidden - whether the column is hidden or not
1856
     */
1857
    public void setColumnHidden(short column, boolean hidden)
1858
    {
1859
        setColumn( column, null, null, new Boolean(hidden), null);
1860
    }
1861
1817
    public void setColumn(short column, Short width, Integer level, Boolean hidden, Boolean collapsed)
1862
    public void setColumn(short column, Short width, Integer level, Boolean hidden, Boolean collapsed)
1818
    {
1863
    {
1819
        if (columns == null)
1864
        if (columns == null)
(-)src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java (+23 lines)
Lines 41-46 Link Here
41
 * @author  Glen Stampoultzis (glens at apache.org)
41
 * @author  Glen Stampoultzis (glens at apache.org)
42
 * @author  Libin Roman (romal at vistaportal.com)
42
 * @author  Libin Roman (romal at vistaportal.com)
43
 * @author  Shawn Laubach (slaubach at apache dot org) (Just a little)
43
 * @author  Shawn Laubach (slaubach at apache dot org) (Just a little)
44
 * @author  Jean-Pierre Paris (jean-pierre.paris at m4x dot org) (Just a little, too)
44
 */
45
 */
45
46
46
public class HSSFSheet
47
public class HSSFSheet
Lines 340-345 Link Here
340
    }
341
    }
341
342
342
    /**
343
    /**
344
     * Get the visibility state for a given column.
345
     * @param column - the column to get (0-based)
346
     * @param width - the visiblity state of the column
347
     */
348
349
    public void setColumnHidden(short column, boolean hidden)
350
    {
351
        sheet.setColumnHidden(column, hidden);
352
    }
353
354
    /**
355
     * Get the hidden state for a given column.
356
     * @param column - the column to set (0-based)
357
     * @return hidden - the visiblity state of the column
358
     */
359
360
    public boolean isColumnHidden(short column)
361
    {
362
        return sheet.isColumnHidden(column);
363
    }
364
365
    /**
343
     * set the width (in units of 1/256th of a character width)
366
     * set the width (in units of 1/256th of a character width)
344
     * @param column - the column to set (0-based)
367
     * @param column - the column to set (0-based)
345
     * @param width - the width in units of 1/256th of a character width
368
     * @param width - the width in units of 1/256th of a character width

Return to bug 33736