1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
| import javax.swing.*;
import javax.swing.JMenuItem.*;
import javax.swing.event.*;
import javax.swing.border.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.util.*;
import java.text.*;
import java.io.*;
import java.lang.*;
import javax.swing.table.*;
// ===== definition of the XrdIServerTypeTableModel class ====================
public class XrdIServerTypeTableModel extends AbstractTableModel
{
protected Object[][] data = {
{"ccbbsn10", new Boolean(true), new Boolean(false), new Boolean(false)},
{"ccbbsn13", new Boolean(true), new Boolean(false), new Boolean(false)},
{"ccbbsn14", new Boolean(true), new Boolean(false), new Boolean(false)},
{"ccbbsn15", new Boolean(true), new Boolean(false), new Boolean(false)},
{"ccbbsn16", new Boolean(true), new Boolean(false), new Boolean(false)}
};
protected String[] columnNames = {"Server name", "Data", "Redirector", "Supervisor"}; // names of the column
//Object[][] data = new Object[serverAllocated.size()][4];
public XrdIServerTypeTableModel(Vector serverAllocated)
{
}
/** Nombre de colonnes */
public int getColumnCount()
{
return columnNames.length;
}
/** Nombre de lignes */
public int getRowCount()
{
return data.length;
}
/** Noms des colonnes */
public String getColumnName(int col)
{
return columnNames[col];
}
/** Type de contenu d'une colonne */
public Class getColumnClass(int c)
{
return getValueAt(0, c).getClass();
}
/** Possibilité d'édition des données */
public boolean isCellEditable(int row, int col)
{
if((row > 1) && (col < 1))
{
return true;
}
else
{
return false;
}
}
/** Contenu d'une cellule */
public Object getValueAt(int row, int col)
{
return data[row][col];
}
/** Changement du contenu d'une cellule */
public void setValueAt(Object value, int row, int col)
{
data[row][col] = value;
fireTableCellUpdated(row, col);
}
}
// ================================ End of the XrdIServerTypeTableModel class ========================================= |