Example usage for org.eclipse.jface.preference JFacePreferences CONTENT_ASSIST_FOREGROUND_COLOR

List of usage examples for org.eclipse.jface.preference JFacePreferences CONTENT_ASSIST_FOREGROUND_COLOR

Introduction

In this page you can find the example usage for org.eclipse.jface.preference JFacePreferences CONTENT_ASSIST_FOREGROUND_COLOR.

Prototype

String CONTENT_ASSIST_FOREGROUND_COLOR

To view the source code for org.eclipse.jface.preference JFacePreferences CONTENT_ASSIST_FOREGROUND_COLOR.

Click Source Link

Document

Identifier for the color used for the foreground of content assist popup dialogs.

Usage

From source file:com.aptana.editor.common.contentassist.CompletionProposalPopup.java

License:Open Source License

/**
 * Returns the foreground color to use./*from  w  w w  . ja v a 2 s  .  c om*/
 * 
 * @param control
 *            the control to get the display from
 * @return the foreground color
 * @since 3.2
 */
private Color getForegroundColor(Control control) {
    Color c = fContentAssistant.getProposalSelectorForeground();
    if (c == null)
        c = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    return c;
}

From source file:com.aptana.ide.editors.unified.contentassist.CompletionProposalPopup.java

License:Open Source License

/**
 * Returns the foreground color to use./*from  ww w . ja v a2  s  .  co  m*/
 * 
 * @param control
 *            the control to get the display from
 * @return the foreground color
 * @since 3.2
 */
private Color getForegroundColor(Control control) {
    Color c = fContentAssistant.getProposalSelectorForeground();
    if (c == null) {
        c = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    }
    return c;
}

From source file:com.cisco.yangide.editor.editors.YangSourceViewerConfiguration.java

License:Open Source License

@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

    ContentAssistant assistant = new ContentAssistant();
    IContentAssistProcessor processor = new YangSimpleCompletionProcessor();
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);

    assistant.setDocumentPartitioning(YangDocumentSetupParticipant.YANG_PARTITIONING);

    assistant.enableAutoActivation(false);
    assistant.setAutoActivationDelay(200);
    assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_REMOVE);
    assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE);
    assistant.setInformationControlCreator(getInformationControlCreator());

    Color background = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
    assistant.setContextInformationPopupBackground(background);
    assistant.setContextSelectorBackground(background);

    Color foreground = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    assistant.setContextInformationPopupForeground(foreground);
    assistant.setContextSelectorForeground(foreground);

    assistant.setStatusLineVisible(true);

    assistant.enableAutoInsert(true);/*from   w w  w  . j a  v a  2  s.  c om*/

    return assistant;
}

From source file:cz.vutbr.fit.xhriba01.bc.jdt.ui.PreferenceConstants.java

License:Open Source License

/**
 * Initializes deprecated color constants.
 * /*from  w w  w .  ja  v  a 2 s.  co m*/
 * @param store the preference store
 * @since 3.6
 */
