Package org.eclipse.jface.text.contentassist

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


    else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_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_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);
View Full Code Here


        if (fReconciler instanceof StructuredRegionProcessor)
          ((StructuredRegionProcessor) fReconciler).setDocument(getDocument());
      }
    }

    IContentAssistant newAssistant = configuration.getContentAssistant(this);
    if (newAssistant != fContentAssistant || newAssistant == null || fContentAssistant == null) {
      if (fContentAssistant != null)
        fContentAssistant.uninstall();

      fContentAssistant = newAssistant;
View Full Code Here

    else if (EditorPreferenceNames.CODEASSIST_PROPOSALS_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_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);
View Full Code Here

        if (fReconciler instanceof StructuredRegionProcessor)
          ((StructuredRegionProcessor) fReconciler).setDocument(getDocument());
      }
    }

    IContentAssistant newAssistant = configuration.getContentAssistant(this);
    if (newAssistant != fContentAssistant || newAssistant == null || fContentAssistant == null) {
      if (fContentAssistant != null)
        fContentAssistant.uninstall();

      fContentAssistant = newAssistant;
View Full Code Here

    }
    return fConfiguredContentTypes;
  }
 
  public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    final IContentAssistant assistant = super.getContentAssistant(sourceViewer);
    if (assistant instanceof ContentAssistant) {
      ((ContentAssistant) assistant).enableAutoInsert(XMLUIPlugin.getInstance().getPreferenceStore().getBoolean(XMLUIPreferenceNames.INSERT_SINGLE_SUGGESTION));
    }
    return assistant;
  }
View Full Code Here

*             org.eclipse.jface.text.quickassist.IQuickAssistProcessor;
*/
public class CorrectionAssistantProviderXML extends CorrectionAssistantProvider {

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

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

      if (sourceViewer != null) {
View Full Code Here

   * (org.eclipse.jface.util.PropertyChangeEvent)
   */
  protected void handlePreferenceStoreChanged(PropertyChangeEvent event) {
    JDISourceViewer isv = (JDISourceViewer) getSourceViewer();
    if (isv != null) {
      IContentAssistant assistant = isv.getContentAssistant();
      if (assistant instanceof ContentAssistant) {
        JDIContentAssistPreference.changeConfiguration(
            (ContentAssistant) assistant, event);
      }
      SourceViewerConfiguration configuration = getSourceViewerConfiguration();
View Full Code Here

    /**
     * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent)
     */
    public void propertyChange(PropertyChangeEvent event) {
        IContentAssistant assistant = getContentAssistant();
        String property = event.getProperty();

        if (JFaceResources.TEXT_FONT.equals(property)) {
            updateViewerFont();
        }
View Full Code Here

      }

      public IContentAssistant getContentAssistant(ISourceViewer viewer) {
        if (!viewer.isEditable())
          return null;
        IContentAssistant assistant = createContentAssistant(viewer);
        // Add content assist proposal handler if assistant exists
        if (assistant != null)
          contentAssistActionHandler = createContentAssistActionHandler(sourceViewer);
        return assistant;
      }
View Full Code Here

      return;
    }
    fViewerConfiguration = configuration;

    PHPStructuredTextViewerConfiguration phpConfiguration = (PHPStructuredTextViewerConfiguration) configuration;
    IContentAssistant newPHPAssistant = phpConfiguration
        .getPHPContentAssistant(this, true);

    // Uninstall content assistant created in super:
    if (fContentAssistant != null) {
      fContentAssistant.uninstall();
View Full Code Here

TOP

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

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.