Package ag.ion.noa.search

Examples of ag.ion.noa.search.ISearchResult


    SearchDescriptor searchDescriptor = new SearchDescriptor(
        XMLArtefact.TAG_PATTERN);
    searchDescriptor.setIsCaseSensitive(false);
    searchDescriptor.setUseRegularExpression(true);
    ISearchResult searchResult = textDocument.getSearchService().findAll(
        searchDescriptor);

    List<IArtefactPosition> positions = new ArrayList<IArtefactPosition>();
    for (ITextRange textRange : searchResult.getTextRanges()) {
      OOArtefactPosition position = new TextPosition(ooDocument,
          textRange);
      positions.add(position);
    }
    return positions;
View Full Code Here


     
      //OK - now we need a search query
      SearchDescriptor searchDescriptor = new SearchDescriptor("NOA");
      searchDescriptor.setIsCaseSensitive(true);
      //Perform the search ...
      ISearchResult searchResult = textDocument.getSearchService().findFirst(searchDescriptor);
      if(!searchResult.isEmpty()) {
        //...and now select the result
        ITextRange[] textRanges = searchResult.getTextRanges();
        textDocument.setSelection(new TextRangeSelection(textRanges[0]));
      }
    }
    catch (OfficeApplicationException exception) {
      exception.printStackTrace();
View Full Code Here

    }
   
    IFile file= (IFile) proxy.requestResource();
    IDocument document = loadDoccument(file);
    if(document != null) {
      ISearchResult searchResult = search(document, searchDescriptor);
      if(!searchResult.isEmpty()) {
        progressMonitor.subTask(Messages.OfficeSearchVisitor_monitor_performinSearch);
        OfficeSearchMatch officeSearchMatch = new OfficeSearchMatch(file, searchResult.getTextRanges().length);
        officeSearchResult.addMatch(officeSearchMatch);
      }
    }
    document.close();
    updateProgressMonitor();
View Full Code Here

TOP

Related Classes of ag.ion.noa.search.ISearchResult

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.