Package org.eclipse.jface.text.contentassist

Examples of org.eclipse.jface.text.contentassist.ContentAssistant


      if (sourceViewer != null) {
        SourceViewerConfiguration configuration = getSourceViewerConfiguration();
        if (configuration != null) {
          IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
          if (contentAssistant instanceof ContentAssistant) {
            ContentAssistant assistant = (ContentAssistant) contentAssistant;
            RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PROPOSALS_BACKGROUND);
            Color color = EditorUtility.getColor(rgb);
            assistant.setProposalSelectorBackground(color);
          }
        }
      }
    }

    // update content assist preferences
    else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND.equals(property)) {
      ISourceViewer sourceViewer = getSourceViewer();
      if (sourceViewer != null) {
        SourceViewerConfiguration configuration = getSourceViewerConfiguration();
        if (configuration != null) {
          IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
          if (contentAssistant instanceof ContentAssistant) {
            ContentAssistant assistant = (ContentAssistant) contentAssistant;
            RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PROPOSALS_FOREGROUND);
            Color color = EditorUtility.getColor(rgb);
            assistant.setProposalSelectorForeground(color);
          }
        }
      }
    }

    // update content assist preferences
    else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND.equals(property)) {
      ISourceViewer sourceViewer = getSourceViewer();
      if (sourceViewer != null) {
        SourceViewerConfiguration configuration = getSourceViewerConfiguration();
        if (configuration != null) {
          IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
          if (contentAssistant instanceof ContentAssistant) {
            ContentAssistant assistant = (ContentAssistant) contentAssistant;
            RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PARAMETERS_BACKGROUND);
            Color color = EditorUtility.getColor(rgb);
            assistant.setContextInformationPopupBackground(color);
            assistant.setContextSelectorBackground(color);
          }
        }
      }
    }

    // update content assist preferences
    else if (EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND.equals(property)) {
      ISourceViewer sourceViewer = getSourceViewer();
      if (sourceViewer != null) {
        SourceViewerConfiguration configuration = getSourceViewerConfiguration();
        if (configuration != null) {
          IContentAssistant contentAssistant = configuration.getContentAssistant(sourceViewer);
          if (contentAssistant instanceof ContentAssistant) {
            ContentAssistant assistant = (ContentAssistant) contentAssistant;
            RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), EditorPreferenceNames.CODEASSIST_PARAMETERS_FOREGROUND);
            Color color = EditorUtility.getColor(rgb);
            assistant.setContextInformationPopupForeground(color);
            assistant.setContextSelectorForeground(color);
          }
        }
      }
    }
View Full Code Here


        public LineStyleProvider[] getLineStyleProviders(ISourceViewer sourceViewer, String partitionType) {
          return baseConfiguration.getLineStyleProviders(sourceViewer, partitionType);
        }

        public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
          ContentAssistant assistant = new ContentAssistant();
          assistant.enableAutoActivation(true);
          assistant.enableAutoInsert(true);
          assistant.setContentAssistProcessor(getTemplateProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
          return assistant;
        }
      };
      return doCreateViewer(parent, sourceViewerConfiguration);
    }
View Full Code Here

  /**
   * @see SourceViewerConfiguration#getContentAssistant(ISourceViewer)
   */
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

    ContentAssistant assistant = new ContentAssistant();
    assistant.setContentAssistProcessor(getContentAssistantProcessor(),
        IDocument.DEFAULT_CONTENT_TYPE);

    JDIContentAssistPreference.configure(assistant, getColorManager());
    assistant
        .setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    assistant
        .setInformationControlCreator(getInformationControlCreator(sourceViewer));

    return assistant;
  }
View Full Code Here

    }

    @Override
    public IContentAssistant getContentAssistant(ISourceViewer sourceViewer)
    {
      ContentAssistant assistant = new ContentAssistant();
       assistant.setContentAssistProcessor(new VdmLinkCompletionProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
      assistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));
      // Allow automatic activation after 500 msec
      assistant.enableAutoActivation(true);
      assistant.setAutoActivationDelay(500);

      return assistant;
    }
