public void locateComponents() { sendOrderButton = new Button("Make order"); for (Menu menu : menuCollection) { tabSheet.addTab(addPanelMenu(menu), menu.getCafeName()); } addComponent(tabSheet); addComponent(sendOrderButton); sendOrderButton.addListener(new SendOrderButtonListener()); }
private Panel addPanelMenu(Menu menu) { panel = new Panel(); initComponents(); for (int i = 1; i <= NUMBER_OF_SERVICE_DAYS; i++) { weekdayLabel = new Label(Weekday.getWeekday(i).toString()); gridLayout.addComponent(locateLayoutWeek(weekdayLabel)); for (MenuItem menuItem : menu.getItems().get(Weekday.getWeekday(i))) { ShowDayMenusPanel showDayMenusPanel = new ShowDayMenusPanel(menuItem.getDescription(), menuItem.getCost()); showDayMenusPanel.setId(menuItem.getId()); showDayMenusPanel.setWeekday(menuItem.getWeekday()); currentWeekMenusPanels.add(showDayMenusPanel); gridLayout.addComponent(showDayMenusPanel); panel.addComponent(gridLayout); } } return panel; }