Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 284447

Summary: [Workbench] Add custom workspace name in front of the Workbench window title
Product: [Eclipse Project] Platform Reporter: Michael Giroux <michael_giroux>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: enhancement    
Priority: P3 CC: bokowski, greg, mober.at+eclipse, mschorn.eclipse, remy.suen, starwarsfan, wbprio
Version: 3.5   
Target Milestone: 3.6 M6   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch
none
Implements a workspace preference for a workspace name pwebster: iplog+

Description Michael Giroux CLA 2009-07-23 11:33:46 EDT
When multiple instances of eclipse are running, the value of the -showlocation option could be used to identify the icons in the task bar.  Unfortunately, the value is displayed at the end of the title and does not appear in the taskbar icon.

It would be nice to move the value specified by -showlocation to the front of the windows title to help identify multiple instances in the task bar.

Perhaps an option in preferences to allow users to specify where it would appear if there is a concern about regressions, and/or compatability.
Comment 1 Michael Giroux CLA 2009-07-24 08:59:32 EDT
This feature is probably only useful when the user has supplied the optional value for -showlocation.  ex. -showlocation Trunk

The default is to include the location of the workspace which generally would not be completely visible in the icon title either.
Comment 2 Martin Oberhuber CLA 2009-09-24 12:30:01 EDT
+1 for exactly this request.

This may seem minor and irrelevant at first sight, but when people switch between multiple workspaces / views / branches frequently, having a workspace ID first in the title bar would be extremely helpful and a big usability improvement.

Workaround: If there is a major perspective in which you perform most of your work, then in each workspace do a "Save As" of exactly that Perspective under a name that is unique for your workspace. For instance:
  JDT --> Save as: Yoyodyne-1.0.1
  JDT --> Save as: Yoyodyne-1.x

This works nicely since by default, the perspective name appears first in the title bar.
Comment 3 Martin Oberhuber CLA 2009-09-24 12:56:18 EDT
BTW, in case anybody wants to contribute something.. the default implementation
of this is in IDEWorkbenchWindowAdvisor#computeTitle() and it works by hooking
several listeners (PageListener, PerspectiveListener, PartListener) to call its
private updateTitle() method.

It would be really nice if products had an easy way to configure this... even
making computeTitle() protected would help for those who dare extending non-API
IDEWorkbenchAdvisor.
Comment 4 Martin Oberhuber CLA 2009-09-24 13:37:16 EDT
Created attachment 148038 [details]
Patch

Attached patch is my "poor man's" approach making the enhancement...

A user's "-showlocation" setting is always prepended, whereas an absolute file system path (supposedly inherited from -data rather than -showlocation) remains appended.

My patch also contains an only loosely related change in IDEWorkbenchAdvisor which suppressed manual -showlocation string in case there was a dash in it. I really couldn't see why a dash in the user-specified name could be problematic... I think that if user explicitly specifies a name in -showlocation it should be used.

Background of this additional change is that we'd like to use clearcase view tags as workspace name, and these often contain a dash for us.
Comment 5 Martin Oberhuber CLA 2009-09-24 13:46:50 EDT
..actually, comparing against Platform.getLocation().toOSString(); may be wiser than new File().isAbsolute()
Comment 6 Markus Schorn CLA 2009-11-24 13:08:40 EST
Hmm, I think the patch does not adress an important use case:
- Use one installation and one way of launching (e.g. one Windwos shortcut)
- Select different workspaces via the eclipse workspace selection dialog.
==> I'd like to see something that identifies the workspace of each running
    instance in the task bar.

Ideally I'd have a workspace preference where I can supply a meaningful name for my workspace, which than is prepended to the current title.
Comment 7 Michael Giroux CLA 2009-11-24 14:06:59 EST
(In reply to comment #6)
> Ideally I'd have a workspace preference where I can supply a meaningful name
> for my workspace, which than is prepended to the current title.

+1 for workspace specific text "prepended" to title.
Comment 8 Markus Schorn CLA 2010-01-29 11:41:45 EST
Created attachment 157641 [details]
Implements a workspace preference for a workspace name

The attached patch adds a preference to the page 'General - Workspace':
   Workspace name (show in the window title): ____________________

The value of this preference, if not empty is prepended to the window title.
The default behavior is unchanged (per default the workspace name is empty)
Comment 9 Paul Webster CLA 2010-01-29 12:20:46 EST
I'll try and look at this in M6
PW
Comment 10 Martin Oberhuber CLA 2010-01-29 12:35:45 EST
Changing the summary, since the proposed new approach is not related to -showlocation. Previous summary was:

[Workbench] Move -showlocation data to beginning of windows title bar
Comment 11 Paul Webster CLA 2010-02-16 13:11:52 EST
Released to HEAD >20100216

Thanx Markus,
PW
Comment 12 Paul Webster CLA 2010-03-09 09:49:41 EST
In I20100309-0100
PW
Comment 13 Paul Webster CLA 2010-03-31 08:40:58 EDT
*** Bug 131566 has been marked as a duplicate of this bug. ***
Comment 14 Martin Oberhuber CLA 2011-07-15 09:09:21 EDT
CQ:WIND00270146 - US1109

While the feature was in Helios already, respective documentation was added in Indigo only: http://help.eclipse.org/indigo/topic/org.eclipse.platform.doc.user/reference/ref-9.htm