Guest User

Untitled

a guest
Sep 18th, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. tblAvailableSubjects.setRowFactory((TableView<Subject> param) -> {
  2. TableRow<Subject> row = new TableRow<>();
  3. row.emptyProperty().addListener((obs, wasEmpty, isEmpty) -> {
  4. if(isEmpty) {
  5. row.setContextMenu(null);
  6. row.setStyle("-fx-border-color: transparent");
  7. } else {
  8.  
  9. Subject subject = row.getItem();
  10.  
  11. if(subject.getSubjectEvaluation().equals(SubjectEvaluation.COMPLETED)) {
  12. row.setStyle("-fx-background: #B2EBF2");
  13. } else if(subject.getSubjectEvaluation().equals(SubjectEvaluation.FAILED)) {
  14. row.setStyle("-fx-background: #FF0000");
  15. row.setContextMenu(tblAvailableContext);
  16. } else if(subject.getSubjectEvaluation().equals(SubjectEvaluation.OKAY)) {
  17. row.setStyle("-fx-background: #8BC34A");
  18. row.setContextMenu(tblAvailableContext);
  19. } else if(subject.getSubjectEvaluation().equals(SubjectEvaluation.ENROLLWITHCOREQ)) {
  20. row.setStyle("-fx-background: #FFEB3B");
  21. row.setContextMenu(tblAvailableContext);
  22. } else if(subject.getSubjectEvaluation().equals(SubjectEvaluation.CANTENROLL)) {
  23. row.setStyle("-fx-background: #FFCDD2");
  24. }
  25. }
  26. });
  27. return row;
  28. });
  29.  
  30. .table-view {
  31. /* Constants used throughout the tableview. */
  32. -fx-table-header-border-color: transparent;
  33. -fx-table-cell-border-color: -fx-box-border;
  34. /* Horizontal Lines*/
  35. -fx-background-color: transparent;
  36. }
  37.  
  38. .table-view .filler, .table-view .column-header
  39. {
  40. -fx-size: 40;
  41. -fx-border-style: null;
  42. -fx-border-color: rgb(200.0, 200.0, 200.0);
  43. -fx-border-width: 0 0 1 0;
  44. -fx-background-color: transparent;
  45. }
  46.  
  47. .table-view .show-hide-columns-button
  48. {
  49. -fx-background-color: transparent;
  50. }
  51.  
  52. .table-view .column-header .label,
  53. .table-view .column-drag-header .label
  54. {
  55. -fx-alignment: CENTER_LEFT;
  56. }
  57.  
  58. .table-view .column-header-background
  59. {
  60. -fx-background-color: transparent;
  61. }
  62.  
  63. .table-row-cell {
  64. -fx-cell-size: 30px;
  65. }
  66.  
  67. .table-cell {
  68. -fx-border-color: transparent;
  69. -fx-border-width: 1;
  70. }
Add Comment
Please, Sign In to add comment