protected void buildPresentationsList() { menuBar.removeItems(); presentationsMenuMap = new HashMap<>(); Presentations p = table.getPresentations(); for (Object presId : p.getPresentationIds()) { MenuBar.MenuItem item = menuBar.addItem( defaultString(p.getCaption(presId)), selectedItem -> table.applyPresentation(presId) ); Presentation current = p.getCurrent(); if (current != null && presId.equals(current.getId())) { setCurrentItemStyle(item); } Presentation defaultPresentation = p.getDefault(); if (defaultPresentation != null && presId.equals(defaultPresentation.getId())) { setDefaultItemStyle(item); } presentationsMenuMap.put(presId, item); } }
protected void fillPresentations(Presentations presentations) { presentation.removeAllItems(); Collection<Object> availablePresentationIds = presentations.getPresentationIds(); for (Object pId : availablePresentationIds) { Presentation p = presentations.getPresentation(pId); presentation.addItem(p); presentation.setItemCaption(p, presentations.getCaption(pId)); } }