KickJava   Java API By Example, From Geeks To Geeks.

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


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.BrowserServices;
11 import org.gjt.jclasslib.browser.detail.FixedListDetailPane;
12 import org.gjt.jclasslib.structures.attributes.ConstantValueAttribute;
13 import org.gjt.jclasslib.util.ExtendedJLabel;
14
15 import javax.swing.tree.TreePath JavaDoc;
16
17 /**
18     Detail pane showing a <tt>ConstantValue</tt> attribute.
19  
20     @author <a HREF="mailto:jclasslib@ej-technologies.com">Ingo Kegel</a>
21     @version $Revision: 1.5 $ $Date: 2003/08/18 08:18:35 $
22 */

23 public class ConstantValueAttributeDetailPane extends FixedListDetailPane {
24
25     // Visual components
26

27     private ExtendedJLabel lblValue;
28     private ExtendedJLabel lblVerbose;
29     
30     /**
31         Constructor.
32         @param services the associated browser services.
33      */

34     public ConstantValueAttributeDetailPane(BrowserServices services) {
35         super(services);
36     }
37     
38     protected void setupLabels() {
39         
40         addDetailPaneEntry(normalLabel("Constant value index:"),
41                            lblValue = linkLabel(),
42                            lblVerbose = highlightLabel());
43     }
44
45     public void show(TreePath JavaDoc treePath) {
46         
47         ConstantValueAttribute attribute = (ConstantValueAttribute)findAttribute(treePath);
48
49         constantPoolHyperlink(lblValue,
50                               lblVerbose,
51                               attribute.getConstantvalueIndex());
52         
53         super.show(treePath);
54     }
55     
56 }
57
58
Popular Tags