Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse place the new opened editor tab next to the currently active one?

Tags:

editor

eclipse

Is it possible to make Eclipse place the new opened editor tab next to the currently active one?

Until the tab row is full, eclipse places the new tab on the first free position, which is acceptable. When the row gets full, eclipse chooses to hide the LRU tab, which is acceptable, too. But it places the new tab on the position freed this way, which is from the user's POV a completely random position. Extremely strange, IMHO.

An example, just in case my English is worse than I though:

Initial position, assuming b is LRU and D is active, opening G:
a b c D e f

Current behavior:
a G c D e f

Wanted behavior:
a c D G e f

like image 982
maaartinus Avatar asked Jan 29 '11 08:01

maaartinus


People also ask

How do I organize tabs in eclipse?

Just drag the tab(s) to the order you want.

How do I open a new tab in eclipse?

To open a new window, click on the Windows menu and select the New Window menu item. Each window can have a different perspective open in them. For example you could open two Eclipse windows one in the Java perspective and the other in the Debug perspective.

How do I display tabs in eclipse?

Check the option " General > Editors > Text Editors > Insert spaces for tabs ": if unchecked, it will display tabs, not space.


3 Answers

I disliked the tab placement before, but I really dislike the way it works in Eclipse Juno. The Eclipse team claims that they have never gotten above 20% of their users liking a tab placement method.

Anyway, the good news is that customizing tab placement may get easier in the future, and if you dislike the current style you can go back to the old style relatively easily.


Comparison of tab placement styles

MRU style (older): The n most recently used tabs are always displayed.

Array style (newer): New tabs always go at the end of an infinite array of tabs. Then the visible set of tabs is scrolled until the selected tab is visible.

Suppose the window is sized very small, so that only 3 tabs are visible at once. Here's how the two styles will place things, given that we've already opened tabs "A" and "B" and are about to open tab "C". I'll capitalize the tab being added for visibility:

Tab    |         Old                    New
opened | Visible  |  Hidden  |  Visible  |  Hidden
----------------------------------------------------
C      | abC      |          | abC       | 
----------------------------------------------------
D      | Dbc      | a        | bcD       | a
----------------------------------------------------
E      | dEc      | ab       | cdE       | ab
----------------------------------------------------
A      | deA      | bc       | Abc       | de
----------------------------------------------------
F      | Fea      | bcd      | deF       | abc
----------------------------------------------------
D      | fDa      | bce      | Def       | abc

Selecting a tab placement style

As described in other StackOverflow questions Eclipse tabs repositionning and Retain previous open file tab under visible tabs, it's possible to choose between the two styles by installing the Eclipse E4 CSS editor plugin and then in Preferences > General > Appearance changing

.MPartStack {
    font-size: 12;
    swt-simple: false;
    swt-mru-visible: false;
}

to

.MPartStack {
    font-size: 12;
    swt-simple: false;
    swt-mru-visible: true;
}
like image 137
Nathaniel Waisbrot Avatar answered Sep 22 '22 22:09

Nathaniel Waisbrot


Have you read the following? https://bugs.eclipse.org/bugs/show_bug.cgi?id=68684

Because i remember reading about this issue.

like image 36
knowledge_is_power Avatar answered Sep 25 '22 22:09

knowledge_is_power


There is no direct way achieve it. [As per my knowledge.]

As mikezx6r said in his comment: You will require to build an eclipse plugin or you can an eclipse view that works as per your need. For your information: In the Eclipse Platform a view is typically used to navigate a hierarchy of information, open an editor, or display properties for the active editor

To know how to create an eclipse view here is a tutorial kinda stuff for you.

Hope this helps.

like image 21
Harry Joy Avatar answered Sep 23 '22 22:09

Harry Joy