You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by "Raghunandan Sapre (JIRA)" <de...@myfaces.apache.org> on 2007/11/20 17:57:43 UTC

[jira] Created: (MYFACES-1772) How to apply style/styleclass by calling getStyle() or getstyleclass()

How to apply style/styleclass by calling getStyle() or getstyleclass()
----------------------------------------------------------------------

                 Key: MYFACES-1772
                 URL: https://issues.apache.org/jira/browse/MYFACES-1772
             Project: MyFaces Core
          Issue Type: Bug
          Components: Extension Feature
    Affects Versions: 1.1.5
            Reporter: Raghunandan Sapre


Hi The source code for many renderer classes say that style of button etc, can be overriden by overriding getStyle method.
I wanted to know how to do that. I was thinking it should be setStyle method and not get method?
Thanks
Raghu
/**

* Can be overwritten by derived classes to overrule the style to be used.

*/

protected String getStyle(FacesContext facesContext, UIComponent link) {

if (link instanceof HtmlCommandLink) {

return ((HtmlCommandLink) link).getStyle();

}

else {

return (String) link.getAttributes().get(HTML.STYLE_ATTR);

}

}


/**

* Can be overwritten by derived classes to overrule the style class to be used.

*/

protected String getStyleClass(FacesContext facesContext, UIComponent link) {

if (link instanceof HtmlCommandLink) {

return ((HtmlCommandLink) link).getStyleClass();

}

else {

return (String) link.getAttributes().get(HTML.STYLE_CLASS_ATTR);

}

}



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


[jira] Commented: (MYFACES-1772) How to apply style/styleclass by calling getStyle() or getstyleclass()

Posted by "David Brainard (JIRA)" <de...@myfaces.apache.org>.
    [ https://issues.apache.org/jira/browse/MYFACES-1772?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12544011 ] 

David Brainard commented on MYFACES-1772:
-----------------------------------------

These methods are hooks provided in case if you want to provide a different implementation.
I think these comments are correct. 

I request you to discuss these type of questions in the mailing list before creating an issue in Jira.

regards,
David


> How to apply style/styleclass by calling getStyle() or getstyleclass()
> ----------------------------------------------------------------------
>
>                 Key: MYFACES-1772
>                 URL: https://issues.apache.org/jira/browse/MYFACES-1772
>             Project: MyFaces Core
>          Issue Type: Bug
>          Components: Extension Feature
>    Affects Versions: 1.1.5
>            Reporter: Raghunandan Sapre
>
> Hi The source code for many renderer classes say that style of button etc, can be overriden by overriding getStyle method.
> I wanted to know how to do that. I was thinking it should be setStyle method and not get method?
> Thanks
> Raghu
> /**
> * Can be overwritten by derived classes to overrule the style to be used.
> */
> protected String getStyle(FacesContext facesContext, UIComponent link) {
> if (link instanceof HtmlCommandLink) {
> return ((HtmlCommandLink) link).getStyle();
> }
> else {
> return (String) link.getAttributes().get(HTML.STYLE_ATTR);
> }
> }
> /**
> * Can be overwritten by derived classes to overrule the style class to be used.
> */
> protected String getStyleClass(FacesContext facesContext, UIComponent link) {
> if (link instanceof HtmlCommandLink) {
> return ((HtmlCommandLink) link).getStyleClass();
> }
> else {
> return (String) link.getAttributes().get(HTML.STYLE_CLASS_ATTR);
> }
> }

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