Search in sources :

Example 1 with TextFieldTreeCell

use of javafx.scene.control.cell.TextFieldTreeCell in project Gargoyle by callakrsos.

the class SVNTreeView method addContextMenus.

/***********************************************************************************/
/***********************************************************************************/
/* 일반API 구현 */
/**
	 * 컨텍스트 메뉴 등록
	 *
	 * @작성자 : KYJ
	 * @작성일 : 2016. 4. 4.
	 */
void addContextMenus() {
    menuNew = new Menu("New");
    menuAddNewLocation = new MenuItem("Repository Location");
    menuDiscardLocation = new MenuItem("Discard Location");
    menuReflesh = new MenuItem("Reflesh");
    menuCheckout = new MenuItem("Checkout");
    menuSvnGraph = new MenuItem("SVN Graph");
    menuProperties = new MenuItem("Properties");
    menuNew.getItems().add(menuAddNewLocation);
    menuAddNewLocation.setOnAction(this::menuAddNewLocationOnAction);
    menuDiscardLocation.setOnAction(this::menuDiscardLocationOnAction);
    menuCheckout.setOnAction(this::menuCheckoutOnAction);
    menuSvnGraph.setOnAction(this::menuSVNGraphOnAction);
    menuProperties.setOnAction(this::menuPropertiesOnAction);
    contextMenu = new ContextMenu(menuNew, new SeparatorMenuItem(), menuCheckout, new SeparatorMenuItem(), menuSvnGraph, new SeparatorMenuItem(), menuDiscardLocation, menuReflesh, new SeparatorMenuItem(), menuProperties);
    // setContextMenu(contextMenu);
    setCellFactory(treeItem -> {
        TextFieldTreeCell<SVNItem> textFieldTreeCell = new TextFieldTreeCell<>();
        textFieldTreeCell.setContextMenu(contextMenu);
        return textFieldTreeCell;
    });
    // 특정 조건에 따른 메뉴 VISIBLE 처리를 정의함.
    contextMenu.setOnShown(contextMenuVisibleEvent);
}
Also used : MenuItem(javafx.scene.control.MenuItem) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem) ContextMenu(javafx.scene.control.ContextMenu) ContextMenu(javafx.scene.control.ContextMenu) Menu(javafx.scene.control.Menu) TextFieldTreeCell(javafx.scene.control.cell.TextFieldTreeCell) SeparatorMenuItem(javafx.scene.control.SeparatorMenuItem)

Aggregations

ContextMenu (javafx.scene.control.ContextMenu)1 Menu (javafx.scene.control.Menu)1 MenuItem (javafx.scene.control.MenuItem)1 SeparatorMenuItem (javafx.scene.control.SeparatorMenuItem)1 TextFieldTreeCell (javafx.scene.control.cell.TextFieldTreeCell)1