KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > detail > ArrayElementValueDetailPane


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;
8
9 import org.gjt.jclasslib.browser.BrowserServices;
10 import org.gjt.jclasslib.browser.BrowserTreeNode;
11 import org.gjt.jclasslib.structures.elementvalues.ArrayElementValue;
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  * Class for showing an array element value entry.
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 ArrayElementValueDetailPane extends FixedListDetailPane {
24
25     private ExtendedJLabel lblTag;
26     private ExtendedJLabel lblTagVerbose;
27
28     private ExtendedJLabel lblValueCount;
29
30     public ArrayElementValueDetailPane(BrowserServices services) {
31         super(services);
32     }
33
34     protected void setupLabels() {
35         addDetailPaneEntry(normalLabel("Tag:"),
36                 lblTag = highlightLabel(),
37                 lblTagVerbose = highlightLabel());
38
39         addDetailPaneEntry(normalLabel("Number of values:"),
40                 lblValueCount = highlightLabel());
41     }
42
43     public void show(TreePath JavaDoc treePath) {
44         ArrayElementValue aev = (ArrayElementValue)
45                 ((BrowserTreeNode)treePath.getLastPathComponent()).getElement();
46
47         lblTag.setText(String.valueOf((char)aev.getTag()));
48         lblTagVerbose.setText("<" + ElementValue.getTagDescription(aev.getTag()) + ">");
49
50         lblValueCount.setText(String.valueOf(aev.getElementValueEntries().length));
51
52         super.show(treePath);
53     }
54
55
56 }
57
Popular Tags