2 Copyright (C) 2000-2005 SKYRIX Software AG
4 This file is part of SOPE.
6 SOPE 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 SOPE 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 SOPE; see the file COPYING. If not, write to the
18 Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
22 #include <NGObjWeb/WOComponent.h>
26 @interface TableView : WOComponent < NSCoding >
35 @implementation TableView
38 if ((self = [super init]) != nil) {
39 WOResourceManager *rm;
42 rm = [[self application] resourceManager];
44 file = [rm pathForResourceNamed:@"TableView.plist"
48 self->list = [[NSArray alloc] initWithContentsOfFile:file];
50 [self takeValue:@"4" forKey:@"batchSize"];
51 [self takeValue:@"#FCF8DF" forKey:@"evenColor"];
52 [self takeValue:@"#FFFFF0" forKey:@"oddColor"];
53 [self takeValue:@"#FFDAAA" forKey:@"headerColor"];
54 [self takeValue:@"#FFDAAA" forKey:@"footerColor"];
55 [self takeValue:@"#FAE8B8" forKey:@"titleColor"];
67 - (void)setList:(NSArray *)_list {
68 ASSIGN(self->list, _list);
75 NSDictionary *obj1, *obj2;
77 obj1 = [self valueForKey:@"item"];
78 obj2 = [self valueForKey:@"previousItem"];
80 return [[obj1 objectForKey:@"city"] isEqualToString:
81 [obj2 objectForKey:@"city"]];
85 NSDictionary *obj1, *obj2;
87 obj1 = [self valueForKey:@"item"];
88 obj2 = [self valueForKey:@"previousItem"];
90 return [[obj1 objectForKey:@"zip"] isEqualToString:
91 [obj2 objectForKey:@"zip"]];
94 - (void)setClicks:(int)_clicks {
95 self->clicks = _clicks;
103 - (id)increaseClicks {
105 [self takeValue:[self valueForKey:@"item"] forKey:@"clickedItem"];
111 - (void)encodeWithCoder:(NSCoder *)_coder {
112 [super encodeWithCoder:_coder];
113 [_coder encodeObject:self->list];
115 - (id)initWithCoder:(NSCoder *)_coder {
116 if ((self = [super initWithCoder:_coder])) {
117 self->list = [[_coder decodeObject] retain];