- Modifying the Outlines structure
First thing to change is the Outlines structure. Per default the Outline view shows (i) the files package, (ii) import declarations and (iii) the files members and methods. I'm only interested in point (iii) so the first thing to do is hiding the package and import declarations. Click on the little arrow button in the Outlines toolbar, then click Go Into Top Level Type. - Sorting the Outlines contents
I prefer a well-defined ordering of the class files members and methods. Toggle the sort button in the Outlines toolbar to order the contents alphabetically. Additionally Eclipse enables you to get visibilities involved into the sorting. At the preferences dialog, go to Java -> Appearance -> Members Sort Order then check Sort members in same category by visibility. You can also change the sequence here to fit your needs. - Filtering the Outlines contents
Eclipse enables you to filter the Outlines members in different ways. The Outlines toolbar contains toggle buttons to show/hide fields, static fields and members and local types. I prefer to hide local types (e.g. anonymous implementations) the whole time while showing or hiding fields and static members depending on the situation.
It's also possible to filter contents by pattern. In the Outlines toolbar click on the arrow button, then choose Filters. In the dialog activate Name Filter Patterns then insert the desired pattern into the textfield. - Categorizing the Outlines contents
One of the most demanded feature is to hide getters and setters in Java files. This is possible in the Outline view by using the categories feature. For each type, member and method you can define a category directly from the sourcecode via the Javadoc keyword@categoryfollowed by one or many category names (e.g.getterorsetter).

The Outline view automatically shows the names of the categories on any element. Besides you can filter the Outlines contents by categories, just click on the arrow button in the Outlines toolbar and click on a category to show or hide.

If you like this feature I recommend you to modify the javadoc code templates for getters and setters. In the preferences dialog go to Java -> Code Style -> Code Templates, then edit the values for comments for getter function and comments for setter function. Add@category getterand@category setterrespectively. Hence Eclipse will generate the appropriate categories automatically while auto-generating getters and setters.
October 05, 2009
How to Customize the Eclipse Outline
What's your first action after opening an unknown class file with the Eclipse IDE? I for myself first inspect the Outline view to get a general idea about the involved members and methods. It's totally crucial to me to optimize the contents of the Outline view, thus minimizing the time to getting started with unknown sourcecode. Let's take a look how to improve the Outline view.


43 comments:
Hi. I want to translate some your articles into Russian and post it in my blog. Can I do that?
Hi Infinity. Feel free to translate the posts into Russian. I would appreciate if you put a link to my blogs original post.
Happy new year!
Thanks! Of course I'll put a link to your post.
Happy new year!
I do like ur article~!!!...................................................
從人生中拿走友誼,猶如從生活中移走陽光........................................
It's great!!.............................................
你的部落格很棒,我期待更新喔........................................
不要小看自己,因為自己有限的可能......................................................
來給你加加油~打打氣!!!更新之餘,也要注意休息哦~~ ..................................................
如果擬任為輸贏是最重要的事,那你輸了 ..................................................
才華在逆境中展現,在順境中被掩藏。..................................................
認清問題就等於已經解決了一半的問題。..................................................
喜歡你的部落格,留言請您繼續加油......................................................
失去金錢的人,失去很多;失去朋友的人,失去更多;失去信心的人,失去所有。..................................................................
想像是什麼並不重要,想像能做什麼才重要......................................................................
你真的很棒~謝謝分享囉~......................................................................
在莫非定律中有項笨蛋定律:「一個組織中的笨蛋,恆大於等於三分之二。」....................................................................
知識可以傳授,智慧卻不行。每個人必須成為他自己。.................................................................
幸福不是一切,人還有責任。.................................................................
It takes all kinds to make a world.............................................................
人有兩眼一舌,是為了觀察倍於說話的緣故。............................................................
Some people cannot see the wood for the trees.............................................................
好的blog需要我們一起努力!............................................................
甘巴嗲!祝你愈來愈好!............................................................
人不可以求其備,必捨其所短,取其所長............................................................
好看耶~一定每天有空給你支持............................................................
Say not all that you know, believe not all that you hear.............................................................
男女互悅,未必廝守終生,相愛就是美的。.................................................................
Offence is the best defence.............................................................
得意人,聽腳步聲就知道。..................................................
馬丁路德:「即使知道明天世界即將毀滅,我仍願在今天種下一棵小樹。」............................................................
良言一句三冬暖,惡語傷人六月寒。......................................................................
無私分享,很不錯哦~謝謝~~............................................................
河水永遠是相同的,可是每一剎那又都是新的。. . . . . . . . . .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Quietude is the crown of life.............................................................
要友誼長存,我們必須原諒彼此的小缺點。......................................................
謝謝大大的分享 我會學會反省與寬容 感恩 ∩△∩............................................................
好文不寂寞~支持!!!!@@a 搞錯了,這不是論壇推文 XDDD............................................................
人生匆匆-把握當下,支持鼓勵~事事如意~..................................................
很棒的分享~祝福你............................................................
真有內容的部落格~推推!.................................[/url]...............
Thanks very nice share ... I follow your site constantly ... değiniyorsunuz important issues ... Congratulations ... I entered this site by chance, but I found very interesting. Seni Bana Yazmışlar A greeting to all the people who visit this page. Kuzey Ve Güney "The powers delegated by the proposed Constitution to the federal government are few and defined. Those which are to remain in the State governments are numerous and indefinite. Yalan Dünya " -Madison Federalist Papers
Thanks for sharing!
Post a Comment