Package org.eclipse.jface.text.presentation

Examples of org.eclipse.jface.text.presentation.PresentationReconciler


  public IPresentationReconciler getPresentationReconciler(
      ISourceViewer sourceViewer)
  {
    if (reconciler == null)
    {
      reconciler = new PresentationReconciler();

      if (vdmCodeScanner == null)
      {
        vdmCodeScanner = getCodeScanner();
      }
View Full Code Here


    /* (non-Javadoc)
     * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
     */
    public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer )
    {
        PresentationReconciler reconciler = new PresentationReconciler();
        reconciler.setDocumentPartitioning( getConfiguredDocumentPartitioning( sourceViewer ) );

        // Creating the damager/repairer for code
        DefaultDamagerRepairer dr = new DefaultDamagerRepairer( Activator.getDefault().getAciCodeScanner() );
        reconciler.setDamager( dr, IDocument.DEFAULT_CONTENT_TYPE );
        reconciler.setRepairer( dr, IDocument.DEFAULT_CONTENT_TYPE );

        return reconciler;
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
     */
    public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer )
    {
        PresentationReconciler reconciler = new PresentationReconciler();
        reconciler.setDocumentPartitioning( getConfiguredDocumentPartitioning( sourceViewer ) );

        // Creating the damager/repairer for code
        DefaultDamagerRepairer dr = new DefaultDamagerRepairer( Activator.getSchemaCodeScanner() );
        reconciler.setDamager( dr, IDocument.DEFAULT_CONTENT_TYPE );
        reconciler.setRepairer( dr, IDocument.DEFAULT_CONTENT_TYPE );

        return reconciler;
    }
View Full Code Here

    public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer )
    {

        if ( this.presentationReconciler == null )
        {
            this.presentationReconciler = new PresentationReconciler();
            this.presentationReconciler.setDocumentPartitioning( getConfiguredDocumentPartitioning( sourceViewer ) );

            damagerRepairer = new LdifDamagerRepairer( this.editor );

            this.presentationReconciler.setDamager( damagerRepairer, IDocument.DEFAULT_CONTENT_TYPE );
View Full Code Here

        {
            this.damagerRepairer = new FilterDamagerRepairer( this.sourceViewer, this.parser );
        }
        if ( this.presentationReconciler == null )
        {
            this.presentationReconciler = new PresentationReconciler();
            this.presentationReconciler.setDamager( this.damagerRepairer, IDocument.DEFAULT_CONTENT_TYPE );
            this.presentationReconciler.setRepairer( this.damagerRepairer, IDocument.DEFAULT_CONTENT_TYPE );
        }
        return this.presentationReconciler;
    }
View Full Code Here

    return fitScanner;
  }

  @Override
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();

    DefaultDamagerRepairer dr =
      new DefaultDamagerRepairer(getFitScanner());
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer ndr =
      new NonRuleBasedDamagerRepairer(
        new TextAttribute(
          colorManager.getColor(IFitColorConstants.COMMENT)));
    reconciler.setDamager(ndr, FitSourcePartitionScanner.FIT_COMMENT);
    reconciler.setRepairer(ndr, FitSourcePartitionScanner.FIT_COMMENT);

    return reconciler;
  }
View Full Code Here

   
    // initialize a new Damager/Repairer with the current Scanner
    NewDamagerRepairer dr = new NewDamagerRepairer(fScanner);
       
    // generate the reconciler
    PresentationReconciler reconciler= new PresentationReconciler()
    reconciler.setDamager(dr, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(dr, IDocument.DEFAULT_CONTENT_TYPE);
   
    return reconciler;
  }
