2 Copyright (C) 2000-2004 SKYRIX Software AG
4 This file is part of OpenGroupware.org.
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 "WETableViewLabelConfig.h"
24 #include "WETableViewDefines.h"
27 @implementation WETableViewLabelConfig
29 - (id)initWithAssociations:(NSDictionary *)_config {
30 if ((self = [super initWithAssociations:_config])) {
31 self->ofLabel = WOExtGetProperty(_config, @"ofLabel");
32 self->toLabel = WOExtGetProperty(_config, @"toLabel");
33 self->firstLabel = WOExtGetProperty(_config, @"firstLabel");
34 self->previousLabel = WOExtGetProperty(_config, @"previousLabel");
35 self->nextLabel = WOExtGetProperty(_config, @"nextLabel");
36 self->lastLabel = WOExtGetProperty(_config, @"lastLabel");
37 self->pageLabel = WOExtGetProperty(_config, @"pageLabel");
38 self->sortLabel = WOExtGetProperty(_config, @"sortLabel");
41 #define SetAssociationValue(_a_, _value_) \
43 _a_ = [[WOAssociation associationWithValue:_value_] retain];
45 SetAssociationValue(self->ofLabel, @"/");
46 SetAssociationValue(self->toLabel, @"-");
47 SetAssociationValue(self->firstLabel, @"<<");
48 SetAssociationValue(self->previousLabel, @"<");
49 SetAssociationValue(self->nextLabel, @">");
50 SetAssociationValue(self->lastLabel, @">>");
51 SetAssociationValue(self->pageLabel, @"Page");
52 SetAssociationValue(self->sortLabel, @"sort column");
53 #undef SetAssociationValue
59 [self->ofLabel release];
60 [self->toLabel release];
61 [self->firstLabel release];
62 [self->previousLabel release];
63 [self->nextLabel release];
64 [self->lastLabel release];
65 [self->pageLabel release];
66 [self->sortLabel release];
70 - (void)updateConfigInContext:(WOContext *)_ctx {
74 cmp = [_ctx component];
76 #define SetConfigInContext(_a_, _key_) \
77 if (_a_ && (tmp = [_a_ valueInComponent:cmp])) \
78 [_ctx setObject:tmp forKey:_key_];
79 SetConfigInContext(self->ofLabel, WETableView_ofLabel);
80 SetConfigInContext(self->toLabel, WETableView_toLabel);
81 SetConfigInContext(self->firstLabel, WETableView_firstLabel);
82 SetConfigInContext(self->previousLabel, WETableView_previousLabel);
83 SetConfigInContext(self->nextLabel, WETableView_nextLabel);
84 SetConfigInContext(self->lastLabel, WETableView_lastLabel);
85 SetConfigInContext(self->pageLabel, WETableView_pageLabel);
86 SetConfigInContext(self->sortLabel, WETableView_sortLabel);
87 #undef SetConfigInContext
90 @end /* WETableViewLabelConfig */