Package at.ssw.coco.ide.features.semanticHighlighting.SemanticHighlightingManager

Examples of at.ssw.coco.ide.features.semanticHighlighting.SemanticHighlightingManager.HighlightedPosition


    List<HighlightedPosition> oldPositions = fRemovedPositions;
    List<HighlightedPosition> newPositions = new ArrayList<HighlightedPosition>(
        fNOfRemovedPositions);
    for (int i = 0; i < oldPositions.size(); i++) {
      HighlightedPosition current = oldPositions.get(i);
      if (current != null) {
        newPositions.add(current);
      }
    }
    fRemovedPositions = newPositions;
View Full Code Here


    private SemanticToken fToken = new SemanticToken();

    private void addPosition(int offset, int length, HighlightingStyle style) {
      boolean isExisting = false;
      for (int i = 0; i < fRemovedPositions.size(); i++) {
        HighlightedPosition position = fRemovedPositions.get(i);
        if (position == null) {
          continue;
        }
        if (position.isEqual(offset, length, style)) {
          isExisting = true;
          fRemovedPositions.set(i, null);
          fNOfRemovedPositions--;
          break;
        }
      }

      if (!isExisting) {
        HighlightedPosition position = fJobPresenter
            .createHighlightedPosition(offset, length, style);
        fAddedPositions.add(position);
      }
    }
View Full Code Here

  private void applyPositions(TextPresentation textPresentation,
      int startIndex, int endIndex) {
    List<StyleRange> ranges = new ArrayList<StyleRange>(endIndex
        - startIndex);
    while (startIndex < endIndex) {
      HighlightedPosition position = (HighlightedPosition) fPositions
          .get(startIndex);
      if (!position.isDeleted()) {
        ranges.add(position.createStyleRange());
      }
      startIndex++;
    }
    StyleRange[] array = new StyleRange[ranges.size()];
    array = (StyleRange[]) ranges.toArray(array);
View Full Code Here

  /** applies the styleRange */
  private int applySinglePosition(TextPresentation textPresentation,
      int startIndex, int endIndex) {
    while (startIndex < endIndex) {
      HighlightedPosition position = (HighlightedPosition) fPositions
          .get(startIndex);
      if (!position.isDeleted()) {
        textPresentation.replaceStyleRange(position.createStyleRange());
      }
      startIndex++;
    }
    return startIndex;
  }
View Full Code Here

   *            the style
   * @return a new HighlightedPosition
   */
  public HighlightedPosition createHighlightedPosition(int offset,
      int length, HighlightingStyle highlightingStyle) {
    return new HighlightedPosition(offset, length, highlightingStyle,
        fPositionUpdater);
  }
View Full Code Here

   * @param highlightingStyle
   *            the style changed
   */
  public void highlightingStyleChanged(HighlightingStyle highlightingStyle) {
    for (int i = 0; i < fPositions.size(); i++) {
      HighlightedPosition position = (HighlightedPosition) fPositions
          .get(i);
      if (position.getStyle() == highlightingStyle) {
        fSourceViewer.invalidateTextPresentation(position.getOffset(),
            position.getLength());
      }
    }
  }
View Full Code Here

      try {

        Position[] positions = e.getDocument().getPositions(fCategory);

        for (int i = 0; i < positions.length; i++) {
          HighlightedPosition position = (HighlightedPosition) positions[i];

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

          if (offset >= eventEnd) {
            updateWithPrecedingEvent(position, e);
          } else if (end <= eventOffset) {
            // skip
          } else {
            position.delete();
          }

        }

      } catch (BadPositionCategoryException exc) {
View Full Code Here

TOP

Related Classes of at.ssw.coco.ide.features.semanticHighlighting.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.