Search in sources :

Example 71 with MenuItem

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

the class SqlMultiplePane method createTreeContextMenu.

/**
	 * 컨텍스트 메뉴 생성 및 기능 적용
	 *
	 * @param schemaTree2
	 */
private void createTreeContextMenu(TreeView<K> schemaTree) {
    MenuItem menuSelectScript = new MenuItem("Select Script");
    menuSelectScript.setOnAction(this::applySelectScript);
    MenuItem menuUpdateScript = new MenuItem("Update Script");
    menuUpdateScript.setOnAction(this::applyUpdateScript);
    MenuItem menuDeleteScript = new MenuItem("Delete Script");
    menuDeleteScript.setOnAction(this::applyDeleteSelectScript);
    MenuItem menuInsertScript = new MenuItem("Insert Script");
    menuInsertScript.setOnAction(this::applyInsertScript);
    Menu menu = new Menu("Script", null, menuSelectScript, menuUpdateScript, menuDeleteScript, menuInsertScript);
    // MenuItem menuPrimaryKeys = new MenuItem("Primary Keys");
    MenuItem menuShowData = new MenuItem("Show 100 rows");
    menuShowData.setOnAction(this::show100RowAction);
    MenuItem menuProperties = new MenuItem("Properties");
    menuProperties.setOnAction(this::showProperties);
    MenuItem menuReflesh = new MenuItem("Reflesh");
    menuReflesh.setOnAction(this::menuRefleshOnAction);
    menuReflesh.setAccelerator(new KeyCodeCombination(KeyCode.F5));
    ContextMenu contextMenu = new ContextMenu(menu, menuShowData, menuProperties, new SeparatorMenuItem(), menuReflesh);
    schemaTree.setContextMenu(contextMenu);
}
Also used : MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) KeyCodeCombination(javafx.scene.input.KeyCodeCombination) ContextMenu(javafx.scene.control.ContextMenu) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem)

Example 72 with MenuItem

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

the class SqlMultiplePane method createResultTableContextMenu.

private void createResultTableContextMenu(TableView<Map<String, Object>> tbResult) {
    MenuItem menuExportExcel = new MenuItem("Export Excel File");
    menuExportExcel.setOnAction(e -> menuExportExcelOnAction(tbResult));
    MenuItem menuExportSpreadSheet = new MenuItem("Export SpreadSheet");
    menuExportSpreadSheet.setOnAction(this::menuExportSpreadSheetOnAction);
    Menu menuExportExcelFile = new Menu("Export", null, menuExportExcel, menuExportSpreadSheet);
    ContextMenu contextMenu = new ContextMenu(menuExportExcelFile);
    tbResult.setContextMenu(contextMenu);
}
Also used : MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) ContextMenu(javafx.scene.control.ContextMenu) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu)

Example 73 with MenuItem

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

the class SqlPane method createResultTableContextMenu.

private void createResultTableContextMenu(TableView<?> tableView) {
    MenuItem menuExportExcel = new MenuItem("Export Excel File");
    menuExportExcel.setOnAction(this::menuExportExcelOnAction);
    MenuItem menuExportSpreadSheet = new MenuItem("Export SpreadSheet");
    menuExportSpreadSheet.setOnAction(this::menuExportSpreadSheetOnAction);
    MenuItem menuExportInsertScript = new MenuItem("Export Insert Script");
    menuExportInsertScript.setOnAction(this::menuExportInsertScriptOnAction);
    MenuItem menuExportMergeScript = new MenuItem("Export Merge Script");
    menuExportMergeScript.setOnAction(this::menuExportMergeScriptOnAction);
    MenuItem menuExportJson = new MenuItem("Export Json");
    menuExportJson.setOnAction(this::menuExportJsonOnAction);
    Menu menuExportExcelFile = new Menu("Export", null, menuExportExcel, menuExportSpreadSheet, menuExportInsertScript, menuExportMergeScript, menuExportJson);
    ContextMenu contextMenu = new ContextMenu(menuExportExcelFile);
    tableView.setContextMenu(contextMenu);
}
Also used : MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) ContextMenu(javafx.scene.control.ContextMenu)

Example 74 with MenuItem

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

the class SqlPane method createTabItem.

/**
	 * 탭추가.
	 *
	 * 2016-12-09 CodeAssistHelper 기능 추가.
	 *
	 * 2016-10-27 키 이벤트를 setAccelerator를 사용하지않고 이벤트 방식으로 변경 이유 : 도킹기능을 적용하하면
	 * setAccelerator에 등록된 이벤트가 호출안됨
	 *
	 * @return
	 */
SqlTab createTabItem() {
    SqlTab sqlTab = new SqlTab(this::txtSqlOnKeyEvent);
    SqlKeywords sqlNode = sqlTab.getSqlNode();
    //코드 AreaHelper 설치.
    new ASTSqlCodeAreaHelper(sqlNode.getCodeArea(), connectionSupplier);
    ContextMenu contextMenu = sqlTab.getTxtSqlPaneContextMenu();
    Menu menuFunc = new Menu("Functions");
    MenuItem menuQueryMacro = new MenuItem("Query-Macro");
    menuQueryMacro.setOnAction(this::menuQueryMacroOnAction);
    MenuItem menuFormatter = new MenuItem("SQL Formatter [F + CTRL + SHIFT] ");
    // 2016-10-27 주석
    // menuFormatter.setAccelerator(new KeyCodeCombination(KeyCode.F,
    // KeyCombination.SHIFT_DOWN, KeyCombination.CONTROL_DOWN));
    menuFormatter.setOnAction(this::menuFormatterOnAction);
    MenuItem menuShowApplicationCode = new MenuItem("Show Application Code");
    menuShowApplicationCode.setOnAction(this::menuShowApplicationCodeOnAction);
    menuFunc.getItems().addAll(menuQueryMacro, menuFormatter, menuShowApplicationCode);
    contextMenu.getItems().add(menuFunc);
    return sqlTab;
}
Also used : SqlKeywords(com.kyj.fx.voeditor.visual.component.text.SqlKeywords) ASTSqlCodeAreaHelper(com.kyj.fx.voeditor.visual.component.text.ASTSqlCodeAreaHelper) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) SqlTab(com.kyj.fx.voeditor.visual.component.sql.tab.SqlTab) Menu(javafx.scene.control.Menu) ContextMenu(javafx.scene.control.ContextMenu)

Example 75 with MenuItem

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

the class DragDropWrapping method createContextMenu.

private ContextMenu createContextMenu() {
    contextMenu = new ContextMenu();
    MenuItem menuSelectAll = new MenuItem("모두선택");
    MenuItem menuDelete = new MenuItem("선택 삭제");
    MenuItem menuTopProp = new MenuItem("위로");
    menuDelete.setOnAction(event -> {
        int indexOf = drawingPane.getChildren().indexOf(source);
        drawingPane.getChildren().remove(indexOf);
    });
    menuTopProp.setOnAction(event -> {
        int indexOf = drawingPane.getChildren().indexOf(source);
        try {
            drawingPane.getChildren().remove(indexOf);
            drawingPane.getChildren().add(getNode());
        } catch (Exception e) {
            e.printStackTrace();
        }
    });
    contextMenu.getItems().addAll(menuSelectAll, menuDelete, menuTopProp);
    return contextMenu;
}
Also used : ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem)

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