/** * Returns the option text * * @return Option text */ public String getText() { return this.getLabel(); }
@Override public Option copy() throws AWException { return new Option(this); }
@Override public Menu copy() throws AWException { return new Menu(this); }
/** * 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)); }
/** * Stores if option is restricted or not * * @param resOpt Option is restricted */ public void setRestricted(boolean resOpt) { // Set restriction to actual option this.restrictedOption = resOpt; getLogger().debug("Setting restricted screen: {0}", new Object[]{this.getName()}); // Set restriction to children option if (this.getElementList() != null) { for (Element element : this.getElementList()) { Option option = (Option) element; option.setRestricted(resOpt); } } }
/** * Search an initial option by screen name * * @param screen Screen name * @return Option found */ @JsonIgnore public Option getOptionByScreen(String screen) { // Variable definition Option option = null; // Found screen if (this.getScreen() != null && this.getScreen().equals(screen)) { option = this; } else { // Search in child options List<Option> optionList = getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByScreen(screen); } } } return option; }
/** * Search an initial option by name * * @param optionName Option name * @return Option found */ @JsonIgnore public Option getOptionByName(String optionName) { // Variable definition Option option = null; // Found option if (this.getName() != null && this.getName().equals(optionName)) { option = this; } else { // Search in child options List<Option> optionList = getElementList(); for (Option child : optionList) { // Check module if (option == null) { child.setParent(this); option = child.getOptionByName(optionName); } } } return option; } }
/** * 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; }
/** * Returns if option is invisible or not * * @return Option is invisible */ @JsonGetter("visible") public boolean isVisible() { return !isInvisible(); }
/** * Retrieve Option list * * @return Option list */ @JsonGetter("options") public List<Option> getOptions() { return getElementList(); }
/** * Retrieve Option list * * @return Option list */ @JsonGetter("options") public List<Element> getOptions() { return menu.getElementList(); }
/** * 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; }