java - How to style a TextButton? -


i have gwt textbutton. following css styles applied global css file nothing:

.gwt-textbutton {    color: red !important; } 

why? correct styles applied change style of textbutton widgets?

textbutton cell-backed widget , based on appearance pattern. uses textbuttoncell render content , wraps using cellwidget<t>.

the global css looking gwt-buttoncellbase obfuscated because used in clientbundle, need extend buttoncellbase.defaultappearance.resources, providing own style. other cell-based widget. need use right constructor (textbutton(appearance appearance, string text)). sample code follows.

define resource appearance extension (fully quoted clarity):

public interface myresources extends buttoncellbase.defaultappearance.resources {   @override   @source(value = {buttoncellbase.defaultappearance.style.default_css, "custom.css"})   buttoncellbase.defaultappearance.style buttoncellbasestyle(); } 

inside custom.css, override whatever want of buttoncellbase.css, , inject everything:

myresources customresources = gwt.create(myresources.class); textbuttoncell.appearance customappearance = new textbuttoncell.defaultappearance(customresources); textbutton button = new textbutton(customappearance, "text"); 

you can above once, , instantiate new textbutton same appearance.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -