@Override public Menu copy() throws AWException { return new Menu(this); }
/** * Retrieve Option list * * @return Option list */ @JsonGetter("options") public List<Element> getOptions() { return menu.getElementList(); }
/** * Generate option menu * * @param screen * * @return */ private Menu generateOptionMenu(Screen screen) throws AWException { // Generate option Option option = new Option() .setScreen(screen.getId()) .setInvisible(true) .setName(screen.getId()); // Add option and return menu return new Menu(aweElements.getMenu(getMenuType()).addElement(option)); }
/** * Get menu object * * @param menuId Menu name * @return Menu object * @throws AWException Clone not supported */ @Cacheable(value = "menu", key = "#menuId") public synchronized Menu getMenu(String menuId) throws AWException { Menu menu; String path = menuPath + menuId + xmlExtension; try { // Clone from list menu = readXmlFile(Menu.class, path); if (menu != null) { // Set menu identifier menu.setId(menuId); } } catch (Exception exc) { throw new AWException("Menu" + NOT_FOUND + menuId, exc); } // Get Action return menu; }
/** * Search an initial option by name * * @param optionName Option name * @return Option found */ @JsonIgnore public Option getOptionByName(String optionName) { Option option = null; // Search in child options List<Option> optionList = this.getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByName(optionName); } } return option; } }
/** * Search an initial option by screen name * * @param screen Screen name * @return Option found */ @JsonIgnore public Option getOptionByScreen(String screen) { Option option = null; List<Option> optionList = getElementList(); // Search in child options for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByScreen(screen); } } return option; }