protected virtual void AddItemsToMenu(GenericMenu menu, int itemIndex, IReorderableListAdaptor adaptor)
{
if ((flags & ReorderableListFlags.DisableReordering) == 0) {
if (itemIndex > 0)
menu.AddItem(commandMoveToTop, false, defaultContextHandler, commandMoveToTop);
else
menu.AddDisabledItem(commandMoveToTop);
if (itemIndex + 1 < adaptor.Count)
menu.AddItem(commandMoveToBottom, false, defaultContextHandler, commandMoveToBottom);
else
menu.AddDisabledItem(commandMoveToBottom);
if (hasAddButton) {
menu.AddSeparator("");
menu.AddItem(commandInsertAbove, false, defaultContextHandler, commandInsertAbove);
menu.AddItem(commandInsertBelow, false, defaultContextHandler, commandInsertBelow);
if ((flags & ReorderableListFlags.DisableDuplicateCommand) == 0)
menu.AddItem(commandDuplicate, false, defaultContextHandler, commandDuplicate);
}
}
if (hasRemoveButtons) {
if (menu.GetItemCount() > 0)
menu.AddSeparator("");
menu.AddItem(commandRemove, false, defaultContextHandler, commandRemove);
menu.AddSeparator("");
menu.AddItem(commandClearAll, false, defaultContextHandler, commandClearAll);
}
}