KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > feature > account > UserSelectionTableModel


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: UserSelectionTableModel.java,v 1.2 2003/03/24 08:36:55 per_nyfelt Exp $
8
package org.ozoneDB.adminGui.feature.account;
9
10 import org.ozoneDB.core.User;
11
12 import javax.swing.table.DefaultTableModel JavaDoc;
13 import java.util.Vector JavaDoc;
14
15 /**
16  * @author Per Nyfelt
17  */

18 class UserSelectionTableModel extends DefaultTableModel JavaDoc {
19
20     public UserSelectionTableModel() {
21         addColumn("id");
22         addColumn("name");
23     }
24
25     /**
26      * Adds a row to the end of the model. The new row will contain
27      * <code>null</code> values unless a <code>User</code> is specified.
28      * Notification of the row being added will be generated.
29      *
30      * @param user data of the row being added
31      */

32     public void addRow(User user) {
33         Vector JavaDoc rowData = new Vector JavaDoc();
34         rowData.add(user.id());
35         rowData.add(user.name());
36         super.addRow(rowData);
37     }
38 }
39
Popular Tags