Refine search
private void updateImageElementFromImageResource(Element imageSpan, ImageResource res, int spacing) { SafeUri url = res.getSafeUri(); int width = res.getWidth(); int height = res.getHeight(); int paddingRight = width + spacing; String style = "url(\"" + url.asString() + "\") no-repeat scroll left center"; imageSpan.getStyle().setProperty("background", style); imageSpan.getStyle().setPropertyPx("width", width); imageSpan.getStyle().setPropertyPx("height", height); imageSpan.getStyle().setPropertyPx("paddingRight", paddingRight); }
messageLabel.getElement().getStyle().setWhiteSpace(WhiteSpace.PRE_WRAP); messageLabel.getElement().getStyle().setProperty("maxHeight", "400px"); messageLabel.getElement().getStyle() .setProperty("maxWidth", Window.getClientWidth() * 2 / 3 + "px"); messageLabel.getElement().getStyle().setOverflowY(Overflow.AUTO); messageLabel.setMessage(message); dialogContents.add(messageLabel);
/** * @deprecated Call and override {@link #setCellVerticalAlignment(Element, * VerticalAlignmentConstant)} instead. */ @Deprecated protected void setCellVerticalAlignment(com.google.gwt.user.client.Element td, VerticalAlignmentConstant align) { td.getStyle().setProperty("verticalAlign", align.getVerticalAlignString()); }
/** * Creates an empty absolute panel. */ public AbsolutePanel() { this(DOM.createDiv()); // Setting the panel's position style to 'relative' causes it to be treated // as a new positioning context for its children. getElement().getStyle().setProperty("position", "relative"); getElement().getStyle().setProperty("overflow", "hidden"); }
/** * Sets the object's width. This width does not include decorations such as * border, margin, and padding. * * @param width the object's new width, in CSS units (e.g. "10px", "1em") */ public void setWidth(String width) { // This exists to deal with an inconsistency in IE's implementation where // it won't accept negative numbers in length measurements assert extractLengthValue(width.trim().toLowerCase(Locale.ROOT)) >= 0 : "CSS widths should not be negative"; getElement().getStyle().setProperty("width", width); }
/** * Sets the object's height. This height does not include decorations such as * border, margin, and padding. * * @param height the object's new height, in CSS units (e.g. "10px", "1em") */ public void setHeight(String height) { // This exists to deal with an inconsistency in IE's implementation where // it won't accept negative numbers in length measurements assert extractLengthValue(height.trim().toLowerCase(Locale.ROOT)) >= 0 : "CSS heights should not be negative"; getElement().getStyle().setProperty("height", height); }
@Override protected void onUpdate(double progress) { int scrollHeight = curPanel.contentWrapper.getElement().getPropertyInt("scrollHeight"); int height = (int) (progress * scrollHeight); if (!opening) { height = scrollHeight - height; } height = Math.max(height, 1); curPanel.contentWrapper.getElement().getStyle().setProperty("height", height + "px"); curPanel.contentWrapper.getElement().getStyle().setProperty("width", "auto"); } }
@Override void convertToFullNode(TreeItem item) { super.convertToFullNode(item); item.getElement().getStyle().setProperty("marginBottom", "0px"); } }
/** * Sets the vertical alignment of the specified row. * * @param row the row whose alignment is to be set * @param align the row's new vertical alignment as specified in * {@link HasVerticalAlignment} * @throws IndexOutOfBoundsException */ public void setVerticalAlign(int row, VerticalAlignmentConstant align) { ensureElement(row).getStyle().setProperty("verticalAlign", align.getVerticalAlignString()); }
@Override protected void onComplete() { if (!opening) { curPanel.contentWrapper.setVisible(false); } curPanel.contentWrapper.getElement().getStyle().setProperty("height", "auto"); curPanel = null; }
@Override public void setHorizontalAlignment(HorizontalAlignmentConstant align) { horzAlign = align; getElement().getStyle().setProperty("textAlign", align.getTextAlignString()); }
/** * Sets whether the specified cell will allow word wrapping of its contents. * * @param row the row of the cell whose word-wrap is to be set * @param column the column of the cell whose word-wrap is to be set * @param wrap <code>false </code> to disable word wrapping in this cell * @throws IndexOutOfBoundsException */ public void setWordWrap(int row, int column, boolean wrap) { prepareCell(row, column); String wrapValue = wrap ? "" : "nowrap"; getElement(row, column).getStyle().setProperty("whiteSpace", wrapValue); }
public void setAlignment(TextAlignment align) { getElement().getStyle().setProperty("textAlign", align.getTextAlignString()); }
/** * Set the minimum width of the tables in this widget. If the widget become * narrower than the minimum width, a horizontal scrollbar will appear so the * user can scroll horizontally. * * <p> * Note that this method is not supported in IE6 and earlier versions of IE. * </p> * * @param value the width * @param unit the unit of the width * @see #setTableWidth(double, Unit) */ public void setMinimumTableWidth(double value, Unit unit) { /* * The min-width style attribute doesn't apply to tables, so we set the * min-width of the element that contains the table instead. The table width * is fixed at 100%. */ tableHeaderContainer.getElement().getStyle().setProperty("minWidth", value, unit); tableFooterContainer.getElement().getStyle().setProperty("minWidth", value, unit); tableDataContainer.getStyle().setProperty("minWidth", value, unit); }
/** * Sets whether this object is visible. This method just sets the * <code>visibility</code> style attribute. You need to call {@link #show()} * to actually attached/detach the {@link PopupPanel} to the page. * * @param visible <code>true</code> to show the object, <code>false</code> to * hide it * @see #show() * @see #hide() */ @Override public void setVisible(boolean visible) { // We use visibility here instead of UIObject's default of display // Because the panel is absolutely positioned, this will not create // "holes" in displayed contents and it allows normal layout passes // to occur so the size of the PopupPanel can be reliably determined. getElement().getStyle().setProperty("visibility", visible ? "visible" : "hidden"); // If the PopupImpl creates an iframe shim, it's also necessary to hide it // as well. if (glass != null) { glass.getStyle().setProperty("visibility", visible ? "visible" : "hidden"); } }
/** * Creates an empty DisclosurePanel that is initially closed. */ public DisclosurePanel() { initWidget(mainPanel); mainPanel.add(header); mainPanel.add(contentWrapper); contentWrapper.getElement().getStyle().setProperty("padding", "0px"); contentWrapper.getElement().getStyle().setProperty("overflow", "hidden"); setStyleName(STYLENAME_DEFAULT); setContentDisplay(false); }
/** * Called only from {@link TreeItem}: Shows the leaf image on a tree item. * * @param treeItem the tree item */ void showLeafImage(TreeItem treeItem) { if (useLeafImages || treeItem.isFullNode()) { showImage(treeItem, images.treeLeaf()); } else if (LocaleInfo.getCurrentLocale().isRTL()) { treeItem.getElement().getStyle().setProperty("paddingRight", indentValue); } else { treeItem.getElement().getStyle().setProperty("paddingLeft", indentValue); } }
public SuggestionMenuItem(Suggestion suggestion, boolean asHTML) { super(suggestion.getDisplayString(), asHTML); // Each suggestion should be placed in a single row in the suggestion // menu. If the window is resized and the suggestion cannot fit on a // single row, it should be clipped (instead of wrapping around and // taking up a second row). getElement().getStyle().setProperty("whiteSpace", "nowrap"); setStyleName(STYLENAME_DEFAULT); setSuggestion(suggestion); }
@Override protected void onStart() { offsetHeight = curPanel.getOffsetHeight(); offsetWidth = curPanel.getOffsetWidth(); curPanel.getElement().getStyle().setProperty("overflow", "hidden"); super.onStart(); }
private void resize() { contentPanel.setWidth(Window.getClientWidth() * 0.90 + "px"); contentPanel.setHeight(Window.getClientHeight() * 0.90 + "px"); contentPanel.getElement().getStyle().setProperty("overflow", "auto"); } }