问题
I'm new to Eclipse (and don't know NetBeans too). I'm reading eclipse tutorial. But I'm stacked and can't understand what "Link with editor" does exactly.It is said in Eclipse->Help:
select the Link with Editor button in the local toolbar or view menu of one of the navigation views. Lastly, click on the editor tab for JanesFile.txt. Notice how the navigation view updated itself to select the file you are currently editing (JanesFile.txt). If you don't like this automatic update you can easily turn it off by deselecting Link with Editor.
I select the Link with Editor button but i can't see any change It looks that it doesn't do any visible thing. It said in another documentation of Eclipse :
When multiple editors are opened, it can be difficult to keep track of where the related resources are in the Navigator. For this reason, the Navigator has support to synchronize its tree view with the currently edited resource.
To link resources between the Navigator and the editors in the workbench, locate the Link button in the Navigator toolbar at the top of its UI. The Link button is an icon with two arrows pointing to each other. Move the mouse over it; hover help should read Link with Editor. This technique also applies to the JDT’s Package Explorer.
I read the above and some other blogs.It is said that it is very useful and necessary while working on large project. what does it do exactly? i can't grasp it . Could anybody help me to grasp it and supply a clear example or information to see what it does? Thanks in advance
回答1:
It ensures that the file you have open (are currently editing) is selected and visible in the Navigator/Project Explorer. So that if you want to see other classes in the same package, e.g. you don't have to drill all the way into it manually.
If you want to see it work, have the Navigator view open and enable this setting. Then switch to editing a new file (without using the Navigator, e.g. use CTRL-T and type the class name directly, or click a different editor tab). The selection in the Navigator should update to the file you're now editing.
回答2:
Link with editor is useful when you open many files in your project. When you select a file in the editor, the Project Explorer or the Navigator show you the same file in its document tree.
回答3:
Whenever you choose an open file (JSP, Java, etc) in the editor, the Navigator will jump to that file in the project structure, opening any folders needed.
I personally found it to be a pain... I like to keep the area of a project I'm working with stable and I'm using Ctrl+Shift+R to skip around looking for files. If I'm doing that, the navigator is skipping all over the place.
回答4:
In simple words, Link with editor sets default editor for file types, for example, xml editor will be used for editing xml files etc.,
来源:https://stackoverflow.com/questions/12333875/what-does-link-with-editor-feature-do-in-eclipse