/core/externals/update-engine/externals/google-toolbox-for-mac/AppKit/GTMDelegatingTableColumn.m

http://macfuse.googlecode.com/ · Objective C · 42 lines · 22 code · 3 blank · 17 comment · 4 complexity · 4df21f9e1f13b41b68eb97827318968c MD5 · raw file

  1. //
  2. // GTMDelegatingTableColumn.m
  3. //
  4. // Copyright 2006-2008 Google Inc.
  5. //
  6. // Licensed under the Apache License, Version 2.0 (the "License"); you may not
  7. // use this file except in compliance with the License. You may obtain a copy
  8. // of the License at
  9. //
  10. // http://www.apache.org/licenses/LICENSE-2.0
  11. //
  12. // Unless required by applicable law or agreed to in writing, software
  13. // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  14. // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
  15. // License for the specific language governing permissions and limitations under
  16. // the License.
  17. //
  18. #import "GTMDelegatingTableColumn.h"
  19. @implementation GTMDelegatingTableColumn
  20. - (id)dataCellForRow:(NSInteger)row {
  21. id dataCell = nil;
  22. id delegate = [[self tableView] delegate];
  23. BOOL sendSuper = YES;
  24. if (delegate) {
  25. if ([delegate respondsToSelector:@selector(gtm_tableView:dataCellForTableColumn:row:)]) {
  26. dataCell = [delegate gtm_tableView:[self tableView]
  27. dataCellForTableColumn:self
  28. row:row];
  29. sendSuper = NO;
  30. } else {
  31. _GTMDevLog(@"tableView delegate didn't implement gtm_tableView:dataCellForTableColumn:row:");
  32. }
  33. }
  34. if (sendSuper) {
  35. dataCell = [super dataCellForRow:row];
  36. }
  37. return dataCell;
  38. }
  39. @end