Package com.cb.eclipse.folding.java

Examples of com.cb.eclipse.folding.java.JavaPositionMetadata


  public String toString() {
    return "Comment Helper - regions: " + result().size();
  }

  private JavaPositionMetadata getMetadata(boolean collapse) {
    return new JavaPositionMetadata(false, false, collapse, false, null);
  }
View Full Code Here


          int oldStart = popBrace();
          helper.end();
          if (shouldFold(owner, token)) {
            boolean doCollapse = shouldCollapse(owner, token);
            boolean shouldNegate = shouldFilterLastLine(owner, token);
            addRegion(new EnhancedPosition(oldStart, end - oldStart, new JavaPositionMetadata(false, shouldNegate, doCollapse, true, getClass().getName())));
          }
        }
        else {
          System.out.println("Bad brace found... omitting!");
        }
View Full Code Here

          int matchedStart;
          if(!trackers.isEmpty()) {
            RegionTracker tracker = (RegionTracker)trackers.pop();
            matchedStart = tracker.start;
            boolean doCollapse = settings.isDefaultCollapsed();
            EnhancedPosition newPos = new EnhancedPosition(matchedStart, end-matchedStart, new JavaPositionMetadata(true, true, doCollapse, true, null));         
            super.addRegion(newPos);
          }
           
        }
      }
View Full Code Here

   *            The position to have its text coordinates normalized
   * @throws BadLocationException
   *             thrown by IDocument queries.
   */
  private void normalizePosition(EnhancedPosition position) throws BadLocationException {
    JavaPositionMetadata metadata = (JavaPositionMetadata)position.getMetadata();
    int start = document.getLineOfOffset(position.getOffset());
    int end = document.getLineOfOffset(position.getOffset() + position.getLength());

    int offset = document.getLineOffset(start);

    if (!metadata.isFilterLastLine()) {
      end++;
    }

    int numLines = document.getNumberOfLines();
    int safeEnd = Math.min(numLines-1, end);
View Full Code Here

  private class UserDefinedCollisionFilter extends PositionFilter {
    boolean shouldFilter(Map allPositions, EnhancedPosition thePosition) throws BadLocationException {
      Iterator positions = allPositions.values().iterator();
      while(positions.hasNext()) {
        EnhancedPosition aPosition = (EnhancedPosition)positions.next();
        JavaPositionMetadata metadata = (JavaPositionMetadata)aPosition.getMetadata();
        if(aPosition == thePosition) continue;
        if( metadata.isUserDefined() && thePosition.collidesWith(aPosition) && !(thePosition.isAdjacent(aPosition))) {         
          return true;
        }
      }
     
      return false;
View Full Code Here

    ISourceRange range = getNaturalRange(elem);

    if (FoldingPlugin.getBoolean(PreferenceKeys.FOLD_IMPORTS)) {
      boolean doCollapse = FoldingPlugin.getBoolean(PreferenceKeys.COLLAPSE_IMPORTS);
      // get a region for the entire range of the IJavaElement
      addRegion(new EnhancedPosition(range.getOffset(), range.getLength(), new JavaPositionMetadata(false, false, doCollapse, false, null)));
    }
    // don't scan.
    return false;
  }
View Full Code Here

   *            The position to have its text coordinates normalized
   * @throws BadLocationException
   *             thrown by IDocument queries.
   */
  private void normalizePosition(EnhancedPosition position) throws BadLocationException {
    JavaPositionMetadata metadata = (JavaPositionMetadata)position.getMetadata();
    int start = document.getLineOfOffset(position.getOffset());
    int end = document.getLineOfOffset(position.getOffset() + position.getLength());

    int offset = document.getLineOffset(start);

    if (!metadata.isFilterLastLine()) {
      end++;
    }

    int numLines = document.getNumberOfLines();
    int safeEnd = Math.min(numLines-1, end);
View Full Code Here

  private class UserDefinedCollisionFilter extends PositionFilter {
    boolean shouldFilter(Map allPositions, EnhancedPosition thePosition) throws BadLocationException {
      Iterator positions = allPositions.values().iterator();
      while(positions.hasNext()) {
        EnhancedPosition aPosition = (EnhancedPosition)positions.next();
        JavaPositionMetadata metadata = (JavaPositionMetadata)aPosition.getMetadata();
        if(aPosition == thePosition) continue;
        if( metadata.isUserDefined() && thePosition.collidesWith(aPosition) && !(thePosition.isAdjacent(aPosition))) {         
          return true;
        }
      }
     
      return false;
View Full Code Here

  public String toString() {
    return "Comment Helper - regions: " + result().size();
  }

  private JavaPositionMetadata getMetadata(boolean collapse) {
    return new JavaPositionMetadata(false, false, collapse, false, null);
  }
View Full Code Here

          int oldStart = popBrace();
          helper.end();
          if (shouldFold(owner, token)) {
            boolean doCollapse = shouldCollapse(owner, token);
            boolean shouldNegate = shouldFilterLastLine(owner, token);
            addRegion(new EnhancedPosition(oldStart, end - oldStart, new JavaPositionMetadata(false, shouldNegate, doCollapse, true, getClass().getName())));
          }
        }
        else {
          System.out.println("Bad brace found... omitting!");
        }
View Full Code Here

TOP

Related Classes of com.cb.eclipse.folding.java.JavaPositionMetadata

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.