01: /*
02: * SalomeTMF is a Test Management Framework
03: * Copyright (C) 2005 France Telecom R&D
04: *
05: * This library is free software; you can redistribute it and/or
06: * modify it under the terms of the GNU Lesser General Public
07: * License as published by the Free Software Foundation; either
08: * version 2 of the License, or (at your option) any later version.
09: *
10: * This library is distributed in the hope that it will be useful,
11: * but WITHOUT ANY WARRANTY; without even the implied warranty of
12: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13: * Lesser General Public License for more details.
14: *
15: * You should have received a copy of the GNU Lesser General Public
16: * License along with this library; if not, write to the Free Software
17: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18: *
19: * @author Mikael MARCHE, Fayçal SOUGRATI, Vincent PAUTRET
20: *
21: * Contact: mikael.marche@rd.francetelecom.com
22: */
23:
24: package org.objectweb.salome_tmf.ihm.models;
25:
26: import org.objectweb.salome_tmf.ihm.main.ExecutionView;
27:
28: /**
29: * Classe qui repr?sente le mod?le d'un table
30: * @author teaml039
31: * @version 0.1
32: */
33: public class ExecutionTableModel extends MyTableModel {
34:
35: /******************************************************************************/
36: /** CONSTRUCTEUR ***/
37: /******************************************************************************/
38:
39: /**
40: * Constructeur du mod?le de table
41: */
42: public ExecutionTableModel() {
43: super ();
44: } // Fin du constructeur ExecutionTableModel/0
45:
46: /******************************************************************************/
47: /** METHODES PUBLIQUES ***/
48: /******************************************************************************/
49:
50: /**
51: * Rend vrai si les cellules de la table sont ?ditables
52: * @return toujours faux
53: */
54: public boolean isCellEditable(int row, int col) {
55: return (col == 0);
56: } // Fin de la m?thode isCellEditable/2
57:
58: /**
59: * Supprime la ligne dont l'?l?ment de la colonne 1 correspond ? la cha?ne
60: * pass?e en param?tre.
61: * @param key
62: */
63: public void removeRow(String key) {
64: for (int i = 0; i < getRowCount(); i++) {
65: if (getValueAt(i, 1).equals(key)) {
66: removeData(i);
67: break;
68: }
69: }
70:
71: ExecutionView.getTable().getColumnModel().getColumn(0)
72: .setMaxWidth(18);
73: ExecutionView.getTable().getColumnModel().getColumn(0)
74: .setPreferredWidth(18);
75:
76: }
77:
78: } // Fin de la classe MyTableModel
|