eclipse : how to differentiate/distinguish different open workspaces - eclipse

I will need to use multiple workspaces for a recent project. Each workspace might consist of 10 or more projects.
When I'm switching between various applications and different eclipse instances(for the multiple workspaces), I want to be able to distinguish a given workspace easily without having to spend 5 seconds to know from the open file, etc.
What facilities are available to quickly know which workspace I'm in ?

Use the -showlocation command line argument when starting Eclipse. This shows the current workspace name in the window's title. You can also put the argument in the eclipse.ini file.

You can also add your own window title in:
eclipse preferences > workspace > workspace name (shown in window title)
Explained here: http://eclipse.dzone.com/articles/show-workspace-location-title

-showlocation is great, but it only changes the text at the end of the title bar, so it's often not visible in the taskbar.
If you want to change the beginning of the title bar, which shows the current Perspective, you can use Window -> Save Perspective As... and the new title will be visible in the Taskbar.

You could use also the OS for this to setup different workspaces, with diff, background or so. Where you have in each workspace a Eclipse running, with a diff workspace.

You can also create different working sets in the same workspace. The you only need one eclipse and switch between working sets in 1 sec depending on the mouse speed :)

Related

Visual Studio Code - Tabs (editors) of the same project in multiple screens

Using multiple screens I normally place multiple classes (files) in different screens, this helps me a lot while refactoring, checking tests and comparing changes.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor.
I checked the documentation and plugins, but the only way I found, is to open two windows, pointing to the same project (folder) and put those in different screens.
I don't like this solution, that causes also some problem when I watch code changes using TypeScript.
Any suggestion?
I use Windows 10, latest version of VSCode.
A solution is to press CTRL+K and after releasing CTRL, press O.
This will open the current file in a new window.
There are few things I don't like about this solution:
- Drag and Drop does not work
- Create a new instance of VS Code resulting in (for me) 180MB of ram used
- To open the file it takes to me few seconds (quite slow)
- The file remains open in the original window as well
Update 20/03/2019:
There is a feature request you can track here:
https://github.com/Microsoft/vscode/issues/10121
And an explanation about why this is difficult to implement here:
https://github.com/Microsoft/vscode/issues/10121#issuecomment-345770248
Update 20/03/2019:
Another important side effect highlighted by #Mär is that:
the IntelliSense fails to establish references it had when the file
was opened in the window, where the entire project is opened
The easy way but with the same drawbacks. More ram and resources will be used. Is to wrap your project in a folder.
It's the best possible thing. As by now!
=> Duplicate the workspace.
Open the command pannel ctrl+shift+p or F1.
Then write dupl
You'll get that
That's it.
More
If you want to add more folder to the working space.
=> go to File then Add Folder To Workspace
You can add as many as you like.
 Also better more
