Search in sources :

Example 81 with MenuItem

use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.

the class CommonsContextMenu method upMenuEvent.

/**
	 * 위로
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 2. 15.
	 * @param node
	 * @return
	 */
private static MenuItem upMenuEvent(Control node) {
    MenuItem menuItem = new MenuItem("위");
    menuItem.addEventHandler(ActionEvent.ACTION, event -> {
        CommonContextMenuEvent addMenuEvent = new CommonContextMenuEvent(node, menuItem, Menus.UP);
        node.fireEvent(addMenuEvent);
    });
    return menuItem;
}
Also used : CommonContextMenuEvent(com.kyj.fx.voeditor.visual.events.CommonContextMenuEvent) MenuItem(javafx.scene.control.MenuItem)

Example 82 with MenuItem

use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.

the class CommonsContextMenu method deleteMenuEvent.

/**
	 * @Date 2015. 10. 14.
	 * @param tableView
	 * @return
	 * @User KYJ
	 */
private static MenuItem deleteMenuEvent(Control node) {
    MenuItem menuItem = new MenuItem("삭제");
    menuItem.addEventHandler(ActionEvent.ACTION, event -> {
        CommonContextMenuEvent addMenuEvent = new CommonContextMenuEvent(node, menuItem, Menus.DELETE);
        node.fireEvent(addMenuEvent);
    });
    return menuItem;
}
Also used : CommonContextMenuEvent(com.kyj.fx.voeditor.visual.events.CommonContextMenuEvent) MenuItem(javafx.scene.control.MenuItem)

Example 83 with MenuItem

use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.

the class SqlTabPanExample method start.

@Override
public void start(Stage primaryStage) throws NotYetSupportException, GargoyleConnectionFailException, InstantiationException, IllegalAccessException, ClassNotFoundException {
    primaryStage.setTitle("Database Exam");
    CommonsSqllPan sqlPane = CommonsSqllPan.getSqlPane();
    sqlPane.getStylesheets().add(SkinManager.getInstance().getSkin());
    BorderPane root = new BorderPane(sqlPane);
    Menu menu = new Menu("Exam");
    MenuItem e = new MenuItem("exam");
    e.setOnAction(System.out::println);
    e.setAccelerator(new KeyCodeCombination(KeyCode.E, KeyCombination.CONTROL_DOWN));
    menu.getItems().add(e);
    root.setTop(new MenuBar(menu));
    primaryStage.setScene(new Scene(root, 1100, 700));
    primaryStage.show();
// Application.setUserAgentStylesheet(Application.STYLESHEET_MODENA);
// DockPane.initializeDefaultUserAgentStylesheet();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) CommonsSqllPan(com.kyj.fx.voeditor.visual.component.sql.view.CommonsSqllPan) MenuBar(javafx.scene.control.MenuBar) MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu) Scene(javafx.scene.Scene)

Example 84 with MenuItem

use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.

the class PagedCodeAreaFindAndReplaceHelper method createMenus.

/**
	 *  FindAndReplace에 대한 메뉴를 정의.
	 * @return
	 * @작성자 : KYJ
	 * @작성일 : 2017. 1. 13.
	 */
public Menu createMenus() {
    menuSearch = new Menu("Search");
    miFindReplace = new MenuItem("Find/Replace");
    miFindReplace.setAccelerator(new KeyCodeCombination(KeyCode.F, KeyCombination.CONTROL_DOWN));
    miFindReplace.setOnAction(this::findReplaceEvent);
    menuSearch.getItems().add(miFindReplace);
    return menuSearch;
}
Also used : MenuItem(javafx.scene.control.MenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) Menu(javafx.scene.control.Menu)

Example 85 with MenuItem

use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.

the class NrchRealtimeSrchFlowComposite method contextMenu.

/**
	 * @작성자 : KYJ
	 * @작성일 : 2016. 11. 21.
	 */
private void contextMenu(Node target) {
    target.setOnMousePressed(ev -> {
        if (MouseButton.SECONDARY == ev.getButton()) {
            if (ev.getClickCount() != 1) {
                return;
            }
            if (ev.getSource() instanceof VBox) {
                VBox tmp = (VBox) ev.getSource();
                Object userData = tmp.getUserData();
                if (userData != null) {
                    ContextMenu contextMenu = new ContextMenu();
                    MenuItem menuGoogleTrend = new MenuItem("구글 트랜드로 조회");
                    menuGoogleTrend.setOnAction(e -> {
                        googleChartSearch((RealtimeSearchItemVO) userData);
                    });
                    MenuItem menuArticleAnalyzer = new MenuItem("기사 분석기 - Preview ver.");
                    menuArticleAnalyzer.setOnAction(e -> {
                        FxUtil.createStageAndShow(new ArticleExtractorComposite((RealtimeSearchItemVO) userData), stage -> {
                            stage.initOwner(FxUtil.getWindow(getParent()));
                            stage.setTitle(ArticleExtractorComposite.TITLE);
                            stage.sizeToScene();
                        });
                    });
                    contextMenu.getItems().addAll(menuGoogleTrend, menuArticleAnalyzer);
                    contextMenu.show(this.getParent().getScene().getWindow(), ev.getScreenX(), ev.getScreenY());
                }
            }
        }
    });
}
Also used : RealtimeSearchItemVO(com.kyj.fx.voeditor.visual.framework.RealtimeSearchItemVO) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) VBox(javafx.scene.layout.VBox)

Aggregations

MenuItem (javafx.scene.control.MenuItem)136 ContextMenu (javafx.scene.control.ContextMenu)72 Menu (javafx.scene.control.Menu)41 SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)41 ActionEvent (javafx.event.ActionEvent)30 File (java.io.File)23 VBox (javafx.scene.layout.VBox)21 ArrayList (java.util.ArrayList)20 List (java.util.List)20 Scene (javafx.scene.Scene)20 Label (javafx.scene.control.Label)19 Collectors (java.util.stream.Collectors)16 MenuBar (javafx.scene.control.MenuBar)15 ObservableList (javafx.collections.ObservableList)13 IOException (java.io.IOException)12 EventHandler (javafx.event.EventHandler)12 Button (javafx.scene.control.Button)12 ImageView (javafx.scene.image.ImageView)12 FXCollections (javafx.collections.FXCollections)11 KeyCodeCombination (javafx.scene.input.KeyCodeCombination)11