mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 02:36:01 +02:00
Fix for 194312: Hover Background Color
This commit is contained in:
parent
eff6754c12
commit
1d3da89cf0
8 changed files with 415 additions and 278 deletions
|
@ -572,8 +572,8 @@
|
||||||
contentTypeId="org.eclipse.cdt.core.binaryFile">
|
contentTypeId="org.eclipse.cdt.core.binaryFile">
|
||||||
</contentTypeBinding>
|
</contentTypeBinding>
|
||||||
</editor>
|
</editor>
|
||||||
|
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.themes">
|
point="org.eclipse.ui.themes">
|
||||||
<themeElementCategory label="%CPresentation.label" id="org.eclipse.cdt.ui.presentation"/>
|
<themeElementCategory label="%CPresentation.label" id="org.eclipse.cdt.ui.presentation"/>
|
||||||
|
@ -614,8 +614,51 @@
|
||||||
%asmCompareFontDefiniton.description
|
%asmCompareFontDefiniton.description
|
||||||
</description>
|
</description>
|
||||||
</fontDefinition>
|
</fontDefinition>
|
||||||
|
<colorDefinition
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_proposals_background"
|
||||||
|
isEditable="false"
|
||||||
|
label="%Dummy.label"
|
||||||
|
value="255,255,255">
|
||||||
|
</colorDefinition>
|
||||||
|
<colorDefinition
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_proposals_foreground"
|
||||||
|
isEditable="false"
|
||||||
|
label="%Dummy.label"
|
||||||
|
value="0,0,0">
|
||||||
|
</colorDefinition>
|
||||||
|
<colorDefinition
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_parameters_background"
|
||||||
|
isEditable="false"
|
||||||
|
label="%Dummy.label"
|
||||||
|
value="255,255,255">
|
||||||
|
</colorDefinition>
|
||||||
|
<colorDefinition
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_parameters_foreground"
|
||||||
|
isEditable="false"
|
||||||
|
label="%Dummy.label"
|
||||||
|
value="0,0,0">
|
||||||
|
</colorDefinition>
|
||||||
|
<theme
|
||||||
|
id="org.eclipse.ui.ide.systemDefault">
|
||||||
|
<colorOverride
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_proposals_background"
|
||||||
|
value="COLOR_LIST_BACKGROUND">
|
||||||
|
</colorOverride>
|
||||||
|
<colorOverride
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_proposals_foreground"
|
||||||
|
value="COLOR_LIST_FOREGROUND">
|
||||||
|
</colorOverride>
|
||||||
|
<colorOverride
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_parameters_background"
|
||||||
|
value="COLOR_LIST_BACKGROUND">
|
||||||
|
</colorOverride>
|
||||||
|
<colorOverride
|
||||||
|
id="org.eclipse.cdt.ui.content_assist_parameters_foreground"
|
||||||
|
value="COLOR_LIST_FOREGROUND">
|
||||||
|
</colorOverride>
|
||||||
|
</theme>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
||||||
<extension
|
<extension
|
||||||
point="org.eclipse.ui.preferencePages">
|
point="org.eclipse.ui.preferencePages">
|
||||||
<page
|
<page
|
||||||
|
|
|
@ -29,4 +29,15 @@ public interface ICThemeConstants {
|
||||||
* A theme constant that holds the foreground color used in the code assist selection dialog.
|
* A theme constant that holds the foreground color used in the code assist selection dialog.
|
||||||
*/
|
*/
|
||||||
public final String CODEASSIST_PROPOSALS_FOREGROUND= ID_PREFIX + PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND;
|
public final String CODEASSIST_PROPOSALS_FOREGROUND= ID_PREFIX + PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A theme constant that holds the background color used for parameter hints.
|
||||||
|
*/
|
||||||
|
public final String CODEASSIST_PARAMETERS_BACKGROUND= ID_PREFIX + PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A theme constant that holds the foreground color used for parameter hints.
|
||||||
|
*/
|
||||||
|
public final String CODEASSIST_PARAMETERS_FOREGROUND= ID_PREFIX + PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_completionProposalForegroundColor, ContentAssistPreference.PROPOSALS_FOREGROUND, null },
|
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_completionProposalForegroundColor, ContentAssistPreference.PROPOSALS_FOREGROUND, null },
|
||||||
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_parameterBackgroundColor, ContentAssistPreference.PARAMETERS_BACKGROUND, null },
|
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_parameterBackgroundColor, ContentAssistPreference.PARAMETERS_BACKGROUND, null },
|
||||||
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_parameterForegroundColor, ContentAssistPreference.PARAMETERS_FOREGROUND, null },
|
{PreferencesMessages.CEditorPreferencePage_ContentAssistPage_parameterForegroundColor, ContentAssistPreference.PARAMETERS_FOREGROUND, null },
|
||||||
|
{PreferencesMessages.CEditorPreferencePage_sourceHoverBackgroundColor, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT},
|
||||||
};
|
};
|
||||||
|
|
||||||
private List fAppearanceColorList;
|
private List fAppearanceColorList;
|
||||||
|
@ -78,6 +79,8 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PROPOSALS_FOREGROUND));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PROPOSALS_FOREGROUND));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_BACKGROUND));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_BACKGROUND));
|
||||||
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_FOREGROUND));
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, ContentAssistPreference.PARAMETERS_FOREGROUND));
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.STRING, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR));
|
||||||
|
overlayKeys.add(new OverlayPreferenceStore.OverlayKey(OverlayPreferenceStore.BOOLEAN, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT));
|
||||||
|
|
||||||
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
|
OverlayPreferenceStore.OverlayKey[] keys = new OverlayPreferenceStore.OverlayKey[overlayKeys.size()];
|
||||||
overlayKeys.toArray(keys);
|
overlayKeys.toArray(keys);
|
||||||
|
@ -92,11 +95,6 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
|
|
||||||
store.setDefault(CEditor.INACTIVE_CODE_ENABLE, true);
|
store.setDefault(CEditor.INACTIVE_CODE_ENABLE, true);
|
||||||
PreferenceConverter.setDefault(store, CEditor.INACTIVE_CODE_COLOR, new RGB(224, 224, 224));
|
PreferenceConverter.setDefault(store, CEditor.INACTIVE_CODE_COLOR, new RGB(224, 224, 224));
|
||||||
|
|
||||||
PreferenceConverter.setDefault(store, ContentAssistPreference.PROPOSALS_BACKGROUND, new RGB(254, 241, 233));
|
|
||||||
PreferenceConverter.setDefault(store, ContentAssistPreference.PROPOSALS_FOREGROUND, new RGB(0, 0, 0));
|
|
||||||
PreferenceConverter.setDefault(store, ContentAssistPreference.PARAMETERS_BACKGROUND, new RGB(254, 241, 233));
|
|
||||||
PreferenceConverter.setDefault(store, ContentAssistPreference.PARAMETERS_FOREGROUND, new RGB(0, 0, 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -266,7 +264,6 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
* @see PreferencePage#createContents(Composite)
|
* @see PreferencePage#createContents(Composite)
|
||||||
*/
|
*/
|
||||||
protected Control createContents(Composite parent) {
|
protected Control createContents(Composite parent) {
|
||||||
|
|
||||||
fOverlayStore.load();
|
fOverlayStore.load();
|
||||||
fOverlayStore.start();
|
fOverlayStore.start();
|
||||||
|
|
||||||
|
@ -280,8 +277,8 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize() {
|
private void initialize() {
|
||||||
|
|
||||||
initializeFields();
|
initializeFields();
|
||||||
|
initializeDefaultColors();
|
||||||
|
|
||||||
for (int i = 0; i < fAppearanceColorListModel.length; i++) {
|
for (int i = 0; i < fAppearanceColorListModel.length; i++) {
|
||||||
fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
|
fAppearanceColorList.add(fAppearanceColorListModel[i][0]);
|
||||||
|
@ -292,14 +289,16 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
handleAppearanceColorListSelection();
|
handleAppearanceColorListSelection();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* @see org.eclipse.cdt.internal.ui.preferences.AbstractPreferencePage#performOk()
|
* Initializes the default colors.
|
||||||
*/
|
*/
|
||||||
public boolean performOk() {
|
private void initializeDefaultColors() {
|
||||||
return super.performOk();
|
if (getPreferenceStore().getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)) {
|
||||||
|
RGB rgb= fAppearanceColorList.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND).getRGB();
|
||||||
|
PreferenceConverter.setValue(getPreferenceStore(), PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR, rgb);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -307,15 +306,8 @@ public class CEditorPreferencePage extends AbstractPreferencePage implements IWo
|
||||||
*/
|
*/
|
||||||
protected void performDefaults() {
|
protected void performDefaults() {
|
||||||
super.performDefaults();
|
super.performDefaults();
|
||||||
|
initializeDefaultColors();
|
||||||
handleAppearanceColorListSelection();
|
handleAppearanceColorListSelection();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* @see org.eclipse.cdt.internal.ui.preferences.AbstractPreferencePage#dispose()
|
|
||||||
*/
|
|
||||||
public void dispose() {
|
|
||||||
super.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,6 +57,7 @@ public final class PreferencesMessages extends NLS {
|
||||||
public static String CEditorPreferencePage_ContentAssistPage_parameterForegroundColor;
|
public static String CEditorPreferencePage_ContentAssistPage_parameterForegroundColor;
|
||||||
public static String CEditorPreferencePage_ContentAssistPage_autoActivationEnableDoubleColon;
|
public static String CEditorPreferencePage_ContentAssistPage_autoActivationEnableDoubleColon;
|
||||||
public static String CEditorPreferencePage_ContentAssistPage_sortingSection_title;
|
public static String CEditorPreferencePage_ContentAssistPage_sortingSection_title;
|
||||||
|
public static String CEditorPreferencePage_sourceHoverBackgroundColor;
|
||||||
public static String CEditorColoringConfigurationBlock_MultiLine;
|
public static String CEditorColoringConfigurationBlock_MultiLine;
|
||||||
public static String CEditorColoringConfigurationBlock_singleLine;
|
public static String CEditorColoringConfigurationBlock_singleLine;
|
||||||
public static String CEditorColoringConfigurationBlock_keywords;
|
public static String CEditorColoringConfigurationBlock_keywords;
|
||||||
|
|
|
@ -39,6 +39,7 @@ CEditorPreferencePage_ContentAssistPage_parameterBackgroundColor=Parameter hint
|
||||||
CEditorPreferencePage_ContentAssistPage_parameterForegroundColor=Parameter hint foreground
|
CEditorPreferencePage_ContentAssistPage_parameterForegroundColor=Parameter hint foreground
|
||||||
CEditorPreferencePage_ContentAssistPage_autoActivationEnableDoubleColon=Enable "::" as trigger
|
CEditorPreferencePage_ContentAssistPage_autoActivationEnableDoubleColon=Enable "::" as trigger
|
||||||
CEditorPreferencePage_ContentAssistPage_sortingSection_title=Sorting and Filtering
|
CEditorPreferencePage_ContentAssistPage_sortingSection_title=Sorting and Filtering
|
||||||
|
CEditorPreferencePage_sourceHoverBackgroundColor=Source hover background
|
||||||
|
|
||||||
# {0} will be replaced by the keyboard shortcut for the command (e.g. "Ctrl+Space", or "no shortcut")
|
# {0} will be replaced by the keyboard shortcut for the command (e.g. "Ctrl+Space", or "no shortcut")
|
||||||
CodeAssistAdvancedConfigurationBlock_page_description=Configure the behavior of the content assist ({0}) command.
|
CodeAssistAdvancedConfigurationBlock_page_description=Configure the behavior of the content assist ({0}) command.
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2006 QNX Software Systems and others.
|
* Copyright (c) 2002, 2007 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -13,6 +13,7 @@
|
||||||
package org.eclipse.cdt.internal.ui.text.c.hover;
|
package org.eclipse.cdt.internal.ui.text.c.hover;
|
||||||
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
|
import org.eclipse.jface.preference.PreferenceConverter;
|
||||||
import org.eclipse.jface.resource.JFaceResources;
|
import org.eclipse.jface.resource.JFaceResources;
|
||||||
import org.eclipse.jface.text.Document;
|
import org.eclipse.jface.text.Document;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
|
@ -31,6 +32,7 @@ import org.eclipse.swt.graphics.Color;
|
||||||
import org.eclipse.swt.graphics.Font;
|
import org.eclipse.swt.graphics.Font;
|
||||||
import org.eclipse.swt.graphics.FontData;
|
import org.eclipse.swt.graphics.FontData;
|
||||||
import org.eclipse.swt.graphics.Point;
|
import org.eclipse.swt.graphics.Point;
|
||||||
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
import org.eclipse.swt.layout.GridData;
|
import org.eclipse.swt.layout.GridData;
|
||||||
import org.eclipse.swt.layout.GridLayout;
|
import org.eclipse.swt.layout.GridLayout;
|
||||||
|
@ -41,6 +43,7 @@ import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
import org.eclipse.cdt.ui.PreferenceConstants;
|
import org.eclipse.cdt.ui.PreferenceConstants;
|
||||||
|
import org.eclipse.cdt.ui.text.ICPartitions;
|
||||||
|
|
||||||
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
|
import org.eclipse.cdt.internal.ui.editor.CSourceViewer;
|
||||||
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
||||||
|
@ -91,6 +94,9 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
*/
|
*/
|
||||||
private int fMaxHeight= SWT.DEFAULT;
|
private int fMaxHeight= SWT.DEFAULT;
|
||||||
|
|
||||||
|
private Color fBackgroundColor;
|
||||||
|
private boolean fIsSystemBackgroundColor= true;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a default information control with the given shell as parent. The given
|
* Creates a default information control with the given shell as parent. The given
|
||||||
* information presenter is used to process the information to be displayed. The given
|
* information presenter is used to process the information to be displayed. The given
|
||||||
|
@ -124,6 +130,8 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
Display display= fShell.getDisplay();
|
Display display= fShell.getDisplay();
|
||||||
fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
|
fShell.setBackground(display.getSystemColor(SWT.COLOR_BLACK));
|
||||||
|
|
||||||
|
initializeColors();
|
||||||
|
|
||||||
Composite composite= fShell;
|
Composite composite= fShell;
|
||||||
layout= new GridLayout(1, false);
|
layout= new GridLayout(1, false);
|
||||||
int border= ((shellStyle & SWT.NO_TRIM) == 0) ? 0 : BORDER;
|
int border= ((shellStyle & SWT.NO_TRIM) == 0) ? 0 : BORDER;
|
||||||
|
@ -142,21 +150,21 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
gd= new GridData(GridData.FILL_BOTH);
|
gd= new GridData(GridData.FILL_BOTH);
|
||||||
composite.setLayoutData(gd);
|
composite.setLayoutData(gd);
|
||||||
composite.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
composite.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||||
composite.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
|
composite.setBackground(fBackgroundColor);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Source viewer
|
// Source viewer
|
||||||
IPreferenceStore store= CUIPlugin.getDefault().getCombinedPreferenceStore();
|
IPreferenceStore store= CUIPlugin.getDefault().getCombinedPreferenceStore();
|
||||||
fViewer= new CSourceViewer(composite, null, null, false, style, store);
|
fViewer= new CSourceViewer(composite, null, null, false, style, store);
|
||||||
CTextTools tools= CUIPlugin.getDefault().getTextTools();
|
CTextTools tools= CUIPlugin.getDefault().getTextTools();
|
||||||
fViewer.configure(new SimpleCSourceViewerConfiguration(tools.getColorManager(), store, null, tools.getDocumentPartitioning(), false));
|
fViewer.configure(new SimpleCSourceViewerConfiguration(tools.getColorManager(), store, null, ICPartitions.C_PARTITIONING, false));
|
||||||
fViewer.setEditable(false);
|
fViewer.setEditable(false);
|
||||||
|
|
||||||
fText= fViewer.getTextWidget();
|
fText= fViewer.getTextWidget();
|
||||||
gd= new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
|
gd= new GridData(GridData.BEGINNING | GridData.FILL_BOTH);
|
||||||
fText.setLayoutData(gd);
|
fText.setLayoutData(gd);
|
||||||
fText.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
fText.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
|
||||||
fText.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));
|
fText.setBackground(fBackgroundColor);
|
||||||
|
|
||||||
initializeFont();
|
initializeFont();
|
||||||
|
|
||||||
|
@ -191,13 +199,30 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
|
|
||||||
// Regarding the color see bug 41128
|
// Regarding the color see bug 41128
|
||||||
fStatusField.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
|
fStatusField.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
|
||||||
|
fStatusField.setBackground(fBackgroundColor);
|
||||||
fStatusField.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addDisposeListener(this);
|
addDisposeListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void initializeColors() {
|
||||||
|
RGB bgRGB= getHoverBackgroundColorRGB();
|
||||||
|
if (bgRGB != null) {
|
||||||
|
fBackgroundColor= new Color(fShell.getDisplay(), bgRGB);
|
||||||
|
fIsSystemBackgroundColor= false;
|
||||||
|
} else {
|
||||||
|
fBackgroundColor= fShell.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND);
|
||||||
|
fIsSystemBackgroundColor= true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private RGB getHoverBackgroundColorRGB() {
|
||||||
|
IPreferenceStore store= CUIPlugin.getDefault().getPreferenceStore();
|
||||||
|
return store.getBoolean(PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT)
|
||||||
|
? null
|
||||||
|
: PreferenceConverter.getColor(store, PreferenceConstants.EDITOR_SOURCE_HOVER_BACKGROUND_COLOR);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a default information control with the given shell as parent. The given
|
* Creates a default information control with the given shell as parent. The given
|
||||||
* information presenter is used to process the information to be displayed. The given
|
* information presenter is used to process the information to be displayed. The given
|
||||||
|
@ -207,7 +232,7 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
* @param style the additional styles for the styled text widget
|
* @param style the additional styles for the styled text widget
|
||||||
*/
|
*/
|
||||||
public SourceViewerInformationControl(Shell parent,int style) {
|
public SourceViewerInformationControl(Shell parent,int style) {
|
||||||
this(parent, SWT.NO_TRIM, style);
|
this(parent, SWT.NO_TRIM | SWT.TOOL, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -222,7 +247,7 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public SourceViewerInformationControl(Shell parent,int style, String statusFieldText) {
|
public SourceViewerInformationControl(Shell parent,int style, String statusFieldText) {
|
||||||
this(parent, SWT.NO_TRIM, style, statusFieldText);
|
this(parent, SWT.NO_TRIM | SWT.TOOL, style, statusFieldText);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -309,6 +334,8 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public final void dispose() {
|
public final void dispose() {
|
||||||
|
if (!fIsSystemBackgroundColor)
|
||||||
|
fBackgroundColor.dispose();
|
||||||
if (fShell != null && !fShell.isDisposed())
|
if (fShell != null && !fShell.isDisposed())
|
||||||
fShell.dispose();
|
fShell.dispose();
|
||||||
else
|
else
|
||||||
|
@ -336,10 +363,6 @@ public class SourceViewerInformationControl implements IInformationControl, IInf
|
||||||
* @see IInformationControl#setLocation(Point)
|
* @see IInformationControl#setLocation(Point)
|
||||||
*/
|
*/
|
||||||
public void setLocation(Point location) {
|
public void setLocation(Point location) {
|
||||||
Rectangle trim= fShell.computeTrim(0, 0, 0, 0);
|
|
||||||
Point textLocation= fText.getLocation();
|
|
||||||
location.x += trim.x - textLocation.x;
|
|
||||||
location.y += trim.y - textLocation.y;
|
|
||||||
fShell.setLocation(location);
|
fShell.setLocation(location);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,6 +17,8 @@ import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
import org.eclipse.cdt.internal.ui.text.CTextTools;
|
||||||
import org.eclipse.cdt.internal.ui.text.IColorManager;
|
import org.eclipse.cdt.internal.ui.text.IColorManager;
|
||||||
import org.eclipse.cdt.ui.CUIPlugin;
|
import org.eclipse.cdt.ui.CUIPlugin;
|
||||||
|
import org.eclipse.cdt.ui.PreferenceConstants;
|
||||||
|
|
||||||
import org.eclipse.jface.preference.IPreferenceStore;
|
import org.eclipse.jface.preference.IPreferenceStore;
|
||||||
import org.eclipse.jface.preference.PreferenceConverter;
|
import org.eclipse.jface.preference.PreferenceConverter;
|
||||||
import org.eclipse.jface.text.IDocument;
|
import org.eclipse.jface.text.IDocument;
|
||||||
|
@ -35,13 +37,13 @@ public class ContentAssistPreference {
|
||||||
/** Preference key for content assist timeout delay (unused) */
|
/** Preference key for content assist timeout delay (unused) */
|
||||||
public final static String TIMEOUT_DELAY= "content_assist_timeout_delay"; //$NON-NLS-1$
|
public final static String TIMEOUT_DELAY= "content_assist_timeout_delay"; //$NON-NLS-1$
|
||||||
/** Preference key for content assist proposal color */
|
/** Preference key for content assist proposal color */
|
||||||
public final static String PROPOSALS_FOREGROUND= "content_assist_proposals_foreground"; //$NON-NLS-1$
|
public final static String PROPOSALS_FOREGROUND= PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND;
|
||||||
/** Preference key for content assist proposal color */
|
/** Preference key for content assist proposal color */
|
||||||
public final static String PROPOSALS_BACKGROUND= "content_assist_proposals_background"; //$NON-NLS-1$
|
public final static String PROPOSALS_BACKGROUND= PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND;
|
||||||
/** Preference key for content assist parameters color */
|
/** Preference key for content assist parameters color */
|
||||||
public final static String PARAMETERS_FOREGROUND= "content_assist_parameters_foreground"; //$NON-NLS-1$
|
public final static String PARAMETERS_FOREGROUND= PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND;
|
||||||
/** Preference key for content assist parameters color */
|
/** Preference key for content assist parameters color */
|
||||||
public final static String PARAMETERS_BACKGROUND= "content_assist_parameters_background"; //$NON-NLS-1$
|
public final static String PARAMETERS_BACKGROUND= PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND;
|
||||||
/** Preference key for content assist auto insert */
|
/** Preference key for content assist auto insert */
|
||||||
public final static String AUTOINSERT= "content_assist_autoinsert"; //$NON-NLS-1$
|
public final static String AUTOINSERT= "content_assist_autoinsert"; //$NON-NLS-1$
|
||||||
/** Preference key for content assist to insert the common prefix */
|
/** Preference key for content assist to insert the common prefix */
|
||||||
|
|
|
@ -1022,6 +1022,34 @@ public class PreferenceConstants {
|
||||||
*/
|
*/
|
||||||
public final static String CODEASSIST_PROPOSALS_FOREGROUND= "content_assist_proposals_foreground"; //$NON-NLS-1$
|
public final static String CODEASSIST_PROPOSALS_FOREGROUND= "content_assist_proposals_foreground"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that holds the background color used for parameter hints.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>String</code>. A RGB color value encoded as a string
|
||||||
|
* using class <code>PreferenceConverter</code>
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see org.eclipse.jface.resource.StringConverter
|
||||||
|
* @see org.eclipse.jface.preference.PreferenceConverter
|
||||||
|
*
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public final static String CODEASSIST_PARAMETERS_BACKGROUND= "content_assist_parameters_background"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that holds the foreground color used in the code assist selection dialog.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>String</code>. A RGB color value encoded as a string
|
||||||
|
* using class <code>PreferenceConverter</code>
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see org.eclipse.jface.resource.StringConverter
|
||||||
|
* @see org.eclipse.jface.preference.PreferenceConverter
|
||||||
|
*
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public final static String CODEASSIST_PARAMETERS_FOREGROUND= "content_assist_parameters_foreground"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A named preference that controls whether words containing digits should
|
* A named preference that controls whether words containing digits should
|
||||||
* be skipped during spell checking.
|
* be skipped during spell checking.
|
||||||
|
@ -1185,6 +1213,33 @@ public class PreferenceConstants {
|
||||||
*/
|
*/
|
||||||
public static final String CODEGEN_ADD_COMMENTS= "org.eclipse.cdt.ui.add_comments"; //$NON-NLS-1$
|
public static final String CODEGEN_ADD_COMMENTS= "org.eclipse.cdt.ui.add_comments"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that holds the source hover background color.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>String</code>. A RGB color value encoded as a string
|
||||||
|
* using class <code>PreferenceConverter</code>
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see org.eclipse.jface.resource.StringConverter
|
||||||
|
* @see org.eclipse.jface.preference.PreferenceConverter
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public final static String EDITOR_SOURCE_HOVER_BACKGROUND_COLOR= "sourceHoverBackgroundColor"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A named preference that tells whether to use the system
|
||||||
|
* default color ({@link SWT#COLOR_INFO_BACKGROUND}) for
|
||||||
|
* the source hover background color.
|
||||||
|
* <p>
|
||||||
|
* Value is of type <code>Boolean</code>.
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @see org.eclipse.jface.resource.StringConverter
|
||||||
|
* @see org.eclipse.jface.preference.PreferenceConverter
|
||||||
|
* @since 5.0
|
||||||
|
*/
|
||||||
|
public final static String EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT= "sourceHoverBackgroundColor.SystemDefault"; //$NON-NLS-1$
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the CDT-UI preference store.
|
* Returns the CDT-UI preference store.
|
||||||
*
|
*
|
||||||
|
@ -1215,6 +1270,8 @@ public class PreferenceConstants {
|
||||||
store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS, "org.eclipse.cdt.ui.BestMatchHover;0;org.eclipse.cdt.ui.CSourceHover;" + sourceHoverModifierName); //$NON-NLS-1$
|
store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS, "org.eclipse.cdt.ui.BestMatchHover;0;org.eclipse.cdt.ui.CSourceHover;" + sourceHoverModifierName); //$NON-NLS-1$
|
||||||
store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS, "org.eclipse.cdt.ui.BestMatchHover;0;org.eclipse.cdt.ui.CSourceHover;" + sourceHoverModifier); //$NON-NLS-1$
|
store.setDefault(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS, "org.eclipse.cdt.ui.BestMatchHover;0;org.eclipse.cdt.ui.CSourceHover;" + sourceHoverModifier); //$NON-NLS-1$
|
||||||
|
|
||||||
|
store.setDefault(EDITOR_SOURCE_HOVER_BACKGROUND_COLOR_SYSTEM_DEFAULT, true);
|
||||||
|
|
||||||
// coloring
|
// coloring
|
||||||
PreferenceConverter.setDefault(store, EDITOR_MULTI_LINE_COMMENT_COLOR, new RGB(63, 127, 95));
|
PreferenceConverter.setDefault(store, EDITOR_MULTI_LINE_COMMENT_COLOR, new RGB(63, 127, 95));
|
||||||
store.setDefault(EDITOR_MULTI_LINE_COMMENT_BOLD, false);
|
store.setDefault(EDITOR_MULTI_LINE_COMMENT_BOLD, false);
|
||||||
|
@ -1304,7 +1361,6 @@ public class PreferenceConstants {
|
||||||
store.setDefault(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, "org.eclipse.cdt.ui.textProposalCategory\0"); //$NON-NLS-1$
|
store.setDefault(PreferenceConstants.CODEASSIST_EXCLUDED_CATEGORIES, "org.eclipse.cdt.ui.textProposalCategory\0"); //$NON-NLS-1$
|
||||||
store.setDefault(PreferenceConstants.CODEASSIST_CATEGORY_ORDER, "org.eclipse.cdt.ui.parserProposalCategory:65539\0org.eclipse.cdt.ui.textProposalCategory:65541\0org.eclipse.cdt.ui.templateProposalCategory:2\0"); //$NON-NLS-1$
|
store.setDefault(PreferenceConstants.CODEASSIST_CATEGORY_ORDER, "org.eclipse.cdt.ui.parserProposalCategory:65539\0org.eclipse.cdt.ui.textProposalCategory:65541\0org.eclipse.cdt.ui.templateProposalCategory:2\0"); //$NON-NLS-1$
|
||||||
|
|
||||||
|
|
||||||
setDefaultAndFireEvent(
|
setDefaultAndFireEvent(
|
||||||
store,
|
store,
|
||||||
PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND,
|
PreferenceConstants.CODEASSIST_PROPOSALS_BACKGROUND,
|
||||||
|
@ -1313,6 +1369,14 @@ public class PreferenceConstants {
|
||||||
store,
|
store,
|
||||||
PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND,
|
PreferenceConstants.CODEASSIST_PROPOSALS_FOREGROUND,
|
||||||
findRGB(registry, ICThemeConstants.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0)));
|
findRGB(registry, ICThemeConstants.CODEASSIST_PROPOSALS_FOREGROUND, new RGB(0, 0, 0)));
|
||||||
|
setDefaultAndFireEvent(
|
||||||
|
store,
|
||||||
|
PreferenceConstants.CODEASSIST_PARAMETERS_BACKGROUND,
|
||||||
|
findRGB(registry, ICThemeConstants.CODEASSIST_PARAMETERS_BACKGROUND, new RGB(255, 255, 255)));
|
||||||
|
setDefaultAndFireEvent(
|
||||||
|
store,
|
||||||
|
PreferenceConstants.CODEASSIST_PARAMETERS_FOREGROUND,
|
||||||
|
findRGB(registry, ICThemeConstants.CODEASSIST_PARAMETERS_FOREGROUND, new RGB(0, 0, 0)));
|
||||||
|
|
||||||
// spell checking
|
// spell checking
|
||||||
store.setDefault(PreferenceConstants.SPELLING_LOCALE, "en_US"); //$NON-NLS-1$
|
store.setDefault(PreferenceConstants.SPELLING_LOCALE, "en_US"); //$NON-NLS-1$
|
||||||
|
|
Loading…
Add table
Reference in a new issue