當前位置: 首頁>>代碼示例>>Java>>正文


Java TreeCell.getTreeItem方法代碼示例

本文整理匯總了Java中javafx.scene.control.TreeCell.getTreeItem方法的典型用法代碼示例。如果您正苦於以下問題:Java TreeCell.getTreeItem方法的具體用法?Java TreeCell.getTreeItem怎麽用?Java TreeCell.getTreeItem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javafx.scene.control.TreeCell的用法示例。


在下文中一共展示了TreeCell.getTreeItem方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addDeleteMenuItem

import javafx.scene.control.TreeCell; //導入方法依賴的package包/類
private void addDeleteMenuItem(ContextMenu menu, TreeCell<NodeDraggable> currentTreeCell) {
	TreeItem<NodeDraggable> currentTreeItem = currentTreeCell.getTreeItem();
	MenuItem deleteMenuItem = new MenuItem("Delete");
	deleteMenuItem.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event)
		{
			if (QueryBuilderHelper.getUserConfirmToDeleteNodeIfNecessary(currentTreeItem)) {
				if (currentTreeItem.getParent() == null) {
					queryNodeTreeView.setRoot(null);
					rootNodeTypeComboBox.getSelectionModel().clearSelection();

					nodeEditorGridPane.getChildren().clear();
				} else {
					currentTreeItem.getParent().getChildren().remove(currentTreeItem);

					nodeEditorGridPane.getChildren().clear();
				}	
			}
		}
	});
	menu.getItems().add(deleteMenuItem);
}
 
開發者ID:Apelon-VA,項目名稱:ISAAC,代碼行數:24,代碼來源:RefsetSpecSearchTypeModel.java

示例2: updateTreeItems

import javafx.scene.control.TreeCell; //導入方法依賴的package包/類
/**
 * Updates all tree items above the current visible one, fetching new items
 * if needed.
 */
private void updateTreeItems()
{
	TreeCell<?> treeCell = virtualFlow.getLastVisibleCell();
	
	if (treeCell != null)
	{
		TreeItem<?> treeItem = treeCell.getTreeItem();
		TreeItem<?> parent = treeItem.getParent();
		
		// Update all items above the current parent.
		int indexAboveParent = treeCell.getIndex() - parent.getChildren().size();
		updateTreeItemsAbove(indexAboveParent);
		
		if (parent instanceof DataPageTreeItem)
		{
			DataPageTreeItem parentDataPageTreeItem = (DataPageTreeItem) parent;
			
			int childrenRemaining = parentDataPageTreeItem.getChildren().size() - parentDataPageTreeItem.getChildren().indexOf(treeItem);
			
			if (childrenRemaining <= 25)
			{
				if (parentDataPageTreeItem.fetchNextBatch())
				{
					// Notify the tree that it needs to rebuild its list.
					fireEvent(new Event(TreeItem.expandedItemCountChangeEvent()));
				}
			}
		}
	}
}
 
開發者ID:ivartanian,項目名稱:JVx.javafx,代碼行數:35,代碼來源:FXDataBooksTree.java

示例3: handleDisclosureNode

import javafx.scene.control.TreeCell; //導入方法依賴的package包/類
@Override
protected boolean handleDisclosureNode(double x, double y) {
    TreeCell<T> treeCell = getControl();
    Node disclosureNode = treeCell.getDisclosureNode();
    if (disclosureNode != null) {
        if (disclosureNode.getBoundsInParent().contains(x, y)) {
            if (treeCell.getTreeItem() != null) {
                treeCell.getTreeItem().setExpanded(! treeCell.getTreeItem().isExpanded());
            }
            return true;
        }
    }
    return false;
}
 
開發者ID:finanzer,項目名稱:epubfx,代碼行數:15,代碼來源:EditingTreeCellBehavior.java

示例4: edit

import javafx.scene.control.TreeCell; //導入方法依賴的package包/類
@Override
protected void edit(TreeCell<T> cell) {
    TreeItem<T> treeItem = cell == null ? null : cell.getTreeItem();
    getCellContainer().edit(treeItem);
}
 
開發者ID:finanzer,項目名稱:epubfx,代碼行數:6,代碼來源:EditingTreeCellBehavior.java


注:本文中的javafx.scene.control.TreeCell.getTreeItem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。