All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.richfaces.fragment.contextMenu.PopupMenu Maven / Gradle / Ivy

There is a newer version: 5.0.0.Alpha3
Show newest version
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2013, Red Hat, Inc. and individual contributors
 * by the @authors tag. See the copyright.txt in the distribution for a
 * full listing of individual contributors.
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this software; if not, write to the Free
 * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
 */
package org.richfaces.fragment.contextMenu;

import org.openqa.selenium.WebElement;
import org.richfaces.fragment.common.picker.ChoicePicker;

/**
 * @author Jiri Stefek
 */
public interface PopupMenu extends PopupMenuGroup {

    /**
     * Selects the menu item from this menu or sub menu according to the rules defined in the picker param.
     * Opens menu, if it is not visible.
     *
     * @param picker for defining the rules by which the item will be selected
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element which satisfies the rules given by picker
     */
    void selectItem(ChoicePicker picker, WebElement target);

    /**
     * Selects the menu item from this menu according to the exact match of its text representation with passed header param.
     * Opens menu, if it is not visible.
     *
     * @param header text representation of the menu item to be selected
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element with text representation matching the given header
     */
    void selectItem(String header, WebElement target);

    /**
     * Selects the menu item from this menu according to its index in the list of all menu items.
     * Opens menu, if it is not visible.
     *
     * Items are indexed from 0. A top menu item (the one which is the closest to the root of the popup menu component) has index 0.
     *
     * @param index zero based index of the item to be selected
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element with index index
     */
    void selectItem(int index, WebElement target);

    /**
     * Expands group from this menu, which satisfies the rules given in picker param.
     * Opens menu, if it is not visible.
     *
     * @param picker object to define which group should be expanded
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element which satisfies the rules given by picker
     * @return the group which was expanded
     */
    PopupMenuGroup expandGroup(ChoicePicker picker, WebElement target);

    /**
     * Expands group from this menu, which text representation matches the given header param.
     * Opens menu, if it is not visible.
     *
     * @param header the header of the group which should be expanded
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element with text representation matching the given header
     * @return the group which was expanded
     */
    PopupMenuGroup expandGroup(String header, WebElement target);

    /**
     * Expands group from this menu, which index equals the given index param.
     * Opens menu, if it is not visible.
     *
     * @param index zero based index of the group to expand
     * @param target for defining the popup menu which will be invoked and from which the item will be selected
     * @throws IllegalArgumentException if there is no such element with index index
     * @return the group which was expanded
     */
    PopupMenuGroup expandGroup(int index, WebElement target);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy