use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class AddFileAction method onEdit.
public void onEdit() {
if (popup != null) {
popup.hide();
return;
}
files.unregisterKeys();
if (addBox == null) {
addBox = new AddFileBox(changeId, revision, files);
}
addBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(addButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(addBox);
p.showRelativeTo(addButton);
GlobalKey.dialog(p);
addBox.setFocus(true);
popup = p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class EditPreferencesAction method show.
void show() {
if (popup != null) {
hide();
return;
}
current = new EditPreferencesBox(view);
current.set(prefs);
popup = new PopupPanel(true, false);
popup.setStyleName(current.style.dialog());
popup.add(current);
popup.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
view.getEditor().focus();
popup = null;
current = null;
}
});
popup.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
popup.setPopupPosition(300, 120);
}
});
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class PreferencesAction method show.
void show() {
if (popup != null) {
// Already open? Close the dialog.
hide();
return;
}
current = new PreferencesBox(view);
current.set(prefs);
popup = new PopupPanel(true, false);
popup.setStyleName(current.style.dialog());
popup.add(current);
popup.addAutoHidePartner(partner.getElement());
popup.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
view.getCmFromSide(DisplaySide.B).focus();
popup = null;
current = null;
}
});
popup.setPopupPositionAndShow(new PositionCallback() {
@Override
public void setPosition(int offsetWidth, int offsetHeight) {
popup.setPopupPosition(300, 120);
}
});
current.setFocus(true);
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class DeleteFileAction method onDelete.
void onDelete() {
if (popup != null) {
popup.hide();
return;
}
if (deleteBox == null) {
deleteBox = new DeleteFileBox(changeId, revision);
}
deleteBox.clearPath();
final PopupPanel p = new PopupPanel(true);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(deleteButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
}
}
});
p.add(deleteBox);
p.showRelativeTo(deleteButton);
GlobalKey.dialog(p);
deleteBox.setFocus(true);
popup = p;
}
use of com.google.gwt.user.client.ui.PopupPanel in project gerrit by GerritCodeReview.
the class ReplyAction method onReply.
void onReply(MessageInfo msg) {
if (popup != null) {
popup.hide();
return;
}
if (replyBox == null) {
replyBox = new ReplyBox(clp, psId, revision, allLabels, permittedLabels);
allLabels = null;
permittedLabels = null;
}
if (msg != null) {
replyBox.replyTo(msg);
}
final PopupPanel p = new PopupPanel(true, false);
p.setStyleName(style.replyBox());
p.addAutoHidePartner(replyButton.getElement());
p.addAutoHidePartner(quickApproveButton.getElement());
p.addCloseHandler(new CloseHandler<PopupPanel>() {
@Override
public void onClose(CloseEvent<PopupPanel> event) {
if (popup == p) {
popup = null;
if (hasDraftComments || replyBox.hasMessage()) {
replyButton.setStyleName(style.highlight());
}
}
}
});
p.add(replyBox);
Window.scrollTo(0, 0);
replyButton.removeStyleName(style.highlight());
p.showRelativeTo(replyButton);
GlobalKey.dialog(p);
popup = p;
}
Aggregations