Examples of StructuredPresentationReconciler


Examples of org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler

   *            the source viewer to be configured by this configuration
   * @return always returns null
   * @see #getLineStyleProviders(ISourceViewer, String)
   */
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    StructuredPresentationReconciler reconciler = new StructuredPresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
   
    String[] contentTypes = getConfiguredContentTypes(sourceViewer);
   
    if(contentTypes != null) {
      StructuredDocumentDamagerRepairer dr = null;
     
      for (int i = 0; i < contentTypes.length; i++) {
        if (fHighlighter != null) {
          LineStyleProvider provider = fHighlighter.getProvider(contentTypes[i]);
          if (provider == null)
            continue;
         
          dr = new StructuredDocumentDamagerRepairer(provider);
          dr.setDocument(sourceViewer.getDocument());
          reconciler.setDamager(dr, contentTypes[i]);
          reconciler.setRepairer(dr, contentTypes[i]);
        }
      }
    }
   
    return reconciler;
View Full Code Here

Examples of org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler

   *            the source viewer to be configured by this configuration
   * @return always returns null
   * @see #getLineStyleProviders(ISourceViewer, String)
   */
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    StructuredPresentationReconciler reconciler = new StructuredPresentationReconciler();
    reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
   
    String[] contentTypes = getConfiguredContentTypes(sourceViewer);
   
    if(contentTypes != null) {
      StructuredDocumentDamagerRepairer dr = null;
     
      for (int i = 0; i < contentTypes.length; i++) {
        if (fHighlighter != null) {
          LineStyleProvider provider = fHighlighter.getProvider(contentTypes[i]);
          if (provider == null)
            continue;
         
          dr = new StructuredDocumentDamagerRepairer(provider);
          dr.setDocument(sourceViewer.getDocument());
          reconciler.setDamager(dr, contentTypes[i]);
          reconciler.setRepairer(dr, contentTypes[i]);
        }
      }
    }
   
    return reconciler;
View Full Code Here

Examples of org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler

   * @param removedPositions the removed positions
   * @return the text presentation or <code>null</code>, if reconciliation should be canceled
   */
  public TextPresentation createPresentation(List addedPositions, List removedPositions) {
    ISourceViewer sourceViewer= fSourceViewer;
    StructuredPresentationReconciler presentationReconciler= fPresentationReconciler;
    if (sourceViewer == null || presentationReconciler == null)
      return null;

    if (isCanceled())
      return null;

    IDocument document= sourceViewer.getDocument();
    if (document == null)
      return null;

    int minStart= Integer.MAX_VALUE;
    int maxEnd= Integer.MIN_VALUE;
    for (int i= 0, n= removedPositions.size(); i < n; i++) {
      Position position= (Position) removedPositions.get(i);
      int offset= position.getOffset();
      minStart= Math.min(minStart, offset);
      maxEnd= Math.max(maxEnd, offset + position.getLength());
    }
    for (int i= 0, n= addedPositions.size(); i < n; i++) {
      Position position= (Position) addedPositions.get(i);
      int offset= position.getOffset();
      minStart= Math.min(minStart, offset);
      maxEnd= Math.max(maxEnd, offset + position.getLength());
    }

    if (minStart < maxEnd)
      try {
        return presentationReconciler.createRepairDescription(new Region(minStart, maxEnd - minStart), document);
      } catch (RuntimeException e) {
        // Assume concurrent modification from UI thread
      }

    return null;
View Full Code Here

Examples of org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler

  }

  @Override
  public IPresentationReconciler getPresentationReconciler(
      ISourceViewer sourceViewer) {
    StructuredPresentationReconciler reconciler = new PHPStructuredPresentationReconciler();
    reconciler
        .setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));

    String[] contentTypes = getConfiguredContentTypes(sourceViewer);

    if (contentTypes != null) {
      StructuredDocumentDamagerRepairer dr = null;

      for (int i = 0; i < contentTypes.length; i++) {
        if (fHighlighter != null) {
          LineStyleProvider provider = fHighlighter
              .getProvider(contentTypes[i]);
          if (provider == null)
            continue;

          dr = new StructuredDocumentDamagerRepairer(provider);
          dr.setDocument(sourceViewer.getDocument());
          reconciler.setDamager(dr, contentTypes[i]);
          reconciler.setRepairer(dr, contentTypes[i]);
        }
      }
    }

    return reconciler;
View Full Code Here

Examples of org.eclipse.wst.sse.ui.internal.provisional.style.StructuredPresentationReconciler

    @Override
    public IPresentationReconciler getPresentationReconciler(
            ISourceViewer sourceViewer)
    {
        this.sourceViewer = sourceViewer;
        StructuredPresentationReconciler reconciler = new TwigStructuredPresentationReconciler();
        reconciler.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
        String[] contentTypes = getConfiguredContentTypes(sourceViewer);
        ITextEditor textEditor = ((PHPStructuredTextViewer) sourceViewer).getTextEditor();


        SelectionListenerWithASTManager.getDefault().addListener(textEditor, new ISelectionListenerWithAST()
        {

            @Override
            public void selectionChanged(IEditorPart part, ITextSelection selection,
                    ISourceModule module, IModuleDeclaration astRoot)
            {
                IPreferenceStore store = TwigUICorePlugin.getDefault()
                        .getPreferenceStore();
                boolean doMark = store
                        .getBoolean(PreferenceConstants.MARK_OCCURRENCES);

                if (doMark) {
                  updateOccurrenceAnnotations(selection, (TwigModuleDeclaration) astRoot);
                }
            }
        });



        if (contentTypes != null) {
            StructuredDocumentDamagerRepairer dr = null;

            for (int i = 0; i < contentTypes.length; i++) {
                if (fHighlighter != null) {
                    LineStyleProvider provider = fHighlighter
                            .getProvider(contentTypes[i]);
                    if (provider == null)
                        continue;

                    dr = new StructuredDocumentDamagerRepairer(provider);
                    dr.setDocument(sourceViewer.getDocument());
                    reconciler.setDamager(dr, contentTypes[i]);
                    reconciler.setRepairer(dr, contentTypes[i]);
                }
            }
        }

        return reconciler;
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.