Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332695 - Sapphire action-link lacks ability to use a specific action handler
Summary: Sapphire action-link lacks ability to use a specific action handler
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Konstantin Komissarchik CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-15 17:49 EST by Konstantin Komissarchik CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin Komissarchik CLA 2010-12-15 17:49:55 EST
As part of the re-work of actions API for 0.2, the nested actions were re-formulated as multiple action handlers attached to the same action. Unfortunately, the API of action-link UI part was not accordingly updated to allow a specific action handler to be specified. This usecase comes up frequently when presenting a heterogeneous list in the content outline. 

The common practice is to add action links like "Add a foo", "Add a bar", etc. where "IFoo" and "IBar" are element types possible for the list.

In 0.1, these action links could be defined like so:

<action-link>
  <action-id>node:add:IFoo</action-id>
  <label>Add a foo</label>
</action-link>
<action-link>
  <action-id>node:add:IBar</action-id>
  <label>Add a bar</label>
</action-link>

In 0.2, the id of the add action is "Sapphire.Add" instead of "node:add", but "Sapphire.Add.IFoo" is the id of an action handler, not an action. The current behavior of the action link part when multiple handlers are present is to invoke the first one. We need to add an optional action-handler-id element to action link definition, such that the above could be expressed as follows...

<action-link>
  <action-id>Sapphire.Add</action-id>
  <action-handler-id>Sapphire.Add.IFoo</action-handler-id>
  <label>Add a foo</label>
</action-link>
<action-link>
  <action-id>Sapphire.Add</action-id>
  <action-handler-id>Sapphire.Add.IBar</action-handler-id>
  <label>Add a bar</label>
</action-link>
Comment 1 Konstantin Komissarchik CLA 2010-12-15 19:41:17 EST
Fixed. Added this scenario to the gallery sample.
Comment 2 Ling Hao CLA 2011-01-05 17:50:37 EST
Verified with gallery-sample heterogeneous list.