View Full Code Here

    /*
     * This Method is used for Syntax/Semantic Highlighting.
     * Every ATG Partition that should support Highlighting has to register a damager and a repairer.
     */
   
    PresentationReconciler reconciler = new ATGPresentationReconciler();

    // Coco code
    DefaultDamagerRepairer dr = new DefaultDamagerRepairer(getATGScanner());
    reconciler.setDamager(dr, ATGPartitions.DEFAULT);
    reconciler.setRepairer(dr, ATGPartitions.DEFAULT);
   
    reconciler.setDamager(dr, ATGPartitions.IGNORECASE_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.IGNORECASE_SEGMENT);
   
    reconciler.setDamager(dr, ATGPartitions.CHARACTERS_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.CHARACTERS_SEGMENT);

    reconciler.setDamager(dr, ATGPartitions.TOKENS_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.TOKENS_SEGMENT);
   
    reconciler.setDamager(dr, ATGPartitions.PRAGMAS_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.PRAGMAS_SEGMENT);

    reconciler.setDamager(dr, ATGPartitions.COMMENTS_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.COMMENTS_SEGMENT);

    reconciler.setDamager(dr, ATGPartitions.IGNORE_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.IGNORE_SEGMENT);
   
    reconciler.setDamager(dr, ATGPartitions.PRODUCTIONS_SEGMENT);
    reconciler.setRepairer(dr, ATGPartitions.PRODUCTIONS_SEGMENT);

    // COMPILER statement
    reconciler.setDamager(dr, ATGPartitions.COMPILER_KEYWORD);
    reconciler.setRepairer(dr, ATGPartitions.COMPILER_KEYWORD);
    reconciler.setDamager(dr, ATGPartitions.COMPILER_IDENT);
    reconciler.setRepairer(dr, ATGPartitions.COMPILER_IDENT);

    // inline code delimiting tags
    NonRuleBasedDamagerRepairer tagDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.ATG.INLINE_CODE_TAG));
    reconciler.setDamager(tagDR, ATGPartitions.INLINE_CODE_START);
    reconciler.setRepairer(tagDR, ATGPartitions.INLINE_CODE_START);
    reconciler.setDamager(tagDR, ATGPartitions.INLINE_CODE_END);
    reconciler.setRepairer(tagDR, ATGPartitions.INLINE_CODE_END);

    // inline code
    ITokenScanner javaCodeScanner = getJavaCodeScanner();
    fEditor.fJavaCodeScanner = (JavaCodeScanner)javaCodeScanner;
    dr = new DefaultDamagerRepairer(javaCodeScanner);
    reconciler.setDamager(dr, ATGPartitions.IMPORTS);
    reconciler.setRepairer(dr, ATGPartitions.IMPORTS);

    dr = new DefaultDamagerRepairer(javaCodeScanner);
    reconciler.setDamager(dr, ATGPartitions.PARSER_CODE);
    reconciler.setRepairer(dr, ATGPartitions.PARSER_CODE);

    dr = new DefaultDamagerRepairer(javaCodeScanner);
    reconciler.setDamager(dr, ATGPartitions.INLINE_CODE);
    reconciler.setRepairer(dr, ATGPartitions.INLINE_CODE);
    reconciler.setDamager(dr, ATGPartitions.PRAGMAS_INLINE_CODE);
    reconciler.setRepairer(dr, ATGPartitions.PRAGMAS_INLINE_CODE);
    reconciler.setDamager(dr, ATGPartitions.PRODUCTIONS_INLINE_CODE);
    reconciler.setRepairer(dr, ATGPartitions.PRODUCTIONS_INLINE_CODE);
   

    NonRuleBasedDamagerRepairer commentDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Common.COMMENT));

    { // comments
      String contentTypes[] = new String[] {
          ATGPartitions.MULTI_LINE_COMMENT,
          ATGPartitions.SINGLE_LINE_COMMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_COMPILER_IDENT,
          ATGPartitions.SINGLE_LINE_COMMENT_COMPILER_IDENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_IGNORECASE_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_IGNORECASE_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_CHARACTERS_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_CHARACTERS_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_TOKENS_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_TOKENS_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_PRAGMAS_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_PRAGMAS_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_COMMENTS_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_COMMENTS_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_IGNORE_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_IGNORE_SEGMENT,
         
          ATGPartitions.MULTI_LINE_COMMENT_PRODUCTIONS_SEGMENT,
          ATGPartitions.SINGLE_LINE_COMMENT_PRODUCTIONS_SEGMENT,
         
          };
      for (String ct : contentTypes) {
        reconciler.setDamager(commentDR, ct);
        reconciler.setRepairer(commentDR, ct);
      }
    }

    NonRuleBasedDamagerRepairer javaSLCommentDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Java.SINGLE_LINE_COMMENT));

    { // java comments single line
      String contentTypes[] = new String[] {
          ATGPartitions.SINGLE_LINE_COMMENT_IMPORTS,
          ATGPartitions.SINGLE_LINE_COMMENT_PARSER_CODE,
      };
      for (String ct : contentTypes) {
        reconciler.setDamager(javaSLCommentDR, ct);
        reconciler.setRepairer(javaSLCommentDR, ct);
      }
    }

    NonRuleBasedDamagerRepairer javaMLCommentDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Java.MULTI_LINE_COMMENT));

    { // java comments multi line
      String contentTypes[] = new String[] {
          ATGPartitions.MULTI_LINE_COMMENT_IMPORTS,
          ATGPartitions.MULTI_LINE_COMMENT_PARSER_CODE,
         
      };
      for (String ct : contentTypes) {
        reconciler.setDamager(javaMLCommentDR, ct);
        reconciler.setRepairer(javaMLCommentDR, ct);
      }
    }

    NonRuleBasedDamagerRepairer stringDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Common.STRING));

    { // strings
      String contentTypes[] = new String[] {
          ATGPartitions.STRING,
          ATGPartitions.CHARACTER,
         
          ATGPartitions.STRING_IGNORECASE_SEGMENT,
          ATGPartitions.CHARACTER_IGNORECASE_SEGMENT,
         
          ATGPartitions.STRING_CHARACTERS_SEGMENT,
          ATGPartitions.CHARACTER_CHARACTERS_SEGMENT,
         
          ATGPartitions.STRING_TOKENS_SEGMENT,
          ATGPartitions.CHARACTER_TOKENS_SEGMENT,
         
          ATGPartitions.STRING_PRAGMAS_SEGMENT,
          ATGPartitions.CHARACTER_PRAGMAS_SEGMENT,
         
          ATGPartitions.STRING_COMMENTS_SEGMENT,
          ATGPartitions.CHARACTER_COMMENTS_SEGMENT,
         
          ATGPartitions.STRING_IGNORE_SEGMENT,
          ATGPartitions.CHARACTER_IGNORE_SEGMENT,
         
          ATGPartitions.STRING_PRODUCTIONS_SEGMENT,
          ATGPartitions.CHARACTER_PRODUCTIONS_SEGMENT,
      };
      for (String ct : contentTypes) {
        reconciler.setDamager(stringDR, ct);
        reconciler.setRepairer(stringDR, ct);
      }
    }

    NonRuleBasedDamagerRepairer javaStringDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Java.STRING));

    { // java strings
      String contentTypes[] = new String[] {
          ATGPartitions.STRING_IMPORTS,
          ATGPartitions.CHARACTER_IMPORTS,
          ATGPartitions.STRING_PARSER_CODE,
          ATGPartitions.CHARACTER_PARSER_CODE,
          ATGPartitions.STRING_INLINE_CODE,
          ATGPartitions.CHARACTER_INLINE_CODE,
          ATGPartitions.STRING_PRAGMAS_INLINE_CODE,
          ATGPartitions.CHARACTER_PRAGMAS_INLINE_CODE,
          ATGPartitions.STRING_PRODUCTIONS_INLINE_CODE,
          ATGPartitions.CHARACTER_PRODUCTIONS_INLINE_CODE,};
      for (String ct : contentTypes) {
        reconciler.setDamager(javaStringDR, ct);
        reconciler.setRepairer(javaStringDR, ct);
      }
    }

   
    return reconciler;
