01: /*
02: This library is free software; you can redistribute it and/or
03: modify it under the terms of the GNU General Public
04: License as published by the Free Software Foundation; either
05: version 2 of the license, or (at your option) any later version.
06: */
07: package org.gjt.jclasslib.browser.detail;
08:
09: 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: /**
18: * Class for showing an element value pair node.
19: *
20: * @author <a href="mailto:vitor.carreira@gmail.com">Vitor Carreira</a>
21: * @version $Revision: 1.1 $ $Date: 2004/12/28 13:04:31 $
22: */
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) ((BrowserTreeNode) treePath
47: .getLastPathComponent()).getElement();
48:
49: constantPoolHyperlink(lblElementName, lblElementNameVerbose,
50: evp.getElementNameIndex());
51:
52: lblValueTag.setText(String.valueOf((char) evp.getElementValue()
53: .getTag()));
54: lblValueTagVerbose.setText("<"
55: + ElementValue.getTagDescription(evp.getElementValue()
56: .getTag()) + ">");
57:
58: super.show(treePath);
59: }
60:
61: }
|