KickJava   Java API By Example, From Geeks To Geeks.

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


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.AnnotationDefaultAttribute;
12 import org.gjt.jclasslib.structures.elementvalues.ElementValue;
13 import org.gjt.jclasslib.util.ExtendedJLabel;
14
15 import javax.swing.tree.TreePath JavaDoc;
16
17 /**
18  * Detail pane showing <tt>AnnotationDefault</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 AnnotationDefaultAttributeDetailPane extends FixedListDetailPane {
24
25     private ExtendedJLabel lblTag;
26     private ExtendedJLabel lblTagVerbose;
27
28     public AnnotationDefaultAttributeDetailPane(BrowserServices services) {
29         super(services);
30     }
31
32     protected void setupLabels() {
33         addDetailPaneEntry(normalLabel("Default value:"),
34                 lblTag = highlightLabel(),
35                 lblTagVerbose = highlightLabel());
36     }
37
38     public void show(TreePath JavaDoc treePath) {
39         AnnotationDefaultAttribute ada = (AnnotationDefaultAttribute)findAttribute(treePath);
40
41         int tag = ada.getDefaultValue().getTag();
42         String JavaDoc name = ada.getDefaultValue().getEntryName();
43         lblTag.setText(name);
44         lblTagVerbose.setText("<" + ElementValue.getTagDescription(tag) + ">");
45
46         super.show(treePath);
47     }
48 }
49
Popular Tags