// // P4SpecEntityDescriptionAdditions.m // P4ObjectLayer // // Created by Michael Bishop on 9/8/10. // Copyright 2010 Numerical Garden, LLC. All rights reserved. // #import <Cocoa/Cocoa.h> #import "P4SpecEntityDescriptionAdditions.h" NSString * const kP4SpecManager = @"P4SpecManager"; NSString * const kP4IdentifierPropertyName = @"P4IdentifierPropertyName"; NSString * const kP4LastAcccessPropertyName = @"P4LastAcccessPropertyName"; NSString * const kP4InverseFetchedPropertyRelationships = @"P4InverseFetchedPropertyRelationships"; NSString * const kP4SpecKeyToMOKeyMapping = @"P4SpecKeyToMOKeyMapping"; NSString * const kNGAFetchedProperties = @"NGAFetchedProperties"; NSString * const kP4SpecTypeKey = @"P4SpecTypeKey"; NSString * const kP4SpecPropertyAliases = @"P4SpecPropertyAliases"; NSString * const kP4SpecSummaryProperties = @"P4SpecSummaryProperties"; NSString * const kP4SpecDescriptionKey = @"P4SpecDescription"; NSString * const kP4PropertyDescriptionSpecTag = @"specTag"; @implementation NSEntityDescription (P4SpecEntityDescriptionAdditions) -(P4SpecManager*)manager { return [[self userInfo] objectForKey:kP4SpecManager]; } -(NSString*)identifierPropertyName { return [[self userInfo] objectForKey:kP4IdentifierPropertyName]; } -(NSString*)lastAccessedPropertyName { return [[self userInfo] objectForKey:kP4LastAcccessPropertyName]; } -(NSArray*)inverseFetchedProperties { return [[self userInfo] objectForKey:kP4InverseFetchedPropertyRelationships]; } -(void)setInverseFetchedProperties:(NSArray*)fetchedProperties { NSMutableDictionary * mutableUserInfo = [[[self userInfo] mutableCopy] autorelease]; [mutableUserInfo setObject:fetchedProperties forKey:kP4InverseFetchedPropertyRelationships]; [self setUserInfo:mutableUserInfo]; } -(NSDictionary*)specKeyToMOKeyMapping { return [[self userInfo] objectForKey:kP4SpecKeyToMOKeyMapping]; } -(NSDictionary*)fetchedPropertyDescriptions { return [[self userInfo] objectForKey:kNGAFetchedProperties]; } -(void)setFetchedPropertyDescriptions:(NSDictionary*)fetchedProperties { NSMutableDictionary * mutableUserInfo = [[[self userInfo] mutableCopy] autorelease]; [mutableUserInfo setObject:fetchedProperties forKey:kNGAFetchedProperties]; [self setUserInfo:mutableUserInfo]; } -(NSString*)type { return [[self userInfo] objectForKey:kP4SpecTypeKey]; } -(NSSet*)allMappedSpecKeys { NSDictionary * mapping = [self specKeyToMOKeyMapping]; return [NSSet setWithArray:[mapping allValues]]; } -(NSDictionary*)summaryPropertyDescriptions { return [[self userInfo] objectForKey:kP4SpecSummaryProperties]; } -(NSString*)specTagForPropertyName:(NSString*)propertyName { return [[[[self attributesByName] objectForKey:propertyName] userInfo] objectForKey:kP4PropertyDescriptionSpecTag]; } -(P4SpecDescription*)specDescription { return [[self userInfo] objectForKey:kP4SpecDescriptionKey]; } @end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8331 | Matt Attaway |
Adding initial version of MacMenu for Perforce MacMenu is a helpful Perforce client that sits in your toolbar. It allows you to run standard Perforce operations on the document that is open the currently active editor/viewer. |