Eclipse javadoc背景颜色为黑色

时间:2021-11-27 23:49:16

My Eclipse javadoc view has a black background which makes it look terrible and partly unreadable (e.g. links are dark blue on black). Even worse, the javadoc popup has black background, too. I can't find the corresponding setting.

我的Eclipse javadoc视图有一个黑色的背景,使它看起来很糟糕,部分不可读(例如黑色的链接是深蓝色)。更糟糕的是,javadoc弹出窗口也有黑色背景。我找不到相应的设置。

The answer by Sumit Singh showed me how to change the background for the javadoc view. However, I still see no way how to change the foreground. Even worse, the javadoc popup background color didn't change.

Sumit Singh的回答向我展示了如何更改javadoc视图的背景。但是,我仍然看不到如何改变前景。更糟糕的是,javadoc弹出窗口背景颜色没有改变。

I don't think it's caused by a plugin, as it happens with a fresh install, too. This happens on Ubuntu 10.4. In Windows the colors can't be changed either, but there are fine.

我认为它不是由插件引起的,因为它也是全新安装的。这发生在Ubuntu 10.4上。在Windows中,颜色也不能改变,但是很好。

11 个解决方案

#1


23  

You need to change the 'Tooltip' color in Ubuntu at the OS level.

您需要在操作系统级别更改Ubuntu中的“工具提示”颜色。

#2


47  

Window > Preferences > General > Appearance > Colors And Fonts > Java
> Javadoc View Background  

Eclipse javadoc背景颜色为黑色

#3


17  

None of the answers here worked for me (I have Eclipse Mars and Ubuntu 14.04). I had to edit /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css. I've changed tooltip_bg_color to #f5f5bf# and tooltip_fg_color to #000000. After restarting eclipse, the change took effect.

这里没有任何答案对我有用(我有Eclipse Mars和Ubuntu 14.04)。我不得不编辑/usr/share/themes/Ambiance/gtk-3.0/gtk-main.css。我已将tooltip_bg_color更改为#f5f5bf#,将tooltip_fg_color更改为#000000。重新启动eclipse后,更改生效。

#4


8  

As a KDE user you have to change the tooltip background color with systemssttings.
Navigate to

作为KDE用户,您必须使用systemssttings更改工具提示背景颜色。导航

Application Apperearence -> Colors -> Colors

and adjust the Tooltip Background and Tooltip Text colors.

并调整工具提示背景和工具提示文本颜色。

#5


6  

On ubuntu 12.10 (quantal) you can use the following two commands:

在ubuntu 12.10(quantal)上,您可以使用以下两个命令:

#foreground white => black
sudo sed -i s/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc
#background black => yellow
sudo sed -i s/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc

(Thanks to the other answers and this that helped me to figure this out)

(感谢其他答案,这有助于我解决这个问题)

#6


6  

Install the "GNOME Color Chooser" in Ubuntu (worked also on Xubuntu)

在Ubuntu中安装“GNOME Color Chooser”(也在Xubuntu上工作)

There you can set the Tooltip colors under the tab "Specific"

在那里你可以在“特定”选项卡下设置工具提示颜色

#7


3  

