[ 
https://issues.apache.org/jira/browse/TRINIDAD-755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12534235
 ] 

Stephen Friedrich commented on TRINIDAD-755:
--------------------------------------------

When I started I hoped for just a few tweaks in the code, but in the end the 
changes were larger than that:
* First, if the position of the required icon is skinnable, then the position 
of the message icon should sure be skinnable, too. Yet, now one must care for 
the relative ordering in between both icons, too. I solved that by specify the 
position as an integer index relative to the text position, so -2 for message 
icon and -1 for required icon is the default, -1 for message and +1 for 
required would show the message icon in front of and the required icon after 
the text.
* There is so much code just to determine whether an icon is shown at all. I 
need to check that first, to figure out if a   is needed in front of 
and/or behind the label's text. Most of that code would be needed again if the 
icon is finally really rendered. To avoid that you can of course remember each 
icon's details (message type, alt text, ...). Well, to remember it, it makes 
sense to encapsulate it. 
* If you encapsulate it, you can just as well move icon specific code to the 
encapsulation class, using it as a delegate from within the renderer. Then it 
makes sense to move code that is common for both delegates to a base class.
* Two utility methods that were available from within the renderer at a base 
class were not accessible from the delegates. I made them static, which is 
probably ok, because several other methods of the same kind were already static.

All in all I think the code is more readable now. 

> Positions of "required" and "message" label should be skinnable
> ---------------------------------------------------------------
>
>                 Key: TRINIDAD-755
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-755
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions: 1.0.3-core
>            Reporter: Stephen Friedrich
>         Attachments: positions.patch, skin-selectors.patch
>
>
> Currently Trinidad always shows icon and text of a label in this order: 
> <message-icon> <required-.icon> <text>
> It should be able to specify a different order in the skin.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to