View Full Code Here

     * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
     */
    public IContentAssistant getContentAssistant( ISourceViewer sourceViewer )
    {
        //        ContentAssistant assistant = new ContentAssistant();
        ContentAssistant assistant = new DialogContentAssistant();
        IContentAssistProcessor aciContentAssistProcessor = new ACIContentAssistProcessor();

        assistant.setContentAssistProcessor( aciContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
        assistant.setDocumentPartitioning( "org.apache.directory.ldapstudio.aci" ); //$NON-NLS-1$
        assistant.enableAutoActivation( true );
        assistant.setAutoActivationDelay( 500 );
        assistant.setProposalPopupOrientation( IContentAssistant.PROPOSAL_STACKED );
        assistant.setContextInformationPopupOrientation( IContentAssistant.CONTEXT_INFO_ABOVE );

        return assistant;
    }
View Full Code Here

  public IContentAssistant getCorrectionAssistant(ISourceViewer sourceViewer) {
    IContentAssistant ca = null;

    if (sourceViewer != null) {
      ContentAssistant assistant = new ContentAssistant();

      if (sourceViewer != null) {
        IContentAssistProcessor correctionProcessor = new CorrectionProcessorXML(sourceViewer);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DEFAULT);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_CDATA);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_COMMENT);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_DECLARATION);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.XML_PI);
        assistant.setContentAssistProcessor(correctionProcessor, IXMLPartitions.DTD_SUBSET);
      }
      ca = assistant;
    }

    return ca;
View Full Code Here

    return reconciler;
  }
 
  @Override
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    ContentAssistant assistant = new ContentAssistant();
    CLNGContentAssistProcessor processor = new CLNGContentAssistProcessor(fEditor.getClassLoader());
   
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
   
   
    return assistant;
  }
View Full Code Here

  /*
   * This Method creates the  ContentAssistant that is necessary for Code Completion
   * Defines a "Content Assist Processor" for every ATG File Partition that should
   * support code Completion and installs it for distinct Partition
   */
    ContentAssistant assistant = new ContentAssistant();
    IContentAssistProcessor processor;
   
    //processor = new ATGContentAssistProcessor(fEditor.getATGModelProvider());
    assistant.setDocumentPartitioning(getConfiguredDocumentPartitioning(sourceViewer));
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new IgnoreCaseSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.IGNORECASE_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new CharactersSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.CHARACTERS_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new TokensSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.TOKENS_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new PragmasSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.PRAGMAS_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new CommentsSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.COMMENTS_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new IgnoreSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.IGNORE_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new ProductionsSegmentProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.PRODUCTIONS_SEGMENT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new DefaultProposalProvider());
    assistant.setContentAssistProcessor(processor, ATGPartitions.DEFAULT);
   
    processor = new ATGCompletionProcessor(fEditor.getATGModelProvider(), new IgnoreCaseSegmentProposalProvider());
    processor = new JavaCompletionProcessor(fEditor.getATGModelProvider(), fEditor);
    assistant.enableAutoActivation(true);
    assistant.setContentAssistProcessor(processor, ATGPartitions.PARSER_CODE);
   
   
    assistant.enableColoredLabels(true);
    //assistant.enablePrefixCompletion(true);
    //assistant.enableAutoInsert(true);
    return assistant;
  }
View Full Code Here

     * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getContentAssistant(org.eclipse.jface.text.source.ISourceViewer)
     */
    public IContentAssistant getContentAssistant( ISourceViewer sourceViewer )
    {
        //        ContentAssistant assistant = new ContentAssistant();
        ContentAssistant assistant = new DialogContentAssistant();
        IContentAssistProcessor aciContentAssistProcessor = new ACIContentAssistProcessor();

        assistant.setContentAssistProcessor( aciContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
        assistant.setDocumentPartitioning( "org.apache.directory.studio.aci" ); //$NON-NLS-1$
        assistant.enableAutoActivation( true );
        assistant.setAutoActivationDelay( 500 );
        assistant.setProposalPopupOrientation( IContentAssistant.PROPOSAL_STACKED );
        assistant.setContextInformationPopupOrientation( IContentAssistant.CONTEXT_INFO_ABOVE );

        return assistant;
    }
View Full Code Here

     * {@inheritDoc}
     */
    public IContentAssistant getContentAssistant( ISourceViewer sourceViewer )
    {
        //        ContentAssistant assistant = new ContentAssistant();
        ContentAssistant assistant = new DialogContentAssistant();
        IContentAssistProcessor aciContentAssistProcessor = new ACIContentAssistProcessor();

        assistant.setContentAssistProcessor( aciContentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
        assistant.enableAutoActivation( true );
        assistant.setAutoActivationDelay( 500 );
        assistant.setProposalPopupOrientation( IContentAssistant.PROPOSAL_STACKED );
        assistant.setContextInformationPopupOrientation( IContentAssistant.CONTEXT_INFO_ABOVE );

        return assistant;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.contentassist.ContentAssistant

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.