[jbossseam-issues] [JBoss JIRA] Commented: (JBSEAM-3508) Generic Transform for s:graphicImage

Pete Muir (JIRA) jira-events at lists.jboss.org
Sun Oct 5 12:09:20 EDT 2008


    [ https://jira.jboss.org/jira/browse/JBSEAM-3508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12432529#action_12432529 ] 

Pete Muir commented on JBSEAM-3508:
-----------------------------------

Other option is to register transforms as Seam components in components.xml or through annotations, and then reference the component name. Then you can just to a call to Component.getInstance()

> Generic Transform for s:graphicImage
> ------------------------------------
>
>                 Key: JBSEAM-3508
>                 URL: https://jira.jboss.org/jira/browse/JBSEAM-3508
>             Project: Seam
>          Issue Type: Feature Request
>          Components: JSF Controls
>    Affects Versions: 2.0.3.CR1, 2.1.0.CR1
>            Reporter: Daniel Roth
>            Assignee: Daniel Roth
>            Priority: Minor
>
> Image transforms for s:graphicImage is a really neat feature. However, there are quite a few reqests for features and additions and I think it will really hard to satisfy all at the same time. Therefore it would be great if one could define one's own image transformer. The tag would essentially delegate the transformation to a defined class:
> public abstract class UITransformImageGeneric extends UIComponentBase implements ImageTransform
> {
>    public void applyTransform(Image image) throws IOException
>    {
>       ImageTransform transform = null;
>       Class transformClass = null;
>       try
>       {
>          transformClass = Class.forName(getImplementation());
>          transform = (ImageTransform) transformClass.newInstance();
>       }
>       catch (Exception e)
>       {
>          throw new IllegalArgumentException("Cannot instanciate class: " + getImplementation(), e);
>       }
>       transform.applyTransform(image);
>    }
>    public abstract String getImplementation();
>    public abstract void setImplementation(String implementation);
> }
> To be able to pass paramaters one could use the f:param tag:
> <s:graphicImage ...>
>    <s:genericTransformImage implementation="org.foo.bar.MyTransform">
>      <f:param name="myParam" value="#{myBean.someValue}"/>
>   </s:genericTransformImage>
> </s:graphicImage>
> What would then be the easiest way to pass those values to the delegate?
> 1) By reflection on the delegate? 
> 2) Resolve the values and put them in a <String,Object> map and pass along with the applyTransform?
> 3) Other suggestions?

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the seam-issues mailing list