Search in sources :

Example 61 with MenuItem

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);
}
Also used : MenuItem(javafx.scene.control.MenuItem)

Example 62 with MenuItem

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;
}
Also used : ArrayList(java.util.ArrayList) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem)

Example 63 with MenuItem

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);
}
Also used : TableMasterDVO(kyj.Fx.dao.wizard.core.model.vo.TableMasterDVO) TableDVO(kyj.Fx.dao.wizard.core.model.vo.TableDVO) ContextMenu(javafx.scene.control.ContextMenu) MenuItem(javafx.scene.control.MenuItem) TableModelDVO(kyj.Fx.dao.wizard.core.model.vo.TableModelDVO) SQLException(java.sql.SQLException) FXML(javafx.fxml.FXML)

Example 64 with MenuItem

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();
    });
}
Also used : MenuItem(javafx.scene.control.MenuItem) ContextMenu(javafx.scene.control.ContextMenu)

Example 65 with MenuItem

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();
    });
}
Also used : MenuItem(javafx.scene.control.MenuItem) ContextMenu(javafx.scene.control.ContextMenu)

Aggregations

MenuItem (javafx.scene.control.MenuItem)136 ContextMenu (javafx.scene.control.ContextMenu)72 Menu (javafx.scene.control.Menu)41 SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)41 ActionEvent (javafx.event.ActionEvent)30 File (java.io.File)23 VBox (javafx.scene.layout.VBox)21 ArrayList (java.util.ArrayList)20 List (java.util.List)20 Scene (javafx.scene.Scene)20 Label (javafx.scene.control.Label)19 Collectors (java.util.stream.Collectors)16 MenuBar (javafx.scene.control.MenuBar)15 ObservableList (javafx.collections.ObservableList)13 IOException (java.io.IOException)12 EventHandler (javafx.event.EventHandler)12 Button (javafx.scene.control.Button)12 ImageView (javafx.scene.image.ImageView)12 FXCollections (javafx.collections.FXCollections)11 KeyCodeCombination (javafx.scene.input.KeyCodeCombination)11