How to avoid eclipse from changing open files when changing perspective - eclipse

I'm using Eclipse Neon and am observing annoying behavior that I didn't have with Mars: the list of files that are open in the editor frames changes when I move from C-perspective to debug-perspective. I lose track between perspectives of which files are open where (I use multiple editor frames). Is there a way to disable that specific behavior? I want to keep the behavior of eclipse automatically changing between perspectives when I run the debugger, I just don't want the editor tabs reshuffled in the process.
C/C++ Perspective -- I have a bunch of files open, represented by editor tabs
Debug Perspective -- note editors now show only two open tabs, and the ordering is different.
EDIT: I discovered this only happens when I use two separate editor frames (i.e., each frame is independently minimizable). When I have two editors inside a single minimizable frame, the tab order is preserved between perspectives.

Related

Banning an editor from a multi-editor perspective in Eclipse

I've been experimenting with multiple editors in Eclipse. I've created a perspective Java (4K), based on default Java perspective, but with multiple editors for when I plug the laptop into my 4K TV. That way a bigger screen enables me to edit multiple files at a time.
However, one of the editors in 4K is the one from the default Java perspective, which I don't want. Just like editors in the 4K perspective are banned from the default, I want the one editor from the default perspective banned in 4K. Is that possible?
I've seen how to hide an editor view in this question, saying that editor views can't be banned. But it seems to me they can:
When I open the 4K perspective I have (at the moment) 5 editors with 5 different files open, let's call them A, B, C, D and E. I switch to the default perspective and only the editor with A is there. If I want to open file C, for example, it will add a tab to the editor with A rather than show the existing editor with C already open, so clearly that editor is banned.
Unfortunately, in the 4K perspective, I haven't been able to ban the editor that's in the default perspective. I have managed to hide it, so there are 4 editors with B, C, D and E. Let's say that last time I was using default (as I was using the small screen) i opened a new file F. Of course, it opened as a new tab in the editor already having A and C. But after switching to 4K, if I want to open file A or F, whatever I do, the editor view with A, C and F will re-emerge. I don't want that editor to re-emerge.
How do I do it? Are perspectives the right approach?
So in short:
I want to be able to switch between a small and large mode (perspective?).
In the small mode I want one editor with multiple tabs when I open new files (regardless of whether they'd been opened in the large mode, which works fine).
In the large mode I want to be able to open files in existing or new editor views regardless of whether they'd been opened in the small mode (not working at the moment).
How do I do it?
UPDATE
This, as far as I understand, is a single editor view with 3 tabs. But, as greg-449 pointed out in a comment, the 3 tabs are apparently 3 editors.
Now the editor area is populated, as I understood, by 2 editor views, the left one is empty and the right one has 2 tabs. Does that mean the right thing contains two editors? And what is the left thing?
Anyway, this is what I see at the moment if I switch to the "Java (HD)" perspective, while I see one big empty thing (the left one) if I switch to the "Java (default)" perspective. The right thing (whatever it is) is banned in the default perspective, as when in default, if I open Test.java, it will open it in the big empty thing, and not bring the one on the right from the HD perspective. Then, when switching to the HD perspective, the left thing will be in the same state as I'd left the big thing in the default perspective, i.e. having files open in tabs that I'd opened using the default perspective.
Now, as the right thing is banned in the default perspective, why can't I ban the left thing from the HD perspective? Am I looking at it wrong way?

Can Eclipse hold multiple different 'Compare' windows at the same time?

Like in the topic - is there any default way or any plugin that lets you have multiple 'Compare' windows open and active at the same time? I find it very frustrating that while doing changes to few files at the same time, I can't have active 'Compare' window for each of them, to see my changes/original code.
I would use Window -> New Window, rerun Team -> Show History and then compare another file.
A compare window in Eclipse is placed inside a normal editor tab.
You can have several editor tabs, including compare windows, visible at the same time. To do this just drag the editor tab (the one on the top with the editor name) to somewhere inside the editor area. The editor area will get split in two, each one displaying one editor.
This works with more than two editors also.
If you find that you need more space for the compare windows because other views take up much space you can maximize the editor area by pressing Ctrl+M while the editor area has focus.
Example:
Go to preferences -> team -> General Team Preferences. For me, the "Reuse open compare editors when opening comparisons" was already checked by default. I unchecked that and now I can have multiple file comparison windows open! (I'm using Eclipse Oxygen.3a -- 4.7.3a)

How to navigate through a lot of files in Eclipse without opening them

In some popular code editors and IDEs such as Sublime Text and Xcode, we can swiftly navigate through lots of code files by a single click without opening them. This is an advantage when we look into many parts of the code base scattered across the projects but nevertheless want to avoid opening too many tabs, which affects performance on slow machines. Does anyone know such a "navigating-without-opening" functionality in Eclipse?
I understand that Eclipse does provide a lot of useful shortcut keys to switch between opened tabs and classes in the project, but what I am looking for is the functionality whereby I can switch between files without opening them in a new tab by a single click (and preferably open specific files by double clicks when we want to keep them opened in new tabs).
EDIT:
I am not searching specific classes or methods. Rather, I would like to peek project files one by one to grasp the structures of the application which contains hundreds of files. In Sublime Text and Xcode, unlike in Eclipse, when one clicks file names in the project explorer only once, the files get opened in a "temporary tab" which automatically closes when we single-click another file. For example, in the following screenshots, when I single-click ToDoListPane.java in Sublime Text or CNBackgroundView.h in Xcode, the files are opened in new temporary tabs, but once another file such as HelloWorldSpring.java or CNAppDelegate.m is clicked once, then the contents in the temporary tabs are switched to those of HelloWorldSpring.java or CNAppDelegate.m without additional tabs being created.
Use Ctrl+Shift+R to search files by name (pattern).
If you know a string that is inside of the files you seek, you can use Search -> File Search (there is a button in the toolbar for that).
Related:
http://www.vogella.com/tutorials/EclipseShortcuts/article.html
http://eclipse.dzone.com/news/effective-eclipse-shortcut-key
http://www.shortcutworld.com/en/win/Eclipse.html
[EDIT] For exploring unknown code, try the "Java Browsing Perspective", it's optimized for this use case.
As for "slow performance", I have often more than 99+ files open without a big impact on performance.
As a quick way to close tabs, you have several options:
Click anywhere in the tab with the middle mouse button to close it.
Use Ctrl+W to close the current tab
Use the tab's context menu to close it, close all tabs or close all other tabs.

Is it possible to duplicate the view of the same source file in Eclipse?

I'm doing some manteinance to a .cpp file with eclipse and I need to compare two methods. It's very uncomfortable to jump ahead and back to check differences.
Is there a way to duplicate the view of the same source file, in order to compare them side by side?
Edit the file and use Window > New Editor to open a second editor on the file. Then drag the title tab of the second editor and Eclipse will show on outline of how it is going to arrange the two editors. You can arrange the two editors vertically or horizontally.
Update:
Eclipse 4.4 Luna (currently only available as Milestone builds) adds support for splitting the editor directly using Ctrl+_ and Ctrl+{.

Changing number of rows of tabs visible in NetBeans

There are times when I have a decent number of source files open at once. Is there a way to change the number of rows of tabs that are visible while working in NetBeans?
Also, I have a dual monitor setup here. I could span NetBeans across the two monitors if it were possible to have multiple NetBeans editor windows open at the same time. This is something that I use in the VS Express editions. I tend to group my source files on one monitor and the designer windows in the other. Can I do this in NetBeans?
for versions 8.0.2+:
Tools -> Options -> Appearance -> Document Tabs -> Multi-row tabs
You can also maximum row count if you wish (the default is 3).
There are 2 way's I have done this:
Drag a tab from the editor panel to the side of the editor window until the red outline shows a rectangle running from top to bottom. Drop the tab there and you get another editor pane. Opening from Project or Files will still use the original panel, but you can drag tabs between the panels.
Right click on a tab and choose "Undock Window". This will create a top-level window independent of the main NB window.
When you create files with keyboard shortcuts (eg, Ctrl-N for new file) they will open in the current panel. Likewise, navigating to other files (eg, Ctrl-Shift-B for go to source).
It's not perfect though. Some keyboard actions will dump you back to the main window, then it's Alt-Tab or fiddle with the mouse to get back.
You can control the number of rows of Tabs in Netbeans by going to (on Windows):
Tools>Options>Miscellaneous>Windows> check the multi-row tabs checkbox.
See the maximum row count with the radio button and set your number.