javafx.collections.ObservableList.removeIf()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(4.6k)|赞(0)|评价(0)|浏览(174)

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

ObservableList.removeIf介绍

暂无

代码示例

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

change.getRemoved()
  .forEach(val -> branch.getChildren()
    .removeIf(item -> val.equals(item.getValue()))
  );

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

/**
 * Remove all ship icons from the sea map.
 */
public void removeShipIcons() {
  shipCanvas.getChildren().removeIf(node -> node instanceof ShipIcon);
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

private void clearLines() {
  shipCanvas.getChildren().removeIf(node -> node instanceof Shape);
}

代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx

public boolean removeDockable(FXDockableEntry dockableEntry) {
  if (containsDockable(dockableEntry)) {
    dockableSet.remove(dockableEntry);
    dockables.removeIf(adapter -> adapter.getAdapted().equals(dockableEntry));
    return true;
  } else {
    return false;
  }
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

public static void setupURITextField(TextField textField) {
  textField.textProperty().addListener((observable, oldValue, newValue) -> {
    if (newValue!=null){
      try {
        URI uri = new URI(newValue);
        textField.getStyleClass().removeIf("error"::equals);
      } catch (URISyntaxException e) {
        textField.getStyleClass().add("error");
      }
    }
  });
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

public static void setupLocalTimeTextField(TextField textField) {
    textField.textProperty().addListener((observable, oldValue, newValue) -> {
      if (newValue!=null){
        try {
          TIME_FORMAT.parse(newValue);
          textField.getStyleClass().removeIf("error"::equals);
        } catch (DateTimeParseException e) {
          textField.getStyleClass().add("error");
        }

      }
    });
  }
}

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

private void handlePathModification(Kind k, Path p) {
  switch (k) {
  case CREATE:
    if (! this.children.stream().filter(i -> i.getNativeResourceObject().equals(p))
        .findFirst().isPresent()) {
      this.children
          .add(Files.isDirectory(p) ? new DirPathItemImpl(p,
              this.observe) : new FileItemImpl(p));
    }
    break;
  case DELETE:
    this.children.removeIf(i -> i.getNativeResourceObject().equals(p));
    break;
  case MODIFY:
    this.children.stream().filter(i -> i.getNativeResourceObject().equals(p))
        .findFirst().ifPresent(i -> i.refresh());
    break;
  default:
    break;
  }
}

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

private void handlePathModification(Kind k, Path p) {
  switch (k) {
  case CREATE:
    if (! this.children.stream().filter(i -> i.getNativeResourceObject().equals(p))
        .findFirst().isPresent()) {
      this.children
          .add(Files.isDirectory(p) ? new DirPathItemImpl(p,
              this.observe) : new FileItemImpl(p));
    }
    break;
  case DELETE:
    this.children.removeIf(i -> i.getNativeResourceObject().equals(p));
    break;
  case MODIFY:
    this.children.stream().filter(i -> i.getNativeResourceObject().equals(p))
        .findFirst().ifPresent(i -> i.refresh());
    break;
  default:
    break;
  }
}

代码示例来源:origin: com.jfoenix/jfoenix

@Override
protected void updateChildren() {
  super.updateChildren();
  getChildren().removeIf(node -> node.getStyleClass().contains("box"));
  if (rippler != null) {
    getChildren().add(rippler);
  }
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

public static void setupLocalDateTextField(TextField textField) {
  textField.textProperty().addListener((observable, oldValue, newValue) -> {
    DateTimeFormatter dtf = new DateTimeFormatterBuilder().appendLocalized(FormatStyle.SHORT, null).toFormatter(Locale.getDefault());
    if (newValue!=null){
      try {
        dtf.parse(newValue);
        textField.getStyleClass().removeIf("error"::equals);
      } catch (DateTimeParseException e) {
        textField.getStyleClass().add("error");
      }
    }
  });
}

代码示例来源:origin: io.github.factoryfx/javafxDataEditing

node.getStyleClass().removeIf(c -> c.equals("error"));
node.setOnMouseEntered(null);
node.setOnMouseExited(null);

代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.code.editor.fx

root.getChildren().removeIf( t -> c.getRemoved().contains(t.getValue()));

代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.code.editor.fx

root.getChildren().removeIf( t -> c.getRemoved().contains(t.getValue()));

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

this.buttonArea.getChildren().removeIf(b -> c.getRemoved().contains(b.getUserData()));

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

this.buttonArea.getChildren().removeIf(b -> c.getRemoved().contains(b.getUserData()));

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

getContent().removeIf(node -> node instanceof VBox);
  initializeContent(itemNavigator);
});

相关文章