Search in sources :

Example 1 with TextSearchComposite

use of com.kyj.fx.voeditor.visual.component.popup.TextSearchComposite in project Gargoyle by callakrsos.

the class BaseConsole method textAreaOnKeyEvent.

/********************************
	 * 작성일 : 2016. 6. 23. 작성자 : KYJ
	 *
	 * 콘솔출력부에서 키 클릭 이벤트
	 *
	 * @param e
	 ********************************/
public void textAreaOnKeyEvent(KeyEvent e) {
    // ctrl + F
    if (e.isControlDown() && e.getCode() == KeyCode.F && !e.isShiftDown() && !e.isAltDown()) {
        TextSearchComposite textSearchView = new TextSearchComposite(this, textArea.textProperty());
        textSearchView.setOnSearchResultListener((vo) -> {
            switch(vo.getSearchType()) {
                case SEARCH_SIMPLE:
                    {
                        int startIndex = vo.getStartIndex();
                        int endIndex = vo.getEndIndex();
                        textArea.selectRange(startIndex, endIndex);
                        break;
                    }
                default:
                    break;
            }
        });
        textSearchView.isSelectScopePropertyProperty().addListener((oba, oldval, newval) -> {
        // if (newval)
        // LOGGER.debug("User Select Locale Scope..");
        // else
        // LOGGER.debug("User Select Gloval Scope..");
        });
        textArea.setOnMouseClicked(event -> {
            IndexRange selection = textArea.getSelection();
            int start = selection.getStart();
            textSearchView.setSlidingStartIndexProperty(start);
        });
        textSearchView.show();
        e.consume();
    }
}
Also used : IndexRange(javafx.scene.control.IndexRange) TextSearchComposite(com.kyj.fx.voeditor.visual.component.popup.TextSearchComposite)

Aggregations

TextSearchComposite (com.kyj.fx.voeditor.visual.component.popup.TextSearchComposite)1 IndexRange (javafx.scene.control.IndexRange)1