Java Eclipse:如何更改当前选择的方法/表达式的高亮颜色?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3434363/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Eclipse: How do you change the highlight color of the currently selected method/expression?
提问by Bijan
In eclipse, when your cursor is placed on a method (or other things), other places the method exists are highlighted. I'd like to change the color of this highlight, but after scouring the eclipse preferences many times in all 3 places, I have yet to find it.
在 Eclipse 中,当您的光标放在一个方法(或其他东西)上时,该方法存在的其他地方会高亮显示。我想更改此突出显示的颜色,但在所有 3 个地方多次搜索日食偏好后,我还没有找到它。
Any of you Eclipse gurus know where to find this option?
你们中的任何 Eclipse 专家都知道在哪里可以找到这个选项吗?
Thank you!
谢谢!
采纳答案by coobird
After running around in the Preferences dialog, the following is the location at which the highlight color for "occurrences" can be changed:
在“首选项”对话框中运行后,以下是可以更改“出现”的突出显示颜色的位置:
General -> Editors -> Text Editors -> Annotations
General -> Editors -> Text Editors -> Annotations
Look for Occurences
from the Annotation typeslist.
Occurences
从注释类型列表中查找。
Then, be sure that Text as highlighted
is selected, then choose the desired color.
然后,确保Text as highlighted
被选中,然后选择所需的颜色。
And, a picture is worth a thousand words...
而且,一张图值一千字……
(source: coobird.net)
(来源:coobird.net)
(source: coobird.net)
(来源:coobird.net)
回答by Peter K.
For those working in Titanium Studio, the item is a little different: It's under the "Titanium Studio" Themes tab.
对于在 Titanium Studio 中工作的人来说,该项目略有不同:它位于“Titanium Studio”主题选项卡下。
The color to change is the "Selection" one in the top right.
要更改的颜色是右上角的“选择”之一。
回答by Tiago
1 - right click the highlight whose color you want to change
1 - 右键单击要更改其颜色的突出显示
2 - select "Properties" in the popup menu
2 - 在弹出菜单中选择“属性”
3 - choose the new color (as coobirdsuggested)
3 - 选择新颜色(如coobird建议)
This solution is easy because you dont have to search for the highlight by its name ("Ocurrence" or "Write Ocurrence" etc), just right click and the appropriate window is shown.
此解决方案很简单,因为您不必按其名称(“Ocurrence”或“Write Ocurrence”等)搜索突出显示,只需右键单击即可显示相应的窗口。
回答by Nijesh Hirpara
If you're using eclipse with PHP package and want to change highlighted colour then there is slight difference to above answer.
如果您将 Eclipse 与 PHP 包一起使用并希望更改突出显示的颜色,那么上述答案略有不同。
- Right click on highlighted word
- Select 'Preferences'
- Go to General > Editors > Text Editors > Annotations. Now look for "PHP elements 'read' occurrences" and "PHP elements 'write' occurrences". You can select your desired colour there.
- 右键单击突出显示的单词
- 选择“首选项”
- 转到“常规”>“编辑器”>“文本编辑器”>“注释”。现在查找“PHP 元素‘读’出现次数”和“PHP 元素‘写’出现次数”。您可以在那里选择您想要的颜色。
回答by thom
right click the highlight whose color you want to change
select "Preference"
->General->Editors->Text Editors->Annotations->Occurrences->Text as Hightlited->color.
Select "Preference ->java->Editor->Restore Defaults
右键单击要更改其颜色的突出显示
选择“偏好”
->General->Editors->Text Editors->Annotations->Occurrences->Text as Hightlited->color。
选择“首选项->java->编辑器->恢复默认值