Link to home
Start Free TrialLog in
Avatar of gudii9
gudii9Flag for United States of America

asked on

eclipse shortcuts

Hi,
what are eclipse shortcuts for


how to extract some code to separate metod
how to put in a loop sysout

how to move whole method up and down

how to find call hierarchy and how it is different from type hierarchy and find references

please advise
Avatar of Am P
Am P
Flag of India image

how to extract some code to separate metod
Unable to understand this. Explain in detail.

how to put in a loop sysout
Unable to understand this. Explain in detail.

how to move whole method up and down
Never needed to move a method from one place to another in the same class. If this is the problem, any specific reason to do so. By the way you can copy entire block and drag it to wherever you want to place it.

how to find call hierarchy and how it is different from type hierarchy and find references
Call hierarchy gives details about the method call. That is from how many places your method is being invoked.
Type hierarchy gives details about the parent class of the selected type as well as child classes for the same.
Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice.
Avatar of gudii9

ASKER

how to extract some code to separate metod
Unable to understand this. Explain in detail.

sorry for long time on this.


say i have 1000 lines of code in a method called MethodA. I want to move first 500 lines of code to MethodB.how to create new MethodB by extracting those first 500 lines of code automatically using eclipse? please advise
Avatar of gudii9

ASKER

how to put in a loop sysout
Unable to understand this. Explain in detail.

sysout i mean to say System.out.println("aaaa")
Avatar of gudii9

ASKER

Call hierarchy gives details about the method call. That is from how many places your method is being invoked.
Type hierarchy gives details about the parent class of the selected type as well as child classes for the same.
Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice.

when to use which one?
say i have 1000 lines of code in a method called MethodA. I want to move first 500 lines of code to MethodB.how to create new MethodB by extracting those first 500 lines of code automatically using eclipse? please advise

You will have to do it manually. B'caz, we, the developers, are aware about the logic, code and how much snippet needed to extract. In my professional career, I used to re-factor the code (you example, method with 1000 lines divided into 5 or more), but all is manually. No IDE for that.
Avatar of gudii9

ASKER

any good videos on eclipise shortcuts and better usage of those functions?
Avatar of gudii9

ASKER

as we spend long time on debug once we know how to better debug it will be easy right?
Avatar of gudii9

ASKER

class A has methodA which is callign Class B's methodB

now i clicked on methodB of ClassB and said call hierarchy
surprisingly it did not show  class A methodA in call hierarchy? why
Avatar of gudii9

ASKER

any good screenshots or tutorials with pictures to understand this with working examples?
ASKER CERTIFIED SOLUTION
Avatar of Am P
Am P
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gudii9

ASKER

Find reference 1. In workspace, select the variable and press Ctrl+Shift+G, In project or hierarchy, select the variable then right click References -> your choice

what is the use of references option?
what is difference between project reference and work space reference?