1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 package com.sun.star.xml.security.uno;
25 
26 import javax.swing.table.AbstractTableModel;
27 
28 /*
29  * this class is used to maintain the unsolved reference
30  * table.
31  */
32 class UnsolvedReferenceTableModel extends AbstractTableModel
33 {
34 	private String[] m_columnNames = {"id",
35 	                       "refNum",
36 	                       "EC's id"};
37 
38 	private TestTool m_testTool;
39 
UnsolvedReferenceTableModel(TestTool testTool)40 	UnsolvedReferenceTableModel(TestTool testTool)
41 	{
42 		m_testTool = testTool;
43 	}
44 
getColumnName(int col)45 	public String getColumnName(int col)
46 	{
47 		return m_columnNames[col].toString();
48 	}
49 
getRowCount()50 	public int getRowCount()
51 	{
52 		return m_testTool.getUnsolvedReferenceIds().size();
53 	}
54 
getColumnCount()55 	public int getColumnCount()
56 	{
57 		return m_columnNames.length;
58 	}
59 
getValueAt(int row, int col)60 	public Object getValueAt(int row, int col)
61 	{
62 	    	if (col == 0)
63 	    	{
64 	    		return (String)m_testTool.getUnsolvedReferenceIds().elementAt(row);
65 		}
66 		else if (col == 1)
67 		{
68 			return ((Integer)m_testTool.getUnsolvedReferenceRefNum().elementAt(row)).toString();
69 		}
70 		else if (col == 2)
71 		{
72 			return ((Integer)m_testTool.getUnsolvedReferenceKeeperIds().elementAt(row)).toString();
73 		}
74 		else
75 		{
76 			return null;
77 		}
78 	}
79 
isCellEditable(int row, int col)80 	public boolean isCellEditable(int row, int col)
81 	{
82 		return false;
83 	}
84 }
85 
86