| Summary: | ImageProvider needs to support a listener mechanism | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Greg Amerson <gregory.amerson> | ||||||
| Component: | Sapphire | Assignee: | Konstantin Komissarchik <konstantin> | ||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | CC: | konstantin, ling.hao | ||||||
| Version: | unspecified | Keywords: | plan | ||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Greg Amerson
Enhancement implemented. Details in the migration guide and the what's new document. Thanks Konstantin, for putting in this change, a very nice feature. However, when I updated to the latest build it seems that none of the images in actions that were declared in sapphire-extension.xml in the UI plugin where showing up. Images declared on modelElements via @Image(path="...") are working fine, it seemed to just be global action images defined in extension file. I'll try to fix it locally and attach a patch Created attachment 193953 [details]
Patch to fix action extension images after build #290
I've attached a patch to the SapphireActionSystemPart.java file that works again HEAD(20110423) and it seems to fix the problem.
Comment on attachment 193953 [details] Patch to fix action extension images after build #290 >### Eclipse Workspace Patch 1.0 >#P org.eclipse.sapphire.ui >Index: src/org/eclipse/sapphire/ui/SapphireActionSystemPart.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.sapphire/plugins/org.eclipse.sapphire.ui/src/org/eclipse/sapphire/ui/SapphireActionSystemPart.java,v >retrieving revision 1.5 >diff -u -r1.5 SapphireActionSystemPart.java >--- src/org/eclipse/sapphire/ui/SapphireActionSystemPart.java 20 Apr 2011 05:40:24 -0000 1.5 >+++ src/org/eclipse/sapphire/ui/SapphireActionSystemPart.java 23 Apr 2011 11:33:23 -0000 >@@ -16,6 +16,7 @@ > import java.util.concurrent.CopyOnWriteArrayList; > > import org.eclipse.jface.resource.ImageDescriptor; >+import org.eclipse.sapphire.modeling.ImageData; > import org.eclipse.sapphire.modeling.el.FailSafeFunction; > import org.eclipse.sapphire.modeling.el.Function; > import org.eclipse.sapphire.modeling.el.FunctionContext; >@@ -80,13 +81,17 @@ > > for( ISapphireActionImage image : def.getImages() ) > { >- final Function imageFunction = FailSafeFunction.create( image.getImage().getContent(), Literal.create( ImageDescriptor.class ) ); >+ final Function imageFunction = FailSafeFunction.create( image.getImage().getContent(), Literal.create( ImageData.class ) ); > final FunctionResult imageFunctionResult = imageFunction.evaluate( this.functionContext ); >- final ImageDescriptor img = (ImageDescriptor) imageFunctionResult.value(); >+ final ImageData data = (ImageData) imageFunctionResult.value(); > >- if( img != null ) >+ if( data != null ) > { >- this.images.add( img ); >+ final ImageDescriptor img = ImageDescriptor.createFromImageData(new org.eclipse.swt.graphics.ImageData(data.contents())); >+ if (img != null) >+ { >+ this.images.add( img ); >+ } > } > > imageFunctionResult.dispose(); Created attachment 193954 [details]
Fix for regression in SapphireActionSystemPart
Silly bugzilla, i meant to upload an updated patch.
Since for me the fix for this bug knocked out images loading properly from sapphire-extension.xml, I'm going to re-open this bug. I hope that is OK. Not sure how I managed to miss that problem. Thanks for fixing. I have released your patch with a small tweak to re-use an existing ImageData to ImageDescriptor conversion function and addition of the required contribution header. Verify with calendar sample. |