public void onClick(ClickEvent event) { if (!actionsPopup.isShowing()) { // Instantiate the popup and show it. final Element parent = ActionsLabel.this.getElement(); actionsPopup .setPopupPositionAndShow(new PopupPanel.PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { int left = parent.getAbsoluteLeft(); int top = parent.getAbsoluteTop() + parent.getOffsetHeight() + 2; if (left + actionsPopup.getOffsetWidth() > Window .getClientWidth()) { left = parent.getAbsoluteRight() - actionsPopup.getOffsetWidth(); } actionsPopup.setPopupPosition(left, top); } }); } else { actionsPopup.hide(); } } });
/** * Normally, the popup is positioned directly below the relative target, with * its left edge aligned with the left edge of the target. Depending on the * width and height of the popup and the distance from the target to the * bottom and right edges of the window, the popup may be displayed directly * above the target, and/or its right edge may be aligned with the right edge * of the target. * * @param target the target to show the popup below */ public final void showRelativeTo(final UIObject target) { // Set the position of the popup right before it is shown. setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { position(target, offsetWidth, offsetHeight); } }); }
@Override protected void onEnterKeyDown(Context context, Element parent, Date value, NativeEvent event, ValueUpdater<Date> valueUpdater) { this.lastKey = context.getKey(); this.lastParent = parent; this.lastValue = value; this.lastIndex = context.getIndex(); this.lastColumn = context.getColumn(); this.valueUpdater = valueUpdater; Date viewData = getViewData(lastKey); Date date = (viewData == null) ? lastValue : viewData; datePicker.setCurrentMonth(date); datePicker.setValue(date); panel.setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } }); } }
/** * Normally, the popup is positioned directly below the relative target, with * its left edge aligned with the left edge of the target. Depending on the * width and height of the popup and the distance from the target to the * bottom and right edges of the window, the popup may be displayed directly * above the target, and/or its right edge may be aligned with the right edge * of the target. * * @param target the target to show the popup below */ public final void showRelativeTo(final UIObject target) { // Set the position of the popup right before it is shown. setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { position(target, offsetWidth, offsetHeight); } }); }
/** * Normally, the popup is positioned directly below the relative target, with * its left edge aligned with the left edge of the target. Depending on the * width and height of the popup and the distance from the target to the * bottom and right edges of the window, the popup may be displayed directly * above the target, and/or its right edge may be aligned with the right edge * of the target. * * @param target the target to show the popup below */ public final void showRelativeTo(final UIObject target) { // Set the position of the popup right before it is shown. setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { position(target, offsetWidth, offsetHeight); } }); }
@Override public void onResize(final ResizeEvent event) { if (m_popupPanel.isShowing()) { m_popupPanel.setPopupPositionAndShow(m_repositionPopupPanel); } } });
@Override public void showPopup() { if (!m_popupPanel.isShowing()) { m_popupPanel.setPopupPositionAndShow(m_repositionPopupPanel); } }
protected void showPopup(final DebugPanelFilterModel model, final int filter) { popup = new FilterPopup(model, filter); popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { //@Override public void setPosition(int offsetWidth, int offsetHeight) { popup.setPopupPosition(Item.this.getAbsoluteLeft(), Item.this.getAbsoluteTop() + Item.this.getOffsetHeight()); } }); }
@Override public void setDataList(List<KscReportDetail> dataList) { m_dataList.setList(dataList); m_popupPanel.setPopupPositionAndShow(new PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { m_popupPanel.setWidth((getOffsetWidth() - 5) + "px"); m_popupPanel.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + 24); } }); }
@Override public void setData(List<NodeDetail> dataList) { m_dataList.setList(dataList); m_popupPanel.setPopupPositionAndShow(new PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { m_popupPanel.setWidth((getOffsetWidth() - 5) + "px"); m_popupPanel.setPopupPosition(getAbsoluteLeft(), getAbsoluteTop() + 24); } }); }
public void onClick( ClickEvent event ) { datePicker.setValue( getValue() ); panel.setPopupPositionAndShow( new PositionCallback() { public void setPosition( int offsetWidth, int offsetHeight ) { panel.setPopupPosition( txtDate.getAbsoluteLeft(), txtDate.getAbsoluteTop() + txtDate.getOffsetHeight() ); } } ); }
public void onClick(ClickEvent event) { final PopupPanel helpPopup = new PopupPanel(true); helpPopup.setWidget(new HTML("<br><h3> " + appVersion + " <h3>")); helpPopup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { int left = (Window.getClientWidth() - offsetWidth); int top = 0; helpPopup.setPopupPosition(left, top); } }); } });
panel.setPopupPositionAndShow( new PositionCallback() { public void setPosition( int offsetWidth, int offsetHeight ) {
panel.setPopupPositionAndShow( new PositionCallback() { public void setPosition( int offsetWidth, int offsetHeight ) {
@Override public void showAndReposition() { onReposition(); asPopupPanel().setPopupPositionAndShow((offsetWidth, offsetHeight) -> { PopupPosition popupPosition = positioner.getPopupPosition(offsetWidth, offsetHeight); asPopupPanel().setPopupPosition(popupPosition.getLeft(), popupPosition.getTop()); }); }
@Override protected void onEnterKeyDown(Context context, Element parent, Date value, NativeEvent event, ValueUpdater<Date> valueUpdater) { this.lastKey = context.getKey(); this.lastParent = parent; this.lastValue = value; this.lastIndex = context.getIndex(); this.lastColumn = context.getColumn(); this.valueUpdater = valueUpdater; Date viewData = getViewData(lastKey); Date date = (viewData == null) ? lastValue : viewData; datePicker.setCurrentMonth(date); datePicker.setValue(date); panel.setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } }); } }
@Override protected void onEnterKeyDown(Context context, Element parent, Date value, NativeEvent event, ValueUpdater<Date> valueUpdater) { this.lastKey = context.getKey(); this.lastParent = parent; this.lastValue = value; this.lastIndex = context.getIndex(); this.lastColumn = context.getColumn(); this.valueUpdater = valueUpdater; Date viewData = getViewData(lastKey); Date date = (viewData == null) ? lastValue : viewData; datePicker.setCurrentMonth(date); datePicker.setValue(date); panel.setPopupPositionAndShow(new PositionCallback() { public void setPosition(int offsetWidth, int offsetHeight) { panel.setPopupPosition(lastParent.getAbsoluteLeft() + offsetX, lastParent.getAbsoluteTop() + offsetY); } }); } }
private void show(final DragContext context) { //Get centre of DropTarget final Widget dropTargetParent = context.dropController.getDropTarget(); int cxmin = dropTargetParent.getElement().getAbsoluteLeft(); int cymin = dropTargetParent.getElement().getAbsoluteTop(); int cxmax = dropTargetParent.getElement().getAbsoluteRight(); int cymax = dropTargetParent.getElement().getAbsoluteBottom(); final CoordinateArea ca = new CoordinateArea(cxmin, cymin, cxmax, cymax); //Display Compass if not already visible if (!popup.isAttached()) { popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2), ca.getCenter().getTop() - (offsetHeight / 2)); } }); } else { popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2), ca.getCenter().getTop() - (popup.getOffsetHeight() / 2)); } }
private void show(final DragContext context) { //Get centre of DropTarget final Widget dropTargetParent = context.dropController.getDropTarget(); int cxmin = dropTargetParent.getElement().getAbsoluteLeft(); int cymin = dropTargetParent.getElement().getAbsoluteTop(); int cxmax = dropTargetParent.getElement().getAbsoluteRight(); int cymax = dropTargetParent.getElement().getAbsoluteBottom(); final CoordinateArea ca = new CoordinateArea(cxmin, cymin, cxmax, cymax); //Display Compass if not already visible if (!popup.isAttached()) { popup.setPopupPositionAndShow(new PopupPanel.PositionCallback() { @Override public void setPosition(int offsetWidth, int offsetHeight) { popup.setPopupPosition(ca.getCenter().getLeft() - (offsetWidth / 2), ca.getCenter().getTop() - (offsetHeight / 2)); } }); } else { popup.setPopupPosition(ca.getCenter().getLeft() - (popup.getOffsetWidth() / 2), ca.getCenter().getTop() - (popup.getOffsetHeight() / 2)); } }
aFilterPopup.setPopupPositionAndShow(new PositionCallback()