Less known but useful features in Eclipse
The plugin Spy (Alt+Shift+F1) is certainly one not very advertised.
Yet if you have any question about "how I develop a feature X looking like the one in eclipse", it can be very useful to quickly locate the right eclipse java source which does implement that feature!
(source: willianmitsuda.com)
See also this Guide to eclipse3.5:
The Plugin Spy gives you easily information about the running UI.
Press Alt+Shift+F1 to get information about the current running Eclipse plugin / data types / screen.
This way you can get immediately access to the plugin which is currently running.
(source: vogella.de)
Eclipse 3.5 introduced the possibility to check which plugin contributed a menu. Press "Alt+Shift+F2" and select a menu to see who is contributing this menu
(source: vogella.de)
Useful Eclipse features?
My most commonly used features are
ctrl+1 quick-fix / spell-checker
opening files
- ctrl+shift+t load class file by classname
- ctrl+shift+r load any file by filename
matches are made on the start of the class/filename. start your search pattern with a * to search anywhere within the filename/classname.
Formatting
- ctrl+shift+f Format source file
(set up your formatting style in Window | preferences | java | code style | formatter) - ctrl+shift+o Organise imports
Generated code
- alt+s,r to generate getters and setters
- alt+s,v to insert method signatures for overidden methods from superclass or interface
Refactorings
- alt+shift+l Extract text-selection as local variable (really handy in that it determines and inserts the type for you.
- alt+shift+m Extract text-selection as a method
- alt+shift+i inline selected method
Running and debugging.
alt+shift+x is a really handy prefix to run stuff in your current file.
- alt+shift+x, t run unit tests in current file
- alt+shift+x, j run main in current file
- alt+shift+x, r run on server
There are more. The options are shown to you in the lower-right popup after hitting alt+shift+x.
alt+shift+x can be switched for alt+shift+d in all the above examples to run in the debugger.
Validation
As of the recent Ganymede release, you can now switch of validation in specified files and folders. I've been waiting for this feature for ages.
- Go to Project | Properties | Validation
- click on the ... button in the settings column of the validator you want to shut up
- Add a rule to the exclude group
code navigation
- hold down ctrl to make all variables, methods and classnames hyperlinks to their definitions.
- alt+left to navigate back to where you clicked ctrl
- alt+right to go "forwards" again
Playing around with Eclipse features - Project files are now hidden?
Check the folder that you have the project files stored inside of, are they set to hidden?
Also you can try reseting your workstation.Go to window then reset perspective.
I hope that helps it may not.
Eclipse Ganymede hacks, hints, tips, tricks, and best practices
Accurate Indexing
With CDT you should be sure to enable the "Full Indexing" option rather than the "Fast Indexing" default. It's not perceptibly slower on modern hardware and it does a much better job. In that vein, you should be sure to enable semantic highlighting. This isn't as important in C/C++ as it is in a language like Scala, but it's still extremely useful.
Streamlined Editing
Get used to using Ctrl+O and Ctrl+Alt+H. The former pops up an incrementally searchable outline view, while the latter opens the "Call Hierarchy" view and searches on the currently selected function. This is incredibly useful for tracing execution.
Ctrl+Shift+T (Open Type) isn't exactly an "editing" combo per se, but it is equally important in my workflow. The C++ Open Type dialog not only allows incremental filtering by type, but also selecting of definition (.h
) or declaration (.cpp
) and even filtering by element type (typedef
, struct
, class
, etc).
Task Oriented Programming
Mylyn: never leave home without it. I just can't say enough about this tool. Every time I'm forced to do without it I find myself having to re-learn how to deal with all of the code noise. Very, very handy to have.
Stripped Down Views
The default Eclipse workspace layout is extremely inefficient both in space and in usability. Everyone has their favorite layout, take some time and find yours. I like to minimize (not necessarily close) everything except for Outline and keep the C/C++ Project Explorer docked in the sidebar configured to precisely hide the Outline when expanded. In this way I can always keep the editor visible while simultaneously reducing the space used by views irrelevant to the current task.
What are the common tricks in eclipse when working with jsp files?
my favorite:
ctrl + shift + r will open a resource dialog like the type dialog
Refer 30 Useful Eclipse Keyboard Shortcuts for Java Programmers for more.
Related Topics
Why Do I Get the "Unhandled Exception Type Ioexception"
Getting the Class Name from a Static Method in Java
Converting Long to Date in Java Returns 1970
How to Get Out of While Loop in Java with Scanner Method "Hasnext" as Condition
Confusion: @Notnull VS. @Column(Nullable = False) with JPA and Hibernate
How to Select/Get Drop Down Option in Selenium 2
Parsing a Date's Ordinal Indicator ( St, Nd, Rd, Th ) in a Date-Time String
Base64 Java Encode and Decode a String
How to Sort an Array of Ints Using a Custom Comparator
Why to Use Swingutilities.Invokelater in Main Method
Date Format Mapping to JSON Jackson
Spring Aop Not Working for Method Call Inside Another Method
Does Polymorphism Apply on Class Attributes in Java
Warning - Build Path Specifies Execution Environment J2Se-1.4
Noclassdeffounderror on Maven Dependency