Ignore:
Timestamp:
2004-12-17T16:50:46+13:00 (19 years ago)
Author:
mdewsnip
Message:

Initial work on allowing metadata databases to be exploded from within the GLI. These are marked with a different icon in the collection tree and a new item is added to the right-click menu for these files. Clicking this will eventually run the explode_metadata_databases.pl script to explode these files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/collection/CollectionTree.java

    r8846 r8853  
    2727package org.greenstone.gatherer.collection;
    2828
     29import java.awt.*;
     30import javax.swing.*;
    2931import org.greenstone.gatherer.gui.tree.DragTree;
     32import org.greenstone.gatherer.gui.tree.DragTreeCellRenderer;
    3033
    3134
     
    3639    {
    3740    super(name, collection_tree_model, mixed_selection);
     41    setCellRenderer(new CollectionTreeCellRenderer());
     42    }
     43
     44
     45    private class CollectionTreeCellRenderer
     46    extends DragTreeCellRenderer
     47    {
     48    public Component getTreeCellRendererComponent(JTree tree, Object value, boolean sel, boolean expanded, boolean leaf, int row, boolean hasFocus)
     49    {
     50        JLabel tree_cell = (JLabel) super.getTreeCellRendererComponent(tree, value, sel, expanded, leaf, row, hasFocus);
     51
     52        // Mark explodable files with a different icon
     53        if (value instanceof CollectionTreeNode && ((CollectionTreeNode) value).isExplodable()) {
     54        tree_cell.setIcon(CollectionTreeNode.GREEN_FILE);
     55        }
     56
     57        return tree_cell;
     58    }
    3859    }
    3960}
Note: See TracChangeset for help on using the changeset viewer.