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

Bug 342775

Summary: Support EL in IMasterDetailsTreeNodeDef.ImagePath
Product: z_Archived Reporter: Greg Amerson <gregory.amerson>
Component: SapphireAssignee: Konstantin Komissarchik <konstantin>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: konstantin
Version: unspecifiedKeywords: plan
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Greg Amerson CLA 2011-04-13 18:17:13 EDT
It would be nice if there were a way to specify a Image path for a default case for a list of objects by using EL.  The idea is that for a list of objects where there may be some special condition where the image should change, like imagine you have a list of columns in a Entity element and one of those columns is the Primary key.  It would be nice to use EL to change the image path for some elements that have a particular boolean property.  ${isPrimary() ? "icons/column_primary.gif" : "icons/column.gif"}
Comment 1 Konstantin Komissarchik CLA 2011-04-20 01:46:30 EDT
Enhancement implemented. You can now use expressions pretty much any place where image specification is done in sdef. 

Added a few examples of this in the gallery and architecture samples. Added a blurb to the 0.3 what's new document.

Here is a sample expression:

<image>${ Dependencies.Size == 0 ? "images/component-leaf.png" : "images/component.png" }</image>

The most common usage is expected to be as above with image specified with a string literal path within an expression, but you can also now define custom functions via Sapphire extension system that directly return ImageDescriptor objects.
Comment 2 Greg Amerson CLA 2011-04-20 09:11:07 EDT
Just verified after installing latest hudson build.  What is nice is this also works dynamically when properies changes (very nice!).  So for me this satifies bug342777 for me since I am going to use the EL instead of an ImageProvider but I understand if you want to leave that bug open for future enhancement.
Comment 3 Konstantin Komissarchik CLA 2011-04-20 12:15:24 EDT
Closing as verified based on Comment #2.