View Full Code Here

  /**
   * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
   */
  @Override
  public IPresentationReconciler getPresentationReconciler(ISourceViewer sourceViewer) {
    PresentationReconciler reconciler = new PresentationReconciler();

    DefaultDamagerRepairer contentDR = new DefaultDamagerRepairer(getCodeScanner());
    reconciler.setDamager(contentDR, IDocument.DEFAULT_CONTENT_TYPE);
    reconciler.setRepairer(contentDR, IDocument.DEFAULT_CONTENT_TYPE);

    NonRuleBasedDamagerRepairer frameDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Frame.KEYWORD));
    reconciler.setDamager(frameDR, FramePartitions.FRAME_KEYWORD);
    reconciler.setRepairer(frameDR, FramePartitions.FRAME_KEYWORD);

    NonRuleBasedDamagerRepairer commentDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Common.COMMENT));
    reconciler.setDamager(commentDR, FramePartitions.MULTI_LINE_COMMENT);
    reconciler.setRepairer(commentDR, FramePartitions.MULTI_LINE_COMMENT);
    reconciler.setDamager(commentDR, FramePartitions.SINGLE_LINE_COMMENT);
    reconciler.setRepairer(commentDR, FramePartitions.SINGLE_LINE_COMMENT);

    NonRuleBasedDamagerRepairer stringDR = new NonRuleBasedDamagerRepairer(
        fSyntaxManager.getTextAttribute(SyntaxManager.Common.STRING));
    reconciler.setDamager(stringDR, FramePartitions.STRING);
    reconciler.setRepairer(stringDR, FramePartitions.STRING);
    reconciler.setDamager(stringDR, FramePartitions.CHARACTER);
    reconciler.setRepairer(stringDR, FramePartitions.CHARACTER);

    return reconciler;
  }
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getPresentationReconciler(org.eclipse.jface.text.source.ISourceViewer)
     */
    public IPresentationReconciler getPresentationReconciler( ISourceViewer sourceViewer )
    {
        PresentationReconciler reconciler = new PresentationReconciler();
        reconciler.setDocumentPartitioning( getConfiguredDocumentPartitioning( sourceViewer ) );

        // Creating the damager/repairer for code
        DefaultDamagerRepairer dr = new DefaultDamagerRepairer( Activator.getDefault().getAciCodeScanner() );
        reconciler.setDamager( dr, IDocument.DEFAULT_CONTENT_TYPE );
        reconciler.setRepairer( dr, IDocument.DEFAULT_CONTENT_TYPE );

        return reconciler;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.presentation.PresentationReconciler

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.