Example #1
0
 findFilesWithText(matchText, filePatterns, searchCriteria, function(filesReplaced){
    var editorState: FileEditorState = FileEditor.currentEditorState();
    
    for(var i = 0; i < filesReplaced.length; i++) {
       var fileReplaced = filesReplaced[i];
       var fileReplacedResource: FilePath = FileTree.createResourcePath("/resource/" + fileReplaced.project + "/" + fileReplaced.resource);
       
       if(editorState.getResource().getResourcePath() == fileReplacedResource.getResourcePath()) {
          FileExplorer.openTreeFile(fileReplacedResource.getResourcePath(), function() {
             //FileEditor.showEditorLine(record.line);  
          }); 
       }
    }
 });
Example #2
0
   function submitDialogListResource(resource, line) {
      $("#dialogCancel").click(); // force the click

      if(line) {
         FileExplorer.openTreeFile(resource, function() {
            window.setTimeout(function() {
               FileEditor.showEditorLine(line);
            }, 100); // delay focus on line, some bug here that needs a delay
         });
      }else {
         location.href = resource;
      }
      return false
   }
Example #3
0
 function updateEditorFromHistory(){
    var location = window.location.hash;
    var hashIndex = location.indexOf('#');
    
    if(hashIndex != -1) {
       var resource = location.substring(hashIndex + 1);
       var resourceData: FilePath = FileTree.createResourcePath(resource);
       var editorState: FileEditorState = FileEditor.currentEditorState();
       var editorResource: FilePath = editorState.getResource();
       
       if(editorResource == null || editorResource.getResourcePath() != resourceData.getResourcePath()) { // only if changed
          FileExplorer.openTreeFile(resourceData.getResourcePath(), function() {});
       }
    }
 }