Search in sources :

Example 61 with Widget

use of com.google.gwt.user.client.ui.Widget in project kie-wb-common by kiegroup.

the class NotificationView method setup.

@Override
public void setup(final NotificationType type, final String size, final String popOverMessage) {
    setup(type, size);
    final Widget parent = this.size.getParent();
    final Popover popover = new Popover(this.size);
    popover.setTrigger(Trigger.CLICK);
    popover.setPlacement(Placement.RIGHT);
    popover.setTitle(getTitleText());
    popover.setContent(popOverMessage);
    parent.getElement().insertAfter(popover.asWidget().getElement(), icon.getElement());
    popover.reconfigure();
}
Also used : Widget(com.google.gwt.user.client.ui.Widget) Popover(org.gwtbootstrap3.client.ui.Popover)

Example 62 with Widget

use of com.google.gwt.user.client.ui.Widget in project cuba by cuba-platform.

the class CubaPopupButtonConnector method isLastChild.

private boolean isLastChild(Element target) {
    Widget widget = WidgetUtil.findWidget(target, null);
    Widget widgetParent = widget.getParent();
    VAbstractOrderedLayout layout = (VAbstractOrderedLayout) widgetParent.getParent();
    int widgetIndex = layout.getWidgetIndex(widgetParent);
    return widgetIndex == layout.getWidgetCount() - 1;
}
Also used : VAbstractOrderedLayout(com.vaadin.client.ui.orderedlayout.VAbstractOrderedLayout) CubaFileUploadWidget(com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget) Widget(com.google.gwt.user.client.ui.Widget)

Example 63 with Widget

use of com.google.gwt.user.client.ui.Widget in project cuba by cuba-platform.

the class CubaPopupButtonWidget method resetSelectedItem.

protected void resetSelectedItem() {
    for (Widget popupChild : getPopup()) {
        if (popupChild instanceof VAbstractOrderedLayout) {
            VAbstractOrderedLayout content = (VAbstractOrderedLayout) popupChild;
            for (Widget slot : content) {
                Widget contentChild = ((Slot) slot).getWidget();
                VButton button = null;
                if (contentChild instanceof CubaFileUploadWidget) {
                    button = ((CubaFileUploadWidget) contentChild).getSubmitButton();
                } else if (contentChild instanceof VButton) {
                    button = (VButton) contentChild;
                } else if (contentChild instanceof VUpload) {
                    button = ((VUpload) contentChild).submitButton;
                }
                if (button != null && button.getStyleName().contains(SELECTED_ITEM_STYLE)) {
                    button.removeStyleName(SELECTED_ITEM_STYLE);
                }
            }
        }
    }
}
Also used : CubaFileUploadWidget(com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget) VButton(com.vaadin.client.ui.VButton) VAbstractOrderedLayout(com.vaadin.client.ui.orderedlayout.VAbstractOrderedLayout) VUpload(com.vaadin.client.ui.VUpload) Widget(com.google.gwt.user.client.ui.Widget) CubaFileUploadWidget(com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget) Slot(com.vaadin.client.ui.orderedlayout.Slot)

Example 64 with Widget

use of com.google.gwt.user.client.ui.Widget in project cuba by cuba-platform.

the class CubaPopupButtonWidget method onPopupOpened.

