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);
}
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);
}
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);
}
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;
}
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;
}
Aggregations