KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > debugger > jpda > ui > models > CallStackTableModel


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.jpda.ui.models;
21
22 import com.sun.jdi.AbsentInformationException;
23 import org.netbeans.api.debugger.jpda.CallStackFrame;
24 import org.netbeans.spi.debugger.ui.Constants;
25 import org.netbeans.spi.viewmodel.TableModel;
26 import org.netbeans.spi.viewmodel.ModelListener;
27 import org.netbeans.spi.viewmodel.UnknownTypeException;
28
29 import org.openide.util.NbBundle;
30
31
32 /**
33  *
34  * @author Jan Jancura
35  */

36 public class CallStackTableModel implements TableModel, Constants {
37
38
39     public Object JavaDoc getValueAt (Object JavaDoc row, String JavaDoc columnID) throws
40     UnknownTypeException {
41         if (row instanceof CallStackFrame) {
42             if (CALL_STACK_FRAME_LOCATION_COLUMN_ID.equals (columnID))
43                 try {
44                     return ((CallStackFrame) row).getSourceName (
45                         null // default stratumn for current csf is used
46
);
47                 } catch (AbsentInformationException e) {
48                     return NbBundle.getMessage (
49                         CallStackTableModel.class,
50                         "MSG_Callstack_NoInformation"
51                     );
52                 }
53         }
54         throw new UnknownTypeException (row);
55     }
56     
57     public boolean isReadOnly (Object JavaDoc row, String JavaDoc columnID) throws
58     UnknownTypeException {
59         if (row instanceof CallStackFrame) {
60             if (CALL_STACK_FRAME_LOCATION_COLUMN_ID.equals (columnID))
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