本文整理汇总了Java中javafx.scene.control.TreeTableRow.setOnDragDetected方法的典型用法代码示例。如果您正苦于以下问题:Java TreeTableRow.setOnDragDetected方法的具体用法?Java TreeTableRow.setOnDragDetected怎么用?Java TreeTableRow.setOnDragDetected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.control.TreeTableRow
的用法示例。
在下文中一共展示了TreeTableRow.setOnDragDetected方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeSourceRowDraggable
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
private void makeSourceRowDraggable(TreeTableRow<? extends SourceEntry> row) {
row.setOnDragDetected(event -> {
if (selectedEntry == null) {
return;
}
Dragboard dragboard = row.startDragAndDrop(TransferMode.COPY_OR_MOVE);
ClipboardContent content = new ClipboardContent();
content.put(DataFormats.source, selectedEntry);
dragboard.setContent(content);
event.consume();
});
}
示例2: call
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
@Override
public TreeTableRow<IResource> call(TreeTableView<IResource> param) {
TreeTableRow<IResource> row = new TreeTableRow<IResource>() {
@Override
protected void updateItem(IResource resource, boolean empty) {
super.updateItem(resource, empty);
if (empty) {
this.setTooltip(null);
} else {
/* Tooltip & Context Menu */
TooltipFactory<IResource> tooltipFactory = new ResourceTooltipFactory();
ResourceContextMenu resourceContextMenu = new ResourceContextMenu(controller.getProject(), resource, controller);
this.setTooltip(tooltipFactory.createTooltip(resource));
resourceContextMenu.initMenus();
this.setContextMenu(resourceContextMenu);
}
}
};
/* Drag & Drop */
row.setOnDragDetected(event -> dragAndDrop.dragDetected(event, row));
row.setOnDragOver(event -> dragAndDrop.dragOver(event, row));
row.setOnDragDropped(event -> dragAndDrop.dragDropped(event, row));
/* Properties double-click */
row.setOnMouseClicked(this::handleDoubleClick);
return row;
}
示例3: call
import javafx.scene.control.TreeTableRow; //导入方法依赖的package包/类
@Override
public TreeTableRow<ITask> call(TreeTableView<ITask> param) {
TreeTableRow<ITask> row = new TreeTableRow<ITask>() {
@Override
protected void updateItem(ITask task, boolean empty) {
super.updateItem(task, empty);
if (empty) {
this.setTooltip(null);
this.setContextMenu(null);
} else {
/* Tooltip & Context Menu */
TooltipFactory<ITask> tooltipFactory = new TaskTooltipFactory();
TaskContextMenu taskContextMenu = new TaskContextMenu(controller.getProject(), task, controller);
this.setTooltip(tooltipFactory.createTooltip(task));
taskContextMenu.initMenus();
this.setContextMenu(taskContextMenu);
}
}
};
/* Drag & Drop */
row.setOnDragDetected(event -> dragAndDrop.dragDetected(event, row));
row.setOnDragOver(event -> dragAndDrop.dragOver(event, row));
row.setOnDragDropped(event -> dragAndDrop.dragDropped(event, row));
/* Properties double-click */
row.setOnMouseClicked(this::handleDoubleClick);
return row;
}