Banning an editor from a multi-editor perspective in Eclipse - 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?

Related

How to avoid eclipse from changing open files when changing perspective

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.

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)

Eclipse auto close unused tabs

I have this habit of looking into other source codes from different projects for a reference. However, this leads to cumulative issue of forgetting to close the tab. I may have around 100 source tabs opened up (which is related to current and unrelated projects).
Is there a preference or plugin to auto close unused tabs after certain idle period? Like say after 10 minutes of inactivity.
The issue I face is when I'm in a hurry the tabs pile up and consume lots of memory, and not to mention if you have opened up Chrome for reading documentation and StackOverflow digging. Finally slows down my system due to swap usage.
[ Update ]
Found some interesting tips from this link
So how to quickly close unnecessary tabs in Eclipse?
Closing tabs one by one by clicking on the tab with a wheel/MMB. It’s faster than clicking LMB on a small cross icon, because it’s enough to click anywhere on a surface of a tab. I do it when there is few tabs to close (like one or two) and tabs that I want to closearen’t hidden.
Closing current tab using Ctrl+W keystroke. I do when tab to be closed happens to be an active tab. And when I just visited some class to check something and I won’t need to revisit it anymore soon.
Using Ctrl+Shift+W keystroke to close all tabs. I do it when I’m starting completely new tasks or at the moment I’m too lazy for 4 or 5. :-) .
Right-clicking on the tab that should stay open and selecting “Close all others” option. It’s handy in cases where only one editor is significant and others are a result of code exploration.
This is my favourite one: Using ctrl+shift+e keystroke to display “Open editors” dialog, selecting editors that should stay open (with ctrl pressed), “invert selection”, “close all selected” and finally hitting esc to close the dialog. It may seem complex but trust me it isn’t. It took me only a few attempts to learn how to use this trick effectively. I often do it when I forgot to close tabs for a while and I have a lot of tabs open and what’s worse, some of tabs aren’t visible on tabs bar (arrow icon needs to be clicked to see the hidden tabs).
There is a feature General > Editors > Close editors automatically which closes unused editors automatically.
There is no auto-close feature/plug-in in eclipse. Because user opened all the editors manually and he/she has to close these on their wishes but not automatically.
For your problem I suggest you to use Mylyn plug-in so that you can stick to only those editors(context) you frequent used, hiding all other editors, packages, classes etc.
Also there is an eclipse plug-in for pinning editors refer my answer for the post Eclipse - How to pin editor tabs?

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.

Any tips on how to organize Eclipse environment on multiple monitors?

I can't find a good way of putting Eclipse windows on two monitors. Currently I just detached (clicked on a header and dragged) a few windows to a secondary monitor (package explorer, console, and outline) while leaving primary monitor with maximized source editing window.
It works pretty well except few annoying issues. Detached windows are not in focus while you are editing your code. Which means that, for example, last build shortcut (Alt-Shift-X, Q) doesn't work because it can't find build file (because package explorer is not in focus). Also "Selected resources" option in a file search menu is not picking up current package selection.
So I was wondering is detaching windows a right way to go? Do you have any better solutions so at least package explorer stays in focus?
Thanks.
PS. Btw "unable to find build" error started showing up only in 3.4 ver for some reason.
In the Eclipse Helios (currently 3.6.2) I found very useful the use of another window to bring up multiple documents in different screens.
in the main menu, go:
Window > New window,
and drag it to the screen you prefer. Double click in the filename on the editor and will maximize the editor's window.
I hope i helped.
Kyr.
PS: If you want to maintain both windows when you closing Eclipse, don't close them one by one. Instead go: File > Exit.
I use Ultramon to spread my Eclipse across two monitors.
I have the left hand side devoted to the code and the right hand side to the Project Explorer, Search, Console, Ant and Outline views.
This way I get focus to all of my Eclipse stuff when I click on it in the taskbar or alt-tab. I can also overlay another window (usually my browser or a trace viewer) on the right hand monitor. I use SemTop to pin the overlayed window if I want to code and read some reference at the same time (This is where shortcuts keys come in handy).
So I can look at code and StackOverflow at the same time ;)
Ultramon
I split the eclipse environment over two monitors (both running at 1600*1200)
on the left I have the main coding window maximised with the outline down the right hand side.
On the second monitor I have the Junit window, Problems, Console and the package explorer
I have the same layout duplicated for all the perspectives that I use.
I have never used the Alt-Shift-Q short cut but I have found the Alt-Shift-X, T shortcut for running junit works fine when I am focussed in the main coding window .
Possibly have the package explorer on the same monitor as the coding window?
I have a widescreen primary monitor and a non-widescreen secondary monitor. The layout on my primary monitor is broken into three columns: column 1 contains the package explorer in the top half and the outline, hierarchy and search results views in tabs on the lower half. Column two is code, and is about two and a half times wider than the other two columns. (Since everybody has widescreen monitors at my office, we've standardized on 100-character lines instead of 80.) The third column has the debug view at the top, somewhat small; the variables, expressions and JUnit views in tabs below that, taking most of the vertical space; and a small breakpoints view below that. My secondary monitor has two torn off windows: the console takes up most of the screen, and below it I have a smaller window containging the problems and history views in tabs.
My only gripe is when I remote desktop in from my single-monitor setup at home: the two windows on the secondary monitor move over to the primary one. I have a "One Screen" perspective which I use in this scenario to rectify that, but when I'm back at work and switch to the dual-monitor perspective, I have to manually move the windows back over to the other monitor. I wish Eclipse would just leave them over there, but I can't see any way to make it do that.
I have my Package Explorer and Code on my primary monitor and the Console on my secondary monitor. I do this by right clicking over console tab and selecting Move.. then View.
This way I am able to drag, drop and resize the console window.
Hope this helps!
I did this by extending my eclipse to both monitors, in windows you can make your screens extended by holding win key and tapping P,
Then, selecting my left monitor as the main one I dragged the right side of the eclipse window to cover the other screen all the way. then made eclipse into three columns. Now my main monitor is dedicated to code editor and console and package explorer are on the other one! when you have a whole monitor for your code it always helps to use cntrl+{ and have a second vertical column for viewing the same file, or dragging the tab of another file to the side of screen to view both in the same time.
Finally I just saved my work from window > save Perspective As
I can switch between my normal and dual monitor perspective whenever I'm not in the office
I've reduced (but not eliminated) the need for the package explorer to always be showing by using Ctrl+Shift+R in eclipse, this pops up a filter-as-you type window that makes switching between files which you remember the name of easy, as well as accepting wildcards to make it easy to find files you partially remember the name of.
I keep source on my main screen and outline tasks and LogCat (android) on my secondary screen, if I find i'm reading a lot of web content i fire up my laptop via synergy as an independent third screen, it's not ideal but it works.