use of com.google.gwt.user.client.ui.PopupPanel 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;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class RebaseAction method call.
static void call(final Button b, final String project, final String branch, final Change.Id id, final String revision, final boolean enabled) {
b.setEnabled(false);
new RebaseDialog(project, branch, id, enabled) {
@Override
public void onSend() {
ChangeApi.rebase(id.get(), revision, getBase(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(id));
}
@Override
public void onFailure(Throwable caught) {
enableButtons(true);
super.onFailure(caught);
}
});
}
@Override
public void onClose(CloseEvent<PopupPanel> event) {
super.onClose(event);
b.setEnabled(true);
}
}.center();
}
use of com.google.gwt.user.client.ui.PopupPanel in project opennms by OpenNMS.
the class CustomDisplay method createPopup.
protected PopupPanel createPopup() {
PopupPanel p = new PopupPanel(true, false);
p.setStyleName("gwt-SuggestBoxPopup");
p.setPreviewingAllNativeEvents(true);
// p.setAnimationType(PopupPanel.AnimationType.ROLL_DOWN);
return p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project activityinfo by bedatadriven.
the class FullScreenOverlay method show.
public void show(IsWidget widget) {
this.widget = widget.asWidget();
container = new AbsolutePanel();
container.addStyleName(BaseStylesheet.CONTAINER_STYLE);
container.addStyleName(BUNDLE.style().container());
container.add(widget);
sizeContainer();
popupPanel = new PopupPanel(false);
popupPanel.setPopupPosition(LEFT_MARGIN, 0);
popupPanel.setWidget(container);
popupPanel.show();
Roles.getDialogRole().set(popupPanel.getElement());
Window.addResizeHandler(new ResizeHandler() {
Timer resizeTimer = new Timer() {
@Override
public void run() {
sizeContainer();
}
};
@Override
public void onResize(ResizeEvent event) {
resizeTimer.cancel();
resizeTimer.schedule(250);
}
});
}
use of com.google.gwt.user.client.ui.PopupPanel in project gwt-react-examples by GWTReact.
the class App method onModuleLoad.
@Override
public void onModuleLoad() {
final Button button = new Button("Show embedded React view");
button.addClickHandler((event) -> {
// Show a React component in a popup panel
dialog = new PopupPanel(true);
StatefulExample.Props statefulComp1Props = new StatefulExample.Props();
statefulComp1Props.aProp = "Embedded React component 1";
ReactPanel reactPanel = new ReactPanel(React.createElement(StatefulExample.class, statefulComp1Props));
reactPanel.setWidth("700px");
reactPanel.setHeight("700px");
dialog.add(reactPanel);
dialog.setGlassEnabled(true);
dialog.center();
});
RootPanel.get("replaceme").add(button);
// Add React component to Root Panel
StatefulExample.Props statefulComp2Props = new StatefulExample.Props();
statefulComp2Props.aProp = "Embedded React component 2";
ReactPanel reactPanel = new ReactPanel(React.createElement(StatefulExample.class, statefulComp2Props));
RootPanel.get("replaceme2").add(reactPanel);
}
Aggregations