Changeset 4385


Ignore:
Timestamp:
2003-05-28T12:14:47+12:00 (21 years ago)
Author:
jmt12
Message:

Added method getIcon() which returns the ImageIcon the file system thinks should be assigned to this file node, or null if the node has no file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/file/FileNode.java

    r4377 r4385  
    157157    }
    158158
     159    /** Retrieve the icon the system thinks should be assigned to this node. If this node has no file then the icon will be null. */
     160    public ImageIcon getIcon() {
     161    ImageIcon icon = null; // Default icon according to tree...
     162    if(file != null) {
     163        Icon raw_icon = FileSystemView.getFileSystemView().getSystemIcon(file);
     164        icon = new ImageIcon(raw_icon);
     165    }
     166    return icon;
     167    }
     168
    159169    /** Returns the index of node in the receivers children. */
    160170    public int getIndex(TreeNode node) {
Note: See TracChangeset for help on using the changeset viewer.