PageRenderTime 10ms CodeModel.GetById 2ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/branches/jsdoc_tk_gui/src/org/jsdoctoolkit/view/TreeFileCellRenderer.java

http://jsdoc-toolkit.googlecode.com/
Java | 51 lines | 7 code | 5 blank | 39 comment | 0 complexity | b6c65ff463a958f2c44b3452646f9e62 MD5 | raw file
 1package org.jsdoctoolkit.view;
 2
 3import javax.swing.tree.DefaultTreeCellRenderer;
 4
 5public class TreeFileCellRenderer extends DefaultTreeCellRenderer {
 6
 7    public TreeFileCellRenderer() {
 8        super();
 9    }
10
11    /*
12     * (non-Javadoc)
13     * 
14     * @see javax.swing.tree.DefaultTreeCellRenderer#getTreeCellRendererComponent(javax.swing.JTree,
15     * java.lang.Object, boolean, boolean, boolean, int, boolean)
16     */
17    //@Override
18   /* public Component getTreeCellRendererComponent(@SuppressWarnings("hiding") JTree tree, Object value, boolean sel,
19            boolean expanded, boolean leaf, int row, @SuppressWarnings("hiding") boolean hasFocus) {
20        if (value instanceof FolderNode) {
21
22            JLabel l = (JLabel) super.getTreeCellRendererComponent(tree, ((FolderNode) value)
23                    .toString(), sel, expanded, leaf, row, hasFocus);
24
25            if (((FolderNode) value).getType() == FolderNode.TYPE_WD) {
26                l.setIcon(IconFactory.getImageIcon("wd", IconFactory.GIF));
27            } else if (((FolderNode) value).getType() == FolderNode.TYPE_TLD) {
28                l.setIcon(IconFactory.getImageIcon("tld", IconFactory.GIF));
29            } else if (((FolderNode) value).getType() == FolderNode.TYPE_DOMAIN) {
30                l.setIcon(IconFactory.getImageIcon("domain", IconFactory.GIF));
31            } else if (((FolderNode) value).getType() == FolderNode.TYPE_GROUP) {
32                l.setIcon(IconFactory.getImageIcon("group", IconFactory.GIF));
33            } else if (((FolderNode) value).getType() == FolderNode.TYPE_LAST_GROUP) {
34                l.setIcon(IconFactory.getImageIcon("lastgroup", IconFactory.GIF));
35            } else if (((FolderNode) value).getType() == FolderNode.TYPE_ECC_FILE) {
36                l.setIcon(IconFactory.getImageIcon("new", IconFactory.GIF));
37            } else if (((FolderNode) value).getType() == FolderNode.TYPE_JS_FILE) {
38                l.setIcon(IconFactory.getImageIcon("script", IconFactory.GIF));
39            } else if (((FolderNode) value).getType() == FolderNode.TYPE_HTML_FILE) {
40                l.setIcon(IconFactory.getImageIcon("new", IconFactory.GIF));
41            } else if (((FolderNode) value).getType() == FolderNode.TYPE_PDF_FILE) {
42                l.setIcon(IconFactory.getImageIcon("new", IconFactory.GIF));
43            }
44            return l;
45        }
46
47        return super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row,
48                hasFocus);
49    }*/
50
51}