Package org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager

Examples of org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition


   * @param highlighting The highlighting
   * @return The new highlighted position
   */
  public HighlightedPosition createHighlightedPosition(int offset, int length, HighlightingStyle highlighting) {
    // TODO: reuse deleted positions
    return new HighlightedPosition(offset, length, highlighting, fPositionUpdater);
  }
View Full Code Here


   * @param highlighting The highlighting
   * @return The new highlighted position
   */
  public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting) {
    // TODO: reuse deleted positions
    return new HighlightedPosition(position, highlighting, fPositionUpdater);
  }
View Full Code Here

   * @param isReadOnly Is this a read-only position
   * @return The new highlighted position
   */
  public HighlightedPosition createHighlightedPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
    // TODO: reuse deleted positions
    return new HighlightedPosition(position, highlighting, fPositionUpdater, isReadOnly);
  }
View Full Code Here

    int maxEnd= Integer.MIN_VALUE;
    int i= computeIndexAtOffset(fPositions, region.getOffset()), n= computeIndexAtOffset(fPositions, region.getOffset() + region.getLength());
    if (n - i > 2) {
      List ranges= new ArrayList(n - i);
      for (; i < n; i++) {
        HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
        if (!position.isDeleted()) {
          if (!position.isReadOnly())
            ranges.add(position.createStyleRange());
          else {
            int offset= position.getOffset();
            minStart= Math.min(minStart, offset);
            maxEnd= Math.max(maxEnd, offset + position.getLength());
          }
           
        }
      }
      StyleRange[] array= new StyleRange[ranges.size()];
      array= (StyleRange[]) ranges.toArray(array);
      textPresentation.replaceStyleRanges(array);
    } else {
      for (; i < n; i++) {
        HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
        if (!position.isDeleted()) {
          if (!position.isReadOnly())
            textPresentation.replaceStyleRange(position.createStyleRange());
          else {
            int offset= position.getOffset();
            minStart= Math.min(minStart, offset);
            maxEnd= Math.max(maxEnd, offset + position.getLength());
          }
        }
      }
    }
    if (minStart < maxEnd) {
View Full Code Here

   *
   * @param highlighting The highlighting
   */
  public void highlightingStyleChanged(HighlightingStyle highlighting) {
    for (int i= 0, n= fPositions.size(); i < n; i++) {
      HighlightedPosition position= (HighlightedPosition) fPositions.get(i);
      if (position.getHighlighting() == highlighting && fSourceViewer instanceof ITextViewerExtension2)
        ((ITextViewerExtension2) fSourceViewer).invalidateTextPresentation(position.getOffset(), position.getLength());
      else
        fSourceViewer.invalidateTextPresentation();
    }
  }
View Full Code Here

      try {
        Position[] positions= event.getDocument().getPositions(fCategory);

        for (int i= 0; i != positions.length; i++) {

          HighlightedPosition position= (HighlightedPosition) positions[i];

          // Also update deleted positions because they get deleted by the background thread and removed/invalidated only in the UI runnable
//          if (position.isDeleted())
//            continue;

          int offset= position.getOffset();
          int length= position.getLength();
          int end= offset + length;

          if (offset > eventEnd)
            updateWithPrecedingEvent(position, event);
          else if (end < eventOffset) {
View Full Code Here

  private void addPosition(Position position, HighlightingStyle highlighting, boolean isReadOnly) {
    boolean isExisting = false;
    // TODO: use binary search
    for (int i = 0, n = fRemovedPositions.size(); i < n; i++) {
      HighlightedPosition highlightedPosition = (HighlightedPosition) fRemovedPositions.get(i);
      if (highlightedPosition == null)
        continue;
      if (highlightedPosition.isEqual(position, highlighting)) {
        isExisting = true;
        fRemovedPositions.set(i, null);
        fNOfRemovedPositions--;
        break;
      }
View Full Code Here

TOP

Related Classes of org.eclipse.wst.sse.ui.internal.style.SemanticHighlightingManager.HighlightedPosition

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.