navigate back in eclipse

D

david wolf

Hi,

I want to know how to navigate back in eclipse editor of JAVA
development. Can some one give me a help ?

For example, I am working on line 2000 of my code. I want to take a
look at the very top of the file, and then come back to this line. How
to mark the location, i.e. line 2000, then I can come back after
looking at the top of the file?

Thanks !!!!!!!!!!!!!!!!!!!

David
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

david wolf schreef:
Hi,

I want to know how to navigate back in eclipse editor of JAVA
development. Can some one give me a help ?

For example, I am working on line 2000 of my code. I want to take a
look at the very top of the file, and then come back to this line. How
to mark the location, i.e. line 2000, then I can come back after
looking at the top of the file?

There are arrow buttons in the menu bar. The arrow with a star brings
you to the last edit location, the others to the last view. Consider
asking Eclipse questions on the Eclipse newsgroups:
http://www.eclipse.org/newsgroups/

HTH, H.

- --
Hendrik Maryns

==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEoVBJe+7xMGD3itQRAoy/AJ97027E6STByRJ1X2kbHQDNxr3ycgCdFx1R
JmagModmBQSPnbCE1KNH2VU=
=Cixt
-----END PGP SIGNATURE-----
 
A

Alex Whitney

david said:
Hi,

I want to know how to navigate back in eclipse editor of JAVA
development. Can some one give me a help ?

For example, I am working on line 2000 of my code. I want to take a
look at the very top of the file, and then come back to this line. How
to mark the location, i.e. line 2000, then I can come back after
looking at the top of the file?

Thanks !!!!!!!!!!!!!!!!!!!

David

I usually just use the method list on the right side of the screen to
navigate. If you click on a method it will take you to it.

You could always purposely generate an error at the line you want
"bookmarked". That way when you want to go back to the line, you just
click on the red rectangle on the right and it will take you to the
line with the error. Or you can create a TODO: tag and it will make a
blue rectangle.
 
R

rhino_moderate

david said:
Hi,

I want to know how to navigate back in eclipse editor of JAVA
development. Can some one give me a help ?

For example, I am working on line 2000 of my code. I want to take a
look at the very top of the file, and then come back to this line. How
to mark the location, i.e. line 2000, then I can come back after
looking at the top of the file?

Thanks !!!!!!!!!!!!!!!!!!!

To find the full story, look up "bookmark" in the Eclipse Help system.

Basically, you can set bookmarks wherever you like in your source code
in much the same way you set breakpoints for your debugger: position
your cursor over the line number in the left margin, right click to get
a context menu, then choose Add Bookmark.... You will be able to choose
your own name for the bookmark so you can write something meaningful to
you. As soon as you click OK, your bookmark is set. You will see a
green rectangle in the left margin, assuming you are using the default
colors in the Eclipse settings.

You can set as many bookmarks as you like, including one on line 2000
and another on line 1, then just click the green rectangles in the left
margin to get from one to another. But if you have a lot of bookmarks
and have trouble telling which is which, there is a Bookmarks View that
you can display by clicking on Window/Show View/Other.../Bookmarks (in
the Basic section). The Bookmarks View shows all of your bookmarks and
lets you click on the one you want, which should be easy if you created
a meaningful remark when you created the bookmark.

You can delete a bookmark as easily as you created it: position the
cursor over the line number (left margin) of the line containing the
bookmark; right click to get the context menu, and choose Remove
Bookmark.

Bookmarks are kept when you save the source file so you don't need to
re-create them when you re-open the file.
 
D

david wolf

To find the full story, look up "bookmark" in the Eclipse Help system.

Basically, you can set bookmarks wherever you like in your source code
in much the same way you set breakpoints for your debugger: position
your cursor over the line number in the left margin, right click to get
a context menu, then choose Add Bookmark.... You will be able to choose
your own name for the bookmark so you can write something meaningful to
you. As soon as you click OK, your bookmark is set. You will see a
green rectangle in the left margin, assuming you are using the default
colors in the Eclipse settings.

You can set as many bookmarks as you like, including one on line 2000
and another on line 1, then just click the green rectangles in the left
margin to get from one to another. But if you have a lot of bookmarks
and have trouble telling which is which, there is a Bookmarks View that
you can display by clicking on Window/Show View/Other.../Bookmarks (in
the Basic section). The Bookmarks View shows all of your bookmarks and
lets you click on the one you want, which should be easy if you created
a meaningful remark when you created the bookmark.

You can delete a bookmark as easily as you created it: position the
cursor over the line number (left margin) of the line containing the
bookmark; right click to get the context menu, and choose Remove
Bookmark.

Bookmarks are kept when you save the source file so you don't need to
re-create them when you re-open the file.

Thanks for all of you !!!!

But I think, is there a easier way to do this? Say some shortcut key?

Use bookmark by mouse require me to do bookmark first then, scroll to
see the book mark. It takes time.

Use outline (at the right side of the screen) need mouse click and
scroll also, it also takes time.

In Linux, we can use two keys ma to set bookmark a, use 'a to back to
the bookmark. all done using keyboard. Is there a similiar way in
eclipse?
 
R

rhino_moderate

david said:
Thanks for all of you !!!!

But I think, is there a easier way to do this? Say some shortcut key?

Use bookmark by mouse require me to do bookmark first then, scroll to
see the book mark. It takes time.

Use outline (at the right side of the screen) need mouse click and
scroll also, it also takes time.

In Linux, we can use two keys ma to set bookmark a, use 'a to back to
the bookmark. all done using keyboard. Is there a similiar way in
eclipse?

I thought the bookmark approach I described was pretty easy - and I
only confirmed it existed when I went to answer your question!
Normally, I just scroll up and down or click on the method names in the
outline; that was already quick enough for me!

I'm guessing that you're young, maybe still in school or just out.
Well, I was more impatient when I was that age too :) I don't suppose
anything I say will actually convince you that you can afford to take
the few seconds it takes to use the outliner, the Outline view or the
Bookmarks view. So, if you really really have to have a technique that
is even faster, why not ask on the eclipse.platform newsgroup on the
Eclipse news server? Someone there may know an even shorter shortcut
that will make you happy.

Sigh.....

Sorry, I don't mean to sound like an Old Geezer....
 
H

Hendrik Maryns

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

david wolf schreef:
Thanks for all of you !!!!

But I think, is there a easier way to do this? Say some shortcut key?

Use bookmark by mouse require me to do bookmark first then, scroll to
see the book mark. It takes time.

Use outline (at the right side of the screen) need mouse click and
scroll also, it also takes time.

In Linux, we can use two keys ma to set bookmark a, use 'a to back to
the bookmark. all done using keyboard. Is there a similiar way in
eclipse?

With ‘in Linux’, I suppose you mean in Emacs. Whatever.

You can define your own key bindings in Eclipse too. Go to Window->
Preferences -> General -> Keys / Keys (Experimental). There is even a
pre-defined Emacs scheme, although it does not contain a shortcut for
Add Bookmark. Anyway, under Keys, you can define it yourself, Alt+D
would be a suitable possibility.

H.
- --
Hendrik Maryns

==================
http://aouw.org
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFEonJSe+7xMGD3itQRAleOAJ9pkPT3PnKacyXbuNKMTIBFRV/O9gCeLBJ3
PM8CHwcoJSeyjhzK/nvYxR4=
=LAO0
-----END PGP SIGNATURE-----
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top