NetBeans link to line in source - netbeans

I have quite a complicated code source and I have commented and split it as best I could and created a table of content. I would love to be able to simply click/ctrl + click on one of the lines in my table of content and automatically put my view to the line/link I specified. Is that possible in NetBeans?

You could use bookmarks which are supported by Netbeans. Under "Window / IDE Tools / Bookmarks" you can open the bookmark window which gives you an overview over all bookmarks which can be also renamed. From this window you can navigate via double-click to your bookmarks.
No exactly what you had in mind but a viable alternative.
(see also http://wiki.netbeans.org/EditorBookmarks72)

Related

Is there some plugin for eclipse which shows a minified outline of the source?

E.g. Komodo IDE has this feature:
Can be really useful for getting an overview of a big file.
Anyone knows something similar for eclipse?
Yes its there. Look this overview-plugin. This plugin shows the overview of the current text editor in the Overview view. Also the tooltip shows the line under the cursor. Also note that you can control the zoom level in overview view.
Screen shots:
The general way of providing that kind of view (not exactly a minified view, but as useful) is through an outline.
For JSON, you would need an eclipse JSON plugin, which has a JSON outline dedicated view:
You can use the Quick Outline feature of many editors in Eclipse to get a pop-up, easily navigable outline of the file's contents. Use Ctrl+O (Command+O on Mac).
To bring up the "normal" persistent Outline View, open Quick Access with Ctrl+3 (Command+3 on Mac) then type outline and select it from the list.

Show the name of the containing folder in the Eclipse tab of a file

I have the same set of files in N folders, one of them, say, blank.xhtml. The files contain somewhat similar information and it is becoming overwhelming to figure out which file comes from which folder every time I switch between the tabs. When I open one of them to edit and happen to open a file with the same name from another folder I get confused and more often than not end up editing the wrong file: nullifying my hard work. So I am wondering if there is a way to show the name of a containing folder in the tab like this G-06/blank.xhtml or G-07/blank.xhtml. I will be very very thankful to anybody who has pointers to how I can make this happen.
As an addition to the Maroun's answer there is an alternative solution.
It's not exactly what you want (full name in the tab's title), but may be useful sometimes.
In the "Project Explore" view (the same goes to "Navigator" view) click the "Link with Editor" button. That way, whenever you choose some file opened in the editor, it will be automatically selected/highlighted (see the picture) in the "Project Explorer" view.
Here is the picture:
Maybe this will be useful to you too.
If you hover the mouse over the tab containing the file name then a popup appears showing the full path. Not exactly what you wanted, but it should help. (This with Eclipse Neon.3 Release 4.6.3 on a Mac).
Not quite what you're looking for, but ctrl+shft+e will open the switch editor window that shows all the open editors with their filepaths. I use this shortcut for the same reason. I'll have multiple build.gradle files open from multiple projects and this helps pick the correct one

How can I copy and edit a file in Eclipse?

This seems so simple but I can't find a good way to do it:
Often I want to take an existing (Java) file and base a new one on it - basically just copy the file, rename the copy, and edit it. I can't find any good way to do this. The best I can do is to right-click on the file in the Package Explorer, select copy, and then paste it. If I do it in the same directory I'm prompted to change its name, which is cool.
The problems with this are: 1) It doesn't seem very "Eclipse-y", and 2) Usually I don't have the Package Explorer expanded to where the source file is, so it's very tedious to go through all the projects/packages and find it.
There must be a better way to do this, no? I expected something in the refactor menu but all there is is "move".
Alternative is there a simple way to show where a file I'm currently editing is in the Package Explorer? That wouldn't be ideal but would be good enough for me.
On the top right portion of the package explorer, there is a "link with editor" button that will automatically highlight which file you have open in the editor.
Select 'Show In - Package Explorer' in the context menu of your editor.

class view in eclipse

In Eclipse, is there a way to have a Package Explorer like view that shows the classes without having to open the files individually.
I have this project where many classes are written in same files, and that makes navigating them so annoying. Is there some sort of ClassView in Eclipse that disregards file names.
Regards
This question is currently almost 2 years old, but for anyone ending up here through a Google search (like me):
Eclipse offers a "Java Browsing" perspective which is probably what you want. To see this, go to Window -> Open Perspective, and select Java Browsing.
You can use the Outline view.
Window > Show View > Other. Filter by the word 'Outline' (it's under General folder)
window->show view->outline was helpful for me as this was the only window missing in existing perspective.
Yes you can use F3 key if you're seeing this class, o you can use Ctrl+Shift+T shortcut to open 'Open Type' and write in it the name class
Okay, it's been asked a long time ago. You may be looking for the Breadcrumb. Searching for it and got this question. Suddenly I did it unknowingly and shared here. There is a button beside "Save", "Print" buttons; "Toggle Breadcrumb". :)

How to replace Eclipse search dialog?

Is it possible to replace Eclipse search dialog to something more convenient, like the search dialog in Firefox or Chrome? The default one doesn't support F3 to search for the next match, it doesn't move itself away if the match is underneath the box and doesn't allow to highlight all the matches - and these are the features I really miss...
I don't think you can replace the Find dialog easily. You would probable need to (re-)write parts of Eclipse. Definitely doable, but not a small task...
That said, most of your problems can probably be addressed by the current dialog:
The default one doesn't support F3 to search for the next match
"search next match" is Ctrl-K by default. You can configure the keybindings under "Preferences / General / Keys": change the keybinding for "Find Next".
it doesn't move itself away if the match is underneath the box
Yes, that would be nifty. The dialog does however remember where you last put it, so just put it somewhere out of the way (e.g. over the package browser, or to the right), and it will stay there.
and doesn't allow to highlight all the matches
This is not yet available (though it has been discussed: https://bugs.eclipse.org/bugs/show_bug.cgi?id=29692 ). There are however two ways of getting a similar result:
Use the search function from the toolbar ("File Search" from the "torch" button). If you search there, it will highlight all matches in the editor (and provide marks in the editor ruler, and a list in the search view).
For Java elements, activate "Mark Occurences" ("highlight pen" button). This will highlight all occurences of a Java element if you mark in in the editor.
Maybe one of these will help you.
Finally, you can just open any file in an external editor (like (g)vim or Notepad++) right from inside Eclipse (right-click -> Open with). Then you can use any editor you want...
While it may not be exactely what you want, have you ever used the incremental search (Ctrl + J)? In my opinion it is much more convenient than the standard search.
A newer alternative is InstaSearch.
Information:
InstaSearch is an Eclipse plug-in for doing fast text search in the workspace. The search is performed instantly as-you-type and resulting files are displayed in an Eclipse view. It is a lightweight plug-in based on Apache Lucene search engine.
Each file then can be previewed using few most matching and relevant lines. A double-click on the match leads to the matching line in the file.
The "search the next match" is Ctrl-K. Previous is also available, see the "Edit" menu...
Only the highlight feature does not seem to be present. You might need a plugin for that (everythinhg is possible with plugins).
There was a Summer of Code project to implement a Firefox like search in Eclipse in 2007.
This is the official page, and this Blog shows a promising screenshot.
I never tried to install it, and I didn't find a final release or something though :(
SearchTab is an Eclipse plugin that shows a Firefox-like search tab
You do this by changing the key bindings under Preferences -> General -> Keys