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
25 Take a look at WETreeView for more information.
27 WETreeHeader associations:
35 TreeHeaderCell: WETreeHeader {
38 HeaderCell: WETreeHeader {
43 #include <NGObjWeb/WODynamicElement.h>
45 @interface WETreeHeader : WODynamicElement
48 WOAssociation *isTreeElement;
50 WOAssociation *string;
54 #include "WETreeContextKeys.h"
57 @implementation WETreeHeader
59 - (id)initWithName:(NSString *)_name
60 associations:(NSDictionary *)_config
61 template:(WOElement *)_subs
63 if ((self=[super initWithName:_name associations:_config template:_subs])) {
64 self->isTreeElement = WOExtGetProperty(_config, @"isTreeElement");
65 self->string = WOExtGetProperty(_config, @"string");
67 self->template = [_subs retain];
73 [self->string release];
74 [self->isTreeElement release];
75 [self->template release];
79 /* request processing */
81 - (void)takeValuesFromRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
82 [self->template takeValuesFromRequest:_rq inContext:_ctx];
85 - (id)invokeActionForRequest:(WORequest *)_rq inContext:(WOContext *)_ctx {
86 return [self->template invokeActionForRequest:_rq inContext:_ctx];
89 /* response generation */
91 - (void)appendToResponse:(WOResponse *)_response inContext:(WOContext *)_ctx {
96 if (![_ctx objectForKey:WETreeView_HEADER_MODE])
99 isTree = [self->isTreeElement boolValueInComponent:[_ctx component]];
100 doTable = ([_ctx objectForKey:WETreeView_RenderNoTable] == nil);
101 content = [self->string stringValueInComponent:[_ctx component]];
104 [_response appendContentString:@"<td"];
105 [self appendExtraAttributesToResponse:_response inContext:_ctx];
106 if (self->otherTagString) {
107 [_response appendContentCharacter:' '];
108 [_response appendContentString:
109 [self->otherTagString stringValueInComponent:
113 [_response appendContentString:@" colspan=\""];
114 [_response appendContentString:
115 [[_ctx objectForKey:WETreeView_HEADER_MODE] stringValue]];
116 [_response appendContentString:@"\"><nobr>"];
119 [_response appendContentString:@"><nobr>"];
122 /* add cell content */
123 [self->template appendToResponse:_response inContext:_ctx];
125 [_response appendContentHTMLString:content];
128 [_response appendContentString:@"</nobr></td>"];
131 @end /* WETreeHeader */