List of usage examples for com.google.gwt.dom.client Document getClientHeight
public int getClientHeight()
From source file:org.rstudio.studio.client.common.satellite.SatelliteManager.java
License:Open Source License
public void forceReopenSatellite(final String name, final JavaScriptObject params) { Size preferredSize = null;//from ww w. j av a 2 s . c om Point preferredPos = null; for (ActiveSatellite satellite : satellites_) { if (satellite.getName().equals(name) && !satellite.getWindow().isClosed()) { // save the window's geometry so we can restore it after the window // is destroyed final WindowEx win = satellite.getWindow(); Document doc = win.getDocument(); preferredSize = new Size(doc.getClientWidth(), doc.getClientHeight()); preferredPos = new Point(win.getLeft(), win.getTop()); callNotifyPendingReactivate(win); // close the window try { win.close(); } catch (Throwable e) { } break; } } // didn't find an open window to reopen if (preferredSize == null) return; // open a new window with the same geometry as the one we just destroyed, // but with the newly supplied set of parameters final Size windowSize = preferredSize; final Point windowPos = preferredPos; openSatellite(name, params, windowSize, false, windowPos); }
From source file:org.xwiki.gwt.wysiwyg.client.plugin.importer.IEPasteManager.java
License:Open Source License
/** * {@inheritDoc}/*from w w w . jav a2 s. c om*/ * <p> * {@link Document#getScrollTop()} and {@link Document#getScrollLeft()} are broken for nested documents in IE9. * </p> * * @see <a href="http://code.google.com/p/google-web-toolkit/issues/detail?id=6256">getAbsoluteTop/getScrollTop * returns wrong values for IE9 when body has been scrolled</a> * @see <a href="https://gwt-review.googlesource.com/#/c/2260/">Document#getScrollTop() and Document#getScrollLeft() * are broken for nested documents in IE9</a> */ @Override protected void centerPasteContainer(Element pasteContainer) { Document document = pasteContainer.getOwnerDocument(); Element viewport = Element.as(document.isCSS1Compat() ? document.getDocumentElement() : document.getBody()); pasteContainer.getStyle().setLeft(viewport.getScrollLeft() + document.getClientWidth() / 2, Unit.PX); pasteContainer.getStyle().setTop(viewport.getScrollTop() + document.getClientHeight() / 2, Unit.PX); }