Changeset 7123


Ignore:
Timestamp:
2004-03-26T18:08:56+12:00 (20 years ago)
Author:
kjdon
Message:

added in 'left arrow on a file moves to teh parent folder' navigation thingy for the trees

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

Legend:

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

    r7098 r7123  
    10581058        }
    10591059        tree.setImmediate(false);
    1060         }
    1061     }
    1062 
     1060        } else if (event.getKeyCode() == KeyEvent.VK_LEFT) {
     1061        // left key on a file shifts the selection to the parent folder
     1062        DragTree tree = (DragTree)event.getSource();
     1063        TreePath path = tree.getLeadSelectionPath();
     1064        if(path != null) {
     1065            File file = ((FileNode)path.getLastPathComponent()).getFile();
     1066            if(file != null && file.isFile()) {
     1067            TreePath parent_path = path.getParentPath();
     1068            if (parent_path != null && parent_path.getParentPath() != null) {
     1069                // if this file is in the top level folder, don't move the focus
     1070                tree.setImmediate(true);
     1071                tree.clearSelection();
     1072                tree.setSelectionPath(parent_path);
     1073                tree.setImmediate(false);
     1074            }
     1075            }
     1076        }
     1077        }
     1078    }
    10631079    }
    10641080
  • trunk/gli/src/org/greenstone/gatherer/gui/GatherPane.java

    r7098 r7123  
    722722        }
    723723        tree.setImmediate(false);
     724        } else if (event.getKeyCode() == KeyEvent.VK_LEFT) {
     725        // left key on a file shifts the selection to the parent folder
     726        DragTree tree = (DragTree)event.getSource();
     727        TreePath path = tree.getLeadSelectionPath();
     728        if(path != null) {
     729            File file = ((FileNode)path.getLastPathComponent()).getFile();
     730            if(file != null && file.isFile()) {
     731            TreePath parent_path = path.getParentPath();
     732            if (parent_path != null && parent_path.getParentPath() != null) {
     733                // if this file is in the top level folder, don't move the focus
     734                tree.setImmediate(true);
     735                tree.clearSelection();
     736                tree.setSelectionPath(parent_path);
     737                tree.setImmediate(false);
     738            }
     739            }
     740        }
    724741        }
    725742    }
Note: See TracChangeset for help on using the changeset viewer.