Please note, this issue has been resolved in Eclipse as of 8th November 2016. To have this fixed, please download one of the latest integration builds: http://download.eclipse.org/eclipse/downloads/
(The maintenance builds don't have the patch at the time of writing 2016-11Nov-09Wed).

请注意,自2016年11月8日起,此问题已在Eclipse中得到解决。要解决此问题,请下载最新的集成版本之一:http://download.eclipse.org/eclipse/downloads/(维护版本不会在编写2016-11Nov-09Wed时有补丁。

I wrote a patch that introduced a new preference in Eclipse "Information Background/Text" under General -> Appearance -> Colors and Fonts. This preference generates the correct color on Linux/Gtk (White background, black text).
See: Bug 505738 – Define a information hover color which JDT, CDT or others can use https://bugs.eclipse.org/bugs/show_bug.cgi?id=505738

我在一般 - >外观 - >颜色和字体下编写了一个在Eclipse“信息背景/文本”中引入新偏好的补丁。此首选项在Linux / Gtk(白色背景,黑色文本)上生成正确的颜色。请参阅:错误505738 - 定义JDT,CDT或其他人可以使用的信息悬停颜色https://bugs.eclipse.org/bugs/show_bug.cgi?id=505738

Subsequently I made Javadoc colors inherit it's color from that preference. See:
Bug 501742 – Default Javadoc text and background color should use colors consistent with Java editor background/foreground. https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742

随后我让Javadoc颜色从该首选项继承了它的颜色。请参阅:错误501742 - 默认Javadoc文本和背景颜色应使用与Java编辑器背景/前景一致的颜色。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742

As an added bonus, it also works on the Dark Theme:
Bug 505851 – [Dark Theme] Style the HOVER_ colors for the dark theme https://bugs.eclipse.org/bugs/show_bug.cgi?id=505851

作为一个额外的奖励,它也适用于黑暗主题:Bug 505851 - [黑暗主题]为黑暗主题设置HOVER_颜色的样式https://bugs.eclipse.org/bugs/show_bug.cgi?id=505851

#8


3  

Had same issue with Neon on Ubuntu 16.04 Mate edition.

在Ubuntu 16.04 Mate版上与Neon有同样的问题。

To fix it, I have created a small, user-specific GTK3 CSS settings file. It is stored as you HOMEDIR/.config/gtk-3.0/gtk.css

为了解决这个问题,我创建了一个小的,用户特定的GTK3 CSS设置文件。它存储为HOMEDIR / .config / gtk-3.0 / gtk.css

In my case, I compressed the spacing a bit, specified default font and also, set the appearance for the tooltip windows:

在我的例子中,我压缩了一点间距,指定了默认字体,并且还设置了工具提示窗口的外观:

#####################
* {
    padding: 1px;
    font: Liberation Mono 12;
}

GtkToolbar {
    padding: 2px;
}

GtkMenuBar {
    padding: 2px;
}

GtkMenuItem {
    padding: 2px 6px;
}

.tooltip {
    background-color: #CAE1FF;
    color: #EEEEEE;
    text-shadow: none;
}
#########################

#9


0  

Also try this sudo apt-get install libwebkitgtk-1.0-0 after I installed the lib the javadoc looks so much better

在我安装了lib后,尝试这个sudo apt-get install libwebkitgtk-1.0-0 javadoc看起来好多了

After installing brand new Eclipse, you may notice, that hover, which shows javadoc comments, and Javadoc view render javadoc comments as a plain text. Eclipse simply ignores all the @link and @see annotations. Well, it's actually not the problem of view itself. The problem is that default Eclipse browser is not working from the box in Ubuntu 12.04. To make it works you need to install libwebkitgtk-1.0-0 package. Just type in the terminal:

在安装全新的Eclipse之后,您可能会注意到,hover(显示javadoc注释)和Javadoc视图将javadoc注释呈现为纯文本。 Eclipse只是忽略了所有的@link和@see注释。嗯,这实际上不是观点本身的问题。问题是默认的Eclipse浏览器不能在Ubuntu 12.04的框中运行。要使其工作,您需要安装libwebkitgtk-1.0-0包。只需输入终端:

source: http://ubuntu-user-tricks.blogspot.com/2012/09/3-things-to-do-after-installing-eclipse.html

来源:http://ubuntu-user-tricks.blogspot.com/2012/09/3-things-to-do-after-installing-eclipse.html

#10


0  

I think the answer here to have a properly formattet tooltip (at least for people who use ubuntu and want to have a nice hover tooltip) with html elements like links working is to install libwebkitgtk as it is used by eclipse to show javadoc. It is not preinstalled on e.g. Ubuntu and does not come with eclipse.. use:

我认为这里的答案有一个正确的formattet工具提示(至少对于那些使用ubuntu并希望有一个漂亮的悬停工具提示的人)与链接工作的html元素是安装libwebkitgtk,因为它被eclipse用来显示javadoc。它没有预先安装在例如Ubuntu并没有带来eclipse ..使用:

sudo apt-get install libwebkitgtk-1.0-0

and restart eclipse to have good looking tooltips.

并重新启动eclipse以获得漂亮的工具提示。

#11


-1  

You can change the color in
Windows->Preferences->general->Appearance .

您可以在Windows-> Preferences-> general-> Appearance中更改颜色。

#1


23  

You need to change the 'Tooltip' color in Ubuntu at the OS level.

您需要在操作系统级别更改Ubuntu中的“工具提示”颜色。

#2


47  

Window > Preferences > General > Appearance > Colors And Fonts > Java
> Javadoc View Background  

Eclipse javadoc背景颜色为黑色

#3


17  

None of the answers here worked for me (I have Eclipse Mars and Ubuntu 14.04). I had to edit /usr/share/themes/Ambiance/gtk-3.0/gtk-main.css. I've changed tooltip_bg_color to #f5f5bf# and tooltip_fg_color to #000000. After restarting eclipse, the change took effect.

这里没有任何答案对我有用(我有Eclipse Mars和Ubuntu 14.04)。我不得不编辑/usr/share/themes/Ambiance/gtk-3.0/gtk-main.css。我已将tooltip_bg_color更改为#f5f5bf#,将tooltip_fg_color更改为#000000。重新启动eclipse后,更改生效。

#4


8  

As a KDE user you have to change the tooltip background color with systemssttings.
Navigate to

作为KDE用户,您必须使用systemssttings更改工具提示背景颜色。导航

Application Apperearence -> Colors -> Colors

and adjust the Tooltip Background and Tooltip Text colors.

并调整工具提示背景和工具提示文本颜色。

#5


6  

On ubuntu 12.10 (quantal) you can use the following two commands:

在ubuntu 12.10(quantal)上,您可以使用以下两个命令:

#foreground white => black
sudo sed -i s/tooltip_fg_color:#ffffff/tooltip_fg_color:#000000/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc
#background black => yellow
sudo sed -i s/tooltip_bg_color:#000000/tooltip_bg_color:#f5f5b5/g  /usr/share/themes/Ambiance/gtk-3.0/settings.ini /usr/share/themes/Ambiance/gtk-3.0/gtk.css /usr/share/themes/Ambiance/gtk-2.0/gtkrc

(Thanks to the other answers and this that helped me to figure this out)

(感谢其他答案,这有助于我解决这个问题)

#6


6  

Install the "GNOME Color Chooser" in Ubuntu (worked also on Xubuntu)

在Ubuntu中安装“GNOME Color Chooser”(也在Xubuntu上工作)

There you can set the Tooltip colors under the tab "Specific"

在那里你可以在“特定”选项卡下设置工具提示颜色

#7


3  

Please note, this issue has been resolved in Eclipse as of 8th November 2016. To have this fixed, please download one of the latest integration builds: http://download.eclipse.org/eclipse/downloads/
(The maintenance builds don't have the patch at the time of writing 2016-11Nov-09Wed).

请注意,自2016年11月8日起,此问题已在Eclipse中得到解决。要解决此问题,请下载最新的集成版本之一:http://download.eclipse.org/eclipse/downloads/(维护版本不会在编写2016-11Nov-09Wed时有补丁。

I wrote a patch that introduced a new preference in Eclipse "Information Background/Text" under General -> Appearance -> Colors and Fonts. This preference generates the correct color on Linux/Gtk (White background, black text).
See: Bug 505738 – Define a information hover color which JDT, CDT or others can use https://bugs.eclipse.org/bugs/show_bug.cgi?id=505738

我在一般 - >外观 - >颜色和字体下编写了一个在Eclipse“信息背景/文本”中引入新偏好的补丁。此首选项在Linux / Gtk(白色背景,黑色文本)上生成正确的颜色。请参阅:错误505738 - 定义JDT,CDT或其他人可以使用的信息悬停颜色https://bugs.eclipse.org/bugs/show_bug.cgi?id=505738

Subsequently I made Javadoc colors inherit it's color from that preference. See:
Bug 501742 – Default Javadoc text and background color should use colors consistent with Java editor background/foreground. https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742

随后我让Javadoc颜色从该首选项继承了它的颜色。请参阅:错误501742 - 默认Javadoc文本和背景颜色应使用与Java编辑器背景/前景一致的颜色。 https://bugs.eclipse.org/bugs/show_bug.cgi?id=501742

As an added bonus, it also works on the Dark Theme:
Bug 505851 – [Dark Theme] Style the HOVER_ colors for the dark theme https://bugs.eclipse.org/bugs/show_bug.cgi?id=505851

作为一个额外的奖励,它也适用于黑暗主题:Bug 505851 - [黑暗主题]为黑暗主题设置HOVER_颜色的样式https://bugs.eclipse.org/bugs/show_bug.cgi?id=505851

#8


3  

Had same issue with Neon on Ubuntu 16.04 Mate edition.

在Ubuntu 16.04 Mate版上与Neon有同样的问题。

To fix it, I have created a small, user-specific GTK3 CSS settings file. It is stored as you HOMEDIR/.config/gtk-3.0/gtk.css

为了解决这个问题,我创建了一个小的,用户特定的GTK3 CSS设置文件。它存储为HOMEDIR / .config / gtk-3.0 / gtk.css

In my case, I compressed the spacing a bit, specified default font and also, set the appearance for the tooltip windows:

在我的例子中,我压缩了一点间距,指定了默认字体,并且还设置了工具提示窗口的外观:

#####################
* {
    padding: 1px;
    font: Liberation Mono 12;
}

GtkToolbar {
    padding: 2px;
}

GtkMenuBar {
    padding: 2px;
}

GtkMenuItem {
    padding: 2px 6px;
}

.tooltip {
    background-color: #CAE1FF;
    color: #EEEEEE;
    text-shadow: none;
}
#########################

#9


0  

Also try this sudo apt-get install libwebkitgtk-1.0-0 after I installed the lib the javadoc looks so much better

在我安装了lib后,尝试这个sudo apt-get install libwebkitgtk-1.0-0 javadoc看起来好多了

After installing brand new Eclipse, you may notice, that hover, which shows javadoc comments, and Javadoc view render javadoc comments as a plain text. Eclipse simply ignores all the @link and @see annotations. Well, it's actually not the problem of view itself. The problem is that default Eclipse browser is not working from the box in Ubuntu 12.04. To make it works you need to install libwebkitgtk-1.0-0 package. Just type in the terminal:

在安装全新的Eclipse之后,您可能会注意到,hover(显示javadoc注释)和Javadoc视图将javadoc注释呈现为纯文本。 Eclipse只是忽略了所有的@link和@see注释。嗯,这实际上不是观点本身的问题。问题是默认的Eclipse浏览器不能在Ubuntu 12.04的框中运行。要使其工作,您需要安装libwebkitgtk-1.0-0包。只需输入终端:

source: http://ubuntu-user-tricks.blogspot.com/2012/09/3-things-to-do-after-installing-eclipse.html

来源:http://ubuntu-user-tricks.blogspot.com/2012/09/3-things-to-do-after-installing-eclipse.html

#10


0  

I think the answer here to have a properly formattet tooltip (at least for people who use ubuntu and want to have a nice hover tooltip) with html elements like links working is to install libwebkitgtk as it is used by eclipse to show javadoc. It is not preinstalled on e.g. Ubuntu and does not come with eclipse.. use:

我认为这里的答案有一个正确的formattet工具提示(至少对于那些使用ubuntu并希望有一个漂亮的悬停工具提示的人)与链接工作的html元素是安装libwebkitgtk,因为它被eclipse用来显示javadoc。它没有预先安装在例如Ubuntu并没有带来eclipse ..使用:

sudo apt-get install libwebkitgtk-1.0-0

and restart eclipse to have good looking tooltips.

并重新启动eclipse以获得漂亮的工具提示。

#11


-1  

You can change the color in
Windows->Preferences->general->Appearance .

您可以在Windows-> Preferences-> general-> Appearance中更改颜色。