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.ElementValue; 12 import org.gjt.jclasslib.structures.elementvalues.ElementValuePair; 13 import org.gjt.jclasslib.util.ExtendedJLabel; 14 15 import javax.swing.tree.TreePath ; 16 17 23 public class ElementValuePairDetailPane extends FixedListDetailPane { 24 25 private ExtendedJLabel lblElementName; 26 private ExtendedJLabel lblElementNameVerbose; 27 28 private ExtendedJLabel lblValueTag; 29 private ExtendedJLabel lblValueTagVerbose; 30 31 public ElementValuePairDetailPane(BrowserServices services) { 32 super(services); 33 } 34 35 protected void setupLabels() { 36 addDetailPaneEntry(normalLabel("Element name:"), 37 lblElementName = linkLabel(), 38 lblElementNameVerbose = highlightLabel()); 39 addDetailPaneEntry(normalLabel("Value tag:"), 40 lblValueTag = highlightLabel(), 41 lblValueTagVerbose = highlightLabel()); 42 43 } 44 45 public void show(TreePath treePath) { 46 ElementValuePair evp = (ElementValuePair) 47 ((BrowserTreeNode)treePath.getLastPathComponent()).getElement(); 48 49 50 constantPoolHyperlink(lblElementName, 51 lblElementNameVerbose, 52 evp.getElementNameIndex()); 53 54 lblValueTag.setText(String.valueOf((char)evp.getElementValue().getTag())); 55 lblValueTagVerbose.setText("<" + ElementValue.getTagDescription(evp.getElementValue().getTag()) + ">"); 56 57 super.show(treePath); 58 } 59 60 } 61 | Popular Tags |