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();
}
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;
}
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);
}
}
}
}
}
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()));
}
}
}
}
}
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++;
}
}
}
Aggregations