/** * 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); }
bodyLabel = new Label(Utils.constants.body()); bodyLabel.setWidth("200px"); ((Widget) body).setWidth("600px"); detailsTable.setWidget(1, 0, bodyLabel); detailsTable.setWidget(1, 1, (Widget) body);
@Override public void onLoad(LoadEvent event) { if(thumbnailWidth != null) { child.setWidth(thumbnailWidth); } if(thumbnailHeight != null) { child.setHeight(thumbnailHeight); } } });
public VDDAccordion() { spacer = GWT.create(HTML.class); spacer.setWidth("100%"); spacer.setStyleName(CLASSNAME_SPACER); }
/*************************************** * Sets the width of this component in string format. How this value is * interpreted may depend on the underlying implementation. * * @param sWidth The new width */ public void setWidth(String sWidth) { getWidget().setWidth(sWidth); }
@Override public void setWidth(String width) { if (contents == null) { throw new IllegalStateException( "Cannot set the width of the collapsible panel before its contents are initialized"); } contents.setWidth(width); refreshWidth(); }
@Override public void onLoad(LoadEvent event) { if(thumbnailWidth != null) { child.setWidth(thumbnailWidth); } if(thumbnailHeight != null) { child.setHeight(thumbnailHeight); } } });
@Override public void setWidth(String width) { super.setWidth(width); doResize(); }
@Override public void setWidth(String width) { super.setWidth(width); if (iconDefaultWidth > 0) { this.text.setWidth(""+ (getOffsetWidth() - iconDefaultWidth) + "px"); } }
@Inject public ScenarioEditorViewImpl(final FixtureLayout fixtureLayout) { this.fixtureLayout = fixtureLayout; layout = uiBinder.createAndBindUi(this); layout.setWidth("100%"); layout.getElement().getStyle().setMargin(5, Style.Unit.PX); }
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 adjust(Widget main, FlowPanel container) { int widgetCount = container.getWidgetCount(); int offsetWidth = main.getOffsetWidth(); container.setWidth(widgetCount * offsetWidth + "px"); for (int i = 0; i < widgetCount; i++) { container.getWidget(i).setWidth(offsetWidth + "px"); } } }
@Override public void adjust(Widget main, FlowPanel container) { int widgetCount = container.getWidgetCount(); int offsetWidth = main.getOffsetWidth(); container.setWidth(widgetCount * offsetWidth + "px"); for (int i = 0; i < widgetCount; i++) { container.getWidget(i).setWidth(offsetWidth + "px"); } } }
@Override public void adjust(Widget main, FlowPanel container) { int widgetCount = container.getWidgetCount(); double scaleFactor = 100d / widgetCount; for (int i = 0; i < widgetCount; i++) { Widget w = container.getWidget(i); w.setWidth(scaleFactor + "%"); w.getElement().getStyle().setLeft(i * scaleFactor, Unit.PCT); } container.setWidth((widgetCount * 100) + "%"); container.getElement().getStyle().setHeight(main.getOffsetHeight(), Unit.PX); }
@Override public void adjust(Widget main, FlowPanel container) { int widgetCount = container.getWidgetCount(); double scaleFactor = 100d / widgetCount; for (int i = 0; i < widgetCount; i++) { Widget w = container.getWidget(i); w.setWidth(scaleFactor + "%"); w.getElement().getStyle().setLeft(i * scaleFactor, Unit.PCT); } container.setWidth((widgetCount * 100) + "%"); container.getElement().getStyle().setHeight(main.getOffsetHeight(), Unit.PX); }
private void adjustTextAreaAndFormSizeToScreen() { int formHeight = calculateFormHeight(); form.setHeight(formHeight + "px"); textWidget.setWidth((form.getOffsetWidth() + getDialogWrapperBorder()[RIGHT] + getDialogWrapperBorder()[LEFT]) + "px"); textWidget.setHeight(formHeight + "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 ); }
public void addField(final IsWidget field, final String label) { final FlowPanel panel = new FlowPanel(); panel.setWidth("99%"); final Label w = new Label(label); panel.add(w); panel.add(field); field.asWidget().setWidth("100%"); getContentContainer().add(panel); }