KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > detail > attributes > CodeAttributeDetailPane


1 /*
2     This library is free software; you can redistribute it and/or
3     modify it under the terms of the GNU General Public
4     License as published by the Free Software Foundation; either
5     version 2 of the license, or (at your option) any later version.
6 */

7
8 package org.gjt.jclasslib.browser.detail.attributes;
9
10 import org.gjt.jclasslib.browser.AbstractDetailPane;
11 import org.gjt.jclasslib.browser.BrowserServices;
12 import org.gjt.jclasslib.browser.detail.attributes.code.*;
13
14 import javax.swing.*;
15 import javax.swing.tree.TreePath JavaDoc;
16 import java.awt.*;
17
18 /**
19     Detail pane showing a <tt>Code</tt> attribute. Contains three other detail
20     panes in its tabbed pane.
21
22     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
23     @version $Revision: 1.5 $ $Date: 2003/08/18 08:19:03 $
24 */

25 public class CodeAttributeDetailPane extends AbstractDetailPane {
26
27     private JTabbedPane tabbedPane;
28     
29     private ExceptionTableDetailPane exceptionTablePane;
30     private ByteCodeDetailPane byteCodePane;
31     private MiscDetailPane miscPane;
32     
33     /**
34         Constructor.
35         @param services the associated browser services.
36      */

37     public CodeAttributeDetailPane(BrowserServices services) {
38         super(services);
39     }
40
41     protected void setupComponent() {
42         setLayout(new BorderLayout());
43         
44         add(buildTabbedPane(), BorderLayout.CENTER);
45     }
46     
47     /**
48         Get the <tt>ByteCodeDetailPane</tt> showing the code
49         of this <tt>Code</tt> attribute.
50         @return the <tt>ByteCodeDetailPane</tt>
51      */

52     public ByteCodeDetailPane getCodeAttributeByteCodeDetailPane() {
53         return byteCodePane;
54     }
55     
56     /**
57         Select the <tt>ByteCodeDetailPane</tt> showing the code
58         of this <tt>Code</tt> attribute.
59      */

60     public void selectByteCodeDetailPane() {
61         tabbedPane.setSelectedIndex(0);
62     }
63     
64     private JTabbedPane buildTabbedPane() {
65         tabbedPane = new JTabbedPane();
66         tabbedPane.addTab("Bytecode", buildByteCodePane());
67         tabbedPane.addTab("Exception table", buildExceptionTablePane());
68         tabbedPane.addTab("Misc", buildMiscPane());
69         
70         return tabbedPane;
71     }
72
73     private JPanel buildByteCodePane() {
74         byteCodePane = new ByteCodeDetailPane(services);
75         return byteCodePane;
76     }
77
78     private JPanel buildExceptionTablePane() {
79         exceptionTablePane = new ExceptionTableDetailPane(services);
80         return exceptionTablePane;
81     }
82
83     private JPanel buildMiscPane() {
84         miscPane = new MiscDetailPane(services);
85         return miscPane;
86     }
87     
88     public void show(TreePath JavaDoc treePath) {
89
90         exceptionTablePane.show(treePath);
91         byteCodePane.show(treePath);
92         miscPane.show(treePath);
93     }
94     
95 }
96
97
Popular Tags