@Override public void treeSelection(TreeSelectionEvent e){
  if (!tree.isDragging()) {
    if (parentObj != null) {
      parentObj.preLoad();
    }
    List<SLDDataInterface> sldDataList=new ArrayList<SLDDataInterface>();
    List<NodeInterface> nodeList=new ArrayList<NodeInterface>();
    boolean isDataSource=false;
    boolean isFolder=false;
    TreePath[] selectedPaths=tree.getSelectionPaths();
    if (selectedPaths != null) {
      for (      TreePath selectedPath : selectedPaths) {
        Object o=selectedPath.getLastPathComponent();
        if (o instanceof NodeInterface) {
          NodeInterface handler=(NodeInterface)o;
          FileSystemInterface input=handler.getHandler();
          SelectedFiles selectedFiles=input.getSLDContents(handler);
          if (selectedFiles != null) {
            isDataSource=selectedFiles.isDataSource();
            isFolder|=selectedFiles.isFolder();
            List<SLDDataInterface> handlerDataList=selectedFiles.getSldData();
            if (handlerDataList != null) {
              sldDataList.addAll(handlerDataList);
            }
          }
          nodeList.add(handler);
        }
      }
      toolMgr.setSelectedItems(nodeList,sldDataList);
      if (!parentObj.loadSLDString(isFolder,isDataSource,sldDataList)) {
        tree.revertSelection(e.getOldLeadSelectionPath());
      }
    }
 else {
      toolMgr.setSelectedItems(nodeList,sldDataList);
    }
  }
}

@ Override public void treeSelection ( TreeSelectionEvent e ) { if ( ! tree . isDragging ( ) ) { if ( parentObj != null ) { parentObj . preLoad ( ) ; } List < SLDDataInterface > sldDataList = new ArrayList < SLDDataInterface > ( ) ; List < NodeInterface > nodeList = new ArrayList < NodeInterface > ( ) ; boolean isDataSource = false ; boolean isFolder = false ; TreePath [ ] selectedPaths = tree . getSelectionPaths ( ) ; if ( selectedPaths != null ) { for ( TreePath selectedPath : selectedPaths ) { Object o = selectedPath . getLastPathComponent ( ) ; if ( o instanceof NodeInterface ) { NodeInterface handler = ( NodeInterface ) o ; FileSystemInterface input = handler . getHandler ( ) ; SelectedFiles selectedFiles = input . getSLDContents ( handler ) ; if ( selectedFiles != null ) { isDataSource = selectedFiles . isDataSource ( ) ; isFolder |= selectedFiles . isFolder ( ) ; List < SLDDataInterface > handlerDataList = selectedFiles . getSldData ( ) ; if ( handlerDataList != null ) { sldDataList . addAll ( handlerDataList ) ; } } nodeList . add ( handler ) ; } } toolMgr . setSelectedItems ( nodeList , sldDataList ) ; if ( ! parentObj . loadSLDString ( isFolder , isDataSource , sldDataList ) ) { tree . revertSelection ( e . getOldLeadSelectionPath ( ) ) ; } } else { toolMgr . setSelectedItems ( nodeList , sldDataList ) ; } } }
called when the file system tree selection has changed .
