Changeset 11599


Ignore:
Timestamp:
2006-04-06T14:39:04+12:00 (18 years ago)
Author:
mdewsnip
Message:

Moved the RecycleBin object into the Gatherer class so it can be more globally used.

Location:
trunk/gli/src/org/greenstone/gatherer
Files:
2 edited

Legend:

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

    r11431 r11599  
    4444import org.greenstone.gatherer.file.FileManager;
    4545import org.greenstone.gatherer.file.FileAssociationManager;
     46import org.greenstone.gatherer.file.RecycleBin;
    4647import org.greenstone.gatherer.gui.GUIManager;
    4748import org.greenstone.gatherer.gui.URLField;
     
    8182    /** A public reference to the CollectionManager. */
    8283    static public CollectionManager c_man;
     84    /** A public reference to the RecycleBin. */
     85    static public RecycleBin recycle_bin;
    8386    /** a reference to the Servlet Configuration is GS3 */
    8487    static public ServletConfiguration servlet_config;
     
    394397        // Create Collection Manager
    395398        c_man = new CollectionManager();
     399        // Create Recycle Bin
     400        recycle_bin = new RecycleBin();
    396401
    397402        if (GS3) {
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r11598 r11599  
    110110    /** Ensures that expansion and selection events between collection trees based on the same model are synchronized. */
    111111    private TreeSynchronizer collection_tree_sync = null;
    112     /** The button used to delete files, which also doubles as a drop target for files from the Trees. */
    113     private RecycleBin bin_button           =  null;
    114112    /** The default size of a special mapping dialog. */
    115113    static final Dimension DIALOG_SIZE = new Dimension(400, 120);
     
    156154    // If a user has clicked on the bin button directly remove whatever
    157155    // files are selected in the active tree.
    158     if(event.getSource() == bin_button) {
    159         if(!bin_button.ignore()) {
     156    if (event.getSource() == Gatherer.recycle_bin) {
     157        if (!Gatherer.recycle_bin.ignore()) {
    160158        // Find the active tree (you've made selections in).
    161159        DragTree tree = (DragTree) group.getActive();
     
    169167            source_nodes[i] = (FileNode)(paths[i].getLastPathComponent());
    170168            }
    171             Gatherer.f_man.action(tree, source_nodes, bin_button, null);
     169            Gatherer.f_man.action(tree, source_nodes, Gatherer.recycle_bin, null);
    172170        }
    173171        }
     
    297295    JPanel button_pane = new JPanel();
    298296
    299     bin_button = new RecycleBin();
    300     bin_button.addActionListener(this);
    301     bin_button.setMinimumSize(MIN_SIZE);
    302     bin_button.setPreferredSize(MIN_SIZE);
    303     Dictionary.registerTooltip(bin_button, "Collection.Delete_Tooltip");
    304     group.add(bin_button);
     297    RecycleBin recycle_bin = Gatherer.recycle_bin;
     298    recycle_bin.addActionListener(this);
     299    recycle_bin.setMinimumSize(MIN_SIZE);
     300    recycle_bin.setPreferredSize(MIN_SIZE);
     301    Dictionary.registerTooltip(recycle_bin, "Collection.Delete_Tooltip");
     302    group.add(recycle_bin);
    305303
    306304    // Layout Components.
     
    334332
    335333    button_pane.add(new_folder);
    336     button_pane.add(bin_button);
     334    button_pane.add(recycle_bin);
    337335
    338336    control_pane.setLayout(new BorderLayout());
     
    722720
    723721        // Fire a delete action
    724         Gatherer.f_man.action(tree, source_nodes, bin_button, null);
     722        Gatherer.f_man.action(tree, source_nodes, Gatherer.recycle_bin, null);
    725723        }
    726724
     
    778776            source_nodes[i] = (FileNode) paths[i].getLastPathComponent();
    779777            }
    780             Gatherer.f_man.action(tree, source_nodes, bin_button, null);
     778            Gatherer.f_man.action(tree, source_nodes, Gatherer.recycle_bin, null);
    781779            source_nodes = null;
    782780        }
Note: See TracChangeset for help on using the changeset viewer.