Package org.eclipse.wst.sse.ui.internal.search

Examples of org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor


    boolean okay = false;
    if (textEditor != null) {
      IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
      if (document != null) {
        ITextSelection textSelection = getTextSelection(textEditor);
        FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
        if (findOccurrenceProcessor != null) {
          if (textEditor.getEditorInput() instanceof IFileEditorInput) {
            IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
            okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
          }
        }
      }
    }
    if (okay) {
View Full Code Here


    // check if we have an action that's enabled on the current partition
    ITypedRegion tr = getPartition(document, textSelection);
    String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$

    Iterator it = getProcessors().iterator();
    FindOccurrencesProcessor processor = null;
    while (it.hasNext()) {
      processor = (FindOccurrencesProcessor) it.next();
      // we just choose the first action that can handle the partition
      if (processor.enabledForParitition(partition))
        return processor;
    }

    List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
    for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
      Object o = extendedFindOccurrencesProcessors.get(i);
      if (o instanceof FindOccurrencesProcessor) {
        /*
         * We just choose the first registered processor that
         * explicitly says it can handle the partition
         */
        processor = (FindOccurrencesProcessor) o;
        if (processor.enabledForParitition(partition))
          return processor;
      }
    }
    return null;
  }
View Full Code Here

    if (textEditor != null) {
      IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
      if (document != null) {
        ITextSelection textSelection = getTextSelection(textEditor);
        FindOccurrencesProcessor findOccurrenceProcessor = getProcessorForCurrentSelection(document, textSelection);
        if (findOccurrenceProcessor != null) {
          if (textEditor.getEditorInput() instanceof IFileEditorInput) {
            IFile file = ((IFileEditorInput) textEditor.getEditorInput()).getFile();
            okay = findOccurrenceProcessor.findOccurrences(document, textSelection, file);
          }
        }
      }
    }
    if (okay) {
View Full Code Here

    // check if we have an action that's enabled on the current partition
    ITypedRegion tr = getPartition(document, textSelection);
    String partition = tr != null ? tr.getType() : ""; //$NON-NLS-1$

    Iterator it = getProcessors().iterator();
    FindOccurrencesProcessor processor = null;
    while (it.hasNext()) {
      processor = (FindOccurrencesProcessor) it.next();
      // we just choose the first action that can handle the partition
      if (processor.enabledForParitition(partition))
        return processor;
    }

    List extendedFindOccurrencesProcessors = ExtendedConfigurationBuilder.getInstance().getConfigurations(FindOccurrencesProcessor.class.getName(), partition);
    for (int i = 0; i < extendedFindOccurrencesProcessors.size(); i++) {
      Object o = extendedFindOccurrencesProcessors.get(i);
      if (o instanceof FindOccurrencesProcessor) {
        /*
         * We just choose the first registered processor that
         * explicitly says it can handle the partition
         */
        processor = (FindOccurrencesProcessor) o;
        if (processor.enabledForParitition(partition))
          return processor;
      }
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.search.FindOccurrencesProcessor

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.