/** * We control size by setting our child widget's size. However, if we don't * currently have a child, we record the size the user wanted so that when we * do get a child, we can set it correctly. Until size is explicitly cleared, * any child put into the popup will be given that size. */ void maybeUpdateSize() { // For subclasses of PopupPanel, we want the default behavior of setWidth // and setHeight to change the dimensions of PopupPanel's child widget. // We do this because PopupPanel's child widget is the first widget in // the hierarchy which provides structure to the panel. DialogBox is // an example of this. We want to set the dimensions on DialogBox's // FlexTable, which is PopupPanel's child widget. However, it is not // DialogBox's child widget. To make sure that we are actually getting // PopupPanel's child widget, we have to use super.getWidget(). Widget w = super.getWidget(); if (w != null) { if (desiredHeight != null) { w.setHeight(desiredHeight); } if (desiredWidth != null) { w.setWidth(desiredWidth); } } }
/** * Setup the container around the widget. */ private void finishWidgetInitialization(Element container, Widget w) { UIObject.setVisible(container, false); container.getStyle().setProperty("height", "100%"); // Set 100% by default. Element element = w.getElement(); if (element.getStyle().getProperty("width").equals("")) { w.setWidth("100%"); } if (element.getStyle().getProperty("height").equals("")) { w.setHeight("100%"); } // Issue 2510: Hiding the widget isn't necessary because we hide its // wrapper, but it's in here for legacy support. w.setVisible(false); }
@Override public void setHeight(int height) { widget.setHeight(height + "px"); }
@Override public void setHeight(String height) { super.setHeight(height); doResize(); }
@Override public void onLoad(LoadEvent event) { if(thumbnailWidth != null) { child.setWidth(thumbnailWidth); } if(thumbnailHeight != null) { child.setHeight(thumbnailHeight); } } });
/*************************************** * Sets the height of this component in string format. How this value is * interpreted may depend on the underlying implementation. * * @param sHeight The new height */ public void setHeight(String sHeight) { getWidget().setHeight(sHeight); }
@Override public void setHeight(String height) { super.setHeight(height); this.text.setHeight(height); } }
@Override public void onLoad(LoadEvent event) { if(thumbnailWidth != null) { child.setWidth(thumbnailWidth); } if(thumbnailHeight != null) { child.setHeight(thumbnailHeight); } } });
public void setHeight(String height) { this.height = height; Widget widget = getWidget(); if(widget != null && widget.isAttached()) { widget.setHeight(height); } }
public static void setMaxHeight(Widget widget) { int absoluteTop = getAbsoluteTop(widget); int newHeight = (Window.getClientHeight() - absoluteTop); if (newHeight>0) { try { widget.setHeight(newHeight + "px"); } catch (Exception e) { // We need to catch this call since in IE7 // it seems to be able to break sometime on initial loading } } }
public void setHeight(String height) { this.height = height; Widget widget = getWidget(); if(widget != null && widget.isAttached()) { widget.setHeight(height); } }
static void setNativeSize(Widget control, int width, int height) { control.setWidth(width + "px"); control.setHeight(height + "px"); control.getElement().getStyle().setOverflow(com.google.gwt.dom.client.Style.Overflow.HIDDEN); }
@Override public void setPreferredHeight(final int height) { if (getWidgetCount() == 1 && getWidget(0) instanceof ModalDialog) { this.getWidget(0).setHeight(height + "px"); } }
@Override public void setPreferredHeight(final int height) { if (getWidgetCount() == 1 && getWidget(0) instanceof ModalDialog) { this.getWidget(0).setHeight(height + "px"); } }
public void addFull(Widget widget) { panel.add( widget ); widget.setWidth( "100%" ); widget.setHeight( "100%" ); widget.getElement().getParentElement().getParentElement().getStyle().setHeight( 100, Unit.PCT ); }
public void addFull(Widget widget) { panel.add( widget ); widget.setWidth( "100%" ); widget.setHeight( "100%" ); widget.getElement().getParentElement().getParentElement().getStyle().setHeight( 100, Unit.PCT ); }
private void sizeContainer() { container.setWidth((Window.getClientWidth() - LEFT_MARGIN) + "px"); container.setHeight((Window.getClientHeight()) + "px"); container.setWidgetPosition(widget, PADDING, PADDING); widget.setWidth((Window.getClientWidth() - LEFT_MARGIN - (PADDING * 2)) + "px"); widget.setHeight((Window.getClientHeight() - (PADDING * 2)) + "px"); }