本文整理了Java中javafx.collections.ObservableList.forEach()
方法的一些代码示例,展示了ObservableList.forEach()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObservableList.forEach()
方法的具体详情如下:
包路径:javafx.collections.ObservableList
类名称:ObservableList
方法名:forEach
暂无
代码示例来源:origin: speedment/speedment
/**
* Animates all the children of a Region.
* <code>
* VBox myVbox = new VBox();
* LayoutAnimator animator = new LayoutAnimator();
* animator.observe(myVbox.getChildren());
* </code>
*
* @param nodes the nodes to observe
*/
public void observe(ObservableList<Node> nodes) {
nodes.forEach((node) -> {
this.observe(node);
});
nodes.addListener(this);
}
代码示例来源:origin: pmd/pmd
examples.getValue().forEach(builder::addExample);
代码示例来源:origin: torakiki/pdfsam
@EventListener
public void onDuplicate(final DuplicateSelectedEvent event) {
LOG.trace("Duplicating selected items");
getSelectionModel().getSelectedItems().forEach(i -> getItems().add(i.duplicate()));
}
代码示例来源:origin: torakiki/pdfsam
private void setContextMenuDisable(boolean value) {
field.getTextField().getContextMenu().getItems().forEach(i -> i.setDisable(value));
disableRemoveMenuItemIfNeeded();
}
代码示例来源:origin: torakiki/pdfsam
@EventListener
public void onClear(final ClearModuleEvent event) {
getItems().forEach(d -> d.descriptor().releaseAll());
getSelectionModel().clearSelection();
getItems().clear();
}
代码示例来源:origin: org.testfx/testfx-legacy
static List<TableColumn> getFlattenedColumns(TableView<?> table) {
List<TableColumn> l = new ArrayList<>();
table.getColumns()
.forEach(c -> l.addAll(flatten(c)));
return l;
}
代码示例来源:origin: org.fxmisc.easybind/easybind
@Override
public void dispose() {
source.forEach(elem -> elem.removeListener(weakElemListener));
source.removeListener(weakListListener);
}
代码示例来源:origin: org.drombler.commons/drombler-commons-fx-docking
@Override
public void updateLayoutConstraints() {
dockingSplitPaneChildren.forEach(dockingSplitPaneChild -> dockingSplitPaneChild.updateLayoutConstraints());
recalculateLayoutConstraints();
}
代码示例来源:origin: com.cedarsoft.commons/javafx
private static void dump(Node node, PrintStream out, int depth) {
out.println(Strings.repeat(" ", depth) + node + " #" + node.getId());
Parent parent = (Parent) node;
parent.getChildrenUnmodifiable()
.forEach(child -> {
dump(child, out, depth + 1);
});
}
}
代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx
@Override
public void updateLayoutConstraints() {
dockingSplitPaneChildren.forEach(dockingSplitPaneChild -> dockingSplitPaneChild.updateLayoutConstraints());
recalculateLayoutConstraints();
}
代码示例来源:origin: no.tornado/tornadofx-controls
protected void invalidated() {
getChildren().forEach(child -> {
if (child instanceof ListItem) {
((ListItem) child).needsLayout();
}
});
}
};
代码示例来源:origin: org.drombler.commons/drombler-commons-docking-fx
private void removeDividerPositionChangeListeners() {
splitPane.getDividers().
forEach((divider) -> removeDividerPositionChangeListener(divider));
}
代码示例来源:origin: org.drombler.commons/drombler-commons-fx-docking
private void removeDividerPositionChangeListeners() {
splitPane.getDividers().
forEach((divider) -> removeDividerPositionChangeListener(divider));
}
代码示例来源:origin: org.testfx/testfx-legacy
static List<TableColumn> flatten(TableColumn col) {
if (col.getColumns().size() == 0) {
return Collections.singletonList(col);
} else {
List<TableColumn> l = new ArrayList<>();
col.getColumns()
.forEach(xa -> l.addAll(flatten((TableColumn) xa)));
return l;
}
}
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
private void setCheckedStateRekursiv(TreeItem<T> treeItem, boolean state) {
if (treeItem instanceof CheckBoxTreeItem) {
setCheckedState((CheckBoxTreeItem<T>) treeItem, state);
}
treeItem.getChildren().forEach(child -> setCheckedStateRekursiv(child, state));
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
private void setCheckedStateRekursiv(TreeItem<T> treeItem, boolean state) {
if (treeItem instanceof CheckBoxTreeItem) {
setCheckedState((CheckBoxTreeItem<T>) treeItem, state);
}
treeItem.getChildren().forEach(child -> setCheckedStateRekursiv(child, state));
}
代码示例来源:origin: com.bitplan.gui/com.bitplan.javafx
private static void calcNoOfNodes(Node node) {
if (node instanceof Parent) {
if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
noOfNodes += tempChildren.size();
tempChildren.forEach(n -> calcNoOfNodes(n));
}
}
}
代码示例来源:origin: no.tornado/tornadofx-controls
private void configureHgrow(Node node) {
HBox.setHgrow(node, getInputGrow());
if( node instanceof Field ){
((Field)node).configureHGrow( getInputGrow() );
} else if ( node instanceof Pane){
((Pane)node).getChildren().forEach( child -> configureHgrow( child ));
}
}
代码示例来源:origin: org.controlsfx/controlsfx
private void listenToValues() {
segments.get().addListener(weakSumListener);
getSegments().forEach(segment -> {
// first remove then add listener to ensure listener is only added once
segment.valueProperty().removeListener(weakSumListener);
segment.valueProperty().addListener(weakSumListener);
});
}
代码示例来源:origin: no.tornado/tornadofx-controls
public void configureHGrow( Priority priority ){
// Configure hgrow for current children
getInputContainer().getChildren().forEach( node -> HBox.setHgrow(node, priority));
// Add listener to support inputs added later
getInputContainer().getChildren().addListener((ListChangeListener<Node>) c1 -> {
while (c1.next()) if (c1.wasAdded()) c1.getAddedSubList().forEach( node -> {
HBox.setHgrow(node, priority);
syncVgrowConstraints( node );
});
});
}
内容来源于网络,如有侵权,请联系作者删除!