ContextMenuHandlers.m.unc 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. */
  14. #import "ContextMenuHandlers.h"
  15. #import "Finder/Finder.h"
  16. #import "MenuManager.h"
  17. @implementation NSObject (ContextMenuHandlers)
  18. + (void) ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 windowController:(id)arg5 addPlugIns:(BOOL)arg6 // Lion
  19. {
  20. MenuManager* contextMenuUtils = [MenuManager sharedInstance];
  21. contextMenuUtils.menuItems = (NSMutableArray*)[contextMenuUtils pathsForNodes:arg2];
  22. [self ContextMenuHandlers_handleContextMenuCommon:arg1 nodes:arg2 event:arg3 view:arg4 windowController:arg5 addPlugIns:arg6];
  23. }
  24. + (void) ContextMenuHandlers_handleContextMenuCommon:(unsigned int)arg1 nodes:(const struct TFENodeVector*)arg2 event:(id)arg3 view:(id)arg4 browserController:(id)arg5 addPlugIns:(BOOL)arg6 // Mountain Lion
  25. {
  26. MenuManager* contextMenuUtils = [MenuManager sharedInstance];
  27. contextMenuUtils.menuItems = (NSMutableArray*)[contextMenuUtils pathsForNodes:arg2];
  28. [self ContextMenuHandlers_handleContextMenuCommon:arg1 nodes:arg2 event:arg3 view:arg4 browserController:arg5 addPlugIns:arg6];
  29. }
  30. + (void) ContextMenuHandlers_addViewSpecificStuffToMenu:(id)arg1 browserViewController:(id)arg2 context:(unsigned int)arg3
  31. {
  32. [self ContextMenuHandlers_addViewSpecificStuffToMenu:arg1 browserViewController:arg2 context:arg3];
  33. if ([MenuManager sharedInstance].menuItems.count > 0)
  34. {
  35. MenuManager* contextMenuUtils = [MenuManager sharedInstance];
  36. [contextMenuUtils addItemsToMenu:arg1 forPaths:contextMenuUtils.menuItems];
  37. [contextMenuUtils.menuItems removeAllObjects];
  38. }
  39. }
  40. - (void) ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 windowController:(id)arg2 container:(BOOL)arg3 // Lion
  41. {
  42. [self ContextMenuHandlers_configureWithNodes:arg1 windowController:arg2 container:arg3];
  43. TContextMenu* realSelf = (TContextMenu*)self;
  44. MenuManager* contextMenuUtils = [MenuManager sharedInstance];
  45. NSArray* selectedItems = [contextMenuUtils pathsForNodes:arg1];
  46. [contextMenuUtils addItemsToMenu:realSelf forPaths:selectedItems];
  47. }
  48. - (void) ContextMenuHandlers_configureWithNodes:(const struct TFENodeVector*)arg1 browserController:(id)arg2 container:(BOOL)arg3 // Mountain Lion
  49. {
  50. [self ContextMenuHandlers_configureWithNodes:arg1 browserController:arg2 container:arg3];
  51. TContextMenu* realSelf = (TContextMenu*)self;
  52. MenuManager* contextMenuUtils = [MenuManager sharedInstance];
  53. NSArray* selectedItems = [contextMenuUtils pathsForNodes:arg1];
  54. [contextMenuUtils addItemsToMenu:realSelf forPaths:selectedItems];
  55. }
  56. @end