类javafx.scene.control.SelectionModel源码实例Demo

下面列出了怎么用javafx.scene.control.SelectionModel的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: pmd-designer   文件: AstTreeView.java
/**
 * Focus the given node, handling scrolling if needed.
 */
@Override
public void setFocusNode(final Node node, DataHolder options) {
    SelectionModel<TreeItem<Node>> selectionModel = getSelectionModel();

    if (getRoot() == null || getRoot().getValue() == null) {
        return;
    }

    mapToMyTree(getRoot().getValue(), node, options.getData(CARET_POSITION))
        .map(((ASTTreeItem) getRoot())::findItem)
        .ifPresent(found -> {
            // don't fire any selection event while itself setting the selected item
            suppressibleSelectionEvents.suspendWhile(() -> selectionModel.select(found));

        });

    getFocusModel().focus(selectionModel.getSelectedIndex());
    if (!isIndexVisible(selectionModel.getSelectedIndex())) {
        scrollTo(selectionModel.getSelectedIndex());
    }
}
 
源代码2 项目: java-ml-projects   文件: AppUtils.java
@SuppressWarnings("rawtypes")
public static void disableIfNotSelected(SelectionModel selectionModel, Node... nodes) {
	BooleanBinding selected = selectionModel.selectedItemProperty().isNull();
	for (Node node : nodes) {
		node.disableProperty().bind(selected);
	}
}
 
源代码3 项目: java-ml-projects   文件: AppUtils.java
@SuppressWarnings("rawtypes")
public static void disableIfNotSelected(SelectionModel selectionModel, Node... nodes) {
	BooleanBinding selected = selectionModel.selectedItemProperty().isNull();
	for (Node node : nodes) {
		node.disableProperty().bind(selected);
	}
}
 
 类所在包
 类方法
 同包方法