public void refreshModel(int input) throws RuntimeException { if (getCategories().size() < input) { output.println("You choose not sutable variant, try more."); categoryIndex = 0; categoryName = ""; throw myException; } else { try { categoryIndex = dataRegistry.getProjectList(input).get(0).getParentId(); categoryName = dataRegistry.getProjectList(input).get(0).getParentName(); } catch (NullPointerException ex) { output.println("You choose not sutable variant, try more."); categoryIndex = 0; categoryName = ""; } } }
public void refreshListModel() { this.categories = dataRegistry.getCategories(); }