package scheduler.view; import javafx.fxml.FXML; import javafx.scene.control.TableColumn; import javafx.scene.control.TableView; import scheduler.Main; public class ViewCalendarController extends ViewScheduleController { @FXML private TableView calendarTable; @FXML private TableColumn range; @FXML private TableColumn sunday; @FXML private TableColumn monday; @FXML private TableColumn tuesday; @FXML private TableColumn wednesday; @FXML private TableColumn thursday; @FXML private TableColumn friday; @FXML private TableColumn saturday; /** * The constructor. The constructor is called before the initialize() method. */ public ViewCalendarController() { } /** * Initializes the controller class. This method is automatically called * after the fxml file has been loaded. */ @FXML private void initialize() { // Initialize the person table with the two columns. range.setCellValueFactory(cellData -> cellData.getValue().rangeProperty()); sunday.setCellValueFactory(cellData -> cellData.getValue().sundayProperty()); monday.setCellValueFactory(cellData -> cellData.getValue().mondayProperty()); tuesday.setCellValueFactory(cellData -> cellData.getValue().tuesdayProperty()); wednesday.setCellValueFactory(cellData -> cellData.getValue().wednesdayProperty()); thursday.setCellValueFactory(cellData -> cellData.getValue().thursdayProperty()); friday.setCellValueFactory(cellData -> cellData.getValue().fridayProperty()); saturday.setCellValueFactory(cellData -> cellData.getValue().saturdayProperty()); } @FXML private void handleOpenAction() { System.out.println("Open clicked\n"); } @FXML private void handleSaveAction() { System.out.println("Save clicked\n"); } @FXML private void handleRatingAction() { System.out.println("Rating clicked"); } /** * Is called by the main application to give a reference back to itself. * * @param mainApp */ public void setMainApp(Main mainApp) { super.setMainApp(mainApp); // Add observable list data to the table calendarTable.setItems(mainApp.getCalendarData()); } }