You can open a new window (ex: ctrl+n)
And then go File > Add Folder To Workspace.
And start adding folders to your new Workspace. You can add any folder, that is already open or not. That's too way great. You can have all the needed folders for example in the second screen.
A little hack I used is to just stretch the editor window to fill both screens and split the view pane between the monitors such that both screens show just one open file.
This is a cheap hack that works without opening multiple instances of VSC.
It may not be the proper solution, but it works without eating up all my system memory.
I found the following way to work on multiple monitors (important: they must be the same size and resolution):
open a visual studio in windowed mode on the 1st monitor (in my case it is a left monitor)
move the window to the (left) top corner
stretch window to the 2nd monitor (right) bottom corner
split screen by clicking “split editor” several times
move the code sections separator to the edge between the monitors
This is old qestion, but such way can be useful for someone. It is not very convenient, but it works. The solution may have already appeared in the VS itself, but I didn't find it.
Visual Studio Code does not allow me to drag a tab outside the window and view it in (for example) another monitor
Actually, VSCode 1.57 (May 2021, 4 years later) will propose something close:
Improved editor drag and drop across windows
Support for dragging editors to other windows was improved in this release. You can now drag diff editors, custom editors and the entire editor group to another window to open the editors there.
My solution was to use Remote-ssh to connect to self and open in another window. This does take extra resources. But I find this comfortable as I don't need to create additional workspace.
For me on Ubuntu the solution was to create a project folder symlink and ope it in a new window (as it won't open the same folder in another window)

Eclipse / PyDev - Remove path from editor tabs when two files with same name are opened

I'm currently using Elipse Luna, and I'm trying to figure out how to remove the path name from the editor tabs when multiple files with the same name but different directories are opened (see screenshot).
So, in other words, keep the file name, but remove the path name inside the parentheses.
I've done this in the past with previous versions of Eclipse, but I can't for the life of me remember how I did it. I just find that path names take up a lot of real estate in my editor and it doesn't take long before tabs are hidden away.
You're correct that this is a Pydev setting.
Go to Preferences -> PyDev -> Editor caption/icon
and change Django modules handling: to
"Show as a regular module"

How to change the eclipse window colour based on the workspace?

If I'm working on live branch as well as development branch at almost same time,
naturally the code in both the branches is similar,
my two eclipse instances are open at the same time,
I keep swapping between them and tend to commit mistake by adding code in the wrong workspace.
To distinguish between the two instances of eclipse if I could have different themes (colours), it could have been good fool proofing measure.
I would like different theme for the eclipse window than the code font or file background.
I use same eclipse (Helios) .exe for different workspaces.
Any simpler advice could also be helpful.
Thanks in advance.
You can also add a name for each workspace. Open Preferences>General>Workspace and enter a Workspace name. It will be shown at the beginning of the title in the shell and the task bar.
That's how I differentiate my 4.2 and 3.8 workspaces, since I often need them both open to compare behaviour.
You may right mouse click in the background of one of your files > Preferences > Text Editor and change background color.

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

how to change text "Eclipse" to some other text say "AshuEclipse" in the Header left hand corner?

How to change text "Eclipse" to some other text say "AshuEclipse" in the Header left hand corner?
Note: I dont want ot change the header to show workspace ,but I want to change the word Eclipse itself.
Plz suggest.
One solution an one workaround:
Solution (in theory, not tested)
The main Eclipse Windows is a WorkbenchWindow for the org.eclipse.ui plugin. It is created by the platform plugin.
If you look into the resources files within the org.eclipse.platform, you could see some files able to keep this value (for you to change it)
I have found:
eclipse-3.5.1\eclipse\plugins\org.eclipse.platform_3.3.201.v200909170800\about.properties
It contains:
blurb=Eclipse Platform\n\
eclipse-3.5.1\eclipse\plugins\org.eclipse.platform_3.3.201.v200909170800\plugin.properties
With:
pluginName=Eclipse Platform
providerName=Eclipse.org
productName=Eclipse Platform
productBlurb=Eclipse Platform\n\
Try and modify those values to see if the display can change. (I would bet on plugin.properties productBlurb)
Just tested: it does not change the display, so you need to explore some of the jars in the plugins directory of eclipse. In theory, you could change one of its resource file...
Workaround (if the previous section does not work)
My eclipse3.5 actually displays the name of the current perspective.
For instance; the Php perspective would be displayed in the header left hand corner:
alt text http://blog.wampserver.com/wp-content/uploads/2009/08/eclipse_perspective_debug.gif
So one solution would be to save your favorite perspective as "Ashu - Php Debug", and you would get what you want.
(see "create your own perspective" article)
alt text http://www.javalobby.org/images/postings/rj/eclipse_perspective/1.gif
That would need to be redefined for every perspective you are usually using.
And it would still have "Eclipse" at the end...
Preferences > General > Workspace > Workspace name
Right click on eclipse shortcut and go to properties.
Change target url text.
-> C:\your eclipe folder\eclipse.exe -showlocation <em>YOURTITLE</em>