Java 类javafx.scene.control.MenuItemBuilder 实例源码

项目:xpanderfx    文件:MainFXMLDocumentController.java   
/**
 * 
 * @return ABOUT
 */
@SuppressWarnings({"deprecation"})
private ContextMenu getAboutMenu() {
    ContextMenu cm = new ContextMenu();
    cm.getItems().addAll(
         MenuItemBuilder.create().text("New Game").onAction(e -> restart()).build(),
         MenuItemBuilder.create().text("Help").onAction(e -> this.showHelpContent()).build(),
         MenuItemBuilder.create().text("About").onAction(e -> this.showAboutContent()).build(),
         MenuItemBuilder.create().text("Exit").onAction(e -> this.setExitAnimationToNode(this.EXITER.getScene().getRoot())).build()
    );
    return cm;
}