KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > ide > editors > ui > DDTableModel


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /*
20  * DDTableModel.java -- synopsis.
21  *
22  */

23 package org.netbeans.modules.j2ee.sun.ide.editors.ui;
24
25 import java.util.*;
26
27 import javax.swing.table.*;
28
29 /**
30  * Table model used for displaying Deployment
31  * Descriptor entries that contain multiple key/value
32  * pairs (ie. can be modeled as arrays).
33  *
34  * @author Joe Warzecha
35  */

36 //
37
// 29-may-2001
38
// Changes for bug 4457984. Changed the signature of addRowAt
39
// to get the value of the newly created row and added the
40
// methods newElementCancelled and editsCancelled to deal with
41
// new rows. (joecorto)
42
//
43
public interface DDTableModel extends TableModel {
44
45     /**
46      * get name to use in dialog titles
47      */

48     public String JavaDoc getModelName();
49   
50     public DDTableModelEditor getEditor();
51
52     public Object JavaDoc [] getValue ();
53
54     public Object JavaDoc getValueAt (int row);
55
56     public void setValueAt (int row, Object JavaDoc value);
57
58     public Object JavaDoc makeNewElement ();
59
60     /**
61      * Called when a user cancels adding a row.
62      */

63     public void newElementCancelled(Object JavaDoc newRow);
64   
65     public void addRowAt (int row, Object JavaDoc newRow, Object JavaDoc editedValue);
66
67
68     public void removeRowAt(int row);
69
70     /**
71      * Verify that the edits performed are OK.
72      * NOTE: This method simply returns true or false which
73      * indicate if the edits are OK. Any error dialogs
74      * that would need to be displayed must be done by
75      * the implementing class to allow for greater flexibility
76      * in the error reporting.
77      * return true if edit is OK
78      * return false if the edit should not applied after all.
79      */

80     public boolean isEditValid (Object JavaDoc rowValue, int row);
81
82     /**
83      * Check to see if supplied row can be deleted.
84      */

85     public List canRemoveRow (int row);
86     
87     /**
88      * invoke underlying model to validate integrity of data.
89      * @return empty list if valid, otherwise list of all errors
90      */

91     public List isValueValid(Object JavaDoc rowValue, int fromRow);
92
93     /**
94      * Called when the user cancels all edits to the table.
95      */

96     public void editsCancelled();
97 }
98
Popular Tags