Changeset 4525


Ignore:
Timestamp:
2003-06-09T15:19:26+12:00 (21 years ago)
Author:
kjdon
Message:

drop now checks that the model is appropriate - ie that htere is a collection loaded - disable dropping into a non-collection

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r4514 r4525  
    315315    event.acceptDrop(drag_action);
    316316    if(!name.equals(Utility.WORKSPACE_TREE)) {
    317                 // Determine what node we dropped over.
     317        // Determine what node we dropped over.
    318318        Point pt = event.getLocation();
    319319        TreePath target_path = this.getPathForLocation(pt.x, pt.y);
     
    331331        }
    332332        else {
    333         target = (FileNode) getModel().getRoot();
     333        TreeModel m = getModel();
     334        // check that we have a model and is a FileSystemModel (ie check that a collection is loaded
     335        if (m != null && m instanceof FileSystemModel) {
     336            target = (FileNode) m.getRoot();
     337        }
    334338        }
    335339        target_path = null;
Note: See TracChangeset for help on using the changeset viewer.