如何获取gwt中css样式属性的值

时间:2011-07-15 21:09:47

标签: css gwt uibinder

是否可以从类中获取面板的边框宽度和/或其他css样式属性值? (如果已使用uibinder中的ui:style声明了css样式属性)。

1 个答案:

答案 0 :(得分:0)

可以使用com.google.gwt.dom.client.Style。 UIObject(以及Widget)具有返回DOM Element的getElement()方法。

尝试getElement() - > getStyle() - > getBorderWidth()。在Style类中,有许多CSS属性的适当方法。对于其他道具,Style具有getProperty(String)方法(例如获取“backgroungPosition”)。这应该适用于ui:style。