Search in sources :

Example 26 with Widget

use of com.google.gwt.user.client.ui.Widget in project gerrit by GerritCodeReview.

the class History method autoOpen.

private void autoOpen(Timestamp lastReply) {
    if (lastReply == null) {
        for (Widget child : getChildren()) {
            ((Message) child).autoOpen();
        }
    } else {
        for (int i = getChildren().size() - 1; i >= 0; i--) {
            Message ui = (Message) getChildren().get(i);
            MessageInfo msg = ui.getMessageInfo();
            if (lastReply.compareTo(msg.date()) < 0) {
                ui.autoOpen();
            } else {
                break;
            }
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) MessageInfo(com.google.gerrit.client.info.ChangeInfo.MessageInfo)

Example 27 with Widget

use of com.google.gwt.user.client.ui.Widget in project GwtMobile by dennisjzh.

the class CheckBoxGroup method onDragStart.

@Override
public void onDragStart(DragEvent e) {
    _pressed = Utils.getTargetItemIndex(getElement(), e.getNativeEvent().getEventTarget());
    if (_pressed >= 0) {
        Widget item = getWidget(_pressed);
        item.addStyleName("Pressed");
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget)

Example 28 with Widget

use of com.google.gwt.user.client.ui.Widget in project GwtMobile by dennisjzh.

the class ListItem method setShowArrow.

public void setShowArrow(boolean show) {
    _showArrow = show ? ShowArrow.True : ShowArrow.False;
    int last = getWidgetCount() - 1;
    if (last >= 0) {
        Widget widget = getWidget(last);
        if (widget.getClass().toString().endsWith(".Chevron")) {
            if (!show) {
                remove(last);
            }
        } else {
            if (show) {
                add(new ListPanel.Chevron());
            }
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget)

Example 29 with Widget

use of com.google.gwt.user.client.ui.Widget in project che by eclipse.

the class PerspectiveViewImpl method onResize.

/** {@inheritDoc} */
@Override
public void onResize() {
    editorPanel.onResize();
    super.onResize();
    Widget widget = infoPanel.getWidget();
    if (widget instanceof RequiresResize) {
        ((RequiresResize) widget).onResize();
    }
    int width = getOffsetWidth();
    int height = getOffsetHeight();
    if (delegate != null) {
        delegate.onResize(width, height);
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) RequiresResize(com.google.gwt.user.client.ui.RequiresResize)

Example 30 with Widget

use of com.google.gwt.user.client.ui.Widget in project che by eclipse.

the class NotificationPopup method update.

/**
     * Update notification's widget values.
     * <p/>
     * Widget consumes:
     * <ul>
     * <li>{@link Notification#title}</li>
     * <li>{@link Notification#content}</li>
     * <li>Icon and background color based on {@link Status}</li>
     * </ul>
     */
private void update() {
    Widget titleWidget = titlePanel.getWidget();
    if (titleWidget != null && titleWidget instanceof Label) {
        ((Label) titleWidget).setText(notification.getTitle());
        titleWidget.setTitle(notification.getTitle());
    }
    Widget messageWidget = messagePanel.getWidget();
    if (messageWidget != null && messageWidget instanceof Label) {
        ((Label) messageWidget).setText(notification.getContent());
    }
    iconPanel.setWidget(getIconBaseOnStatus());
    removeStyleName(resources.notificationCss().notificationStatusProgress());
    removeStyleName(resources.notificationCss().notificationStatusSuccess());
    removeStyleName(resources.notificationCss().notificationStatusFail());
    removeStyleName(resources.notificationCss().notificationStatusWarning());
    DisplayMode displayMode = notification.getDisplayMode();
    Status status = notification.getStatus();
    switch(status) {
        case PROGRESS:
            setStyleName(resources.notificationCss().notificationStatusProgress(), true);
            break;
        case SUCCESS:
            setStyleName(resources.notificationCss().notificationStatusSuccess(), true);
            break;
        case FAIL:
            setStyleName(resources.notificationCss().notificationStatusFail(), true);
            break;
        case WARNING:
            setStyleName(resources.notificationCss().notificationStatusWarning(), true);
            break;
    }
    if (FLOAT_MODE == displayMode && PROGRESS == status) {
        hideTimer.cancel();
        return;
    }
    hideTimer.schedule(DEFAULT_TIME);
}
Also used : DisplayMode(org.eclipse.che.ide.api.notification.StatusNotification.DisplayMode) Status(org.eclipse.che.ide.api.notification.StatusNotification.Status) Widget(com.google.gwt.user.client.ui.Widget) Label(com.google.gwt.user.client.ui.Label)

Aggregations

Widget (com.google.gwt.user.client.ui.Widget)56 FixedRatioWidget (org.rstudio.core.client.widget.FixedRatioWidget)5 PreWidget (org.rstudio.core.client.widget.PreWidget)5 Command (com.google.gwt.user.client.Command)4 HTML (com.google.gwt.user.client.ui.HTML)4 Timer (com.google.gwt.user.client.Timer)3 IsWidget (com.google.gwt.user.client.ui.IsWidget)3 SimplePanel (com.google.gwt.user.client.ui.SimplePanel)3 Test (org.junit.Test)3 JavaScriptObject (com.google.gwt.core.client.JavaScriptObject)2 JsArrayString (com.google.gwt.core.client.JsArrayString)2 Element (com.google.gwt.dom.client.Element)2 Style (com.google.gwt.dom.client.Style)2 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)2 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)2 JSONString (com.google.gwt.json.client.JSONString)2 FlowPanel (com.google.gwt.user.client.ui.FlowPanel)2 HorizontalPanel (com.google.gwt.user.client.ui.HorizontalPanel)2 Label (com.google.gwt.user.client.ui.Label)2 TabPanel (com.google.gwt.user.client.ui.TabPanel)2