title: JavaFX tableview colors
body: <p>i need create JavaFx TableView with multicolor rows (color1 for low priority, color2 for medium priority etc.). I have created CellFactory</p>
  
  <pre><code>public class TaskCellFactory implements Callback&lt;TableColumn, TableCell&gt; {
  
  @Override
  public TableCell call(TableColumn p) {
  
     TableCell cell = new TableCell&lt;Task, Object&gt;() {
          @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() &amp;&amp; !isSelected() &amp;&amp; !isFocused()){
                      setPriorityStyle(priority);
                  }
              }
          }
  
          @Override
          public void updateSelected(boolean upd){
              super.updateSelected(upd);
              System.out.println("is update");
          }
  
          private void clearPriorityStyle(){
              ObservableList&lt;String&gt; 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;
  } }
  </code></pre>
  
  <p>and css</p>
  
  <pre><code>.priorityLow{ -fx-background-color: palegreen; }
  .priorityMedium{ -fx-background-color: skyblue;}
  .priorityHigh{ -fx-background-color: palevioletred;}
  </code></pre>
  
  <p>But i still need highlight selected rows. How can i do that?</p>