use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class ShowHelpCommand method onKeyPress.
@Override
public void onKeyPress(final KeyPressEvent event) {
if (current != null) {
// Already open? Close the dialog.
//
current.hide();
return;
}
final KeyHelpPopup help = new KeyHelpPopup();
help.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(final CloseEvent<PopupPanel> event) {
current = null;
BUS.fireEvent(new FocusEvent() {
});
}
});
current = help;
help.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(final int pWidth, final int pHeight) {
final int left = (Window.getClientWidth() - pWidth) >> 1;
final int wLeft = Window.getScrollLeft();
final int wTop = Window.getScrollTop();
help.setPopupPosition(wLeft + left, wTop + 50);
}
});
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class PopupHelper method show.
void show() {
final PopupPanel p = new PopupPanel(true);
p.setStyleName(Resources.I.style().popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
activatingButton.unlink();
if (popup == p) {
popup = null;
}
}
});
p.add(panel);
p.showRelativeTo(activatingButton);
GlobalKey.dialog(p);
popup = p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class ActionMessageBox method show.
void show() {
if (popup != null) {
popup.hide();
popup = null;
return;
}
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.popup());
p.addAutoHidePartner(activatingButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(this);
p.showRelativeTo(activatingButton);
GlobalKey.dialog(p);
message.setFocus(true);
popup = p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class RenameFileAction method onRename.
void onRename() {
if (popup != null) {
popup.hide();
return;
}
if (renameBox == null) {
renameBox = new RenameFileBox(changeId, revision);
}
renameBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(renameButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(renameBox);
p.showRelativeTo(renameButton);
GlobalKey.dialog(p);
renameBox.setFocus(true);
popup = p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class RevertAction method call.
static void call(final Button b, final Change.Id id, final String revision, final String commitSubject) {
// TODO Replace ActionDialog with a nicer looking display.
b.setEnabled(false);
new TextAreaActionDialog(Util.C.revertChangeTitle(), Util.C.headingRevertMessage()) {
{
sendButton.setText(Util.C.buttonRevertChangeSend());
message.setText(Util.M.revertChangeDefaultMessage(commitSubject, revision));
}
@Override
public void onSend() {
ChangeApi.revert(id.get(), getMessageText(), new GerritCallback<ChangeInfo>() {
@Override
public void onSuccess(ChangeInfo result) {
sent = true;
hide();
Gerrit.display(PageLinks.toChange(result.legacyId()));
}
@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();
}
Aggregations