KickJava   Java API By Example, From Geeks To Geeks.

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


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.RuntimeAnnotationsAttribute;
12 import org.gjt.jclasslib.util.ExtendedJLabel;
13
14 import javax.swing.tree.TreePath JavaDoc;
15
16 /**
17  * Detail pane showing <tt>VisibleRuntimeAnnotations</tt> and
18  * <tt>InvisibleRuntimeAnnotations</tt> attribute.
19  *
20  * @author <a HREF="mailto:vitor.carreira@gmail.com">Vitor Carreira</a>
21  * @version $Revision: 1.1 $ $Date: 2004/12/28 13:04:30 $
22  */

23 public class RuntimeAnnotationsAttributeDetailPane extends FixedListDetailPane {
24
25     private ExtendedJLabel lblAnnotationEntries;
26
27     /**
28      * Constructor.
29      *
30      * @param services the associated browser services.
31      */

32     public RuntimeAnnotationsAttributeDetailPane(BrowserServices services) {
33         super(services);
34     }
35
36
37     protected void setupLabels() {
38         addDetailPaneEntry(normalLabel("Number of annotations:"),
39                 lblAnnotationEntries = highlightLabel());
40     }
41
42     public void show(TreePath JavaDoc treePath) {
43         RuntimeAnnotationsAttribute raa =
44                 (RuntimeAnnotationsAttribute)findAttribute(treePath);
45
46         lblAnnotationEntries.setText(String.valueOf(raa.getRuntimeAnnotations().length));
47
48         super.show(treePath);
49
50     }
51 }
52
Popular Tags