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
Post a Comment