Eclipse RCP open view on certain position - eclipse

Assume that I have three views A,B,C. How can I assure that they will be always opened in that given order. At the moment I have a problem that if B,C are open and A closed, after opening A it is appended at the end. So I have B,C,A visible.
to open a new view I use following method:
IWorkbenchPage.showView(viewId, secondardId, IWorkbenchPage.VIEW_ACTIVATE);
It seems that existing placeholders for those views are ignored.

The short answer is: rather not possible.
The Eclipse workbench with its background as an IDE leaves the control over which part is shown how and where mostly with the user and does not give you full programmatic control over the workbench parts. While I think this policy is a good fit for IDEs, some RCP apps may have reason to be more restrictive with their users.
However, you might get away with a hack and first close all views in question (if they are open) and then open them in the desired order. But this will likely cause flicker and you also may loose state in the opened views (depending on how complete they save and restore their state).
A rather drastic approach - but it might work from a technical POV - are fixed views and/or perspectives
If it is important to have those views in a specific order, why don't you merge them into one?

Related

Get Eclipse columns to stay as they've been set

I've customized the perspectives I use often in Eclipse pretty thoroughly. Sometimes, however, I accidentally close a window and I need to reopen it. However, when I do, all the selected columns reset to the defaults.
The easiest way to reproduce this, is in Java mode (or any mode, I suppose):
Choose upside-down triangle in the Tasks view
Click configure columns
Remove a column, such as "Completion".
Window -> Save Perspective as... It will say "do you wish to overwrite Java"?
Choose yes, because the changes don't actually save anyway
Window -> New Window
And you will see, in the new Window, the removed column has returned!
Is there a way to make this change permanent? I tried looking through the files in /.metadata/.plugins/.org.eclipse.core.runtime/.settings but as I didn't know what I was looking for, I didn't know what to change. I also tried File->Export->General->Preferences, but the Tasks settings file created there had no mention of columns. I also tried the advice in this thread but none of it was helpful really. Does this feature exist?
Edit: After getting little response here and on their forums, I have created an Eclipse bug

How to change toolbar button order in eclipse 4.2?

With the old version, we just needed to drag and drop to change the positions toolbar's button. But with juno, how do we do this?
I don't believe you can re-order them in Eclipse 4.2.
However, you can choose to hide them:
- Window -> Customize Perspective -> Tool Bar Visibility
This is bug 364046, and has supposedly been fixed but is not yet released.
In the meantime, you can reorder the perspective buttons using the Live Application Model View. I am not sure what you need to install to get this view -- Eclipse e4 Tools perhaps?
I didn't see the view in the Show View dialog but it shows up with Ctrl-3.
Once you get the live application model view up, you need to find the Perspectives Stack,
which I found under Windows->Trimmed Window->Controls->PartSashContainer->Perspectives Stack.
Then you can reorder either by dragging/dropping in the tree view, or by the up/down buttons in the editor. I had to restart Eclipse to see the changes.
until the bug is fixed, i've found that one can:
figure out the order of the perspective items you are interested in
close all perspectives (or at least all that are in the wrong order
re-open in the order preferred.
if switching the last 2, just close the 2nd to last one, then re-open it, and it will be the last one.
if you want to move the first one to the last position, close it, then re-open.
if you want to move the last one to the first position, well ... you'll have to close all the others, then re-open them in the order you want.
this might involve less work than pulling in the "live application model view". at the very least, it just worked for me after coming to this question in hopes of seeing a real answer to the problem.

Eclipse PDT Differentiating file name tabs for MVC?

When working with MVC in Eclipse you might often have a model, view, and controller all with the same name open at the same time. When looking at each of the file tabs, you won't always know which is which and have to click through them, which can be quite a hassle sometimes. I've heard of being able to color code files based on the path in some editors. For example, tabs with path model could be set as green, path controller set as yellow, etc. Is this possible in Eclipse, or is there a plugin for something like this? If not, what do you do to more easily differentiate between the tabs? I've heard of people always opening a MVC set in a certain order. So you'll know the leftmost tab is the controller, the right most is the view, etc. However, that must also mean you need to open all 3 files each time. Any better tips or tricks?
Another thing about the file tabs that can be annoying is that when you have more files that can't fit in one line, eclipse pushes off to an arrow which you have to click to see the rest. It seems to be random which tabs get pushed off there, maybe the least used ones, I have no idea... This coupled with the problem above gets kind of annoying. I was trying to find a way to disable this and just show tabs that can't fit in one line to show up on a second line, but surprisingly couldn't find such an option (then again you also can't wordwrap without a plugin).
Hopefully there are some solutions to these two problems. Thanks.
Maybe this can be helpful
http://www.dipherence.com/2011/03/20/full-coloured-eclipse-navigator-plug-in/
With the latest version of Eclipse (Kepler 4.3.1, build M20130911-1000) when two or more files with the same base name are opened, tab will show also the parent directory name.

