当前位置: 首页>>代码示例>>Java>>正文


Java ObservableList.indexOf方法代码示例

本文整理汇总了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);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:TabDockingContainer.java

示例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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:21,代码来源:JavaFXElementPropertyAccessor.java

示例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;
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:26,代码来源:JavaFXElementPropertyAccessor.java

示例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);
}
 
开发者ID:nonilole,项目名称:Conan,代码行数:15,代码来源:ProofView.java

示例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);
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:9,代码来源:SplitDockingContainer.java

示例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()));
}
 
开发者ID:tengai650,项目名称:SnapDup,代码行数:11,代码来源:MapDeviceDialog.java

示例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());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:VBoxDockingContainer.java

示例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());
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:7,代码来源:VBoxDockingContainer.java


注:本文中的javafx.collections.ObservableList.indexOf方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。