Class ActionList

  • All Implemented Interfaces:

    public class ActionListextends Objectimplements ActionItem
    A simple class that is meant to represent a submenu (or a list of items in a menu) when used with methods such as Exhibit.getActionsForView(View) and View.getViewCommands(). The name of an ActionList is meant to be used as a name for a submenu that contains commands corresponding to all the items in the ActionList.
    • Constructor Summary

      Constructor and Description
      Create an unnamed ActionList.
      ActionList(String name)
      Create an ActionList with a specfied name.
    • Constructor Detail

      • ActionList

        public ActionList()
        Create an unnamed ActionList.
      • ActionList

        public ActionList(String name)
        Create an ActionList with a specfied name.
        name -
    • Method Detail

      • add

        public void add(ActionItem object)
        Adds an ActionItem to the list of items in this ActionList. The object added can be of type AbstractActionVMM, ToggleAction, <@link ActionRadioGroup}, ActionList, or any other object that implements ActionItem. Null values are allowed and are meant to r epresent separators in a mwnu.
      • remove

        public void remove(ActionItem object)
        Removes a specified ActionItem from this ActionList. If the item does not occur in the list, nothing is done and no error occurs. (If the item occurs more than once, only the first occurrence is removed.)
        object - the object to be removed
      • setName

        public void setName(String name)
        Sets the name of this ActionList which, if non-null, is meant to be used as a name for the submenu.
      • getName

        public String getName()
        Get the name of this ActionList.
      • getItemCount

        public int getItemCount()
        Gets the number of items that have been added to this ActionList.
      • getItem

        public ActionItem getItem(int i)
        Gets the i-th ActionItem in this ActionList. Will throw an exception if i is less than zero or greater than or equal to the number of items in the list.
      • getItems

        public ArrayList<ActionItem> getItems()
        Returns a list containing all the ActionItems that have been added to this ActionList. (The returned ArrayList is newly allocated and no reference is kept to it.)
      • addAll

        public void addAll(ActionList list)
        Add all the ActionItems in list to this ActionList.
        list - list of items to be added; if null, nothing is done
      • getMenuItems

        public JMenuItem[] getMenuItems()
        If this ActionList is unnamed then the retunn value is an array containing JMenuItems created by the individual ActionItems in the ActionList. If this ActionList has a non-null name with non-zero length, then the return value is an array containing a single item, which is a JMenu that in turn contains all the JMenuItems the JMenuItems from the individual ActionItems; the name of the JMenu is the name of the ActionList.
        Specified by:
        getMenuItems in interface ActionItem

SCaVis 1.7 ©