Search in sources :

Example 1 with FileType

use of com.acgist.snail.pojo.ITaskSession.FileType in project snail by acgist.

the class TaskTableCell method updateItem.

@Override
public void updateItem(String value, boolean empty) {
    super.updateItem(value, empty);
    final HBox box = new HBox();
    final ITaskSession taskSession = this.getTableRow().getItem();
    if (taskSession != null) {
        final Text name = new Text(value);
        if (this.pos != null) {
            box.setAlignment(this.pos);
        }
        if (this.icon) {
            final FileType fileType = taskSession.getFileType();
            final Label fileLabel = Fonts.fileTypeIconLabel(fileType);
            box.getChildren().add(fileLabel);
        }
        if (this.tooltip) {
            this.setTooltip(Tooltips.newTooltip(value));
        }
        box.getChildren().add(name);
    }
    this.setGraphic(box);
}
Also used : HBox(javafx.scene.layout.HBox) ITaskSession(com.acgist.snail.pojo.ITaskSession) FileType(com.acgist.snail.pojo.ITaskSession.FileType) Label(javafx.scene.control.Label) Text(javafx.scene.text.Text)

Aggregations

ITaskSession (com.acgist.snail.pojo.ITaskSession)1 FileType (com.acgist.snail.pojo.ITaskSession.FileType)1 Label (javafx.scene.control.Label)1 HBox (javafx.scene.layout.HBox)1 Text (javafx.scene.text.Text)1