Search in sources :

Example 46 with ContextMenu

use of javafx.scene.control.ContextMenu 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 47 with ContextMenu

use of javafx.scene.control.ContextMenu 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 48 with ContextMenu

use of javafx.scene.control.ContextMenu 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 49 with ContextMenu

use of javafx.scene.control.ContextMenu 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 50 with ContextMenu

use of javafx.scene.control.ContextMenu 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

ContextMenu (javafx.scene.control.ContextMenu)81 MenuItem (javafx.scene.control.MenuItem)69 ActionEvent (javafx.event.ActionEvent)21 SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)20 Menu (javafx.scene.control.Menu)18 Label (javafx.scene.control.Label)15 List (java.util.List)13 Collectors (java.util.stream.Collectors)13 File (java.io.File)12 VBox (javafx.scene.layout.VBox)11 ObservableList (javafx.collections.ObservableList)9 ArrayList (java.util.ArrayList)8 EventHandler (javafx.event.EventHandler)8 FXCollections (javafx.collections.FXCollections)7 Optional (java.util.Optional)6 Node (javafx.scene.Node)6 Scene (javafx.scene.Scene)6 Text (javafx.scene.text.Text)6 IOException (java.io.IOException)5 Arrays (java.util.Arrays)5