KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > debugger > ui > models > WatchesTableModel


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 package org.netbeans.modules.debugger.ui.models;
21
22 import org.netbeans.api.debugger.Watch;
23 import org.netbeans.spi.debugger.ui.Constants;
24 import org.netbeans.spi.viewmodel.TableModel;
25 import org.netbeans.spi.viewmodel.ModelListener;
26 import org.netbeans.spi.viewmodel.UnknownTypeException;
27
28
29 /**
30  *
31  * @author Jan Jancura
32  */

33 // XXX ??? Totally useless class ???
34
public class WatchesTableModel implements TableModel, Constants {
35
36     public Object JavaDoc getValueAt (Object JavaDoc row, String JavaDoc columnID) throws
37     UnknownTypeException {
38         if (row instanceof Watch) {
39             if (columnID.equals (WATCH_TO_STRING_COLUMN_ID))
40                 return "";
41             else
42             if (columnID.equals (WATCH_TYPE_COLUMN_ID))
43                 return "";
44             else
45             if (columnID.equals (WATCH_VALUE_COLUMN_ID))
46                 return "";
47         }
48         throw new UnknownTypeException (row);
49     }
50     
51     public boolean isReadOnly (Object JavaDoc row, String JavaDoc columnID) throws
52     UnknownTypeException {
53         if (row instanceof Watch) {
54             if (columnID.equals (WATCH_TO_STRING_COLUMN_ID))
55                 return true;
56             else
57             if (columnID.equals (WATCH_TYPE_COLUMN_ID))
58                 return true;
59             else
60             if (columnID.equals (WATCH_VALUE_COLUMN_ID))
61                 return true;
62         }
63         throw new UnknownTypeException (row);
64     }
65     
66     public void setValueAt (Object JavaDoc row, String JavaDoc columnID, Object JavaDoc value)
67     throws UnknownTypeException {
68         throw new UnknownTypeException (row);
69     }
70     
71     /**
72      * Registers given listener.
73      *
74      * @param l the listener to add
75      */

76     public void addModelListener (ModelListener l) {
77     }
78
79     /**
80      * Unregisters given listener.
81      *
82      * @param l the listener to remove
83      */

84     public void removeModelListener (ModelListener l) {
85     }
86 }
87
Popular Tags