}
private void fillMenu() throws IllegalStateException {
Menu mainMenu = new Menu();
ArrayList<MenuItem> menuItems = new ArrayList<MenuItem>();
EnabledFeatures enabledFeatures = view.getEnabledFeatures();
if (enabledFeatures.queryParametersEnabled()) menuItems.add(getQueryParamMenuItem());
if (enabledFeatures.namedGraphsSpecificationEnabled()) menuItems.add(getNamedGraphMenuItem());
if (enabledFeatures.defaultGraphsSpecificationEnabled()) menuItems.add(getDefaultGraphMenuItem());
if (enabledFeatures.acceptHeadersEnabled()) menuItems.add(getAcceptHeaderMenuItem());
if (enabledFeatures.requestParametersEnabled()) menuItems.add(getRequestMethodMenuItem());
if (menuItems.size() == 0) {
throw new IllegalStateException("No items to fill query config menu");
}
mainMenu.setItems(menuItems.toArray(new MenuItem[menuItems.size()]));