MainPageController.java 文件源码

java
阅读 25 收藏 0 点赞 0 评论 0

项目:grantmaster 作者:
@FXML
private void handleContextHelpButtonAction(ActionEvent event) {
 final Popup popup = new Popup();

  Tab activeTab = TabSelectionChangeListener.getActiveTab();
  if (activeTab == null || activeTab.getUserData() == null) {
    return;
  }
  // The help text is currently stored in userData.
  // TODO(gaborfeher): Find a better place.
  String helpText = (String) activeTab.getUserData();
  Label popupLabel = new Label(helpText);
  popupLabel.setStyle("-fx-border-color: black;");
  popup.setAutoHide(true);
  popup.setAutoFix(true);
  // Calculate popup placement coordinates.
  Node eventSource = (Node) event.getSource();
  Bounds sourceNodeBounds = eventSource.localToScreen(eventSource.getBoundsInLocal());
  popup.setX(sourceNodeBounds.getMinX() - 5.0);
  popup.setY(sourceNodeBounds.getMaxY() + 5.0);
  popup.getContent().addAll(popupLabel);
  popup.show(stage);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号