KickJava   Java API By Example, From Geeks To Geeks.

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


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 package org.gjt.jclasslib.browser.detail.attributes;
8
9 import org.gjt.jclasslib.browser.BrowserServices;
10 import org.gjt.jclasslib.browser.detail.FixedListDetailPane;
11 import org.gjt.jclasslib.structures.attributes.EnclosingMethodAttribute;
12 import org.gjt.jclasslib.util.ExtendedJLabel;
13
14 import javax.swing.tree.TreePath JavaDoc;
15
16 /**
17  * Detail pane showing a <tt>Enclosing Method</tt> attribute.
18  *
19  * @author <a HREF="mailto:vitor.carreira@gmail.com">Vitor Carreira</a>
20  * @version $Revision: 1.1 $ $Date: 2004/12/28 13:04:30 $
21  */

22 public class EnclosingMethodAttributeDetailPane extends FixedListDetailPane {
23
24     // Visual components
25
private ExtendedJLabel lblClass;
26     private ExtendedJLabel lblClassVerbose;
27     private ExtendedJLabel lblMethod;
28     private ExtendedJLabel lblMethodVerbose;
29
30     /**
31      * Constructor.
32      *
33      * @param services the associated browser services.
34      */

35     public EnclosingMethodAttributeDetailPane(BrowserServices services) {
36         super(services);
37     }
38
39     protected void setupLabels() {
40         addDetailPaneEntry(normalLabel("Class index:"),
41                 lblClass = linkLabel(),
42                 lblClassVerbose = highlightLabel());
43         addDetailPaneEntry(normalLabel("Method index:"),
44                 lblMethod = linkLabel(),
45                 lblMethodVerbose = highlightLabel());
46     }
47
48     public void show(TreePath JavaDoc treePath) {
49         EnclosingMethodAttribute attribute = (EnclosingMethodAttribute)findAttribute(treePath);
50         constantPoolHyperlink(lblClass,
51                 lblClassVerbose,
52                 attribute.getClassInfoIndex());
53
54         constantPoolHyperlink(lblMethod,
55                 lblMethodVerbose,
56                 attribute.getMethodInfoIndex());
57
58         super.show(treePath);
59     }
60 }
61
Popular Tags