You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Jeanne Waldman (JIRA)" <de...@myfaces.apache.org> on 2009/03/06 02:17:56 UTC

[jira] Created: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

allow :alias support to merge in -tr- custom skin properties as well
--------------------------------------------------------------------

                 Key: TRINIDAD-1415
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
             Project: MyFaces Trinidad
          Issue Type: New Feature
          Components: Skinning
    Affects Versions:  1.2.11-core
            Reporter: Jeanne Waldman


.AFSomeAlias:alias {-tr-my-property: red}

af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 

should resolve into:

af|foo {-tr-my-property: red}

so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Updated: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Marius Petoi (JIRA)" <de...@myfaces.apache.org>.
     [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marius Petoi updated TRINIDAD-1415:
-----------------------------------

    Status: Patch Available  (was: Open)

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Commented: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Marius Petoi (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797031#action_12797031 ] 

Marius Petoi commented on TRINIDAD-1415:
----------------------------------------

Hello,

I added a patch to the task that hopefully solves this issue. In SkinStyleSheetParserUtils._createStyleSheetEntry(), when the parsing of each selector is done, for each selector that is an alias (ends in ":alias") I keep the list of selectors that reference that alias (have a "-tr-rule-ref" to that alias). In the end, I add new -tr-properties for all the selectors that reference the alias. The added -tr-property has the same name as the property in the alias and the value the property in the alias. Then in StyleSheetDocument, these properties are resolved, using an algorithm similar to the one for StyleNode-s. The method in FileSystemStyleCache that retrieves all properties is replaced then with a call to the method in StyleSheetDocument that returns all the resolved properties.

Could you please have a look over the patch and see whether it is ok. Thank you!

Marius

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>         Attachments: tr_properties_in_alias.patch
>
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Commented: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Marius Petoi (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12841274#action_12841274 ] 

Marius Petoi commented on TRINIDAD-1415:
----------------------------------------

Hi Jeanne,

What I did here is similar to the way in which aliases are included with "-tr-rule-ref". The styles are resolved in StyleSheetDocument, when they are necessary. I did the same way with the properties in the aliases. They are resolved also in StyleSheetDocument, when all "StyleSheetNode"-s are built. Therefore, for a StyleSheetDocument, the method getResolvedSkinProperties yields all the properties resolved; and afterwards this method is called from FileSystemStyleCache, so that when in a renderer we say getSkin().getProperty("af|foot-tr-my-property"), the value returned will be the resolved value of the property.

What you debugged is the parsing of the CSS file. And the value you got for the property is the correct one, as it is not resolved yet...it will be resolved when the actual property is needed.

Marius

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>         Attachments: 1415Reformatted.patch, tr_properties_in_alias.patch
>
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Commented: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Jeanne Waldman (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12918601#action_12918601 ] 

Jeanne Waldman commented on TRINIDAD-1415:
------------------------------------------

uploaded  patch	saveWorkSkinERs.patch

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>            Assignee: Jeanne Waldman
>         Attachments: 1415Reformatted.patch, 1415WithLatestTrunkDoesNotWork.patch, saveWorkSkinERs.patch, tr_properties_in_alias.patch
>
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Commented: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Jeanne Waldman (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12908235#action_12908235 ] 

Jeanne Waldman commented on TRINIDAD-1415:
------------------------------------------

After merging this into trunk again, I see that this does work for the simplest case, but not for many other test cases.
Now that TRINIDAD-17 is implemented (-tr-rule-ref for icons), I would like to investigate if the skinning properties can be resolved in the same way. Store the skin properties on the Node. When we generate the css file for a particular StyleContext, we should be able to store resolved skin properties for that StyleContext. This is similar to this patch, but we wouldn't do much work in the SkinStyleSheetParserUtils. We'd do more work in StyleSheetDocument.
I will try to get investigate in the next couple of weeks if my schedule allows, since I fixed TRINIDAD-17 recently.

test cases that must work:

test: (simplest test case works in the previous patch)
.AFShowLastItem:alias {-tr-show-last-item: false;}
af|breadCrumbs {-tr-rule-ref: selector(".AFShowLastItem:alias");}

test:
@agent gecko {
.AFShowLastItem:alias {-tr-show-last-item: false;}
}
af|breadCrumbs {-tr-rule-ref: selector(".AFShowLastItem:alias");}

test:
af|someOtherSelector {-tr-show-last-item: false;}
af|breadCrumbs {-tr-rule-ref: selector("af|someOtherSelector");}

test:
.AFFoo:alias {-tr-show-last-item: false;}
.AFBar:alias {color: red; background-color: blue}
.AFCombined:alias {
-tr-rule-ref: selector(".AFFoo:alias");
-tr-rule-ref: selector(".AFBar:alias");
}

af|breadCrumbs {
-tr-rule-ref: selector(".AFCombined:alias");
}

Test multiple skins, so alias is in one skin and its include is in another

Test different locales as well

Test the browser in different languages, since we had an error when the icons were in different languages when there wasn't an icon for that language.

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>            Assignee: Jeanne Waldman
>         Attachments: 1415Reformatted.patch, tr_properties_in_alias.patch
>
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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


[jira] Commented: (TRINIDAD-1415) allow :alias support to merge in -tr- custom skin properties as well

Posted by "Jeanne Waldman (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/TRINIDAD-1415?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12835366#action_12835366 ] 

Jeanne Waldman commented on TRINIDAD-1415:
------------------------------------------

I reformatted your patch because the formatting was all off, and I uploaded it so you can use this.
I added a test case to purple css file 

/* Test that aliases that have skinning properties get resolved */
.AFAliasWithSkinProperty:alias {-tr-some-skin-property: true}
af|someComponent {-tr-rule-ref:selector(".AFAliasWithSkinProperty:alias");}

af|anotherComponent {-tr-rule-ref:selector("af|someComponent");}

I ran it and this does not work.
I stopped at this code in the debugger, and the SkinPropertyNode it was creating had incorrect values.
The key was ok (af|someComponent-tr-some-skin-property), but the value was .AFAliasWithSkinProperty-tr-some-skin-property instead of 'true'.


      // add all alias properties as properties for the referencing
      // selectors.
      List<SkinPropertyNode> addedTrProperties =
        new ArrayList<SkinPropertyNode>();
      for (String alias: aliases.keySet())
      {
        List<String> selectors = aliases.get(alias);
        for (SkinPropertyNode property: trSkinPropertyNodeList)
        {
          String propertyName = property.getKey().toString();
          if (propertyName.startsWith(alias))
          {
            String trProperty = propertyName.substring(alias.length());
            for (String selectorName: selectors)
            {
              addedTrProperties.add(_createSkinPropertyNode(selectorName,
                                                            trProperty,
                                                            propertyName));
            }
          }
        }
        trSkinPropertyNodeList.addAll(addedTrProperties);
      }

> allow :alias support to merge in -tr- custom skin properties as well
> --------------------------------------------------------------------
>
>                 Key: TRINIDAD-1415
>                 URL: https://issues.apache.org/jira/browse/TRINIDAD-1415
>             Project: MyFaces Trinidad
>          Issue Type: New Feature
>          Components: Skinning
>    Affects Versions:  1.2.11-core
>            Reporter: Jeanne Waldman
>         Attachments: tr_properties_in_alias.patch
>
>
> .AFSomeAlias:alias {-tr-my-property: red}
> af|foo {-tr-rule-ref: selector(".AFSomeAlias:alias")} 
> should resolve into:
> af|foo {-tr-my-property: red}
> so from the renderer you can say, getSkin().getProperty("af|foot-tr-my-property") and it would return red.

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