Bug 221172 - [Commands] [ViewMgmt] Window > Show View doesn't open existing instances of multi-instance views
Summary: [Commands] [ViewMgmt] Window > Show View doesn't open existing instances of m...
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard: candidate43
Keywords:
Depends on:
Blocks: 384835
  Show dependency tree
 
Reported: 2008-03-03 11:34 EST by Stefan Xenos CLA
Modified: 2014-11-27 07:43 EST (History)
6 users (show)

See Also:


Attachments
show views with secondary IDs v01 (11.00 KB, patch)
2010-01-20 13:55 EST, Paul Webster CLA
no flags Details | Diff
Patch v02 (23.08 KB, patch)
2010-12-01 05:05 EST, Prakash Rangaraj CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Xenos CLA 2008-03-03 11:34:49 EST
To reproduce:

1. Create and instantiate a multi-instance view with a non-empty secondary ID.
2. Activate another view.
3. Use Ctrl+3 and type in the name of your multi-instance view.

Observed:
- A new instance of the multi-instance view opens. (Presumably an instance with a null secondary ID).

Expected:
- An existing instance of the view is activated.
Comment 1 Stefan Xenos CLA 2008-03-03 11:43:04 EST
Window -> Show View has the same problem
Comment 2 Stefan Xenos CLA 2008-03-03 11:45:33 EST
You can reproduce this with the console view.
Comment 3 Boris Bokowski CLA 2008-03-03 11:46:02 EST
This is not specific to Ctrl+3: Window>Show View exhibits the same behaviour.
Comment 4 Kim Horne CLA 2008-03-05 07:58:57 EST
Sounds like the org.eclipse.ui.views.showView command needs another parameter for the secondary ID.
Comment 5 Kim Horne CLA 2008-03-05 07:59:14 EST
(to start with)
Comment 6 Kim Horne CLA 2008-03-05 08:02:54 EST
Actually (good thing these comments are free) I dont know if this would even be possible.  You can't have a parameter keyed on the value of another parameter can you?  IParameterValues doesn't accept an arguement or initializer of any kind...
Comment 7 Paul Webster CLA 2008-03-05 09:13:17 EST
I can add the secondary id to showView command, and if you bind it in a plugin.xml or programmatically it would work fine.  But the keybinding preference page doesn't have anything like the CommandComposer in UA, which allows users to just fill in parameters (much more like an multi-field editor), it generates combinations based on the IParamterValues.

A possible enhancement (I think we already have a bug open about it) would be to have the keybinding preference page show existing bindings and "parameterized markers" that could somehow open something to fill in required and any optional parameters that a command could take.

That being said, I can add the secondary ID parameter for use, but massive modifications to the keys preference page is not on my plan for 3.4.

PW
Comment 8 Stefan Xenos CLA 2008-07-29 12:40:45 EDT
> A possible enhancement (I think we already have a bug open about it) would 
> be to have the keybinding preference page show existing bindings 
> and "parameterized markers" that could somehow open something to fill 
> in required and any optional parameters that a command could take.

YES! I think I suggested that when the whole parameterized command thing was first written. That would simplify the code and give us a prettier UI. It would also fix the explosion of unbound command IDs that are cluttering the keybindings page. That is, there would only be ONE command ID for show view that opens a "choose a view" dialog when you bind to it rather than having 100s of "show view x" commands.

It would also permit a wider variety of commands - for example, we could have commands that run a user script or that execute a sequence of mouse gestures - stuff that can't be easily enumerated.

It would also speed up the extension point, since it would no longer be necessary to enumerate all possible command arguments when gathering the list of command IDs.

For an example of how it might work, check out the extension points for the JDT classpath containers. They use this pattern and it works quite nicely. That is, the data stored in a classpath container is just an arbitrary string. They have one extension point that interprets that string and performs behaviors based on it, and another extension point that provides a UI for editing the string. The string itself could be XML or some arbitrary persistence format known only to the implementor of the two extensions.

If you don't have a bug report for it yet, it would be awesome to track this somewhere. 
Comment 9 Boris Bokowski CLA 2009-11-11 17:32:07 EST
Remy is now responsible for watching the [ViewMgmt] category.
Comment 10 Paul Webster CLA 2010-01-20 13:55:47 EST
Created attachment 156692 [details]
show views with secondary IDs v01

This updates the showView command to take a secondary ID, and the Window>Show View menu to display open views with secondary IDs as well as the shortcuts.

No update to quick access, though a similar pattern could be applied there.

PW
Comment 11 Prakash Rangaraj CLA 2010-12-01 05:05:41 EST
Created attachment 184232 [details]
Patch v02

Patch v01 + support for Quick Access
Comment 12 Prakash Rangaraj CLA 2010-12-15 02:13:03 EST
Patch v02 released to HEAD
Comment 13 Prakash Rangaraj CLA 2011-01-25 04:00:20 EST
Verified in I20110124-1800
Comment 14 Dani Megert CLA 2011-10-06 06:31:33 EDT
Reopening as the ui.workbench part did not make it into the 4.x stream.
Comment 15 Eric Moffatt CLA 2011-12-09 13:09:49 EST
Aggregate move to M5. Retarget to a different milestone if you wish...
Comment 17 Daniel Rolka CLA 2014-11-27 07:43:12 EST
The patch has been already ported to the 4.x version. However got adjusted to the E4 architecture

Daniel