1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 package com.sun.star.xml.security.uno;
29 
30 import javax.swing.table.AbstractTableModel;
31 
32 /*
33  * this class is used to maintain the unsolved reference
34  * table.
35  */
36 class UnsolvedReferenceTableModel extends AbstractTableModel
37 {
38 	private String[] m_columnNames = {"id",
39 	                       "refNum",
40 	                       "EC's id"};
41 
42 	private TestTool m_testTool;
43 
44 	UnsolvedReferenceTableModel(TestTool testTool)
45 	{
46 		m_testTool = testTool;
47 	}
48 
49 	public String getColumnName(int col)
50 	{
51 		return m_columnNames[col].toString();
52 	}
53 
54 	public int getRowCount()
55 	{
56 		return m_testTool.getUnsolvedReferenceIds().size();
57 	}
58 
59 	public int getColumnCount()
60 	{
61 		return m_columnNames.length;
62 	}
63 
64 	public Object getValueAt(int row, int col)
65 	{
66 	    	if (col == 0)
67 	    	{
68 	    		return (String)m_testTool.getUnsolvedReferenceIds().elementAt(row);
69 		}
70 		else if (col == 1)
71 		{
72 			return ((Integer)m_testTool.getUnsolvedReferenceRefNum().elementAt(row)).toString();
73 		}
74 		else if (col == 2)
75 		{
76 			return ((Integer)m_testTool.getUnsolvedReferenceKeeperIds().elementAt(row)).toString();
77 		}
78 		else
79 		{
80 			return null;
81 		}
82 	}
83 
84 	public boolean isCellEditable(int row, int col)
85 	{
86 		return false;
87 	}
88 }
89 
90