简体   繁体   中英

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

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:
abc D ef

Current behavior :
a G c D ef

Wanted behavior :
ac DG ef

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;
}

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

Because i remember reading about this issue.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM