Package org.eclipse.jdt.core.search

Examples of org.eclipse.jdt.core.search.SearchDocument


  protected IStatus doQuery(IProgressMonitor monitor) {
    IStatus status = Status.OK_STATUS;
    try {
      JSPSearchSupport support = JSPSearchSupport.getInstance();
      // index the file
      SearchDocument delegate =  support.addJspFile(getFile());
     
      String scopePath = delegate.getPath();
      JSPSearchScope singleFileScope = new JSPSearchScope(new String[]{getFile().getFullPath().toString(), scopePath});
     
      // perform a searchs
      // by passing in this jsp search query, requstor can add matches
      support.searchRunnable(getJavaElement(), singleFileScope, new JSPSingleFileSearchRequestor(getInstance()), monitor);
View Full Code Here


  /**
   * Important to never return null here or else Java search participation
   * will break.
   */
  public SearchDocument getDocument(String documentPath) {
    SearchDocument sDoc = JSPSearchSupport.getInstance().getSearchDocument(documentPath);

    if (sDoc == null) {
      // return a dummy doc here so search participation doesn't break
      return new NullSearchDocument(documentPath);
    }
View Full Code Here

    if (monitor != null && monitor.isCanceled())
      return;

    // filter out null matches
    List filtered = new ArrayList();
    SearchDocument match = null;
    for (int i = 0; i < indexMatches.length; i++) {
      if (DEBUG)
        System.out.println("found possible matching JavaSearchDocumentDelegate: " + indexMatches[i]); //$NON-NLS-1$
      match = indexMatches[i];
      if (match != null) {
View Full Code Here

    if(JSPSearchSupport.getInstance().isCanceled())
      return;
       
    String matchDocumentPath = match.getResource().getFullPath().toString();
    SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
   
    if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
      JavaSearchDocumentDelegate javaSearchDoc = (JavaSearchDocumentDelegate)searchDoc;
      int jspStart = javaSearchDoc.getJspOffset(match.getOffset());
      int jspEnd = javaSearchDoc.getJspOffset(match.getOffset() + match.getLength());
View Full Code Here

  protected IStatus doQuery() {
    IStatus status = Status.OK_STATUS;
    try {
      JSPSearchSupport support = JSPSearchSupport.getInstance();
      // index the file
      SearchDocument delegate =  support.addJspFile(getFile());
     
      String scopePath = delegate.getPath();
      JSPSearchScope singleFileScope = new JSPSearchScope(new String[]{getFile().getFullPath().toString(), scopePath});
     
      // perform a searchs
      // by passing in this jsp search query, requstor can add matches
      support.searchRunnable(getJavaElement(), singleFileScope, new JSPSingleFileSearchRequestor(getInstance()));
View Full Code Here

   * @see org.eclipse.jdt.core.search.SearchRequestor#acceptSearchMatch(org.eclipse.jdt.core.search.SearchMatch)
   */
  public void acceptSearchMatch(SearchMatch javaMatch) throws CoreException {
   
    String matchDocumentPath = javaMatch.getResource().getFullPath().toString();
    SearchDocument searchDoc = JSPSearchSupport.getInstance().getSearchDocument(matchDocumentPath);
 
    if (searchDoc != null && searchDoc instanceof JavaSearchDocumentDelegate) {
 
      String renameText = getRenameText((JavaSearchDocumentDelegate)searchDoc, javaMatch);
     
      //if rename text is null then don't create an edit for it
      if(renameText != null) {
        // add it for the correct document
        addJavaEdit(searchDoc.getPath(), new ReplaceEdit(javaMatch.getOffset(), javaMatch.getLength(), renameText));
      }
    }
  }
View Full Code Here

   
    JSPSearchSupport support = JSPSearchSupport.getInstance();
    List changes = new ArrayList();
    Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
    String searchDocPath = null;
    SearchDocument delegate = null;
   
    while(keys.hasNext()) {
      // create on the fly
      searchDocPath = (String)keys.next();
      MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
View Full Code Here

   
    JSPSearchSupport support = JSPSearchSupport.getInstance();
    List changes = new ArrayList();
    Iterator keys = fSearchDocPath2JavaEditMap.keySet().iterator();
    String searchDocPath = null;
    SearchDocument delegate = null;
   
    while(keys.hasNext()) {
      // create on the fly
      searchDocPath = (String)keys.next();
      MultiTextEdit javaEdit = (MultiTextEdit)fSearchDocPath2JavaEditMap.get(searchDocPath);
View Full Code Here

        if (DEBUG)
            System.out.println("adding JSP file:" + file.getFullPath()); //$NON-NLS-1$

        // create
        SearchDocument delegate = createSearchDocument(file);
        // null if not a jsp file
        if (delegate != null) {
            try {
                getSearchParticipant().scheduleDocumentIndexing(delegate, computeIndexLocation(file.getParent().getFullPath()));
            } catch (Exception e) {
View Full Code Here

     * @param doc
     * @return the JSPSearchDocument or null if one is not found
     */
    public SearchDocument getSearchDocument(String searchDocPath) {
        
        SearchDocument delegate = null;
        IFile f = fileForCUPath(searchDocPath);
        if (f != null) {
            delegate = createSearchDocument(f);
        } else {
            // handle failure case... (file deleted maybe?)
View Full Code Here

TOP

Related Classes of org.eclipse.jdt.core.search.SearchDocument

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.