001    /*
002      Copyright (C) 2002 Laurent Martelli.
003    
004      This program is free software; you can redistribute it and/or modify
005      it under the terms of the GNU Lesser General Public License as
006      published by the Free Software Foundation; either version 2 of the
007      License, or (at your option) any later version.
008    
009      This program is distributed in the hope that it will be useful,
010      but WITHOUT ANY WARRANTY; without even the implied warranty of
011      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
012      GNU Lesser General Public License for more details.
013    
014      You should have received a copy of the GNU Lesser General Public
015      License along with this program; if not, write to the Free Software
016      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
017      USA */
018    
019    package org.objectweb.jac.aspects.gui;
020    
021    /**
022     * The GUI target independent menu. Submenus, actions, and separators
023     * appears in the order they are added into the menu. */
024    
025    public interface MenuView extends View {
026    
027        /**
028         * Adds a sub-menu in this menu.
029         *
030         * @param label the sub-menu's label
031         * @param icon the sub-menu's icon
032         * @param submenu the submenu */ 
033        void addSubMenu(String label, String icon, MenuView submenu);
034    
035        /**
036         * Adds an action to this menu.
037         *
038         * @param label the sub-menu's label
039         * @param icon the sub-menu's icon
040         * @param callback the actual action */ 
041        void addAction(String label, String icon, Callback callback);
042    
043        /**
044         * Adds a separator in this menu. */
045        void addSeparator();
046    
047        /**
048         * Sets the position of the menu bar (TOP||BOTTOM||LEFT||RIGHT).
049         *
050         * @param position the position. If null, use the default position
051         * @see Menu */
052        void setPosition(String position);
053    
054        /**
055         * Gets the position of the menu bar (TOP||BOTTOM||LEFT||RIGHT).
056         *
057         * @return the position
058         * @see Menu */
059        String getPosition();
060    }