2 Copyright (C) 2000-2003 SKYRIX Software AG
4 This file is part of OGo
6 OGo is free software; you can redistribute it and/or modify it under
7 the terms of the GNU Lesser General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
11 OGo is distributed in the hope that it will be useful, but WITHOUT ANY
12 WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with OGo; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
23 #include <NGObjWeb/WOComponent.h>
27 @interface TableView : WOComponent < NSCoding >
36 @implementation TableView
39 if ((self = [super init])) {
40 WOResourceManager *rm;
43 rm = [[self application] resourceManager];
45 file = [rm pathForResourceNamed:@"TableView.plist"
49 self->list = [[NSArray alloc] initWithContentsOfFile:file];
51 [self takeValue:@"4" forKey:@"batchSize"];
52 [self takeValue:@"#FCF8DF" forKey:@"evenColor"];
53 [self takeValue:@"#FFFFF0" forKey:@"oddColor"];
54 [self takeValue:@"#FFDAAA" forKey:@"headerColor"];
55 [self takeValue:@"#FFDAAA" forKey:@"footerColor"];
56 [self takeValue:@"#FAE8B8" forKey:@"titleColor"];
71 - (void)setList:(NSArray *)_list {
72 ASSIGN(self->list, _list);
79 obj1 = [self valueForKey:@"item"];
80 obj2 = [self valueForKey:@"previousItem"];
82 return [[obj1 objectForKey:@"city"] isEqualToString:
83 [obj2 objectForKey:@"city"]];
90 obj1 = [self valueForKey:@"item"];
91 obj2 = [self valueForKey:@"previousItem"];
93 return [[obj1 objectForKey:@"zip"] isEqualToString:
94 [obj2 objectForKey:@"zip"]];
97 - (void)setClicks:(int)_clicks {
98 self->clicks = _clicks;
106 - (id)increaseClicks {
108 [self takeValue:[self valueForKey:@"item"] forKey:@"clickedItem"];
114 - (void)encodeWithCoder:(NSCoder *)_coder {
115 [super encodeWithCoder:_coder];
116 [_coder encodeObject:self->list];
118 - (id)initWithCoder:(NSCoder *)_coder {
119 if ((self = [super initWithCoder:_coder])) {
120 self->list = [[_coder decodeObject] retain];