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

Bug 266839

Summary: [GlobalActions] Provide more API for commandIDs
Product: [Eclipse Project] Platform Reporter: Markus Keller <markus.kell.r>
Component: UIAssignee: Paul Webster <pwebster>
Status: VERIFIED FIXED QA Contact: Paul Webster <pwebster>
Severity: normal    
Priority: P3 CC: daniel_megert, hoffmann
Version: 3.5   
Target Milestone: 3.5 M6   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 54581    
Bug Blocks:    
Attachments:
Description Flags
Command IDs and action factory v01
none
Command IDs and action factory v02
none
Command IDs and IDE action factory v03
none
Command IDs and action factory v04 none

Description Markus Keller CLA 2009-03-03 07:18:33 EST
+++ This bug was initially created as a clone of Bug #54581 +++

The interface IWorkbenchCommandConstants is not enough. The link between the actions from the ActionFactory and the commandID is still not specified anywhere. Best would be if the ActionFactory got an additional method

    String getCommandId();

which returns the commandID used in the generated actions (or null if none). Otherwise, the commandID should at least be added to the Javadocs of the ActionFactory constants.

You should replace the command IDs used in ActionFactory by references to the new API constants. Then you see that some of the command IDs are still missing, e.g.
org.eclipse.ui.window.showViewMenu.

From the constants we declare in org.eclipse.jdt.internal.ui.actions.IWorkbenchCommandIds, only LINK_WITH_EDITOR and REFRESH became API - the rest is still missing.

I don't quite understand where org.eclipse.ui.navigate.showIn is used. org.eclipse.ui.navigate.showInQuickMenu is the one for which a key binding is defined.
Comment 1 Paul Webster CLA 2009-03-03 12:20:37 EST
Also look at

----
thanks for adopting the constants to the API. In your latest commit you removed
some of the global command ids again -- which would have been be useful to
register local handlers for view specific implementations, some examples:

* org.eclipse.ui.edit.findReplace

  E.g. custom local finders, to search an entry in a long table or an element
in
  a graphical editor.

* org.eclipse.ui.navigate.goInto
* org.eclipse.ui.navigate.up
----

org.eclipse.ui.fieldassist.ContentAssistCommandAdapter.CONTENT_PROPOSAL_COMMAND
Comment 2 Paul Webster CLA 2009-03-09 10:55:30 EDT
Created attachment 128037 [details]
Command IDs and action factory v01

I've added back Marc's requested IDs, and introduced a getCommandId() to ActionFactory (can return null).  I've started converting ActionFactory actions to return their command id.

PW
Comment 3 Paul Webster CLA 2009-03-09 11:06:29 EDT
(In reply to comment #2)
> Created an attachment (id=128037) [details]
> Command IDs and action factory v01
> 

Released for I20090309-1300
PW
Comment 4 Paul Webster CLA 2009-03-09 12:35:13 EDT
Created attachment 128052 [details]
Command IDs and action factory v02

Provide command ids for the most common action factory actions.

PW
Comment 5 Paul Webster CLA 2009-03-09 12:37:01 EDT
(In reply to comment #4)
> Created an attachment (id=128052) [details]
> Command IDs and action factory v02

Released for the next I build (probably I20090309-1800)
PW
Comment 6 Paul Webster CLA 2009-03-09 12:53:57 EDT
Created attachment 128054 [details]
Command IDs and IDE action factory v03

I've added the project constants from IWorkbenchCommandIds.

I wasn't going to add the showViewMenu,showSystemMenu constants at this time, although I don't have any strong feelings about it.

PW
Comment 7 Paul Webster CLA 2009-03-09 12:55:01 EDT
(In reply to comment #6)
> Created an attachment (id=128054) [details]
> Command IDs and IDE action factory v03

Released for I20090309-1800
PW
Comment 8 Markus Keller CLA 2009-03-09 13:49:56 EDT
(In reply to comment #0)
> From the constants we declare in
> org.eclipse.jdt.internal.ui.actions.IWorkbenchCommandIds, only LINK_WITH_EDITOR
> and REFRESH became API - the rest is still missing.

Still absent are
- org.eclipse.ui.window.showViewMenu
- org.eclipse.ui.navigate.showInQuickMenu

P.S.: The IWorkbenchCommandConstants.PROJECT_* in HEAD are the only ones without
     * (value is <code>"org.eclipse.ui.project.*"</code>).
Comment 9 Paul Webster CLA 2009-03-09 13:56:58 EDT
(In reply to comment #8)
> Still absent are
> - org.eclipse.ui.window.showViewMenu
> - org.eclipse.ui.navigate.showInQuickMenu

I wasn't going to provide these 2.  I'll add them now.

> P.S.: The IWorkbenchCommandConstants.PROJECT_* in HEAD are the only ones
> without
>      * (value is <code>"org.eclipse.ui.project.*"</code>).

I removed those deliberately (I thought we weren't adding them to the javadoc any more).  I checked with Boris and he said that we were inconsistent (no policy) with new constants (obviously nothing wrong with adding them, since they can't change anyway).

PW
Comment 10 Paul Webster CLA 2009-03-09 14:09:48 EDT
Created attachment 128075 [details]
Command IDs and action factory v04

- Added the last 2 JDT interface constants
- added value statements to the PROJECT_* javadoc

PW
Comment 11 Paul Webster CLA 2009-03-09 14:10:47 EDT
(In reply to comment #10)
> Created an attachment (id=128075) [details]
> Command IDs and action factory v04

Released for I20090309-1800
PW
Comment 12 Paul Webster CLA 2009-03-10 09:45:58 EDT
For I20090310-0100
PW
Comment 13 Paul Webster CLA 2009-03-10 09:46:12 EDT
In I20090310-0100
PW