myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeanne Waldman <jeanne.wald...@oracle.com>
Subject [Trinidad] skinning keys for 'icons'
Date Wed, 21 Jul 2010 01:52:01 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I started working on some skinning tasks regarding Icon Objects. <br>
<a class="moz-txt-link-freetext" href="https://issues.apache.org/jira/browse/TRINIDAD-636">https://issues.apache.org/jira/browse/TRINIDAD-636</a>
and
<a class="moz-txt-link-freetext" href="https://issues.apache.org/jira/browse/TRINIDAD-17">https://issues.apache.org/jira/browse/TRINIDAD-17</a><br>
One is to have -tr-rule-ref work for icons. The other is to be able to
inherit properties from a base skin for icons.<br>
<br>
While looking at these issues, I found that some of our skinning keys
end in "-icon" when they should have ended in "-icon-style". The reason
is the parser code looks at -icon and says it is an Icon Object, and it
creates an Icon Object. If the 'content' property is not there, it also
creates a StyleNode. StyleNodes get transformed and written to the
generated CSS file. Icon Objects do not.<br>
<br>
What should have happened is that anything that ended with -icon was an
Icon Object, and if there was no 'content' we output a warning, but do
not create a StyleNode.<br>
<br>
This way people wouldn't have been able to create selectors with names
that ended in '-icon' and really weren't icons.<br>
<br>
This makes it harder to solve those JIRA issues.<br>
<br>
The point of this email is twofold. <br>
<br>
<b>One</b>:<i> remember, icons end in '-icon' or 'Icon:alias' whereas
styles that you want generated in the CSS should not - they should say
'-icon-style' or 'IconStyle:alias'.</i><br>
<br>
<b>Two</b>: <i>For backward compatibility, I don't think I can change
the selectors with wrong names because they are public. What do people
think?</i><br>
<br>
They are:<br>
<br>
af|panelPopup::close-icon<br>
and<br>
af|dialog::close-icon<br>
<br>
The new casablanca skin creates its own selectors, and it uses Icon,
when it meant IconStyle. These are not documented anywhere, but I
suppose someone could have created a skin from them either way. They
are:<br>
<br>
<code>/* Dialog window component
------------------------------------------------------------------------------------------
*/<br>
<br>
.CBDialogHeadCloseIcon {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBDialogHeadCloseIcon:alias");<br>
}<br>
.CBDialogHeadCloseIconHover {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBDialogHeadCloseIconHover:alias");<br>
}<br>
<br>
af|dialog::close-icon {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBDialogHeadCloseIcon");<br>
}<br>
<br>
--<br>
/* Table icons */<br>
<b>/* We don't use ":alias" sufix because didn't work, probably its a
bug */</b><br>
.CBTableSelectAllIcon{<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLook:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconSelectAll:alias");<br>
}<br>
.CBTableSelectAllIconHover {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLookHover:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconSelectAll:alias");<br>
}<br>
.CBTableSelectNoneIcon {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLook:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconSelectNone:alias");<br>
}<br>
.CBTableSelectNoneIconHover {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLookHover:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconSelectNone:alias");<br>
}<br>
.CBTableSelectExpandAllIcon {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLook:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconExpandAll:alias");<br>
}<br>
.CBTableSelectExpandAllIconHover {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLookHover:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconExpandAll:alias");<br>
}<br>
.CBTableSelectCollapseAllIcon {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLook:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconCollapseAll:alias");<br>
}<br>
.CBTableSelectCollapseAllIconHover {<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconLookHover:alias");<br>
&nbsp;&nbsp;&nbsp; -tr-rule-ref: selector(".CBIconCollapseAll:alias");<br>
}</code><br>
<br>
--<br>
The person that created these keys thought it was a bug that :alias
didn't work, when really it is a bug that ending the selector name with
'Icon' did work! :)<br>
<br>
I'm wondering if anyone has thoughts on this.<br>
<br>
I'm thinking I can add a warning if I know a selector ends in Icon but
doesn't have 'content'.<br>
<br>
When I implement -tr-rule-ref, the only thing I can think of is to
resolve all the includes to see if anywhere there is a 'content', and
if so, create an Icon, if not create a StyleNode, but this will make it
more complicated.<br>
<br>
If I had to do all this over again, I'd make an @rule for icons or have
them be in a separate file, rather than relying on a naming convention
which obviously did not work. In fact, I wonder if I can create an
@icon rule now. Hmmm.<br>
<br>
- Jeanne<br>
</body>
</html>

Mime
View raw message