JavaFX таблицы цветов

Мне нужно создать JavaFx TableView с многоцветными строками (color1 для низкого приоритета, color2 для среднего приоритета и т. д.). Я создал CellFactory

public class TaskCellFactory implements Callback {

@Override
public TableCell call(TableColumn p) {

   TableCell cell = new TableCell() {
        @Override
        public void updateItem(Object item, boolean empty) {
            super.updateItem(item, empty);
            setText(empty ? null : getString());
            setGraphic(null);
            TableRow currentRow = getTableRow();
            Task currentTask = currentRow == null ? null : (Task)currentRow.getItem();
            if(currentTask != null){   
                Priority priority = currentTask.getPriority();
                clearPriorityStyle();
                if(!isHover() && !isSelected() && !isFocused()){
                    setPriorityStyle(priority);
                }
            }
        }

        @Override
        public void updateSelected(boolean upd){
            super.updateSelected(upd);
            System.out.println("is update");
        }

        private void clearPriorityStyle(){
            ObservableList styleClasses = getStyleClass();
            styleClasses.remove("priorityLow");
            styleClasses.remove("priorityMedium");
            styleClasses.remove("priorityHigh");
        }

        private void setPriorityStyle(Priority priority){
            switch(priority){
                case LOW:
                    getStyleClass().add("priorityLow");
                    break;
                case MEDIUM:
                    getStyleClass().add("priorityMedium");
                    break;
                case HIGH:
                    getStyleClass().add("priorityHigh");
                    break;
            }
            System.out.println(getStyleClass());
        }

        private String getString() {
            return getItem() == null ? "" : getItem().toString();
        }
    };
    return cell;
} }

и CSS

.priorityLow{ -fx-background-color: palegreen; }
.priorityMedium{ -fx-background-color: skyblue;}
.priorityHigh{ -fx-background-color: palevioletred;}

Но мне все еще нужно выделить выделенные строки. Как я могу это сделать?

Ответы на вопрос(1)

Ваш ответ на вопрос