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() . 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
Source File: ColumnLayout.java    From appinventor-extensions with Apache License 2.0 5 votes vote down vote up
/**
 * 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
Source File: MaterialStepper.java    From gwt-material-addins with Apache License 2.0 5 votes vote down vote up
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();
            }
        }
    }

}