/SA.Framework/SAWUI/Site.m
http://eeframework.googlecode.com/ · Objective C · 84 lines · 52 code · 20 blank · 12 comment · 1 complexity · f4db720a3233faff619fd7ff5d8e990c MD5 · raw file
- // -*- objc -*-
- #import "Site.h"
- @implementation Site
- - (id)init
- {
- self = [super init];
- return self;
- }
- - (void)dealloc
- {
- [super dealloc];
- }
- /* WO overridings */
- -(void)appendToResponse:(GSWResponse *)aResponse
- inContext:(GSWContext *)aContext
- {
- NSString *tmp = [[self parent] valueForKey:@"siteName"];
- if(![tmp isEqualToString:_entityName])
- {
- ASSIGN(_entityName, tmp);
- _isFirst = YES;
- }
- [super appendToResponse:aResponse inContext:aContext];
- }
- /* SAWUI specific */
- - (NSString *)entityName
- {
- /* return [_entityName stringByPaddingToLength:_maxLengthOfItemName
- withString:@" "
- startingAtIndex:0];*/
- return _entityName;
- }
- - (NSArray *)list
- {
- return [(SAWUIController *)GSWApp loginsForSite:_entityName];
- }
- - (NSDecimalNumber *)itemBytes
- {
- return [(SAWUIController *)GSWApp
- bytesForLogin:[[self list] objectAtIndex:_base + _index]
- bySite:_entityName];
- }
- - (NSString *)itemName
- {
- return [super itemName];
- }
- - (NSString *)selectedItemName
- {
- return [super selectedItemName];
- }
- - (GSWElement *)itemHasBeenClicked
- {
- _selectedItem = _base + _index;
- [[self parent] setValue:[self selectedItemName] forKey:@"loginName"];
- [[self parent] setValue:[NSNumber numberWithInt:LOGIN] forKey:@"mode"];
- return nil;
- }
- @end /* Site */
- /*
- - (NSDecimalNumber *)bytes
- {
- return [(SAWUIController *)GSWApp bytesForSite:_siteName];
- }
- */