KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > viewmodel > ExceptionNode


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.viewmodel;
21
22 import java.awt.event.ActionEvent JavaDoc;
23 import java.beans.PropertyEditor JavaDoc;
24 import java.lang.IllegalAccessException JavaDoc;
25 import java.lang.ref.WeakReference JavaDoc;
26 import java.lang.reflect.InvocationTargetException JavaDoc;
27 import java.util.ArrayList JavaDoc;
28 import java.util.Collections JavaDoc;
29 import java.util.HashMap JavaDoc;
30 import javax.swing.AbstractAction JavaDoc;
31 import javax.swing.Action JavaDoc;
32
33 import org.netbeans.spi.viewmodel.ColumnModel;
34 import org.netbeans.spi.viewmodel.TreeModel;
35 import org.netbeans.spi.viewmodel.TableModel;
36 import org.netbeans.spi.viewmodel.UnknownTypeException;
37
38 import org.openide.nodes.AbstractNode;
39 import org.openide.nodes.Children;
40 import org.openide.nodes.Node;
41 import org.openide.nodes.PropertySupport;
42 import org.openide.nodes.Sheet;
43 import org.openide.util.HelpCtx;
44 import org.openide.util.lookup.Lookups;
45
46
47 /**
48  *
49  * @author Jan Jancura
50  */

51 public class ExceptionNode extends AbstractNode {
52
53     
54     private Exception JavaDoc exception;
55     
56     // init ....................................................................
57

58     /**
59     * Creates root of call stack for given producer.
60     */

61     public ExceptionNode (
62         Exception JavaDoc exception
63     ) {
64         super (
65             Children.LEAF,
66             Lookups.singleton (exception)
67         );
68         this.exception = exception;
69         setIconBaseWithExtension ("org/openide/resources/actions/empty.gif");
70     }
71     
72     public String JavaDoc getName () {
73         return exception.getLocalizedMessage ();
74     }
75     
76     public String JavaDoc getDisplayName () {
77         return exception.getLocalizedMessage ();
78     }
79
80     public HelpCtx getHelpCtx() {
81         return new HelpCtx (getClass ());
82     }
83 }
84
85
Popular Tags