本文整理汇总了Java中com.jfoenix.controls.JFXTreeTableColumn类的典型用法代码示例。如果您正苦于以下问题:Java JFXTreeTableColumn类的具体用法?Java JFXTreeTableColumn怎么用?Java JFXTreeTableColumn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JFXTreeTableColumn类属于com.jfoenix.controls包,在下文中一共展示了JFXTreeTableColumn类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: setupGroupView
import com.jfoenix.controls.JFXTreeTableColumn; //导入依赖的package包/类
private void setupGroupView() {
groupList = new JFXTreeTableView<>();
TreeTableColumn<GroupTreeObject, String> nameColumn = new JFXTreeTableColumn<>("Name");
nameColumn.setPrefWidth(150);
nameColumn.setCellValueFactory((TreeTableColumn.CellDataFeatures<GroupTreeObject, String> param) -> {
Group group = fromItem(param.getValue());
if (group == null) {
return new SimpleStringProperty();
}
return new SimpleStringProperty(group.getDisplayName());
});
groupList.getColumns().add(nameColumn);
TreeItem treeItem = new TreeItem<>();
treeItem.setExpanded(true);
groupList.setRoot(treeItem);
groupList.setShowRoot(false);
groupList.setPrefHeight(Short.MAX_VALUE);
}
开发者ID:MakerTim,项目名称:LuckPermsUI,代码行数:20,代码来源:GroupListManager.java
示例2: checkGroupedColumn
import com.jfoenix.controls.JFXTreeTableColumn; //导入依赖的package包/类
/**
* only allows editing for items that are not grouped
*
* @return whether the item is grouped or not
*/
private boolean checkGroupedColumn() {
boolean allowEdit = true;
if (getTreeTableRow().getTreeItem() != null) {
Object rowObject = getTreeTableRow().getTreeItem().getValue();
if (rowObject instanceof RecursiveTreeObject && rowObject.getClass() == RecursiveTreeObject.class) {
allowEdit = false;
} else {
// check grouped columns in the tableview
if (getTableColumn() instanceof JFXTreeTableColumn && ((JFXTreeTableColumn) getTableColumn()).isGrouped()) {
// make sure that the object is a direct child to a group node
if (getTreeTableRow().getTreeItem().getParent() != null &&
getTreeTableRow().getTreeItem().getParent().getValue().getClass() == RecursiveTreeObject.class) {
allowEdit = false;
}
}
}
}
return allowEdit;
}
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:25,代码来源:GenericEditableTreeTableCell.java
示例3: setupCellValueFactory
import com.jfoenix.controls.JFXTreeTableColumn; //导入依赖的package包/类
private <T> void setupCellValueFactory(JFXTreeTableColumn<FXHost, T> column, Function<FXHost, ObservableValue<T>> mapper) {
column.setCellValueFactory((TreeTableColumn.CellDataFeatures<FXHost, T> param) -> {
if (column.validateValue(param)) {
return mapper.apply(param.getValue().getValue());
} else {
return column.getComputedValue(param);
}
});
}
开发者ID:b3log,项目名称:JHosts,代码行数:10,代码来源:HostController.java
示例4: leftLabelPadding
import com.jfoenix.controls.JFXTreeTableColumn; //导入依赖的package包/类
@Override
protected double leftLabelPadding() {
double leftPadding = super.leftLabelPadding();
final double height = getCellSize();
TreeTableColumn<S, T> tableColumn = getSkinnable().getTableColumn();
if (tableColumn == null) {
return leftPadding;
}
TreeTableView<S> treeTable = getSkinnable().getTreeTableView();
if (treeTable == null) {
return leftPadding;
}
int columnIndex = treeTable.getVisibleLeafIndex(tableColumn);
TreeTableColumn<S, ?> treeColumn = treeTable.getTreeColumn();
if (!(treeTable instanceof JFXTreeTableView)) {
if ((treeColumn == null && columnIndex != 0) || (treeColumn != null && !tableColumn.equals(treeColumn))) {
return leftPadding;
}
}
TreeTableRow<S> treeTableRow = getSkinnable().getTreeTableRow();
if (treeTableRow == null) {
return leftPadding;
}
TreeItem<S> treeItem = getSkinnable().getTreeTableRow().getTreeItem();
if (treeItem == null) {
return leftPadding;
}
// getTreeItemLevel ignore the group nodes level
treeColumn = treeTable.getTreeColumn() == null ? treeTable.getVisibleLeafColumn(0) : treeTable.getTreeColumn();
if (tableColumn == treeColumn) {
int nodeLevel = treeTable.getTreeItemLevel(treeItem);
if (!treeTable.isShowRoot()) {
nodeLevel--;
}
double indentPerLevel = 10;
if (treeTableRow.getSkin() instanceof JFXTreeTableRowSkin) {
indentPerLevel = ((JFXTreeTableRowSkin<?>) treeTableRow.getSkin()).getIndentationPerLevel();
}
leftPadding += nodeLevel * indentPerLevel;
}
if (tableColumn == treeColumn || ((JFXTreeTableColumn<S, T>) tableColumn).isGrouped()) {
// add in the width of the disclosure node
if (JFXTreeTableRowSkin.disclosureWidthMap != null && JFXTreeTableRowSkin.disclosureWidthMap.containsKey(
treeTable)) {
leftPadding += JFXTreeTableRowSkin.disclosureWidthMap.get(treeTable);
}
}
// adding in the width of the graphic on the tree item
leftPadding += treeItem.getGraphic() == null ? 0 : treeItem.getGraphic().prefWidth(height);
return leftPadding;
}
开发者ID:jfoenixadmin,项目名称:JFoenix,代码行数:57,代码来源:JFXTreeTableCellSkin.java
示例5: MethodRefCellValueFactory
import com.jfoenix.controls.JFXTreeTableColumn; //导入依赖的package包/类
public MethodRefCellValueFactory(Function<S, T> supplier, JFXTreeTableColumn<S, T> column) {
this.supplier = Objects.requireNonNull(supplier);
this.column = Objects.requireNonNull(column);
}
开发者ID:openbase,项目名称:bco.bcozy,代码行数:5,代码来源:PermissionsPaneController.java
注:本文中的com.jfoenix.controls.JFXTreeTableColumn类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论