Community
Participate
Working Groups
on Eclipse RCP V3.0M7, it is possible to open dynamically multiple instances of a view : showView ( String view Id, String secondary Id, int mode) the text shown in the tab of the view is tne name of the view defined in plugin.xml ( <view name=".." ). When you open several instances of a view, all of the tabs show this text. The problem is that it is not possible to modify programmatically this text. It is possible to see it but not to change it : IViewpart.getViewSite().getRegisteredName() gives the name of the view Is it possible to have the setRegisteredName (String name) function ??
Investigate for M9.
Matt, you're probably interested in this too.
We have added IViewPart2 defining new properties getPartName() and getStatusText(), and specifying property id(s) for notifying about changes to these (currently using PROP_TITLE, but we may change to have separate ids). Stefan to complete the implementation and hook this up to the presentations.
*** Bug 56304 has been marked as a duplicate of this bug. ***
Just to be clear: setPartName will change the tab text in presentations that use tab folders, including the default one.
How about setDescription instead of setStatusText?
The API is in place (check out IWorkbenchPart2), but it's not hooked up to anything yet.
*** Bug 62636 has been marked as a duplicate of this bug. ***
Created attachment 10879 [details] Patch that fixes the remaining issues
Created attachment 10880 [details] Adds a new view to the test suites that excercises the new APIs
AFAIK, these patches should be ready to go... unfortunately, I'm getting test failures in the testObjectStateContentType test. I can't see how this is related to my patch, but I'm CC'ing doug since I think the test is his. It would be nice (although extremely unlikely) if this could make it in for tonight's build.
Are you using a recent integration build and sync'ed with head? Fixes/changes went in recently, so you need >=I200405181622.
The patch is extensive enough that I'd want to go over it with you. I did notice that the spec for WorkbenchPage.setContentDescription still talks in terms of "status text" though.
And IWorkbenchPart2.getContentDescription too.
Some preliminary comments on the patch: WorkbenchPartReference: - Should use Util.safeString in getPartName() and getContentDescription(). ViewFactory: - The getViewState method and callers are ignoring secondaryId (this wasn't being handled properly before either) - it would be better if getViewState took the IViewReference as the arg, and used ViewFactory.getKey for the map key - In saveViewState it casts down to ViewReference. \ I'd just as soon add getPartName() to IWorkbenchPartReference. - Presumably this should be persisted for editors as well.
It would also help to have some documentation, at least in the implementation if not in the spec, on the automatic updating and interplay between partName, title and contentDescription.
Nick, thanks for looking this over at such a late hour. These are all good suggestions. FYI, the title is persisted for editors too (at least, it's supposed to be <g>).
Note: some of the subtleties of the title behavior can only be observed in the R21 presentation.
Fixed in head
IWorkbenchPartReference.getContentDescription() and getPartName() should be marked @since 3.0 The comments for EditorPart.setPartName and setTitle, and for ViewPart.setContentDescription and setTitle should be reviewed. These are protected methods overriding methods declared on WorkbenchPart. Do these methods need/deserve specs at all?
Note: this patch added the following new APIs: IPresentablePart.PROP_PART_NAME IPresentablePart.PROP_CONTENT_DESCRIPTION These were added since the presentation needs to be notified of changes to these properties and it shouldn't be referring directly to the workbench's constant pool. IWorkbenchPartReference.getPartName() IWorkbenchPartReference.getContentDescription() These were added to allow the workbench to access the new properties of IWorkbenchPart2 without downcasting the IWorkbenchPartReference to a WorkbenchPartReference.