Bug 55822 [CoolBar] CoolBarManager.setLayout is poor API
build I20040323 CoolBarManager.setLayout has a couple of problems: 1. its Javadoc talks about internals 2. it takes an ArrayList of unspec'ed element type instead of IContributionItem[] 3. it talks about order, but really it allows the whole set of items to be replaced, not just reordered. Should change to take an IContributionItem[] (and copy the array).
bundles/org.eclipse.jface/src/org/eclipse/jface/action/CoolBarManager.java
public void setContextMenuManager(IMenuManager contextMenuManager) {
        this.contextMenuManager = (MenuManager) contextMenuManager;
        if (coolBar != null) {
            coolBar.setMenu(getContextMenuControl());
        }
    }
    /**
     * Replaces the internal data structure with the given new order. Then
     * force and update.
     * 
     * @param newLayout
     *            a list of new order of contribution items.
     */
    public void setLayout(ArrayList newLayout) {
        IContributionItem[] newItems = new IContributionItem[newLayout.size()];
        newItems = (IContributionItem[]) newLayout.toArray(newItems);
        
        if (coolBar != null) {
            CoolItem[] coolItems = coolBar.getItems();
            for (int i = 0; i < coolItems.length; i++) {
                dispose(coolItems[i]);
            }
        }
        
        internalSetItems(newItems);
        
        update(true);
    }
    /*
     * (non-Javadoc)