@Override
protected void onPopupOpened() {
    super.onPopupOpened();
    if (customLayout) {
        return;
    }
    // find button, assign .v-selected style
    for (Widget popupChild : getPopup()) {
        if (popupChild instanceof VAbstractOrderedLayout) {
            VAbstractOrderedLayout content = (VAbstractOrderedLayout) popupChild;
            for (Widget slot : content) {
                Widget contentChild = ((Slot) slot).getWidget();
                if (contentChild instanceof VButton) {
                    VButton button = (VButton) contentChild;
                    if (button.isEnabled() && !button.getStyleName().contains(SELECTED_ITEM_STYLE)) {
                        button.addStyleName(SELECTED_ITEM_STYLE);
                        button.setFocus(true);
                        break;
                    }
                }
            }
        }
    }
    // add focus handler
    for (Widget popupChild : getPopup()) {
        if (popupChild instanceof VAbstractOrderedLayout) {
            VAbstractOrderedLayout content = (VAbstractOrderedLayout) popupChild;
            for (Widget slot : content) {
                Widget contentChild = ((Slot) slot).getWidget();
                VButton button = null;
                if (contentChild instanceof CubaFileUploadWidget) {
                    button = ((CubaFileUploadWidget) contentChild).getSubmitButton();
                } else if (contentChild instanceof VUpload) {
                    button = ((VUpload) contentChild).submitButton;
                } else if (contentChild instanceof VButton) {
                    button = (VButton) contentChild;
                }
                if (button != null) {
                    final VButton finalButton = button;
                    button.addFocusHandler(new FocusHandler() {

                        @Override
                        public void onFocus(FocusEvent event) {
                            childWidgetFocused(finalButton);
                        }
                    });
                    // sink mouse over
                    DOM.sinkEvents(button.getElement(), Event.ONMOUSEOVER | DOM.getEventsSunk(button.getElement()));
                }
            }
        }
    }
}
Also used : CubaFileUploadWidget(com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget) VButton(com.vaadin.client.ui.VButton) VAbstractOrderedLayout(com.vaadin.client.ui.orderedlayout.VAbstractOrderedLayout) VUpload(com.vaadin.client.ui.VUpload) FocusHandler(com.google.gwt.event.dom.client.FocusHandler) Widget(com.google.gwt.user.client.ui.Widget) CubaFileUploadWidget(com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget) Slot(com.vaadin.client.ui.orderedlayout.Slot) FocusEvent(com.google.gwt.event.dom.client.FocusEvent)

Example 65 with Widget

use of com.google.gwt.user.client.ui.Widget in project cuba by cuba-platform.

the class CubaTabSheetWidget method assignAdditionalCellStyles.

public void assignAdditionalCellStyles(int navIndex) {
    if (navIndex >= 0) {
        int i = 0;
        boolean firstVisibleAfterSelection = false;
        for (Widget widget : tabBar) {
            Tab t = (Tab) widget;
            t.removeStyleName("c-tab-sibling-visible");
            if (!firstVisibleAfterSelection && i > navIndex && !t.isHiddenOnServer()) {
                t.addStyleName("c-tab-sibling-visible");
                firstVisibleAfterSelection = true;
            }
            i++;
        }
    }
}
Also used : Widget(com.google.gwt.user.client.ui.Widget)

Aggregations

Widget (com.google.gwt.user.client.ui.Widget)194 Test (org.junit.Test)22 ClickEvent (com.google.gwt.event.dom.client.ClickEvent)16 IsWidget (com.google.gwt.user.client.ui.IsWidget)16 ClickHandler (com.google.gwt.event.dom.client.ClickHandler)15 HTML (com.google.gwt.user.client.ui.HTML)10 ArrayList (java.util.ArrayList)10 IFrameTabPanel (org.pentaho.mantle.client.solutionbrowser.tabs.IFrameTabPanel)10 Element (com.google.gwt.dom.client.Element)9 MaterialWidget (gwt.material.design.client.base.MaterialWidget)9 Label (com.google.gwt.user.client.ui.Label)8 ListItem (gwt.material.design.client.ui.html.ListItem)8 ListBox (org.gwtbootstrap3.client.ui.ListBox)8 ChangeEvent (com.google.gwt.event.dom.client.ChangeEvent)7 ChangeHandler (com.google.gwt.event.dom.client.ChangeHandler)7 Command (com.google.gwt.user.client.Command)7 FileItem (org.pentaho.mantle.client.solutionbrowser.filelist.FileItem)7 Image (com.google.gwt.user.client.ui.Image)6 CubaFileUploadWidget (com.haulmont.cuba.web.toolkit.ui.client.jqueryfileupload.CubaFileUploadWidget)6 Timer (com.google.gwt.user.client.Timer)5