Bug 293447 - [Commands] Parameter as a part of command's name in the Quick Access
Summary: [Commands] Parameter as a part of command's name in the Quick Access
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.5   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 293453
  Show dependency tree
 
Reported: 2009-10-27 10:35 EDT by Mykola Nikishov CLA
Modified: 2019-09-06 16:12 EDT (History)
2 users (show)

See Also:


Attachments
Proposed implementation (3.03 KB, patch)
2009-10-27 10:42 EDT, Mykola Nikishov CLA
no flags Details | Diff
Missing NON-NLS tag was added (3.04 KB, patch)
2009-11-16 12:41 EST, Mykola Nikishov CLA
no flags Details | Diff
J2SE-1.3-compatible implementation (3.08 KB, patch)
2009-12-27 10:15 EST, Mykola Nikishov CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mykola Nikishov CLA 2009-10-27 10:35:26 EDT
User has a parameterized command with two parameters. Now this command will be displayed in the Quick Access dialog as:

---------------
	Run (Runner: CoolRunner; Project: ABC)
	Run (Runner: MyRunner; Project: XYZ)
---------------

It seems to me this would be clearer in some cases:

---------------
	Run with CoolRunner (Project: ABC)
	Run with MyRunner (Project: XYZ)
---------------

So, a requested feature is to be able to use parameter(s) as a part of command's name. User will declare command's name i.e. in plugin.properties as:
	Some_Command_name = Run with {0}

- '{0}' in command's name will be replaced with a value for a parameter with index 0;
- parameter with index 0 would not appear in the list of parameters.
Comment 1 Mykola Nikishov CLA 2009-10-27 10:42:01 EDT
Created attachment 150632 [details]
Proposed implementation

This patch is against 3.5.0.I20090429-1800. Source code was imported using Plug-ins context menu 'Import as' - 'Source project'.
Comment 2 Mykola Nikishov CLA 2009-11-16 12:41:52 EST
Created attachment 152320 [details]
Missing NON-NLS tag was added
Comment 3 Tomasz Zarna CLA 2009-12-22 05:33:52 EST
Mykola I applied both patches you prepared (for this bug and for bug 293453) and I noticed that when changing ParametrizedCommand.java you added invalid references to system libs. o.e.core.commands is supposed to run on J2SE-1.3 (see MANIFEST.MF) but you're using classes added in 1.4. This is very similar to what happened to o.e.ui.workbench in bug 298153. I'm afraid you'll need to update the patch.
Comment 4 Mykola Nikishov CLA 2009-12-22 05:44:12 EST
Thank you for pointing this out, Tomasz. I'll take a look at this.
Comment 5 Mykola Nikishov CLA 2009-12-27 10:15:54 EST
Created attachment 155065 [details]
J2SE-1.3-compatible implementation
Comment 6 Paul Webster CLA 2010-01-20 13:16:45 EST
I'll have to look at this in M6
PW
Comment 7 Paul Webster CLA 2010-02-16 10:21:56 EST
(In reply to comment #5)
> Created an attachment (id=155065) [details]
> J2SE-1.3-compatible implementation

I can't apply this patch (it's not a project or workspace patch, simply a git patch with 'a' and 'b' at the top).

Please see http://wiki.eclipse.org/Platform_UI/How_to_Contribute

PW
Comment 8 Tomasz Zarna CLA 2010-02-17 06:26:36 EST
Paul, the patch will apply fine if you select 'o.e.core.commands' project on the Target Resource page of the Apply Patch wizard and when previewing the patch you set 'Ignore leading path name segments' to 1.
Comment 9 Paul Webster CLA 2010-02-17 10:47:50 EST
(In reply to comment #5)
> Created an attachment (id=155065) [details]
> J2SE-1.3-compatible implementation

Patch applied fine following Tomasz instructions.  Some comments that would need to be addressed:

1) it won't handle the case where there are 2 parameters and you want the second one as part of the name (it appends the ", ")
Run with CoolRunner (Project: ABC, )

2) what guarantees the order of the parameters?  For example, a could a change in the configuration swap the order in the parameterizations array? (My guess is it's usually stable, but we don't guarantee the order)

3) it won't handler the showView case, with an optional parameter (my first one doesn't have the optional parameter).

Show View
Show the Error View

4) an extension of 1 and 3.  A command with multiple optional parameters  (say 3 optional parameters) wouldn't work, because {0} and {1} could be any combination of the 3.

Updating and changing the algorithm to something more along the lines of ${parameter.id} and then not including that parameter.id later on would address #1, #2, and #4.  That still leaves #3 as a problem that would need to be addressed before this would be accepted.

I would also need to see a couple of the parameterized commands in the SDK switched to use this (we can't monitor if it works unless we're using it ourselves).

A different approach:
If this is about making it easy to find the command you want in Quick Access, perhaps the typing filter could be updated to work more like the one in Open Type (where the fragments that a user types produce appropriate choices).

PW
Comment 10 Eclipse Webmaster CLA 2019-09-06 16:12:46 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.