Selection[] selection = textArea.getSelection();
if (selection == null || selection.length <= 0){
  textArea.selectWord();
  selection = textArea.getSelection();
}
if (selection != null && selection.length > 0){
  // Registers.copy(textArea,'$');
  int currentPos = textArea.getCaretPosition();
  String text = textArea.getSelectedText(selection[0]).trim();
  
  ise.plugin.nav.NavigatorPlugin plugin = jEdit.getPlugin("ise.plugin.nav.NavigatorPlugin");
  plugin.getNavigator(editPane).update();
  
  // left = view.getDockableWindowManager().getLeftDockingArea().getCurrent();
  // System.out.println(left == null);
  // isShow = view.getDockableWindowManager().isDockableWindowVisible("codebrowser");
  // if (!isShow){
    // view.getDockableWindowManager().showDockableWindow("codebrowser");
  // }
  
  com = view.getDockableWindowManager().getDockableWindow("codebrowser");
  if (com == null) {
    view.getDockableWindowManager().showDockableWindow("codebrowser");
    com = view.getDockableWindowManager().getDockableWindow("codebrowser");
  }
  
  String mode = buffer.getMode().getName();
  // public void findString(Buffer buffer, String nodename, boolean startWith, boolean gotoSelected, int sleep)
  
  if (mode.startsWith("cobol")){
    ((com.bitart.codebrowser.CodeBrowser)com).findString(buffer,text,false,false,100);
  } else {
    ((com.bitart.codebrowser.CodeBrowser)com).findString(buffer,text,true,false,100);
  }
    if (textArea.getCaretPosition() != currentPos){
    ise.plugin.nav.NavigatorPlugin plugin = jEdit.getPlugin("ise.plugin.nav.NavigatorPlugin");
    plugin.getNavigator(editPane).update();
  }
  // Thread th = new Thread( new Runnable() {
    // public void run(){
      // try {
        // Thread.sleep(100);
      // } catch (Exception e){}
      // ((com.bitart.codebrowser.CodeBrowser)com).findString(text,false);
      // if (left != null){
        // view.getDockableWindowManager().showDockableWindow(left);
      // }
    // }
  // });
  // th.start();
}

