KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > poi > hssf > usermodel > TestHSSFSheetSetOrder


1
2 /* ====================================================================
3    Copyright 2002-2004 Apache Software Foundation
4
5    Licensed under the Apache License, Version 2.0 (the "License");
6    you may not use this file except in compliance with the License.
7    You may obtain a copy of the License at
8
9        http://www.apache.org/licenses/LICENSE-2.0
10
11    Unless required by applicable law or agreed to in writing, software
12    distributed under the License is distributed on an "AS IS" BASIS,
13    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14    See the License for the specific language governing permissions and
15    limitations under the License.
16 ==================================================================== */

17         
18
19 package org.apache.poi.hssf.usermodel;
20
21 import junit.framework.TestCase;
22
23 import org.apache.poi.hssf.model.Sheet;
24
25 /**
26 * Tests HSSFWorkbook method setSheetOrder()
27 *
28 *
29 * @author Ruel Loehr (loehr1 at us.ibm.com)
30 */

31
32 public class TestHSSFSheetSetOrder
33        extends TestCase
34 {
35    public TestHSSFSheetSetOrder(String JavaDoc s)
36    {
37        super(s);
38    }
39
40    /**
41     * Test the sheet set order method
42     */

43
44    public void testBackupRecord()
45            throws Exception JavaDoc
46    {
47        HSSFWorkbook wb = new HSSFWorkbook();
48        
49        for (int i=0; i < 10; i++)
50        {
51             HSSFSheet s = wb.createSheet("Sheet " +i);
52             Sheet sheet = s.getSheet();
53        }
54
55      wb.getWorkbook().setSheetOrder("Sheet 6", 0);
56       wb.getWorkbook().setSheetOrder("Sheet 3", 7);
57       wb.getWorkbook().setSheetOrder("Sheet 1", 9);
58       
59      
60    }
61
62
63 }
64
65
66
Popular Tags