Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
EclipseCon NA 2014 | Eclipse Tips and Tricks
1
Noopur Gupta
Eclipse JDT/UI Committer
IBM India
noopur_gupta@in.ibm.com
EclipseCon NA 2014 | Eclipse Tips and Tricks
2
EclipseCon NA 2014 | Eclipse Tips and Tricks
3
EclipseCon NA 2014 | Eclipse Tips and Tricks
4
Show Workspace Location in the Title Bar
OR
(-showLocation)
EclipseCon NA 2014 | Eclipse Tips and Tricks
5
Show Workspace Name in the Title Bar
(Window > Preferences > General > Work...
EclipseCon NA 2014 | Eclipse Tips and Tricks
6
Create Eclipse shortcuts with default workspaces
(-data workspacePath)
EclipseCon NA 2014 | Eclipse Tips and Tricks
7
Working Sets
Package Explorer >
Configure Working Sets…
Package Explorer >
...
EclipseCon NA 2014 | Eclipse Tips and Tricks
8
Abbreviate package names with custom rules
Window > Preferences >
Java > Ap...
EclipseCon NA 2014 | Eclipse Tips and Tricks
9
Export/Import
File > Export…
General > Preferences
File > Import…
General >...
EclipseCon NA 2014 | Eclipse Tips and Tricks
10
EclipseCon NA 2014 | Eclipse Tips and Tricks
11
Talk to Eclipse : Start typing and get the results from many
categories of...
EclipseCon NA 2014 | Eclipse Tips and Tricks
+Ctrl O
12
Quick Outline:
To list the structural
elements of the file (such
a...
EclipseCon NA 2014 | Eclipse Tips and Tricks
13
Toggle Breadcrumb tool bar button
Shows the path to the
element at the cur...
EclipseCon NA 2014 | Eclipse Tips and Tricks
14
Ctrl+Click on a property key in the *.properties file shows the places in
...
EclipseCon NA 2014 | Eclipse Tips and Tricks
15
Finds undefined, unused and duplicate keys.
Source > Find Broken Externali...
EclipseCon NA 2014 | Eclipse Tips and Tricks
16
From a stack trace in log file, instead of locating the file and going to ...
EclipseCon NA 2014 | Eclipse Tips and Tricks
17
EclipseCon NA 2014 | Eclipse Tips and Tricks
18
+ +Alt  F1
+ +Alt  F2
EclipseCon NA 2014 | Eclipse Tips and Tricks
19
Just copy the Java code and paste on Package Explorer.
A new Java project ...
EclipseCon NA 2014 | Eclipse Tips and Tricks
20
To determine who last
modified a line of code and
when.
EclipseCon NA 2014 | Eclipse Tips and Tricks

+Ctrl 
21
To see the Javadoc in such cases, press and hover.
When there is...
EclipseCon NA 2014 | Eclipse Tips and Tricks
22
To ignore certain types from the Open Type dialog, content assist, quick
f...
EclipseCon NA 2014 | Eclipse Tips and Tricks
23
Templates are shown together with the Content Assist (Ctrl+Space)
proposal...
EclipseCon NA 2014 | Eclipse Tips and Tricks
24
To find all read/write accesses to the selected field or local variable in...
EclipseCon NA 2014 | Eclipse Tips and Tricks
25
To edit large number of almost
identical lines.
EclipseCon NA 2014 | Eclipse Tips and Tricks
26
Formatter Off/On tags can be used in any comment to turn the formatter
off...
EclipseCon NA 2014 | Eclipse Tips and Tricks
+Ctrl 1
27
Don’t type too much yourself – Let Eclipse help you with quick fix...
EclipseCon NA 2014 | Eclipse Tips and Tricks
+ = Delete current lineCtrl D
+ / = Move line(s)Alt  
+ = Maximize/Minimize...
EclipseCon NA 2014 | Eclipse Tips and Tricks
29
EclipseCon NA 2014 | Eclipse Tips and Tricks
30
To step into a single method within a series of chained or nested method c...
EclipseCon NA 2014 | Eclipse Tips and Tricks
31
Line Breakpoint
Conditional Breakpoint
Exception Breakpoint:
When exceptio...
EclipseCon NA 2014 | Eclipse Tips and Tricks
32
Classload Breakpoint:
To inspect who is trying to load
the class or where ...
EclipseCon NA 2014 | Eclipse Tips and Tricks
33
: A point in code where the debugger does not break the
execution but only...
EclipseCon NA 2014 | Eclipse Tips and Tricks
34
To filter out specified classes and packages while steping into code durin...
EclipseCon NA 2014 | Eclipse Tips and Tricks
35
A container for random snippets of code that
can be executed any time with...
EclipseCon NA 2014 | Eclipse Tips and Tricks
36
LAST BUT NOT THE LEAST!
Help > Help Contents >
Search “What’s new”Help > T...
EclipseCon NA 2014 | Eclipse Tips and Tricks
EVALUATE THIS SESSION
Sign-in: www.eclipsecon.org
Select session from schedule
Evaluate:
1
2
3
Upcoming SlideShare
Loading in …5
×

Eclipse Tips & Tricks - EclipseCon North America 2014

2,609 views

Published on

Eclipse provides a lot of powerful features and capabilities as an IDE. With so much functionality at your disposal, there is a lot of functionality that is very useful, but not easily discoverable. To be productive, mastering your IDE is as important as mastering your source code.

In this talk, I will unleash many invaluable tips and tricks that will allow you to better use the Eclipse IDE and make you more productive in your routine development tasks. During this talk you will have many "Ah, I didn't know Eclipse can do that!" moments.

Published in: Technology
  • Nice !! Download 100 % Free Ebooks, PPts, Study Notes, Novels, etc @ https://www.ThesisScientist.com
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Eclipse Tips & Tricks - EclipseCon North America 2014

  1. 1. EclipseCon NA 2014 | Eclipse Tips and Tricks 1 Noopur Gupta Eclipse JDT/UI Committer IBM India noopur_gupta@in.ibm.com
  2. 2. EclipseCon NA 2014 | Eclipse Tips and Tricks 2
  3. 3. EclipseCon NA 2014 | Eclipse Tips and Tricks 3
  4. 4. EclipseCon NA 2014 | Eclipse Tips and Tricks 4 Show Workspace Location in the Title Bar OR (-showLocation)
  5. 5. EclipseCon NA 2014 | Eclipse Tips and Tricks 5 Show Workspace Name in the Title Bar (Window > Preferences > General > Workspace)
  6. 6. EclipseCon NA 2014 | Eclipse Tips and Tricks 6 Create Eclipse shortcuts with default workspaces (-data workspacePath)
  7. 7. EclipseCon NA 2014 | Eclipse Tips and Tricks 7 Working Sets Package Explorer > Configure Working Sets… Package Explorer > Top Level Elements > Working Sets
  8. 8. EclipseCon NA 2014 | Eclipse Tips and Tricks 8 Abbreviate package names with custom rules Window > Preferences > Java > Appearance > Abbreviate package names
  9. 9. EclipseCon NA 2014 | Eclipse Tips and Tricks 9 Export/Import File > Export… General > Preferences File > Import… General > Preferences
  10. 10. EclipseCon NA 2014 | Eclipse Tips and Tricks 10
  11. 11. EclipseCon NA 2014 | Eclipse Tips and Tricks 11 Talk to Eclipse : Start typing and get the results from many categories of UI elements. +Ctrl 3
  12. 12. EclipseCon NA 2014 | Eclipse Tips and Tricks +Ctrl O 12 Quick Outline: To list the structural elements of the file (such as classes, fields, methods for a Java source file). In-place Outline: To pop up an in-place outline of the element at the current cursor position. +Ctrl F3
  13. 13. EclipseCon NA 2014 | Eclipse Tips and Tricks 13 Toggle Breadcrumb tool bar button Shows the path to the element at the cursor position. Navigate to other elements via drop-downs and invoke actions (when other views are not visible). Also available on multiple editors that are open side-by-side.
  14. 14. EclipseCon NA 2014 | Eclipse Tips and Tricks 14 Ctrl+Click on a property key in the *.properties file shows the places in source code where it is being used and takes you to the referencing code.
  15. 15. EclipseCon NA 2014 | Eclipse Tips and Tricks 15 Finds undefined, unused and duplicate keys. Source > Find Broken Externalized Strings
  16. 16. EclipseCon NA 2014 | Eclipse Tips and Tricks 16 From a stack trace in log file, instead of locating the file and going to the line number via Ctrl+L, use Java Stack Trace Console. Copy the stack trace from log file and click: Copy the stack trace and paste on the console: Click on the hyperlinks for Java class names with line numbers to navigate. Clicking on the exception name in stack trace will create an exception breakpoint. Navigate > Open from Clipboard Console view > Open Console (drop-down menu) > Java Stack Trace Console OR
  17. 17. EclipseCon NA 2014 | Eclipse Tips and Tricks 17
  18. 18. EclipseCon NA 2014 | Eclipse Tips and Tricks 18 + +Alt  F1 + +Alt  F2
  19. 19. EclipseCon NA 2014 | Eclipse Tips and Tricks 19 Just copy the Java code and paste on Package Explorer. A new Java project will be created and the file will be opened in the Java editor.
  20. 20. EclipseCon NA 2014 | Eclipse Tips and Tricks 20 To determine who last modified a line of code and when.
  21. 21. EclipseCon NA 2014 | Eclipse Tips and Tricks  +Ctrl  21 To see the Javadoc in such cases, press and hover. When there is an error/warning at an identifier, the corresponding message is shown on hover instead of the Javadoc. Update text hover key modifers at: Window > Preferences > Java > Editor > Hovers To see the source on hover, press and hover. Or use Javadoc view. Or use Declaration view.
  22. 22. EclipseCon NA 2014 | Eclipse Tips and Tricks 22 To ignore certain types from the Open Type dialog, content assist, quick fix proposals, import organization etc. Window > Preferences > Java > Appearance > Type Filters Example:
  23. 23. EclipseCon NA 2014 | Eclipse Tips and Tricks 23 Templates are shown together with the Content Assist (Ctrl+Space) proposals. There are existing templates that you can configure or define new templates. Window > Preferences > Java > Editor > Templates OR Templates view
  24. 24. EclipseCon NA 2014 | Eclipse Tips and Tricks 24 To find all read/write accesses to the selected field or local variable in the chosen scope. OR
  25. 25. EclipseCon NA 2014 | Eclipse Tips and Tricks 25 To edit large number of almost identical lines.
  26. 26. EclipseCon NA 2014 | Eclipse Tips and Tricks 26 Formatter Off/On tags can be used in any comment to turn the formatter off and on. Example: To prevent formatting of SQL queries.
  27. 27. EclipseCon NA 2014 | Eclipse Tips and Tricks +Ctrl 1 27 Don’t type too much yourself – Let Eclipse help you with quick fixes, quick assists, refactorings, content assist and more. Examples: Quick Assist: Quick Fix:
  28. 28. EclipseCon NA 2014 | Eclipse Tips and Tricks + = Delete current lineCtrl D + / = Move line(s)Alt   + = Maximize/Minimize Editor/ViewCtrl M + + = To upper case/ lower caseCtrl  X + = Comment/Uncomment lineCtrl / / Y + = Quick Switch EditorCtrl E + +Alt   = Expand selection to enclosing element + + = Lists all keyboard short cutsCtrl  L 28 Examples:
  29. 29. EclipseCon NA 2014 | Eclipse Tips and Tricks 29
  30. 30. EclipseCon NA 2014 | Eclipse Tips and Tricks 30 To step into a single method within a series of chained or nested method calls. Example: + +Ctrl Alt Click +Ctrl F5 OR OR
  31. 31. EclipseCon NA 2014 | Eclipse Tips and Tricks 31 Line Breakpoint Conditional Breakpoint Exception Breakpoint: When exceptions are passed over several layers, they are often wrapped or discarded in another exception. To find the origins of an exception, use Exception breakpoint. The execution will suspend whenever the exception is thrown or caught.
  32. 32. EclipseCon NA 2014 | Eclipse Tips and Tricks 32 Classload Breakpoint: To inspect who is trying to load the class or where is it used for the first time. Watchpoint: To suspend the execution where a field is accessed or modified. Method Breakpoint: To suspend the execution when the method is entered or exited.
  33. 33. EclipseCon NA 2014 | Eclipse Tips and Tricks 33 : A point in code where the debugger does not break the execution but only prints to console. To debug race conditions or to see the order of threads execution. To prevent the addition of print statements in the code while debugging. Set a conditional breakpoint with Suspend when 'true' option and a condition which is always false (eg: return false;) as the last statement.
  34. 34. EclipseCon NA 2014 | Eclipse Tips and Tricks 34 To filter out specified classes and packages while steping into code during debugging. In the Debug view, the selected stack frame's package or declaring type can be quickly added to the list of filters by selecting Filter Type or Filter Package from the stack frame's context menu. Window > Preferences > Java > Debug > Step Filtering OR
  35. 35. EclipseCon NA 2014 | Eclipse Tips and Tricks 35 A container for random snippets of code that can be executed any time without a context. To experiment with an API or test a piece of code (algorithm/method). No need to create a new project / class / main method / run the application to test.
  36. 36. EclipseCon NA 2014 | Eclipse Tips and Tricks 36 LAST BUT NOT THE LEAST! Help > Help Contents > Search “What’s new”Help > Tips and Tricks...
  37. 37. EclipseCon NA 2014 | Eclipse Tips and Tricks
  38. 38. EVALUATE THIS SESSION Sign-in: www.eclipsecon.org Select session from schedule Evaluate: 1 2 3

×