You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Martin Grigorov (JIRA)" <ji...@apache.org> on 2014/03/11 13:57:43 UTC

[jira] [Commented] (WICKET-5340) CssAttributeModifier and StyleAttributeModifier

    [ https://issues.apache.org/jira/browse/WICKET-5340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13930303#comment-13930303 ] 

Martin Grigorov commented on WICKET-5340:
-----------------------------------------

Any comments on https://github.com/apache/wicket/compare/5340-css-class-style-modifier ?
I'd like to (improve and) close this ticket.

> CssAttributeModifier and StyleAttributeModifier
> -----------------------------------------------
>
>                 Key: WICKET-5340
>                 URL: https://issues.apache.org/jira/browse/WICKET-5340
>             Project: Wicket
>          Issue Type: Wish
>            Reporter: Betlista
>            Assignee: Martin Grigorov
>            Priority: Minor
>
> It would be perfect if there are modifiers, that can work with css attribute and style attribute.
> Simple idea is to replace String newValue(final String currentValue, final String replacementValue) method with something "better":
> For CssAttributeModifier the method can be
> void modify(Set<String> classes)
> in which I can add/remove CSS classes for HTML element, for class="class1 class2", the classes set id {"class1", "class2"}
> StyleAttributeModifier will be similar, but instead of String set, developer gets map
> void modify(Map<String, String> styles)
> and modifications are possible. For style="color: #CC0000; padding: 2px 0px 2px 15px;" map content is { "color"="#CC0000", "padding"="2px 0px 2px 15px" }
> Especially modifying of class attribute is common, see f.e. http://stackoverflow.com/questions/10135791/how-to-remove-a-css-class-from-a-wicket-component



--
This message was sent by Atlassian JIRA
(v6.2#6252)