Hi there,

I have some new Skin API proposals I would like to run by everyone. This involves public API changes and some private IMPL changes, and comes up while I (with code reviews by Blake Sullivan) am trying to fix JIRA issue https://issues.apache.org/jira/browse/TRINIDAD-105 "enable registerResourceBundle to any skin". (currently we get severe errors when running custom components against the simple skin because the resource bundle keys do not exist in the simple skin).

Our Skin API already has the method registerStyleSheetName, so I was going to add a registerResourceBundleName method. But I have to admit that these apis really confuse me because we also have a getStyleSheetName API. But that doesn't get the skin-addition stylesheets, that gets the Skin's original stylesheet. I think we need to differentiate these two things better.

The registerStyleSheetName API is meant for skin-additions (In trinidad-skins.xml, custom component developers use skin-additions to add a stylesheet -- and with this JIRA fixed also a resource bundle -- to any skin, most likely the simple skin).

I think that registerStyleSheetName should be something like addSkinAdditionStyleSheetName. And the registerResourceBundleName method I wanted to add would be addSkinAdditionResourceBundle. This would be a big improvement.

But now that we will have two skin-addition properties on the Skin (stylesheetname and resourcebundlename), it seems clearer to add a new SkinAddition object to a Skin instead of having these two skin addition methods. A SkinAddition object can take styleSheetName/resourceBundleName in its constructor.

[Summary for Skin.java]

replace registerStyleSheetName with addSkinAddition
add getSkinAdditions

[Summary for new SkinAddition object:]

Constructor takes styleSheetName and resourceBundleName
add getStyleSheetName
add getResourceBundleName

[Changes to SkinImpl object]

remove setStyleSheetName (move to constructor)
remove setBundleName (move to constructor)
Add the above properties to the constructor. This will clean up the API and prevent someone from changing the stylesheet and bundle on a Skin
Change getBundleName to getResourceBundleName


Thanks for your feedback!

- Jeanne







Reply via email to