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

Bug 426783

Summary: Commands group with the default command
Product: [ECD] Orion Reporter: Szymon Brandys <Szymon.Brandys>
Component: ClientAssignee: Malgorzata Janczarska <malgorzata.tomczyk>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ken_walker
Version: unspecified   
Target Milestone: 5.0 RC1   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Bug Depends on:    
Bug Blocks: 426782    

Description Szymon Brandys CLA 2014-01-28 07:26:27 EST
What we have:
- in action bars we can add commands, ie a button which when is clicked triggers some operation
- or we can add a group of commands, ie when a button is clicked we get dropdown with actions

What we need:
- need to be able to add group of commands, ie a button with 'v'
- when 'v' is clicked we get dropdown with actions
- clicking the button triggers default action

This may be used in various places. Two that I am aware of is Bug 426782 and Push/Fetch actions for Git.
Comment 1 Malgorzata Janczarska CLA 2014-01-30 04:55:57 EST
I added an extra parameter to addCommandGroup function, defaultActionId, this made the function signature like this:
addCommandGroup: function(scopeId, groupId, position, title, parentPath, emptyGroupMessage, imageClass, tooltip, selectionClass, defaultActionId)

defaultActionId is a String or boolean. It contains an id of an action from this group that should be invoked when the group is selected. This will add an arrow to the grup that will open the dropdown. Optionally this can be set to *true* instead of adding a particular action. If set to *true* the group will be rendered as if there was a default action, but instead of invoking the default action it will open the dropdown. This option will be ignored if the group is rendered as a subgroup, so top level groups only.