1 7 package org.gjt.jclasslib.browser.detail; 8 9 import org.gjt.jclasslib.browser.BrowserServices; 10 import org.gjt.jclasslib.browser.BrowserTreeNode; 11 import org.gjt.jclasslib.structures.elementvalues.AnnotationElementValue; 12 import org.gjt.jclasslib.structures.elementvalues.ElementValue; 13 import org.gjt.jclasslib.util.ExtendedJLabel; 14 15 import javax.swing.tree.TreePath ; 16 17 23 public class AnnotationDetailPane extends FixedListDetailPane { 24 25 private ExtendedJLabel lblTag; 26 private ExtendedJLabel lblTagVerbose; 27 28 private ExtendedJLabel lblType; 29 private ExtendedJLabel lblTypeVerbose; 30 31 private ExtendedJLabel lblValuePairEntries; 32 33 public AnnotationDetailPane(BrowserServices services) { 34 super(services); 35 } 36 37 protected void setupLabels() { 38 addDetailPaneEntry(normalLabel("Tag:"), 39 lblTag = highlightLabel(), 40 lblTagVerbose = highlightLabel()); 41 42 addDetailPaneEntry(normalLabel("Type:"), 43 lblType = linkLabel(), 44 lblTypeVerbose = highlightLabel()); 45 46 addDetailPaneEntry(normalLabel("Number of entries:"), 47 lblValuePairEntries = highlightLabel()); 48 } 49 50 public void show(TreePath treePath) { 51 AnnotationElementValue annotation = (AnnotationElementValue) 52 ((BrowserTreeNode)treePath.getLastPathComponent()).getElement(); 53 54 lblTag.setText(String.valueOf((char)annotation.getTag())); 55 lblTagVerbose.setText("<" + ElementValue.getTagDescription(annotation.getTag()) + ">"); 56 57 constantPoolHyperlink(lblType, 58 lblTypeVerbose, 59 annotation.getTypeIndex()); 60 61 lblValuePairEntries.setText(String.valueOf(annotation.getElementValuePairEntries().length)); 62 63 super.show(treePath); 64 } 65 } 66 | Popular Tags |