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

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

There is a newer version: 5.0.0.Alpha3
Show newest version
/*
 * JBoss, Home of Professional Open Source
 * Copyright 2010-2015, 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.richfaces.fragment.common.picker.ChoicePicker;

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

    /**
     * Selects the menu item from this menu or menu group according to the rules defined in the picker param.
     * Opens menu or sub menu from visible menu, if it is not visible.
     *
     * @param picker for defining the rules by 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);

    /**
     * Selects the menu item from this menu or menu group according to the exact match of its text representation with passed header param.
     * Opens menu or sub menu from visible menu, if it is not visible.
     *
     * @param header text representation of the menu item to be selected
     * @throws IllegalArgumentException if there is no such element with text representation matching the given header
     */
    void selectItem(String header);

    /**
     * Selects the menu item from this menu or menu group according to its index in the list of all menu items.
     * Opens menu or sub menu from visible 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
     * @throws IllegalArgumentException if there is no such element with index index
     */
    void selectItem(int index);

    /**
     * Expands group or sub group from this menu, which satisfies the rules given in picker param.
     * Opens menu or sub menu from visible menu, if it is not visible.
     *
     * @param picker object to define which group should be expanded
     * @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);

    /**
     * Expands group or sub group from this menu, which text representation matches the given header param.
     * Opens menu or sub menu from visible menu, if it is not visible.
     *
     * @param header the header of the group which should be expanded
     * @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);

    /**
     * Expands group or sub group from this menu, which index equals the given index param.
     * Opens menu or sub menu from visible menu, if it is not visible.
     *
     * @param index zero based index of the group to expand
     * @throws IllegalArgumentException if there is no such element with index index
     * @return the group which was expanded
     */
    PopupMenuGroup expandGroup(int index);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy