KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > gjt > jclasslib > browser > detail > elementvalues > GenericElementValueDetailPane


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.elementvalues;
8
9 import org.gjt.jclasslib.browser.BrowserServices;
10 import org.gjt.jclasslib.browser.BrowserTreeNode;
11 import org.gjt.jclasslib.browser.detail.FixedListDetailPane;
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 /**
19  * Detail pane showing the generic information which applies to all element values.
20  * and switches between the contained panes as required.
21  *
22  * @author <a HREF="mailto:vitor.carreira@gmail.com">Vitor Carreira</a>
23  * @version $Revision: 1.1 $ $Date: 2004/12/28 13:04:30 $
24  */

25 public class GenericElementValueDetailPane extends FixedListDetailPane {
26
27     private ExtendedJLabel lblTag;
28     private ExtendedJLabel lblTagVerbose;
29
30     public GenericElementValueDetailPane(BrowserServices services) {
31         super(services);
32     }
33
34     protected void setupLabels() {
35         addDetailPaneEntry(normalLabel("Tag:"),
36                 lblTag = highlightLabel(),
37                 lblTagVerbose = highlightLabel());
38     }
39
40     public void show(TreePath JavaDoc treePath) {
41         ElementValue ceve = (ElementValue)
42                 ((BrowserTreeNode)treePath.getLastPathComponent()).getElement();
43
44         lblTag.setText(String.valueOf((char)ceve.getTag()));
45         lblTagVerbose.setText("<" + ElementValue.getTagDescription(ceve.getTag()) + ">");
46
47         super.show(treePath);
48     }
49 }
50
Popular Tags