本文整理汇总了Java中javafx.collections.ObservableList.indexOf方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableList.indexOf方法的具体用法?Java ObservableList.indexOf怎么用?Java ObservableList.indexOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.collections.ObservableList
的用法示例。
在下文中一共展示了ObservableList.indexOf方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: replace
import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override public void replace(Node base, INewDockingContainer indc) {
ObservableList<Tab> tabs = getTabs();
Tab found = null;
for (Tab tab : tabs) {
if (tab.getContent() == base) {
found = tab;
break;
}
}
if (found != null) {
int index = tabs.indexOf(found);
tabs.remove(index);
found.setContent(indc.get());
tabs.add(index, found);
}
}
示例2: getTreeItemText
import javafx.collections.ObservableList; //导入方法依赖的package包/类
private String getTreeItemText(TreeItem<?> lastPathComponent) {
if (lastPathComponent == null || lastPathComponent.getValue() == null) {
return "";
}
String original = lastPathComponent.getValue().toString();
String itemText = original;
int suffixIndex = 0;
TreeItem<?> parent = lastPathComponent.getParent();
if (parent == null)
return itemText;
ObservableList<?> children = parent.getChildren();
for (int i = 0; i < children.indexOf(lastPathComponent); i++) {
TreeItem<?> child = (TreeItem<?>) children.get(i);
String current = child.getValue().toString();
if (current.equals(original)) {
itemText = String.format("%s(%d)", original, ++suffixIndex);
}
}
return itemText;
}
示例3: getTreeTableItemText
import javafx.collections.ObservableList; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") private String getTreeTableItemText(TreeTableView<?> treeTableView,
TreeItem<?> lastPathComponent) {
@SuppressWarnings("rawtypes")
TreeTableColumn treeTableColumn = treeTableView.getTreeColumn();
if (treeTableColumn == null) {
treeTableColumn = treeTableView.getColumns().get(0);
}
ObservableValue<?> cellObservableValue = treeTableColumn.getCellObservableValue(lastPathComponent);
String original = cellObservableValue.getValue().toString();
String itemText = original;
int suffixIndex = 0;
TreeItem<?> parent = lastPathComponent.getParent();
if (parent == null)
return itemText;
ObservableList<?> children = parent.getChildren();
for (int i = 0; i < children.indexOf(lastPathComponent); i++) {
TreeItem<?> child = (TreeItem<?>) children.get(i);
cellObservableValue = treeTableColumn.getCellObservableValue(child);
String current = cellObservableValue.getValue().toString();
if (current.equals(original)) {
itemText = String.format("%s(%d)", original, ++suffixIndex);
}
}
return itemText;
}
示例4: boxRemoved
import javafx.collections.ObservableList; //导入方法依赖的package包/类
public void boxRemoved(int rowNumber) {
RowPane rp = rList.get(rowNumber - 1);
rp.decrementNrOfClosingBoxes();
VBox metabox = (VBox) rp.getParent().getParent();
ObservableList<Node> children = metabox.getChildren();
int idx = children.indexOf(rp.getParent());
children.remove(idx);
children.add(idx, rp);
if (idx != 0) {
rp.setIsFirstRowInBox(false);
}
updateLabelPaddings(rowNumber);
}
示例5: replace
import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override public void replace(Node base, INewDockingContainer indc) {
double[] dividerPositions = getDividerPositions();
ObservableList<Node> items = getItems();
int indexOf = items.indexOf(base);
items.remove(indexOf);
items.add(indexOf, indc.get());
setDividerPositions(dividerPositions);
}
示例6: handle
import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override
public void handle(CellEditEvent<Pair<String, String>, String> event)
{
ObservableList<Pair<String, String>> deviceList = tblMapDevice.getItems();
Pair<String, String> pair = event.getRowValue();
int index = deviceList.indexOf(pair);
deviceList.set(index, new Pair<String, String>(pair.first, event.getNewValue()));
}
示例7: replaceBaseWith
import javafx.collections.ObservableList; //导入方法依赖的package包/类
private void replaceBaseWith(Dockable base, INewDockingContainer dc) {
ObservableList<Node> children = getChildren();
int baseIndex = children.indexOf(base.getComponent());
children.remove(base.getComponent());
children.add(baseIndex, dc.get());
}
示例8: replace
import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override public void replace(Node base, INewDockingContainer indc) {
ObservableList<Node> children = getChildren();
int baseIndex = children.indexOf(base);
children.remove(base);
children.add(baseIndex, indc.get());
}