本文整理汇总了Java中com.google.gwt.user.client.ui.PopupPanel.addAutoHidePartner方法的典型用法代码示例。如果您正苦于以下问题:Java PopupPanel.addAutoHidePartner方法的具体用法?Java PopupPanel.addAutoHidePartner怎么用?Java PopupPanel.addAutoHidePartner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.gwt.user.client.ui.PopupPanel
的用法示例。
在下文中一共展示了PopupPanel.addAutoHidePartner方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
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;
}
示例2: onRename
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onRename() {
if (popup != null) {
popup.hide();
return;
}
if (renameBox == null) {
renameBox = new RenameFileBox(project, 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;
}
示例3: onEdit
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public void onEdit() {
if (popup != null) {
popup.hide();
return;
}
files.unregisterKeys();
if (addBox == null) {
addBox = new AddFileBox(project, 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;
}
示例4: onReply
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onReply(MessageInfo msg) {
if (popup != null) {
popup.hide();
return;
}
if (replyBox == null) {
replyBox = new ReplyBox(clp, project, 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;
}
示例5: onDelete
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
void onDelete() {
if (popup != null) {
popup.hide();
return;
}
if (deleteBox == null) {
deleteBox = new DeleteFileBox(project, 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;
}
示例6: show
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
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;
}
示例7: AriaSuggestBox
import com.google.gwt.user.client.ui.PopupPanel; //导入方法依赖的package包/类
public AriaSuggestBox(AriaTextBox box, SuggestOracle oracle) {
iOracle = oracle;
iText = box;
iText.setStyleName("gwt-SuggestBox");
initWidget(iText);
addEventsToTextBox();
iSuggestionMenu = new SuggestionMenu();
iPopupScroll = new ScrollPanel(iSuggestionMenu);
iPopupScroll.addStyleName("scroll");
iSuggestionPopup = new PopupPanel(true, false);
iSuggestionPopup.setPreviewingAllNativeEvents(true);
iSuggestionPopup.setStyleName("unitime-SuggestBoxPopup");
iSuggestionPopup.setWidget(iPopupScroll);
iSuggestionPopup.addAutoHidePartner(getElement());
iSuggestionCallback = new SuggestionCallback() {
@Override
public void onSuggestionSelected(Suggestion suggestion) {
if (!suggestion.getReplacementString().isEmpty()) {
setStatus(ARIA.suggestionSelected(status(suggestion)));
}
iCurrentText = suggestion.getReplacementString();
setText(suggestion.getReplacementString());
hideSuggestionList();
fireSuggestionEvent(suggestion);
}
};
iOracleCallback = new SuggestOracle.Callback() {
@Override
public void onSuggestionsReady(Request request, Response response) {
if (response.getSuggestions() == null || response.getSuggestions().isEmpty()) {
if (iSuggestionPopup.isShowing()) iSuggestionPopup.hide();
} else {
iSuggestionMenu.clearItems();
SuggestOracle.Suggestion first = null;
for (SuggestOracle.Suggestion suggestion: response.getSuggestions()) {
iSuggestionMenu.addItem(new SuggestionMenuItem(suggestion));
if (first == null) first = suggestion;
}
iSuggestionMenu.selectItem(0);
ToolBox.setMinWidth(iSuggestionMenu.getElement().getStyle(), (iText.getElement().getClientWidth() - 4) + "px");
iSuggestionPopup.showRelativeTo(iText);
iSuggestionMenu.scrollToView();
if (response.getSuggestions().size() == 1) {
if (first.getReplacementString().isEmpty())
setStatus(status(first));
else
setStatus(ARIA.showingOneSuggestion(status(first)));
} else {
setStatus(ARIA.showingMultipleSuggestions(response.getSuggestions().size(), request.getQuery(), status(first)));
}
}
}
};
Roles.getTextboxRole().setAriaAutocompleteProperty(iText.getElement(), AutocompleteValue.NONE);
iSuggestionPopup.getElement().setAttribute("id", DOM.createUniqueId());
Roles.getTextboxRole().setAriaOwnsProperty(iText.getElement(), Id.of(iSuggestionPopup.getElement()));
}