Search in sources :

Example 41 with Style

use of com.google.gwt.dom.client.Style in project gerrit by GerritCodeReview.

the class RightSidePopdownAction method show.

void show() {
    if (popup != null) {
        button.removeStyleName(style.selected());
        popup.hide();
        return;
    }
    final PopupPanel p = new PopupPanel(true) {

        @Override
        public void setPopupPosition(int left, int top) {
            top -= Document.get().getBodyOffsetTop();
            int w = Window.getScrollLeft() + Window.getClientWidth();
            int r = relativeTo.getAbsoluteLeft() + relativeTo.getOffsetWidth();
            int right = w - r;
            Style style = getElement().getStyle();
            style.clearProperty("left");
            style.setPropertyPx("right", right);
            style.setPropertyPx("top", top);
        }
    };
    p.setStyleName(style.replyBox());
    p.addAutoHidePartner(button.getElement());
    p.addCloseHandler(new CloseHandler<PopupPanel>() {

        @Override
        public void onClose(CloseEvent<PopupPanel> event) {
            if (popup == p) {
                button.removeStyleName(style.selected());
                popup = null;
            }
        }
    });
    p.add(getWidget());
    p.showRelativeTo(relativeTo);
    GlobalKey.dialog(p);
    button.addStyleName(style.selected());
    popup = p;
}
Also used : PopupPanel(com.google.gwt.user.client.ui.PopupPanel) Style(com.google.gwt.dom.client.Style)

Example 42 with Style

use of com.google.gwt.dom.client.Style in project gerrit by GerritCodeReview.

the class InsertCommentBubble method position.

void position(Rect r) {
    Style s = getElement().getStyle();
    int top = (int) (r.top() - (getOffsetHeight() - 8));
    if (top < 0) {
        s.setTop(-3, Unit.PX);
        s.setLeft(r.right() + 2, Unit.PX);
    } else {
        s.setTop(top, Unit.PX);
        s.setLeft((int) (r.right() - 14), Unit.PX);
    }
}
Also used : Style(com.google.gwt.dom.client.Style)

Example 43 with Style

use of com.google.gwt.dom.client.Style in project GwtMobile by dennisjzh.

the class ScrollPanel method setStyleTop.

private void setStyleTop(int top) {
    Style style = getWidget().getElement().getStyle();
    style.setTop(top, Unit.PX);
}
Also used : Style(com.google.gwt.dom.client.Style)

Aggregations

Style (com.google.gwt.dom.client.Style)43 Element (com.google.gwt.dom.client.Element)5 Button (com.google.gwt.user.client.ui.Button)4 Image (com.google.gwt.user.client.ui.Image)4 GwtTestTest (com.googlecode.gwt.test.GwtTestTest)4 Test (org.junit.Test)4 ImageElementEx (org.rstudio.core.client.dom.ImageElementEx)3 ImageResource2x (org.rstudio.core.client.resources.ImageResource2x)3 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 Command (com.google.gwt.user.client.Command)2 Timer (com.google.gwt.user.client.Timer)2 FlexTable (com.google.gwt.user.client.ui.FlexTable)2 HTMLPanel (com.google.gwt.user.client.ui.HTMLPanel)2 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)2 VerticalPanel (com.google.gwt.user.client.ui.VerticalPanel)2 MultiLineLabel (org.rstudio.core.client.widget.MultiLineLabel)2 MessageDialogImages (org.rstudio.core.client.widget.images.MessageDialogImages)2 PreloaderCallback (com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderCallback)1 PreloaderState (com.badlogic.gdx.backends.gwt.preloader.Preloader.PreloaderState)1