Java Code Examples for com.google.gwt.user.client.ui.Widget#setWidth()

The following examples show how to use com.google.gwt.user.client.ui.Widget#setWidth() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Invoked upon resizing of the work area panel.
 *
 * @see WorkAreaPanel#onResize(int, int)
 *
 * @param width column width in pixel
 */
public void onResize(int width) {
  absoluteWidth = width * relativeWidth / 100;
  columnPanel.setWidth(absoluteWidth + "px");
  for (Widget w : columnPanel) {
    if (w instanceof Box) {
      ((Box) w).onResize(absoluteWidth);
    } else {
      // Top-of-column marker (otherwise invisible widget)
      w.setWidth(absoluteWidth + "px");
    }
  }
}
 
Example 2
public void updateStepWidth() {
    for (Widget child : getChildren()) {
        if (child instanceof MaterialStep) {
            if (fixedStepWidth) {
                double stepWidth = 100 / getChildren().size();
                child.setWidth(stepWidth + "%");
            } else {
                child.getElement().getStyle().clearWidth();
            }
        }
    }

}