@Override public StylesBuilder display(Display value) { delegate.assertCanAddStyleProperty().setDisplay(value); return this; }
/** * The default implementation will display, but not consume, received errors * whose {@link EditorError#getEditor() getEditor()} method returns the Editor * passed into {@link #setEditor}. * * @param errors a List of {@link EditorError} instances */ public void showErrors(List<EditorError> errors) { StringBuilder sb = new StringBuilder(); for (EditorError error : errors) { if (error.getEditor().equals(editor)) { sb.append("\n").append(error.getMessage()); } } if (sb.length() == 0) { errorLabel.setInnerText(""); errorLabel.getStyle().setDisplay(Display.NONE); return; } errorLabel.setInnerText(sb.substring(1)); errorLabel.getStyle().setDisplay(Display.INLINE_BLOCK); } }
@Override protected void onComplete() { if (endSize == 0) { borderElement.getStyle().setDisplay(Display.NONE); return; } borderElement.getStyle().setHeight(endSize, Unit.PX); }
/** * Show or hide an element. * * @param element the element to show or hide * @param show true to show, false to hide */ private static void showOrHide(Element element, boolean show) { if (show) { element.getStyle().clearDisplay(); } else { element.getStyle().setDisplay(Display.NONE); } }
@Override public boolean remove(Widget w) { // Validate. if (w.getParent() != this) { return false; } // Orphan. try { orphan(w); } finally { // Physical detach. w.getElement().removeFromParent(); // Logical detach. if (w == content) { content = null; contentContainer.getStyle().setDisplay(Display.NONE); } else if (w == header) { header = null; headerContainer.getStyle().setDisplay(Display.NONE); } else if (w == footer) { footer = null; footerContainer.getStyle().setDisplay(Display.NONE); } } return true; }
/** * Show or hide an element. * * @param element the element * @param show true to show, false to hide */ void showOrHide(Element element, boolean show) { if (element == null) { return; } if (show) { element.getStyle().clearDisplay(); } else { element.getStyle().setDisplay(Display.NONE); } } }
@Override public void setClip(Element popup, String rect) { super.setClip(popup, rect); popup.getStyle().setDisplay(Display.NONE); popup.getStyle().clearDisplay(); } }
public void onResize(ResizeEvent event) { Style style = glass.getStyle(); int winWidth = Window.getClientWidth(); int winHeight = Window.getClientHeight(); // Hide the glass while checking the document size. Otherwise it would // interfere with the measurement. style.setDisplay(Display.NONE); style.setWidth(0, Unit.PX); style.setHeight(0, Unit.PX); int width = Document.get().getScrollWidth(); int height = Document.get().getScrollHeight(); // Set the glass size to the larger of the window's client size or the // document's scroll size. style.setWidth(Math.max(width, winWidth), Unit.PX); style.setHeight(Math.max(height, winHeight), Unit.PX); // The size is set. Show the glass again. style.setDisplay(Display.BLOCK); } };
private void showImpl() { borderElement.getStyle().setDisplay(Display.BLOCK); borderElement.getStyle().setWidth(notificationText.getOffsetWidth(), Unit.PX); animation.animateMole(0, heightMeasure.getOffsetHeight(), animationDuration); } }
/** * Ensure that the animation frame exists and return it. * * @return the animation frame */ Element ensureAnimationFrame() { if (animationFrame == null) { animationFrame = Document.get().createDivElement(); animationFrame.getStyle().setOverflow(Overflow.HIDDEN); animationFrame.getStyle().setDisplay(Display.NONE); getElement().appendChild(animationFrame); } return animationFrame; }
/** * Put the node back into a clean state and clear fields. */ private void cleanup() { if (opening) { animFrame.getStyle().clearDisplay(); } else { animFrame.getStyle().setDisplay(Display.NONE); childContainer.setInnerHTML(""); } animFrame.getStyle().clearHeight(); animFrame.getStyle().clearPosition(); this.contentContainer = null; this.childContainer = null; this.animFrame = null; } }
private Element createContainer() { Element container = Document.get().createDivElement().cast(); container.getStyle().setPosition(Position.ABSOLUTE); container.getStyle().setDisplay(Display.NONE); container.getStyle().setLeft(0.0, Unit.PX); container.getStyle().setWidth(100.0, Unit.PCT); return container; }
@Override public void onBrowserEvent(Context context, Element parent, String value, NativeEvent event, ValueUpdater<String> valueUpdater) { // The loading indicator can fire its own load or error event, so we check // that the event actually occurred on the main image. String type = event.getType(); if (BrowserEvents.LOAD.equals(type) && eventOccurredOnImage(event, parent)) { // Remove the loading indicator. parent.getFirstChildElement().getStyle().setDisplay(Display.NONE); // Show the image. Element imgWrapper = parent.getChild(1).cast(); imgWrapper.getStyle().setProperty("height", "auto"); imgWrapper.getStyle().setProperty("width", "auto"); imgWrapper.getStyle().setProperty("overflow", "auto"); } else if (BrowserEvents.ERROR.equals(type) && eventOccurredOnImage(event, parent)) { // Replace the loading indicator with an error message. parent.getFirstChildElement().setInnerSafeHtml(errorRenderer.render(value)); } }
@Override protected void refreshColumnWidths() { super.refreshColumnWidths(); /* * Clear the display for all columns that appear in the table. And update or remove the cols of * the colgroup that are no longer in the table according to the removeCOlumnsOnHide flag. */ if (colGroupEnabled) { int colCount = colgroup.getChildCount(); int lastColumn = getRealColumnCount(); for (int i = 0; i < lastColumn; i++) { ensureTableColElement(i).getStyle().clearDisplay(); } for (int i = colCount - 1; i >= lastColumn; i--) { if (removeColumnsOnHide) { colgroup.removeChild(colgroup.getChild(i)); } else { doSetColumnWidth(i, "0px"); ensureTableColElement(i).getStyle().setDisplay(Display.NONE); } } } }
public CustomSuggestionDisplay() { super(); final PopupPanel popup = getPopupPanel(); popup.setStyleName(Styles.DROPDOWN_MENU); popup.getElement().getStyle().setDisplay(Display.BLOCK); }
style.setDisplay(Display.NONE);
public DropdownContainer(String caption) { super(caption); for (Widget widget : getChildren()) { if (widget instanceof UnorderedList) { menu = (UnorderedList) widget; break; } } menu.getElement().getStyle().clearDisplay(); menu.getElement().getStyle().setDisplay(Style.Display.NONE); handlerManager = createHandlerManager(); }
style.clearDisplay(); } else { style.setDisplay(Display.NONE);
public void hideContainer() { menu.getElement().getStyle().setDisplay(Style.Display.NONE); menuVisible = false; for (int i = 0; i < handlerManager.getHandlerCount(HideEvent.getType()); i++) { HideHandler hh = handlerManager.getHandler(HideEvent.getType(), i); hh.onHide(new HideEvent(null)); } }
tableDataContainer.getStyle().setDisplay(Display.BLOCK);