How can I close an empty pane in Eclipse

I often end up with lots of empty panes in Eclipse that can only be minimized but not destroyed. How do I close these?
Update:
In this screenshot you can see two minimized on the upper left and several on the right hand side. In the center are four more. They only seem to be restorable in the Debug mode.
http://img406.imageshack.us/img406/9900/eclipse1.png
this happened to me, too. What worked for me (based on FilmJ and douncon's comments) was to open a class file, then drag that tab over the top of the empty pane.
Select Window -> Reset Perspective. That should reset the current perspective (what you call "mode") to its' initial state, (hopefully) closing all irrelevant views.
Something seems terribly wrong with your Eclipse. Maybe you should reinstall it. It is possible that you installed a buggy plugin.
First of all, what do you mean by pane? Eclipse has:
Windows (Eclipse itself, e.g. instance)
Documents (tabs)
Views (properties, tasks, explorer, etc)
If by 'pane' you mean document editors, you have problems either with your Eclipse version or most likely one of the installed plugins.
Each View also can be closed (except maybe some project types (perspectives) of which I'm not aware). For CDT (C/C++) you can close practically everything.
I'll recommend you download latest Eclipse version with no plugins, extract it to different folder, and check if that happens again. If yes, please explain more in details (like Eclipse version, perspective you are using, any side plugins, etc).
Also a good places are Eclipse community forum, mailing list and bugz :-)
I had the same problem. For me it helped to go into the right perspective and activate the functionality that caused the window in the first place. Once I reactivated the functionality, in my case "QNX Memory Analysis perspective", I was able to close all the windows one by one.
The conclusion is you have to refill the empty windows with content and then you will be able to close them properly.
So, it's really very easy for this to happen, if you open an editor that's incompatible with the existing editor, you can often end up having to place it outside of the tab list in one of your editor panes, then you might clear or copy that, typically while trying to add that view to a tab list.
In any case, what it's done is create a new editor, and all you need to do is drag some file to that empty editor window giving it some form of context, then close it.
I had the same issue. I followed #zvikico, but instead of just resetting, I first reset and then closed all the perspectives. Please follow the following to fix the problem. It worked for me:
Window -> Perspective -> Reset perspective..
After resetting follow below:
Window -> Perspective -> Close All Perspectives

Eclipse: Nested Editor Tabs?

Is anyone aware of any method (or external plugin) that would allow for nested editor tabs? It would be nice to be able to group related open files into their own "master" tabs, but I'm not sure if this is even possible. Any ideas?
This is totally non-obvious, and I discovered it by accident, but...
If you click on a tab and start dragging it downwards, once you get more than half-way down the editor pane, a horizontal line will appear. Let go, and now you'll have two different editor panes, each with tabs of documents. Now you can drag tabs up and down between the two panes to see different documents at the same time.
I think that's as close as you can get.
I think the best you can currently do is "Window->New Window" and then use each new window as a separate "tab" of related editors. Not exactly ideal, I admit.
It's a cool idea though, especially if you could have shortcuts or something that open groups of editors with a single command.
This definitely isn't possible in the current RCP. You might be able to construct an editor component which created a CTabFolder and delegated to other editor components, but I'm not sure how well that would work.
There are Perspectives in Eclipse that you might use to achieve something close, they are more global things though...
But I agree with you, I would like this feature as well! This would be also very useful when editing many files that have the same name but come from different packages, because now it's a mess >_<
For me the utility of such a feature is to reduce context switching time. I'm working on project A, have lots of editors open, now I need to drop that and work on project B. I want to keep all the editors open associated with project A but hide them while I work on B. When I'm done with B, I can pick up right where I left off in A without having to find and open all those A files again; I can even leave them unsaved indefinitely, since Juno never crashes!! :)
I have used the New Window feature, and it's great, but the new window needs a bunch of configuration (closing Views I don't need, moving stuff around to where I want it, opening Views I had open in the old window, and so on) before I can get to work. It also uses a lot more memory than a simple tab group would since it seems to be a complete new copy of Eclipse.
The split-window feature is great and I use it all the time. It is indeed tab groups, and if there were a way to hide a tab group, and for each tab group to have its own tab list (the thing you get when you click ">>5" so you can see editors you have open that don't fit in the tab header), it would totally fill the bill.