use of javafx.scene.control.SeparatorMenuItem in project jabref by JabRef.
the class GroupTreeController method createContextMenuForGroup.
private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) {
ContextMenu menu = new ContextMenu();
MenuItem editGroup = new MenuItem(Localization.lang("Edit group"));
editGroup.setOnAction(event -> {
menu.hide();
viewModel.editGroup(group);
});
MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup"));
addSubgroup.setOnAction(event -> {
menu.hide();
viewModel.addNewSubgroup(group);
});
MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups"));
removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group));
MenuItem removeGroupKeepSubgroups = new MenuItem(Localization.lang("Remove group, keep subgroups"));
removeGroupKeepSubgroups.setOnAction(event -> viewModel.removeGroupKeepSubgroups(group));
MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups"));
removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group));
MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group"));
addEntries.setOnAction(event -> viewModel.addSelectedEntries(group));
MenuItem removeEntries = new MenuItem(Localization.lang("Remove selected entries from this group"));
removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group));
MenuItem sortAlphabetically = new MenuItem(Localization.lang("Sort all subgroups (recursively)"));
sortAlphabetically.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group));
menu.getItems().add(editGroup);
menu.getItems().add(new SeparatorMenuItem());
menu.getItems().addAll(addSubgroup, removeSubgroups, removeGroupAndSubgroups, removeGroupKeepSubgroups);
menu.getItems().add(new SeparatorMenuItem());
menu.getItems().addAll(addEntries, removeEntries);
menu.getItems().add(new SeparatorMenuItem());
menu.getItems().add(sortAlphabetically);
return menu;
}
use of javafx.scene.control.SeparatorMenuItem in project jabref by JabRef.
the class EditorMenus method getDOIMenu.
public static List<MenuItem> getDOIMenu(TextArea textArea) {
AbstractAction copyDoiUrlAction = new CopyDoiUrlAction(textArea);
MenuItem copyDoiUrlMenuItem = new MenuItem((String) copyDoiUrlAction.getValue(Action.NAME));
copyDoiUrlMenuItem.setOnAction(event -> copyDoiUrlAction.actionPerformed(null));
List<MenuItem> menuItems = new ArrayList<>();
menuItems.add(copyDoiUrlMenuItem);
menuItems.add(new SeparatorMenuItem());
return menuItems;
}
use of javafx.scene.control.SeparatorMenuItem in project jabref by JabRef.
the class ProtectedTermsMenu method updateFiles.
private void updateFiles() {
externalFiles.getItems().clear();
for (ProtectedTermsList list : Globals.protectedTermsLoader.getProtectedTermsLists()) {
if (!list.isInternalList()) {
MenuItem fileItem = new MenuItem(list.getDescription());
fileItem.setOnAction(event -> {
String selectedText = opener.getSelectedText();
if ((selectedText != null) && !selectedText.isEmpty()) {
list.addProtectedTerm(selectedText);
}
});
externalFiles.getItems().add(fileItem);
}
}
externalFiles.getItems().add(new SeparatorMenuItem());
MenuItem addToNewFileItem = new MenuItem(Localization.lang("New") + "...");
addToNewFileItem.setOnAction(event -> {
NewProtectedTermsFileDialog dialog = new NewProtectedTermsFileDialog(JabRefGUI.getMainFrame(), Globals.protectedTermsLoader);
dialog.setVisible(true);
if (dialog.isOKPressed()) {
Globals.prefs.setProtectedTermsPreferences(Globals.protectedTermsLoader);
}
});
externalFiles.getItems().add(addToNewFileItem);
}
use of javafx.scene.control.SeparatorMenuItem 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.SeparatorMenuItem in project Gargoyle by callakrsos.
the class JavaCodeAreaHelper method createMenus.
/**
* 메뉴 생성
* @작성자 : KYJ
* @작성일 : 2016. 10. 6.
*/
@Override
public void createMenus() {
super.createMenus();
menuPmd = new Menu("PMD");
menuRunPmd = new MenuItem("Run PMD");
menuAutoComment = new MenuItem("Auto Comment");
menuRunPmd.setOnAction(this);
menuAutoComment.setOnAction(this);
menuPmd.getItems().addAll(menuRunPmd);
codeArea.getContextMenu().getItems().addAll(menuPmd, new SeparatorMenuItem(), menuAutoComment);
}
Aggregations