Examples of ITypedRegion


Examples of org.eclipse.jface.text.ITypedRegion

    try {
      int offset = sdRegion.getStartOffset(completionRegion);
      if(offset > 0) {
        offset--;
      }
      ITypedRegion prevRegion = context.getDocument().getPartition(offset);
      prevTextRegion = sdRegion.getRegionAtCharacterOffset(prevRegion.getOffset());
    } catch(BadLocationException e) {
      //this should never happen
      Logger.logException(e);
    }
   
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    // TODO: make some of these instance variables to prevent creation on
    // stack
    LineStyleProvider currentLineStyleProvider = null;
    boolean handled = false;
    for (int i = 0; i < partitions.length; i++) {
      ITypedRegion currentPartition = partitions[i];
      currentLineStyleProvider = getProviderFor(currentPartition);
      currentLineStyleProvider.init(getDocument(), this);
      handled = currentLineStyleProvider.prepareRegions(currentPartition, currentPartition.getOffset(), currentPartition.getLength(), fHoldStyleResults);
      if (Debug.syntaxHighlighting && !handled) {
        System.out.println("Did not handle highlighting in Highlighter inner while"); //$NON-NLS-1$
      }
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

      final IDocument document = getSourceViewer().getDocument();
      if (document != null) {
        try {
          final Point selection = viewer.getSelectedRange();
          final int offset = selection.x;
          final ITypedRegion partition = document.getPartition(offset);
          if (partitions.contains(partition.getType())) {
            // Don't modify if the editor input cannot be changed
            if (!validateEditorInputState())
              return false;
            event.doit = !inserter.pair(viewer, event.character);
            return true;
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

   * @param textSelection
   * @return
   */
  private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
    // 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();
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    }
    return null;
  }

  private ITypedRegion getPartition(IDocument document, ITextSelection textSelection) {
    ITypedRegion region = null;
    if (textSelection != null) {
      try {
        region = document.getPartition(textSelection.getOffset());
      }
      catch (BadLocationException e) {
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    try {
      int offset = sdRegion.getStartOffset(completionRegion);
      if(offset > 0) {
        offset--;
      }
      ITypedRegion prevRegion = context.getDocument().getPartition(offset);
      prevTextRegion = sdRegion.getRegionAtCharacterOffset(prevRegion.getOffset());
    } catch(BadLocationException e) {
      //this should never happen
      Logger.logException(e);
    }
   
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    /*
     * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
     */
    public int nextPosition(int position, boolean forward) {
      ITypedRegion partition= getPartition(position);
      if (fPartition.equals(partition.getType()))
        return super.nextPosition(position, forward);

      if (forward) {
        int end= partition.getOffset() + partition.getLength();
        if (position < end)
          return end;
      } else {
        int offset= partition.getOffset();
        if (position > offset)
          return offset - 1;
      }
      return super.nextPosition(position, forward);
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    /*
     * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
     */
    public int nextPosition(int position, boolean forward) {
      ITypedRegion partition= getPartition(position);
      if (fPartition.equals(partition.getType()))
        return super.nextPosition(position, forward);

      if (forward) {
        int end= partition.getOffset() + partition.getLength();
        if (position < end)
          return end;
      } else {
        int offset= partition.getOffset();
        if (position > offset)
          return offset - 1;
      }
      return super.nextPosition(position, forward);
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

    /*
     * @see org.eclipse.jdt.internal.ui.text.JavaHeuristicScanner.StopCondition#nextPosition(int, boolean)
     */
    public int nextPosition(int position, boolean forward) {
      ITypedRegion partition= getPartition(position);
      if (fPartition.equals(partition.getType()))
        return super.nextPosition(position, forward);

      if (forward) {
        int end= partition.getOffset() + partition.getLength();
        if (position < end)
          return end;
      } else {
        int offset= partition.getOffset();
        if (position > offset)
          return offset - 1;
      }
      return super.nextPosition(position, forward);
    }
View Full Code Here

Examples of org.eclipse.jface.text.ITypedRegion

   * @param textSelection
   * @return FindOccurrencesProcessor
   */
  private FindOccurrencesProcessor getProcessorForCurrentSelection(IDocument document, ITextSelection textSelection) {
    // 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();
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.