當前位置: 首頁>>代碼示例>>Java>>正文


Java PopupPanel.showRelativeTo方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.PopupPanel.showRelativeTo方法的典型用法代碼示例。如果您正苦於以下問題:Java PopupPanel.showRelativeTo方法的具體用法?Java PopupPanel.showRelativeTo怎麽用?Java PopupPanel.showRelativeTo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.PopupPanel的用法示例。


在下文中一共展示了PopupPanel.showRelativeTo方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:20,代碼來源:PopupHelper.java

示例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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:30,代碼來源:RenameFileAction.java

示例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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:31,代碼來源:AddFileAction.java

示例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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:39,代碼來源:ReplyAction.java

示例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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:30,代碼來源:DeleteFileAction.java

示例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;
}
 
開發者ID:gerrit-review,項目名稱:gerrit,代碼行數:26,代碼來源:ActionMessageBox.java

示例7: showMenu

import com.google.gwt.user.client.ui.PopupPanel; //導入方法依賴的package包/類
protected void showMenu() {
	if (menu != null) {
		final PopupPanel pp = new PopupPanel();
		pp.setAutoHideEnabled(true);
		pp.setAutoHideOnHistoryEventsEnabled(true);
		pp.setAnimationEnabled(true);
		pp.setWidget(menu);
		pp.showRelativeTo(chevronMenu);
	}
}
 
開發者ID:marat-gainullin,項目名稱:platypus-js,代碼行數:11,代碼來源:DropDownButton.java

示例8: 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()));
}
 
開發者ID:Jenner4S,項目名稱:unitimes,代碼行數:66,代碼來源:AriaSuggestBox.java


注:本文中的com.google.gwt.user.client.ui.PopupPanel.showRelativeTo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。