use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class DesignerFx method createFxMenuBar.
// private JMenuBar createMenuBar() {
// JMenuBar menuBar = new JMenuBar();
// JMenu menu = new JMenu("Language");
// ButtonGroup group = new ButtonGroup();
//
// LanguageVersion[] languageVersions = getSupportedLanguageVersions();
// for (int i = 0; i < languageVersions.length; i++) {
// LanguageVersion languageVersion = languageVersions[i];
// MenuItem button = new MenuItem(languageVersion.getShortName());
// languageVersionMenuItems[i] = button;
// group.add(button);
// menu.add(button);
// }
// languageVersionMenuItems[DEFAULT_LANGUAGE_VERSION_SELECTION_INDEX].setSelected(true);
// menuBar.add(menu);
//
// JMenu actionsMenu = new JMenu("Actions");
// JMenuItem copyXMLItem = new JMenuItem("Copy xml to clipboard");
// copyXMLItem.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// copyXmlToClipboard();
// }
// });
// actionsMenu.add(copyXMLItem);
// JMenuItem createRuleXMLItem = new JMenuItem("Create rule XML");
// createRuleXMLItem.addActionListener(new ActionListener() {
// public void actionPerformed(ActionEvent e) {
// createRuleXML();
// }
// });
// actionsMenu.add(createRuleXMLItem);
// menuBar.add(actionsMenu);
//
// return menuBar;
// }
private MenuBar createFxMenuBar() {
MenuBar menuBar = new MenuBar();
Menu menu = new Menu("Language");
ToggleGroup group = new ToggleGroup();
LanguageVersion[] languageVersions = getSupportedLanguageVersions();
for (int i = 0; i < languageVersions.length; i++) {
LanguageVersion languageVersion = languageVersions[i];
// JRadioButtonMenuItem button = new JRadioButtonMenuItem(languageVersion.getShortName());
RadioMenuItem button = new RadioMenuItem(languageVersion.getShortName());
button.setToggleGroup(group);
languageVersionMenuItems[i] = button;
// group.add(button);
menu.getItems().add(button);
}
// languageVersionMenuItems[DEFAULT_LANGUAGE_VERSION_SELECTION_INDEX].setSelected(true);
languageVersionMenuItems[getDefaultLanguageVersionSelectionIndex()].setSelected(true);
menuBar.getMenus().add(menu);
Menu actionsMenu = new Menu("Actions");
MenuItem copyXMLItem = new MenuItem("Copy xml to clipboard");
copyXMLItem.setOnAction(e -> copyXmlToClipboard());
actionsMenu.getItems().add(copyXMLItem);
MenuItem createRuleXMLItem = new MenuItem("Create rule XML");
createRuleXMLItem.setOnAction(e -> createRuleXML());
actionsMenu.getItems().add(createRuleXMLItem);
menuBar.getMenus().add(actionsMenu);
return menuBar;
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class SqlPane method createTreeContextMenu.
/**
* 컨텍스트 메뉴 생성 및 기능 적용
*
*
* 2016-10-27 키 이벤트를 setAccelerator를 사용하지않고 이벤트 방식으로 변경 이유 : 도킹기능을 적용하하면
* setAccelerator에 등록된 이벤트가 호출안됨
*
* @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 [F1]");
menuShowData.setOnAction(this::show100RowAction);
MenuItem menuEditShowData = new MenuItem("Show Editable View [CTRL + F1]");
menuEditShowData.setOnAction(this::menuEditShowDataAction);
MenuItem menuFindTable = new MenuItem("Find Table [CTRL + SHIFT + R]");
// menuFindTable.setAccelerator(new KeyCodeCombination(KeyCode.R,
// KeyCombination.CONTROL_DOWN));
menuFindTable.setOnAction(this::showFileTableOnAction);
MenuItem menuProperties = new MenuItem("Properties");
menuProperties.setOnAction(this::showProperties);
MenuItem menuReflesh = new MenuItem("Reflesh [F5]");
// menuReflesh.setOnAction(this::menuRefleshOnAction);
menuReflesh.setAccelerator(new KeyCodeCombination(KeyCode.F5));
ContextMenu contextMenu = new ContextMenu(menu, menuShowData, menuEditShowData, menuFindTable, menuProperties, new SeparatorMenuItem(), menuReflesh);
schemaTree.setContextMenu(contextMenu);
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class CommonsContextMenu method addMenus.
/**
* 컨텍스트 메뉴 추가.
*
* @param node
* @param items
*/
public static void addMenus(Control node, MenuItem... items) {
ContextMenu contextMenu = new ContextMenu();
if (items != null) {
for (MenuItem item : items) {
contextMenu.getItems().add(item);
}
}
node.setContextMenu(contextMenu);
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class CodeAreaFindAndReplaceHelper 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;
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class CodeAreaHelper method createMenus.
/**
*
* 2016-10-27 키 이벤트를 setAccelerator를 사용하지않고 이벤트 방식으로 변경 이유 : 도킹기능을 적용하하면
* setAccelerator에 등록된 이벤트가 호출안됨
*
* @작성자 : KYJ
* @작성일 : 2016. 10. 27.
*/
public void createMenus() {
Menu menuSearch = findAndReplaceHelper.createMenus();
menuMoveToLine = new MenuItem("Move to line");
miToUppercase = new MenuItem("To Uppercase");
miToLowercase = new MenuItem("To Lowercase");
menuMoveToLine.setAccelerator(new KeyCodeCombination(KeyCode.L, KeyCombination.CONTROL_DOWN));
menuMoveToLine.setOnAction(this::moveToLineEvent);
miToUppercase.setAccelerator(new KeyCodeCombination(KeyCode.U, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN));
miToUppercase.setOnAction(this::toUppercaseEvent);
miToLowercase.setAccelerator(new KeyCodeCombination(KeyCode.L, KeyCombination.CONTROL_DOWN, KeyCombination.SHIFT_DOWN));
miToLowercase.setOnAction(this::toLowercaseEvent);
codeArea.getContextMenu().getItems().addAll(menuSearch, menuMoveToLine, miToUppercase, miToLowercase);
}
Aggregations