private static void initializeDeprecatedColorConstants(IPreferenceStore store) {
    RGB bgRGB = null;
    RGB fgRGB = null;

    // Don't fail in headless mode
    //if (PlatformUI.isWorkbenchRunning()) {
    bgRGB = JFaceResources.getColorRegistry().getRGB(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
    fgRGB = JFaceResources.getColorRegistry().getRGB(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    //}

    // Workaround for https://bugs.eclipse.org/306736
    if (bgRGB == null)
        bgRGB = new RGB(255, 255, 255);
    if (fgRGB == null)
        fgRGB = new RGB(0, 0, 0);

    setRGBValue(store, PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND, bgRGB);
    setRGBValue(store, PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND, fgRGB);

}

From source file:org.csstudio.autocomplete.ui.content.ContentProposalPopup.java

License:Open Source License

protected Color getForeground() {
    return JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
}

From source file:org.eclipse.ajdt.internal.ui.editor.quickfix.JavaCorrectionAssistant.java

License:Open Source License

/**
 * Constructor for JavaCorrectionAssistant.
 *///  w ww  .  j  a  v  a2  s  .  c  o  m
public JavaCorrectionAssistant(ITextEditor editor) {
    super();
    Assert.isNotNull(editor);
    fEditor = editor;

    JavaCorrectionProcessor processor = new JavaCorrectionProcessor(this);

    setQuickAssistProcessor(processor);

    setInformationControlCreator(getInformationControlCreator());

    JavaTextTools textTools = JavaPlugin.getDefault().getJavaTextTools();
    IColorManager manager = textTools.getColorManager();

    IPreferenceStore store = JavaPlugin.getDefault().getPreferenceStore();

    Color c = getColor(store, JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR, manager);
    setProposalSelectorForeground(c);

    // use the default each time, rather than setting it here
    //      c= getColor(store, JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR, manager);
    //      setProposalSelectorBackground(c);
}

From source file:org.eclipse.ant.internal.ui.editor.AntEditorSourceViewerConfiguration.java

License:Open Source License

@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    fContentAssistant = new ContentAssistant();
    AntEditorCompletionProcessor processor = new AntEditorCompletionProcessor(fEditor.getAntModel());
    fContentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
    fContentAssistant.setContentAssistProcessor(processor, AntEditorPartitionScanner.XML_TAG);
    fContentAssistant.setDocumentPartitioning(AntDocumentSetupParticipant.ANT_PARTITIONING);

    String triggers = fPreferenceStore
            .getString(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS);
    if (triggers != null) {
        processor.setCompletionProposalAutoActivationCharacters(triggers.toCharArray());
    }/*from  w  w  w .  j a  va 2  s  . c o m*/

    fContentAssistant
            .enableAutoInsert(fPreferenceStore.getBoolean(AntEditorPreferenceConstants.CODEASSIST_AUTOINSERT));
    fContentAssistant.enableAutoActivation(
            fPreferenceStore.getBoolean(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION));
    fContentAssistant.setAutoActivationDelay(
            fPreferenceStore.getInt(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
    fContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
    fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    fContentAssistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));

    Color background = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
    fContentAssistant.setContextInformationPopupBackground(background);
    fContentAssistant.setContextSelectorBackground(background);

    Color foreground = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    fContentAssistant.setContextInformationPopupForeground(foreground);
    fContentAssistant.setContextSelectorForeground(foreground);

    IInformationControlCreator creator = getInformationControlCreator(sourceViewer);
    fContentAssistant.setInformationControlCreator(creator);

    fContentAssistant.setRepeatedInvocationMode(true);
    fContentAssistant.setStatusLineVisible(true);
    fContentAssistant.setShowEmptyList(true);
    fContentAssistant.addCompletionListener(processor);
    return fContentAssistant;
}

From source file:org.eclipse.vex.ui.internal.swt.ContentAssist.java

License:Open Source License

@Override
protected Color getForeground() {
    return JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
}

From source file:org.ganoro.phing.ui.editors.AntEditorSourceViewerConfiguration.java

License:Open Source License

public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
    fContentAssistant = new ContentAssistant();
    AntEditorCompletionProcessor processor = new AntEditorCompletionProcessor(fEditor.getAntModel());
    fContentAssistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);
    fContentAssistant.setContentAssistProcessor(processor, AntEditorPartitionScanner.XML_TAG);
    fContentAssistant.setDocumentPartitioning(AntDocumentSetupParticipant.ANT_PARTITIONING);

    String triggers = fPreferenceStore
            .getString(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_TRIGGERS);
    if (triggers != null) {
        processor.setCompletionProposalAutoActivationCharacters(triggers.toCharArray());
    }/*ww w . j  av  a2  s  .com*/

    fContentAssistant
            .enableAutoInsert(fPreferenceStore.getBoolean(AntEditorPreferenceConstants.CODEASSIST_AUTOINSERT));
    fContentAssistant.enableAutoActivation(
            fPreferenceStore.getBoolean(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION));
    fContentAssistant.setAutoActivationDelay(
            fPreferenceStore.getInt(AntEditorPreferenceConstants.CODEASSIST_AUTOACTIVATION_DELAY));
    fContentAssistant.setProposalPopupOrientation(IContentAssistant.PROPOSAL_OVERLAY);
    fContentAssistant.setContextInformationPopupOrientation(IContentAssistant.CONTEXT_INFO_ABOVE);
    fContentAssistant.setInformationControlCreator(getInformationControlCreator(sourceViewer));

    Color background = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
    fContentAssistant.setContextInformationPopupBackground(background);
    fContentAssistant.setContextSelectorBackground(background);

    Color foreground = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    fContentAssistant.setContextInformationPopupForeground(foreground);
    fContentAssistant.setContextSelectorForeground(foreground);

    IInformationControlCreator creator = getInformationControlCreator(sourceViewer);
    fContentAssistant.setInformationControlCreator(creator);

    fContentAssistant.setRepeatedInvocationMode(true);
    fContentAssistant.setStatusLineVisible(true);
    fContentAssistant.setShowEmptyList(true);
    fContentAssistant.addCompletionListener(processor);
    return fContentAssistant;
}

From source file:org.opendaylight.yangide.editor.editors.YangSourceViewerConfiguration.java

License:Open Source License

@Override
public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {

    ContentAssistant assistant = new ContentAssistant();
    IContentAssistProcessor processor = new YangSimpleCompletionProcessor(getEditor());
    assistant.setContentAssistProcessor(processor, IDocument.DEFAULT_CONTENT_TYPE);

    assistant.setDocumentPartitioning(YangDocumentSetupParticipant.YANG_PARTITIONING);

    assistant.enableAutoActivation(false);
    assistant.setAutoActivationDelay(200);
    assistant.setProposalPopupOrientation(ContentAssistant.PROPOSAL_REMOVE);
    assistant.setContextInformationPopupOrientation(ContentAssistant.CONTEXT_INFO_ABOVE);
    assistant.setInformationControlCreator(getInformationControlCreator());

    Color background = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR);
    assistant.setContextInformationPopupBackground(background);
    assistant.setContextSelectorBackground(background);

    Color foreground = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR);
    assistant.setContextInformationPopupForeground(foreground);
    assistant.setContextSelectorForeground(foreground);

    assistant.setStatusLineVisible(true);

    assistant.enableAutoInsert(true);/*from www.j  a v a  2s.co  m*/

    return assistant;
}