Tips on Using Eclipse Effectively


Tips on Using Eclipse Effectively
Useful Eclipse Shortcut Keys



ALT + Left/Right ArrowMove backward/forward in the editor navigation history
CTRL+OShow the quick outline for the editor input
CTRL+KFind next item, no need to ctrl+f, type some words, then search
CTRL+1Activates the quick fix
CTRL+SHIFT+TOpen Type
CTRL+SPACEContent Assist
ALT+/Word completion
ALR+SHIFT+RRename the selected element
ALT+SHIFT+MExtract statements into a new method and use the new method
Ctrl + LGo To Line
CTRL+TShow quick hierarchy of the selected element
CTRL + SHIFT + FFormat code
CTRL+SHIFT+OOrganize imports
Ctrl+Shift+XChange the selection to upper case, useful in declare final variable
Ctrl+Shift+YChange the selection to lower case
Ctrl+Shift+HOpen a type in the type hierarchy view
Ctrl+Shift+SSave all current contents
Ctrl+Shift+WClose all editors
Ctrl+Shift+GSearch for references to the selected element in the workspace
CTRL+EShow a list of all open editors
CTRL + DDelete row
CTRL+MToggle maximize/restore state of active view or editor
Others:
CTRL+SHIFT+U    Shows the Occurrences in File quick menu
Ctrl+Shift+R        Open Resources
CTRL + I               Corrects indentation
Ctrl+M                  Maximize Active View or Editor
Ctrl+Shift+Space
Context Information, If typing a method call with several parameters use this to show the applicable parameter types.
Alt+Left/Right Backward/Forward History
CTRL + I         Corrects indentation
CTL + N            Open new type wizard
CTRL + J           Incremental search
CTRL + SHIFT + L Shows you a list of your currently defined shortcut keys
CTRL+F6          Use to move between open editors
CTRL+F7          Move between views
CTRL+F8          Move between perspectives
To configure the shortcut key, click Window --> Preferences --> General --> Keys


Associate editors with file types:
Window -> Preferences -> General -> Editors -> File Associations

Find: ^\s*\n
Replace with: (empty)



Eclipse plugins:
Code quality:
Checkstyle: http://eclipse-cs.sourceforge.net/update
It is used to enforce Coding Standards in Java Project, such as Naming conventions, Coding problems, Best Practices.


PMD http://pmd.sf.net/eclipse
PMD focuses more on preemptive defect detection.


FindBugs http://findbugs.cs.umd.edu/eclipse/
FindBugs concentrates on detecting potential bugs and performance issues.
Klocwork: http://developer.klocwork.com
Klocwork is aimed at improving software security, quality, and reliability. It is not free, but we can get 30 days free trail. And it is really very cool.


Mylyn: http://www.eclipse.org/mylyn/
Mylyn can integrate with issue management systems such as Bugzilla, and it also provides context management, which can hide much of the detail of projects that is irrelevant to the task at hand.
Mylyn is very helpful, especially your main job is to fix defects, or focus on one component of a big project.


ShellEd: http://sourceforge.net/projects/shelled/
EPIC - Perl Editor and IDE for Eclipse http://e-p-i-c.sf.net/updates
The PyDev Update Site http://pydev.sourceforge.net/updates/
Groovy Eclipse plugin http://dist.codehaus.org/groovy/distributions/update/
Aptana Studio http://update.aptana.com/install/studio/3.2/
http://www.aptana.com


Problem
Recently, I re-downloaded and reinstalled jdk, and Eclipse always shows this error:
'UnsupportedEncodingException: GBK'. After google search, on http://dev.eclipse.org/newslists/news.eclipse.tools/msg30710.html,
I found out this is because I installed a JRE only for US English, and I should choose to download and install Multi-language JRE.

Problem:
When we save file, it may print out the error "Some characters can not be mapped using GBK character encoding".
The solution is to change file encoding to 'utf-8':
Select Window -> Preferences ->General
Select  Workspace , set Text file encoding to 'utf-8'.
Select Content Types, set Default encoding to 'utf-8'

Ignore white space when compare two files in Eclipse IDE
When compare two files in Eclipse, many times lines differ only in white spaces, and we don't want to notice this minor difference.
Solution:
Select Window -> Preference -> Compare/Path, and in 'General' tab, select the checkbox --'Ignore white space'.


Reference:
http://www.javaprogrammingforums.com/eclipse/19-useful-eclipse-shortcut-keys.html
http://www.rossenstoyanchev.org/write/prog/eclipse/eclipse3.html
http://tkramar.blogspot.com/search/label/eclipse
Java Power tools safari online book

Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)