@Override public StylesBuilder left(double value, Unit unit) { delegate.assertCanAddStyleProperty().setLeft(value, unit); return this; }
public void fillParent(Element elem) { Style style = elem.getStyle(); style.setPosition(Position.ABSOLUTE); style.setLeft(0, PX); style.setTop(0, PX); style.setRight(0, PX); style.setBottom(0, PX); }
/** * When enabled, the background will be blocked with a semi-transparent pane * the next time it is shown. If the PopupPanel is already visible, the glass * will not be displayed until it is hidden and shown again. * * @param enabled true to enable, false to disable */ public void setGlassEnabled(boolean enabled) { this.isGlassEnabled = enabled; if (enabled && glass == null) { glass = Document.get().createDivElement(); glass.setClassName(glassStyleName); glass.getStyle().setPosition(Position.ABSOLUTE); glass.getStyle().setLeft(0, Unit.PX); glass.getStyle().setTop(0, Unit.PX); } }
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 StylesBuilder left(double value, Unit unit) { delegate.assertCanAddStyleProperty().setLeft(value, unit); return this; }
/** * Construct a new {@link SplitLayoutPanel} with the specified splitter size * in pixels. * * @param splitterSize the size of the splitter in pixels */ public SplitLayoutPanel(int splitterSize) { super(Unit.PX); this.splitterSize = splitterSize; setStyleName("gwt-SplitLayoutPanel"); if (glassElem == null) { glassElem = Document.get().createDivElement(); glassElem.getStyle().setPosition(Position.ABSOLUTE); glassElem.getStyle().setTop(0, Unit.PX); glassElem.getStyle().setLeft(0, Unit.PX); glassElem.getStyle().setMargin(0, Unit.PX); glassElem.getStyle().setPadding(0, Unit.PX); glassElem.getStyle().setBorderWidth(0, Unit.PX); // We need to set the background color or mouse events will go right // through the glassElem. If the SplitPanel contains an iframe, the // iframe will capture the event and the slider will stop moving. glassElem.getStyle().setProperty("background", "white"); glassElem.getStyle().setOpacity(0.0); } }
scrollLock.getStyle().setRight(0, Unit.PX); } else { scrollLock.getStyle().setLeft(0, Unit.PX);
@Override protected void onUpdate(double progress) { double delta = (endSize - startSize) * progress; double newSize = startSize + delta; double deltaLeft = (endTabLeft - startTabLeft) * progress; double newLeft = startTabLeft + deltaLeft; toolBar.getElement().getStyle().setLeft(newLeft, Style.Unit.PX); container.setWidth(newSize + "px"); }
protected void updateAutocompleteStyle(final Widget widget) { // we only need to do this once if (m_updated.contains(widget)) { return; } final Style style = widget.getElement().getStyle(); // ugh style.setPosition(Position.ABSOLUTE); style.setLeft(5, Unit.PX); style.setTop(25, Unit.PX); m_updated.add(widget); }
/** * Recalculate the height and width of a native scrollbar. */ private static void maybeRecalculateNativeScrollbarSize() { // Check if the size has already been calculated. if (nativeHeight > -1) { return; } // Create a scrollable element and attach it to the body. Element scrollable = Document.get().createDivElement(); scrollable.getStyle().setPosition(Position.ABSOLUTE); scrollable.getStyle().setTop(-1000.0, Unit.PX); scrollable.getStyle().setLeft(-1000.0, Unit.PX); scrollable.getStyle().setHeight(100.0, Unit.PX); scrollable.getStyle().setWidth(100.0, Unit.PX); scrollable.getStyle().setOverflow(Overflow.SCROLL); scrollable.getStyle().setProperty("direction", "rtl"); Document.get().getBody().appendChild(scrollable); // Add some content. Element content = Document.get().createDivElement(); content.setInnerText("content"); scrollable.appendChild(content); // Measure the height and width. nativeHeight = scrollable.getOffsetHeight() - scrollable.getClientHeight(); nativeWidth = scrollable.getOffsetWidth() - scrollable.getClientWidth(); nativeRtl = (content.getAbsoluteLeft() > scrollable.getAbsoluteLeft()); // Detach the scrollable element. scrollable.removeFromParent(); }
private void styleAndPositionMenuContainer(final int eventX, final int eventY) { menuContainer.addStyleName(OPEN); clickButton.getElement().setAttribute(ARIA_EXPANDED, Boolean.TRUE.toString()); menuContainer.getElement().getStyle().setPosition(Position.ABSOLUTE); menuContainer.getElement().getStyle().setTop(Window.getScrollTop() + eventY, Unit.PX); menuContainer.getElement().getStyle().setLeft(eventX, Unit.PX); }
private void renderTransformed() { getElement().getStyle().setLeft(deltaX - panX, Unit.PX); getElement().getStyle().setTop(deltaY - panY, Unit.PX); for (int i = 0; i < getChildCount(); i++) { TransformableWidget w = (TransformableWidget) getChild(i); w.setScale(scaleX, scaleY); w.setTranslation(panX, panY); } }
private void shrinkLayout() { stretched = false; getElement().getStyle().setTop(top, Unit.PX); getElement().getStyle().setLeft(left, Unit.PX); int y = viewPort.getZoomStrategy().getZoomStepCount() * ZOOMSTEP_HEIGHT; setSize(ZOOMBUTTON_SIZE + "px", (y + 1 + (ZOOMBUTTON_SIZE * 2)) + "px"); applyPositions(); }
private void positionZoomHandle() { int index = viewPort.getResolutionCount() - viewPort.getResolutionIndex(viewPort.getResolution()) - 1; int handleY = getBaseTop() + ZOOMBUTTON_SIZE + 1 + (index * ZOOMSTEP_HEIGHT); int handleX = getBaseLeft(); zoomHandle.getElement().getStyle().setLeft(handleX, Unit.PX); zoomHandle.getElement().getStyle().setTop(handleY, Unit.PX); handleDragStartY = handleY; }
private void addModality() { windowFrameGlassPanel = new HTMLPanel("div", ""); Style style = windowFrameGlassPanel.getElement().getStyle(); style.setPosition(FIXED); style.setWidth(100., PCT); style.setHeight(100., PCT); style.setTop(0., PX); style.setLeft(0., PX); RootPanel.get().add(windowFrameGlassPanel); }
private void showDropTarget( int x, int y, int width, int height ) { dropTargetHighlight.getStyle().setLeft( x, Style.Unit.PX ); dropTargetHighlight.getStyle().setWidth( width, Style.Unit.PX ); dropTargetHighlight.getStyle().setTop( y, Style.Unit.PX ); dropTargetHighlight.getStyle().setHeight( height, Style.Unit.PX ); dropTargetHighlight.getStyle().setVisibility( Style.Visibility.VISIBLE ); dropTargetHighlight.getStyle().setDisplay( Style.Display.BLOCK ); }
private void hideDropTarget() { dropTargetHighlight.getStyle().setVisibility( Style.Visibility.HIDDEN ); dropTargetHighlight.getStyle().setDisplay( Style.Display.NONE ); dropTargetHighlight.getStyle().setLeft( 0, Style.Unit.PX ); dropTargetHighlight.getStyle().setWidth( 0, Style.Unit.PX ); dropTargetHighlight.getStyle().setTop( 0, Style.Unit.PX ); dropTargetHighlight.getStyle().setHeight( 0, Style.Unit.PX ); dropTargetPosition = CompassPosition.NONE; }
protected LoadTracker() { if(Document.get().getElementById(m_trackerDivId) == null) { Element div = DOM.createDiv(); div.getStyle().setPosition(Position.ABSOLUTE); div.getStyle().setTop(0.0, Unit.PX); div.getStyle().setLeft(-9999.0, Unit.PX); div.getStyle().setVisibility(Visibility.HIDDEN); div.setId("loadTracker"); Document.get().getBody().appendChild(div); } }