Package org.eclipse.jface.text.source.projection

Examples of org.eclipse.jface.text.source.projection.ProjectionAnnotationModel


  }

  @Override
  protected void installFoldingSupport(ProjectionViewer projectionViewer) {
    super.installFoldingSupport(projectionViewer);
    ProjectionAnnotationModel model = projectionViewer.getProjectionAnnotationModel();
    foldRegionsOnStartup(model);
  }
View Full Code Here


  }

  private FoldingStructureComputationContext createContext(boolean allowCollapse) {
    if (!isInstalled())
      return null;
    ProjectionAnnotationModel model = getModel();
    if (model == null)
      return null;
    IDocument doc = getDocument();
    if (doc == null)
      return null;
View Full Code Here

    return null;
  }

  private Map computeCurrentStructure(FoldingStructureComputationContext ctx) {
    Map<IJavaElement, List<Tuple>> map = new HashMap<IJavaElement, List<Tuple>>();
    ProjectionAnnotationModel model = ctx.getModel();
    Iterator e = model.getAnnotationIterator();
    while (e.hasNext()) {
      Object annotation = e.next();
      if (annotation instanceof JavaProjectionAnnotation) {
        JavaProjectionAnnotation java = (JavaProjectionAnnotation) annotation;
        Position position = model.getPosition(java);
        Assert.isNotNull(position);
        List<Tuple> list = map.get(java.getElement());
        if (list == null) {
          list = new ArrayList<Tuple>(2);
          map.put(java.getElement(), list);
View Full Code Here

   */
  private void modifyFiltered(Filter filter, boolean expand) {
    if (!isInstalled())
      return;

    ProjectionAnnotationModel model = getModel();
    if (model == null)
      return;

    List<Annotation> modified = new ArrayList<Annotation>();
    Iterator iter = model.getAnnotationIterator();
    while (iter.hasNext()) {
      Object annotation = iter.next();
      if (annotation instanceof JavaProjectionAnnotation) {
        JavaProjectionAnnotation java = (JavaProjectionAnnotation) annotation;

        if (expand == java.isCollapsed() && filter.match(java)) {
          if (expand)
            java.markExpanded();
          else
            java.markCollapsed();
          modified.add(java);
        }

      }
    }

    model.modifyAnnotations(null, null, modified.toArray(new Annotation[modified.size()]));
  }
View Full Code Here

  }

  private FoldingStructureComputationContext createContext(boolean allowCollapse) {
    if (!isInstalled())
      return null;
    ProjectionAnnotationModel model = getModel();
    if (model == null)
      return null;
    IDocument doc = getDocument();
    if (doc == null)
      return null;
View Full Code Here

    return null;
  }

  private Map computeCurrentStructure(FoldingStructureComputationContext ctx) {
    Map<IJavaElement, List<Tuple>> map = new HashMap<IJavaElement, List<Tuple>>();
    ProjectionAnnotationModel model = ctx.getModel();
    Iterator e = model.getAnnotationIterator();
    while (e.hasNext()) {
      Object annotation = e.next();
      if (annotation instanceof JavaProjectionAnnotation) {
        JavaProjectionAnnotation java = (JavaProjectionAnnotation) annotation;
        Position position = model.getPosition(java);
        Assert.isNotNull(position);
        List<Tuple> list = map.get(java.getElement());
        if (list == null) {
          list = new ArrayList<Tuple>(2);
          map.put(java.getElement(), list);
View Full Code Here

   */
  private void modifyFiltered(Filter filter, boolean expand) {
    if (!isInstalled())
      return;

    ProjectionAnnotationModel model = getModel();
    if (model == null)
      return;

    List<Annotation> modified = new ArrayList<Annotation>();
    Iterator iter = model.getAnnotationIterator();
    while (iter.hasNext()) {
      Object annotation = iter.next();
      if (annotation instanceof JavaProjectionAnnotation) {
        JavaProjectionAnnotation java = (JavaProjectionAnnotation) annotation;

        if (expand == java.isCollapsed() && filter.match(java)) {
          if (expand)
            java.markExpanded();
          else
            java.markCollapsed();
          modified.add(java);
        }

      }
    }

    model.modifyAnnotations(null, null, modified.toArray(new Annotation[modified.size()]));
  }
View Full Code Here

    try {
      ProjectionViewer viewer = (ProjectionViewer)getSourceViewer();
      if(viewer==null){
        return;
      }
      ProjectionAnnotationModel model = viewer.getProjectionAnnotationModel();
      if(model==null){
        return;
      }
     
      IDocument doc = getDocumentProvider().getDocument(getEditorInput());
View Full Code Here

    try {
      ProjectionViewer viewer = (ProjectionViewer) getSourceViewer();
      if (viewer == null) {
        return;
      }
      ProjectionAnnotationModel model = viewer.getProjectionAnnotationModel();
      if (model == null) {
        return;
      }

      List<FoldingInfo> list = new ArrayList<FoldingInfo>();
View Full Code Here

  public void outlineNodeCollapsed(String target) {
    if (!_collapsedIDs.contains(target)) {
      _collapsedIDs.add(target);

      FuzzyXMLNode selectedNode = _idToNodeMap.get(target);
      ProjectionAnnotationModel model = ((ProjectionViewer) _editor.getViewer()).getProjectionAnnotationModel();
      ProjectionAnnotation lastAnnotation = getAnnotationForNode(selectedNode, model);
      if (lastAnnotation != null) {
        model.collapse(lastAnnotation);
      }
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.source.projection.ProjectionAnnotationModel

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.