Package org.eclipse.search.ui.text

Examples of org.eclipse.search.ui.text.Match


    private void addMatches(final List<ModuleLineFunctionArityRef> chunk) {
        final List<Match> l = Lists.newArrayListWithCapacity(chunk.size());
        final List<ErlangSearchElement> resultAdded = Lists
                .newArrayListWithCapacity(chunk.size());
        for (final ModuleLineFunctionArityRef ref : chunk) {
            final Match m = SearchUtil.createMatch(ref, pathToModuleMap);
            l.add(m);
            resultAdded.add((ErlangSearchElement) m.getElement());
        }
        fSearchResult = (ErlangSearchResult) getSearchResult();
        final List<ErlangSearchElement> result = fSearchResult.getResult();
        result.addAll(resultAdded);
        fSearchResult.setResult(result);
View Full Code Here


 
  public static Match createMatch(final ModuleLineFunctionArityRef ref, final Map<String, IErlModule> pathToModuleMap) {
    final ErlangSearchElement ese = SearchUtil.createSearchElementFromRef(ref, pathToModuleMap);
    int _offset = ref.getOffset();
    int _length = ref.getLength();
    return new Match(ese, _offset, _length);
  }
View Full Code Here

                return isShown;
            }

            public Match[] computeContainedMatches(
                    AbstractTextSearchResult result, IEditorPart editor) {
                Match matches [];
                IEditorInput ei = editor.getEditorInput();
                if (ei instanceof IFileEditorInput) {
                    FileEditorInput fi = (FileEditorInput) ei;
                    matches = getMatches(fi.getFile());
                } else {
View Full Code Here

        if (!timedNode.timerExist())
            return;
        if (query.getSearchText().equals(timedNode.getDuration().getVariableName())) {
            ElementMatch elementMatch = new ElementMatch((GraphElement) timedNode, definitionFile, ElementMatch.CONTEXT_TIMED_VARIABLE);
            elementMatch.setMatchesCount(1);
            query.getSearchResult().addMatch(new Match(elementMatch, 0, 0));
        }
    }
View Full Code Here

            }
        }
        if (matchesCount > 0) {
            ElementMatch elementMatch = new ElementMatch(subprocessNode);
            elementMatch.setMatchesCount(matchesCount);
            query.getSearchResult().addMatch(new Match(elementMatch, 0, 0));
        }
    }
View Full Code Here

            }
        }
        String swimlaneName = ((SwimlanedNode) formNode).getSwimlaneName();
        if (query.getSearchText().equals(swimlaneName)) {
            formElementMatch.setMatchesCount(1);
            query.getSearchResult().addMatch(new Match(formElementMatch, 0, 0));
        }
    }
View Full Code Here

        int k = 0;
        while (matcher.find()) {
            int start = matcher.start();
            int end = matcher.end();
            if (end != start) {
                matches.add(new Match(elementMatch, start, end - start));
            }
            if (k++ == 20) {
                if (progressMonitor.isCanceled()) {
                    throw new OperationCanceledException(SearchMessages.TextSearchVisitor_canceled);
                }
View Full Code Here

      String elementMessage = document.get().substring(lineStart, lineStart + lineLength);
     
      //add the match to the result
        BasicSearchMatchElement element = new BasicSearchMatchElement(fFile, lineNumber, lineStart, elementMessage);
        fResult.addMatch(new Match(element, Match.UNIT_CHARACTER, matchStart, matchEnd - matchStart));
     
    } catch (BadLocationException e) {
      Logger.logException(e);
    }
  }
View Full Code Here

   */
  public StyledString getStyledText(Object obj) {
    StyledString styledText = new StyledString();
    BasicSearchMatchElement element = null;
    if (obj instanceof Match) {
      Match match = (Match) obj;

      if(match.getElement() instanceof BasicSearchMatchElement) {
        element = (BasicSearchMatchElement) match.getElement();
      }
    } else if(obj instanceof BasicSearchMatchElement) {
      element = (BasicSearchMatchElement)obj;
    }
   
View Full Code Here

      String elementMessage = document.get().substring(lineStart, lineStart + lineLength);
     
      //add the match to the result
        BasicSearchMatchElement element = new BasicSearchMatchElement(fFile, lineNumber, lineStart, elementMessage);
        fResult.addMatch(new Match(element, Match.UNIT_CHARACTER, matchStart, matchEnd - matchStart));
     
    } catch (BadLocationException e) {
      Logger.logException(e);
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.search.ui.text.Match

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.