在eclipse中使用快捷鍵,不小心按錯了,使得變量的高亮顯示沒了。
其恢複方式如下:
選擇:windows-> preferences->java->Editor->Mark Occurences
選擇最上的複選框,下面的就有很多了。
其中的Local variables就是變量的高亮顯示。
也有更簡單的辦法:
網上搜了一下,原來是Toggle Mark Occurrences (Alt + Shift + 0)
這個按鈕沒有按下,在工具欄的小黃顔色的筆 的形狀的圖示。
改變其顔色:
選擇:windows-> preferences->java->Editor->Mark Occurences->第一行有個“Annotations”點選進入,顯示出清單,找到 Occurrence annotation 右邊選擇Color即可。
關于Annotations的連結問題:
改變顔色時,有的版本(比如日文版)可能沒有連接配接(Annotations),這時可以這麼做
General--->Editors----->Test Editors------>Annotations
關于上面的兩個英語單詞 Occerence 發生 ;Annotations 标注(這時java1.5的一個新的文法),在這裡的意思是:“标記”。
來源:http://hi.baidu.com/cnbxj/blog/item/a511b5589681d088800a18bf.html