use of javafx.scene.control.MenuItem in project aima-java by aimacode.
the class IntegratedAppBuilder method registerDemo.
public void registerDemo(Class<?> demoClass) {
final IntegratedAppPaneCtrl ctrl = paneCtrl;
MenuItem item = new MenuItem(demoClass.getSimpleName());
item.setOnAction(ev -> ctrl.startDemo(demoClass));
addToMenu(demosMenu, demoClass.getPackage().getName(), item);
}
use of javafx.scene.control.MenuItem in project jabref by JabRef.
the class EditorMenus method getDefaultMenu.
public static List<MenuItem> getDefaultMenu(TextArea textArea) {
List<MenuItem> menuItems = new ArrayList<>();
menuItems.add(new CaseChangeMenu(textArea.textProperty()));
menuItems.add(new ConversionMenu(textArea.textProperty()));
menuItems.add(new SeparatorMenuItem());
menuItems.add(new ProtectedTermsMenu(textArea));
menuItems.add(new SeparatorMenuItem());
return menuItems;
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class DatabaseTableView method initialize.
@FXML
void initialize() {
contextMenuTbModelMst = new ContextMenu();
txtTableName.setOnKeyReleased(event -> {
if (KeyCode.ENTER == event.getCode()) {
String tableName = txtTableName.getText();
requestTables(tableName);
}
});
btnSearch.setOnMouseClicked(event -> {
String name = txtTableName.getText();
String selectedItem = choType.getSelectionModel().getSelectedItem();
switch(selectedItem) {
case TYPE_TABLE:
requestTables(name);
break;
case TYPE_VIEW:
requestViews(name);
}
});
tbMaster.setOnMouseClicked(event -> {
if (event.getClickCount() == 2) {
tbModelMst.getItems().clear();
TableMasterDVO selectedItem = tbMaster.getSelectionModel().getSelectedItem();
try {
if (selectedItem == null)
return;
List<TableModelDVO> list = listColumns(selectedItem);
tbModelMst.getItems().addAll(list);
} catch (Exception e) {
DialogUtil.showExceptionDailog(e, "데이터베이스 처리 에러");
}
}
});
btnSelect.setOnMouseClicked(event -> {
if (tbMaster.getItems().isEmpty() || tbModelMst.getItems().isEmpty()) {
return;
}
TableMasterDVO selectedItem = tbMaster.getSelectionModel().getSelectedItem();
ObservableList<TableModelDVO> items = tbModelMst.getItems();
tableDVO = new TableDVO(selectedItem, items);
close();
});
MenuItem menuDelete = new MenuItem("삭제");
menuDelete.setOnAction(event -> {
TableViewSelectionModel<TableModelDVO> selectionModel = tbModelMst.getSelectionModel();
int selectedIndex = selectionModel.getSelectedIndex();
if (selectedIndex >= 0) {
tbModelMst.getItems().remove(selectedIndex);
selectionModel.clearSelection();
}
});
// MenuItem menuDistinct = new MenuItem("중복제거");
// menuDistinct.setOnAction(event -> {
// ObservableList<TableModelDVO> items = tbModelMst.getItems();
// items.stream().filter(distinctByKey(new Function<TableModelDVO,
// ObservableList<TableModelDVO>>(){
//
// @Override
// public ObservableList<TableModelDVO> apply(TableModelDVO t) {
// // TODO Auto-generated method stub
// return null;
// }));
contextMenuTbModelMst.getItems().add(menuDelete);
tbModelMst.setContextMenu(contextMenuTbModelMst);
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class ProxyServerController method initRemote.
private void initRemote() {
MenuItem miClear = new MenuItem("Clear All");
lvRemoteData.setContextMenu(new ContextMenu(miClear));
miClear.setOnAction(ev -> {
lvRemoteData.getItems().clear();
});
}
use of javafx.scene.control.MenuItem in project Gargoyle by callakrsos.
the class ProxyServerController method initLocal.
private void initLocal() {
MenuItem miClear = new MenuItem("Clear All");
lvLocalData.setContextMenu(new ContextMenu(miClear));
miClear.setOnAction(ev -> {
lvLocalData.getItems().clear();
});
}
Aggregations