How to get the values of the css style attributes in gwt

Tags: css,gwt,uibinder

Problem :

Is it possible to get the width of a border for a panel, and/or other css style attributes values from a class? (if the css style attributes has been declared using ui:style from uibinder).

Solution :

It's possible to do with the UIObject (so as the Widget) has the getElement() method which returns DOM Element.

Try getElement() -> getStyle() -> getBorderWidth(). In the Style class there are appropriate methods for many CSS properties. For the other props Style has getProperty(String) method (to get "backgroungPosition" for example). This should work for ui:style as well.

    CSS Howto..

    HTML/CSS - How do I fill background of region to left of div that shrinks on zoom out?

    How to center a CSS Hexagon

    How can I rotate(or change) background image using CSS and Javascript

    How to draw scalable rectangles Ruby on Rails

    How to append a CSS rule to the another CSS rule

    How to draw a CSS petagon with all borders radius?

    How do I organize imports in Compass/Blueprint?

    How to I get this element to span 100% of LI? [closed]

    How can i stop my text css from over-riding my form on my blog?

    How do you make it so the navbar is transparent then changes color using bootstrap 3. (Affix)

    How can I center a button in the cell of a table using CSS ASP.NET

    show No-Overlay (transparent background) when using backdrop:“static” in bootstrap modal

    How to display visual rows and cols in textarea using css

    Implementing a select element in my form, but unsure how to grab user selection for a list

    How to position div which contains font-awesome icons to centre of another div?

    How to slide up / slide down an element with Zepto on mobile devices?

    How to adapt website to user's Screen Resolution?

    How to make rotating shape look thick?

    How can I make a div *not* expand to fill it's parent?

    how to move canvas along with a centered canvas

    CSS menu list items need to show inside div container

    How to make image appear upon hover over text using css?

    How to move text up using CSS when nothing is working

    How * tag can be used in CSS?

    How to center a ul CSS

    How to make a grid with one style?

    How to take an element over to given padding with CSS

    How to achieve image changing on hover?

    How to align to the center a div with position absolute within a div with position relative?

    How to position a div differently for a specific page?