本文整理汇总了Java中javafx.scene.control.TreeItem.isLeaf方法的典型用法代码示例。如果您正苦于以下问题:Java TreeItem.isLeaf方法的具体用法?Java TreeItem.isLeaf怎么用?Java TreeItem.isLeaf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TreeItem
的用法示例。
在下文中一共展示了TreeItem.isLeaf方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: changed
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
@Override public void changed(ObservableValue<? extends TreeItem<Object>> observable, TreeItem<Object> oldValue,
TreeItem<Object> newValue) {
if (newValue == null) {
okButton.setDisable(true);
documentArea.setText("");
argumentPane.getChildren().clear();
return;
}
TreeItem<Object> item = tree.getSelectionModel().getSelectedItem();
String doc = "";
boolean disable = true;
functionItem = item;
Object value = item.getValue();
if (value instanceof Module) {
doc = ((Module) value).getDocumentation();
} else {
doc = ((Function) value).getDocumentation();
disable = false;
}
okButton.setDisable(disable);
documentArea.setText(doc);
argumentPane.getChildren().clear();
if (item.isLeaf()) {
addArguments(item);
}
}
示例2: onNextFailure
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
public void onNextFailure() {
if (testTree.getRoot() == null) {
return;
}
TreeItem<Test> item = testTree.getSelectionModel().getSelectedItem();
TestTreeItem nextFailure = null;
if (item != null) {
if (item.isLeaf()) {
nextFailure = findNextFailureInSiblings((TestTreeItem) item);
} else {
nextFailure = findNextFailureInChildren((TestTreeItem) item, true);
}
} else {
nextFailure = findNextFailureInChildren((TestTreeItem) testTree.getRoot(), false);
}
if (nextFailure == null) {
return;
}
isExpandNeeded(nextFailure);
int failureIndex = testTree.getRow(nextFailure);
testTree.getSelectionModel().clearAndSelect(failureIndex);
testTree.scrollTo(failureIndex);
}
示例3: findNextFailureInChildren
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private TestTreeItem findNextFailureInChildren(TestTreeItem parent, boolean findInSibling) {
TestTreeItem found = null;
for (TreeItem<Test> child : parent.getChildren()) {
if (child.isLeaf()
&& (((TestTreeItem) child).getState() == State.FAILURE || ((TestTreeItem) child).getState() == State.ERROR)) {
found = (TestTreeItem) child;
break;
} else {
found = findNextFailureInChildren((TestTreeItem) child, findInSibling);
if (found != null) {
break;
}
}
}
if (found == null && findInSibling) {
TestTreeItem sib = (TestTreeItem) parent.nextSibling();
if (isFailure(sib)) {
found = sib;
} else {
if (sib != null) {
found = findNextFailureInChildren(sib, true);
}
}
}
return found;
}
示例4: LinkToTreeClass
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void LinkToTreeClass(TreeItem<TypeController> tree){
if(tree.getValue() != null && tree.getValue().getType().getName().equals(this.classe.getName())) {
this.treeClass = tree.getValue();
this.treeClassTreeItem = tree;
tree.getValue().getClassNameController().addObserver(this);
tree.getValue().getClassColorController().addObserver(this);
tree.getValue().getAddPropertySchemeController().addObserver(this);
tree.getValue().getRemovePropertySchemeController().addObserver(this);
tree.getValue().GetAddPropertySchemeWithValueController().addObserver(this);
tree.getValue().getAddClassSchemeController().addObserver(this);
tree.getValue().getRemoveClassSchemeController().addObserver(this);
return;
}
if(!tree.isLeaf()) {
for(TreeItem<TypeController> t : tree.getChildren()) {
LinkToTreeClass(t);
}
}
}
示例5: sortTree
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
/**
* Sorts tree nodes recursively in order of branches before leaves, then alphabetically.
*
* @param root the root node to sort
*/
private void sortTree(TreeItem<? extends SourceEntry> root) {
if (!root.isLeaf()) {
FXCollections.sort(root.getChildren(),
branchesFirst.thenComparing(alphabetical));
root.getChildren().forEach(this::sortTree);
}
}
示例6: sort
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
/**
* Sorts tree nodes recursively in order of branches before leaves, then alphabetically.
*
* @param node the root node to sort
*/
private void sort(TreeItem<? extends SourceEntry> node) {
if (!node.isLeaf()) {
FXCollections.sort(node.getChildren(),
branchesFirst.thenComparing(alphabetical));
node.getChildren().forEach(this::sort);
}
}
示例7: expandTreeView
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void expandTreeView(TreeItem<Resource> item) {
if (item != null && !item.isLeaf()) {
item.setExpanded(true);
for (TreeItem<Resource> child : item.getChildren()) {
expandTreeView(child);
}
}
}
示例8: collapseTreeView
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void collapseTreeView(TreeItem<?> item) {
if (item != null && !item.isLeaf()) {
item.setExpanded(false);
for (TreeItem<?> child : item.getChildren()) {
collapseTreeView(child);
}
}
}
示例9: expandTreeView
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void expandTreeView(TreeItem<Test> item) {
if (item != null && !item.isLeaf()) {
item.setExpanded(true);
for (TreeItem<Test> child : item.getChildren()) {
expandTreeView(child);
}
}
}
示例10: writeToParent
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void writeToParent(TreeItem<Test> parent, JSONObject parentJSON) {
ObservableList<TreeItem<Test>> children = parent.getChildren();
for (TreeItem<Test> child : children) {
if (child.isLeaf()) {
writeLeafToParent(child, parentJSON);
} else {
writeToParent(child, createParentJSONObject(child, parentJSON));
}
}
}
示例11: expandTreeView
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void expandTreeView(TreeItem<?> item){
if(item != null && !item.isLeaf()){
item.setExpanded(true);
for(TreeItem<?> child:item.getChildren()){
expandTreeView(child);
}
}
}
示例12: collapseTreeView
import javafx.scene.control.TreeItem; //导入方法依赖的package包/类
private void collapseTreeView(TreeItem<?> item){
if(item != null && !item.isLeaf()){
item.setExpanded(false);
for(TreeItem<?> child:item.getChildren()){
collapseTreeView(child);
}
}
}