MenuItemCompare comp = new MenuItemCompare(); MiscUtilities.quicksort(pluginMenus,comp); MiscUtilities.quicksort(pluginMenuItems,comp);
MiscUtilities.quicksort(pluginMenuItems,new MenuItemCompare());
	private void updatePluginsMenu()	{		if(plugins.getMenuComponentCount() != 0)			plugins.removeAll();		// Query plugins for menu items		Vector pluginMenus = new Vector();		Vector pluginMenuItems = new Vector();		EditPlugin[] pluginArray = jEdit.getPlugins();		for(int i = 0; i < pluginArray.length; i++)		{			try			{				pluginArray[i].createMenuItems(this,pluginMenus,					pluginMenuItems);			}			catch(Throwable t)			{				Log.log(Log.ERROR,this,"Error creating menu items"					+ " for plugin");				Log.log(Log.ERROR,this,t);			}		}		if(pluginMenus.isEmpty() && pluginMenuItems.isEmpty())		{			plugins.add(GUIUtilities.loadMenuItem("no-plugins"));			return;		}		// Sort them		MenuItemCompare comp = new MenuItemCompare();		MiscUtilities.quicksort(pluginMenus,comp);		MiscUtilities.quicksort(pluginMenuItems,comp);		JMenu menu = plugins;		for(int i = 0; i < pluginMenus.size(); i++)		{			if(menu.getItemCount() >= 20)			{				menu.addSeparator();				JMenu newMenu = new JMenu(jEdit.getProperty(					"common.more"));				menu.add(newMenu);				menu = newMenu;			}			menu.add((JMenu)pluginMenus.elementAt(i));		}		for(int i = 0; i < pluginMenuItems.size(); i++)		{			if(menu.getItemCount() >= 20)			{				menu.addSeparator();				JMenu newMenu = new JMenu(jEdit.getProperty(					"common.more"));				menu.add(newMenu);				menu = newMenu;			}			menu.add((JMenuItem)pluginMenuItems.elementAt(i));		}	}