javafx.scene.control.ListView.focusedProperty()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(211)

本文整理了Java中javafx.scene.control.ListView.focusedProperty()方法的一些代码示例,展示了ListView.focusedProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ListView.focusedProperty()方法的具体详情如下:
包路径:javafx.scene.control.ListView
类名称:ListView
方法名:focusedProperty

ListView.focusedProperty介绍

暂无

代码示例

代码示例来源:origin: pmd/pmd

@Override
protected void beforeParentInit() {
  xpathExpressionArea.setSyntaxHighlighter(new XPathSyntaxHighlighter());
  initGenerateXPathFromStackTrace();
  initialiseVersionSelection();
  expressionTitledPane.titleProperty().bind(xpathVersionUIProperty.map(v -> "XPath Expression (" + v + ")"));
  xpathResultListView.setCellFactory(v -> new XpathViolationListCell());
  exportXpathToRuleButton.setOnAction(e -> showExportXPathToRuleWizard());
  EventStreams.valuesOf(xpathResultListView.getSelectionModel().selectedItemProperty())
        .conditionOn(xpathResultListView.focusedProperty())
        .filter(Objects::nonNull)
        .map(TextAwareNodeWrapper::getNode)
        .subscribe(parent::onNodeItemSelected);
  xpathExpressionArea.richChanges()
            .filter(t -> !t.isIdentity())
            .successionEnds(XPATH_REFRESH_DELAY)
            // Reevaluate XPath anytime the expression or the XPath version changes
            .or(xpathVersionProperty().changes())
            .subscribe(tick -> parent.refreshXPathResults());
}

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls

contentView.focusedProperty().addListener(new ChangeListener<Boolean>() {

代码示例来源:origin: com.dlsc.formsfx/formsfx-core

/**
 * {@inheritDoc}
 */
@Override
public void setupValueChangedListeners() {
  super.setupValueChangedListeners();
  field.itemsProperty().addListener((observable, oldValue, newValue) -> listView.setItems(field.getItems()));
  field.selectionProperty().addListener((observable, oldValue, newValue) -> {
    if (preventUpdate) {
      return;
    }
    preventUpdate = true;
    for (int i = 0; i < field.getItems().size(); i++) {
      if (field.getSelection().contains(field.getItems().get(i))) {
        listView.getSelectionModel().select(i);
      } else {
        listView.getSelectionModel().clearSelection(i);
      }
    }
    preventUpdate = false;
  });
  field.errorMessagesProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(listView));
  field.tooltipProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(listView));
  listView.focusedProperty().addListener((observable, oldValue, newValue) -> toggleTooltip(listView));
}

相关文章